Print the whole exception.

Print the whole exception.

--- src/ContentSync/Program.cs
+++ src/ContentSync/Program.cs
@@ -74,7 +74,7 @@
             }
             catch (Exception ex)
             {
-                Log.WriteError($"Unrecoverable error: {ex.Message}");
+                Log.WriteError(ex.ToString());
                 return 3;
             }
         }


refactor: rename m_NeedsListOfFriends => m_NeedsListOfOnlineFriends to better reflect its actual function

--- OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -92,7 +92,7 @@
         /// Maintain a record of viewers that need to be sent notifications for friends that are online.  This only
         /// needs to be done on login.  Subsequent online/offline friend changes are sent by a different mechanism.
         /// </summary>
-        protected HashSet<UUID> m_NeedsListOfFriends = new HashSet<UUID>();
+        protected HashSet<UUID> m_NeedsListOfOnlineFriends = new HashSet<UUID>();

         protected IPresenceService PresenceService
         {
@@ -331,8 +331,8 @@
             StatusChange(agentID, true);

             // Register that we need to send the list of online friends to this user
-            lock (m_NeedsListOfFriends)
-                m_NeedsListOfFriends.Add(agentID);
+            lock (m_NeedsListOfOnlineFriends)
+                m_NeedsListOfOnlineFriends.Add(agentID);
         }

         public virtual bool SendFriendsOnlineIfNeeded(IClientAPI client)
@@ -340,9 +340,9 @@
             UUID agentID = client.AgentId;

             // Check if the online friends list is needed
-            lock (m_NeedsListOfFriends)
-            {
-                if (!m_NeedsListOfFriends.Remove(agentID))
+            lock (m_NeedsListOfOnlineFriends)
+            {
+                if (!m_NeedsListOfOnlineFriends.Remove(agentID))
                     return false;
             }


Refactor : expansion & limit work for a pawn movement

--- PFE_UnityProject/Assets/ChessProject/Scripts/Model/Pawn.cs
+++ PFE_UnityProject/Assets/ChessProject/Scripts/Model/Pawn.cs
@@ -123,13 +123,9 @@
                         convert = (int[,])tmpMatrix.Clone();
                     }

-                    //if (pp != null)
-                    {
-                        //if ((pp.IsThereAPawn(current)) && !canJump)
-                        { // if the pawn can't jump, then we don't go further in this position
-                            canContinue = false;
-                        }
-                    }
+                    Pawn p = current.board.GetSquare(current.coo).gameObject.GetComponentInChildren<Pawn>();
+                    if (p != null) canContinue = false;
+
                 }
             }
         }


missing mapped columns are ignored if WillThrowOnMissingField = false

Issue #166

--- src/CsvHelper/CsvReader.cs
+++ src/CsvHelper/CsvReader.cs
@@ -1263,6 +1263,11 @@
 				{
 					// If a name was explicitly set, use it.
 					index = GetFieldIndex( propertyMap.Data.Names.ToArray(), propertyMap.Data.NameIndex );
+                    if (index == -1)
+                    {
+                        // Skip if the index was not found.
+                        continue;
+                    }
 				}
 				else if( propertyMap.Data.IsIndexSet )
 				{


调整了下代码。 :100:

调整了下代码。 :100:

--- src/Data/DataAccessBase.cs
+++ src/Data/DataAccessBase.cs
@@ -390,7 +390,8 @@
 			if(expression == parameter)
 				return GetMembers(expression.Type);

-			if(expression.GetType().FullName == "System.Linq.Expressions.PropertyExpression")
+			//if(expression.GetType().FullName == "System.Linq.Expressions.PropertyExpression")
+			if(expression.NodeType == ExpressionType.MemberAccess)
 			{
 				if(IsScalarType(expression.Type))
 					return new string[] { ExpressionToString(expression, parameter) };


language update of game description works propeply

--- ParticleStormControl/ParticleStormControl/InGame/InGame.cs
+++ ParticleStormControl/ParticleStormControl/InGame/InGame.cs
@@ -56,25 +56,37 @@
         private const float ARCADE_MIN_HEALTH = 1.0f;

-        static public readonly String[] GAMEMODE_NAME = new String[]
-        {
-            VirusXStrings.GameModeClassic,
-            VirusXStrings.GameModeCTC,
-            VirusXStrings.GameModeLvsR,
-            VirusXStrings.GameModeFun,
-            VirusXStrings.GameModeDomination,
-            VirusXStrings.GameModeArcade
-        };
-
-        static public readonly String[] GAMEMODE_DESCRIPTION = new String[]
-        {
-            VirusXStrings.GameModeDescriptionClassic,
-            VirusXStrings.GameModeDescriptionCTC,
-            VirusXStrings.GameModeDescriptionLvsR,
-            VirusXStrings.GameModeDescriptionFun,
-            VirusXStrings.GameModeDescriptionDomination,
-            VirusXStrings.GameModeDescriptionArcade
-        };
+        static public String[] GAMEMODE_NAME
+        {
+            get
+            {
+                return new String[]
+                {
+                    VirusXStrings.GameModeClassic,
+                    VirusXStrings.GameModeCTC,
+                    VirusXStrings.GameModeLvsR,
+                    VirusXStrings.GameModeFun,
+                    VirusXStrings.GameModeDomination,
+                    VirusXStrings.GameModeArcade
+                };
+            }
+        }
+
+        static public String[] GAMEMODE_DESCRIPTION
+        {
+            get
+            {
+                return new String[]
+                {
+                    VirusXStrings.GameModeDescriptionClassic,
+                    VirusXStrings.GameModeDescriptionCTC,
+                    VirusXStrings.GameModeDescriptionLvsR,
+                    VirusXStrings.GameModeDescriptionFun,
+                    VirusXStrings.GameModeDescriptionDomination,
+                    VirusXStrings.GameModeDescriptionArcade
+                };
+            }
+        }

         #endregion


Refac

Refac

--- PogoLocationFeeder/Helper/JsonSerializerSettingsFactory.cs
+++ PogoLocationFeeder/Helper/JsonSerializerSettingsFactory.cs
@@ -13,9 +13,7 @@

         public static JsonSerializerSettings create()
         {
-            var jsonSerializerSettings = new JsonSerializerSettings();
-            jsonSerializerSettings.Culture = CultureInfo.InvariantCulture;
-            return jsonSerializerSettings;
+            return new JsonSerializerSettings { Culture = CultureInfo.InvariantCulture };
         }
     }
 }


Added resource files started GUI layout

Added resource files started GUI layout

--- VrPlayer/Views/VrGui/VrGui.cs
+++ VrPlayer/Views/VrGui/VrGui.cs
@@ -18,7 +18,18 @@

         Point3D Center = new Point3D(0, 0, 0);
         VisualBrush _material;
-        double cameraSeparation = 0.01;
+
+        private static double cameraSeparation  = 0.01;         // Left and right camera separation
+        private static double CANVAS_WIDTH      = 640;          // GUI menu base panel width
+        private static double CANVAS_HEIGHT     = 400;          // GUI menu base panel height
+        private static double CELL_PADDING      = 8;            // Pseudo-cell padding for the content grid\
+
+#if DEBUG // Base address for the resource files is different in debug mode then it is for release
+        private static string BASE_DIR = @"C:\Users\41X\Documents\41X\VrPlayer";
+#else
+        private static string BASE_DIR = System.AppDomain.CurrentDomain.BaseDirectory;
+#endif
+

         private Point _mouseXY = new Point(0, 0);
         public Point MouseXY
@@ -39,37 +50,35 @@
         {
             // Main canvas
             Canvas c = new Canvas();
-            c.Width = 640;
-            c.Height = 400;
+            c.Width = CANVAS_WIDTH;
+            c.Height = CANVAS_HEIGHT;
             c.Background = new SolidColorBrush(Color.FromArgb(0x00, 0x00, 0x00, 0x00));
             c.ClipToBounds = true;

-            // Crap
-            StackPanel myStackPanel = new StackPanel();
-
-            Rectangle redRectangle = new Rectangle();
-            redRectangle.Width = 640;
-            redRectangle.Height = 25;
-            redRectangle.Fill = Brushes.Green;
-            redRectangle.Margin = new Thickness(2);
-            myStackPanel.Children.Add(redRectangle);
-
-            TextBlock someText = new TextBlock();
-            FontSizeConverter myFontSizeConverter = new FontSizeConverter();
-            someText.FontSize = (double)myFontSizeConverter.ConvertFrom("12pt");
-            someText.Text = "Hello, World!";
-            someText.Margin = new Thickness(2);
-            someText.Foreground = Brushes.White;
-            myStackPanel.Children.Add(someText);
-
-            Button aButton = new Button();
-            aButton.Content = "A Button";
-            aButton.Margin = new Thickness(2);
-            myStackPanel.Children.Add(aButton);
-
-            c.Children.Add(myStackPanel);
-
-            // Mouse
+            // Main Stack Panel. Vertical stack
+            StackPanel mainPanel = new StackPanel();
+            mainPanel.Width = CANVAS_WIDTH;
+            mainPanel.Height = CANVAS_HEIGHT;
+
+            //Title block for the menu
+            TextBlock title = new TextBlock();
+            FontSizeConverter fsc = new FontSizeConverter();
+            title.FontSize = (double)fsc.ConvertFrom("22pt");
+            title.TextAlignment = TextAlignment.Center;
+            title.Text = "MAIN MENU";
+            title.Margin = new Thickness(2);
+            title.Foreground = Brushes.Black;
+            title.Background = new SolidColorBrush(Color.FromRgb(0xEC, 0xEC, 0xEC));
+
+            mainPanel.Children.Add(title);
+
+            // Grid Panel for the content selection and content navigation
+            Grid content = createContentGrid(CANVAS_WIDTH, CANVAS_HEIGHT/2);
+            mainPanel.Children.Add(content);
+
+            c.Children.Add(mainPanel);
+
+            // Mouse Canvas
             Canvas m = new Canvas();
             m.Width = 10;
             m.Height = 10;
@@ -77,10 +86,129 @@
             Canvas.SetTop(m, _mouseXY.Y);
             Canvas.SetLeft(m, _mouseXY.X);
             m.ClipToBounds = true;
+            m.MouseUp += MouseUpHandler;

             c.Children.Add(m);

             _material.Visual = c;
+        }
+
+        ///
+        /// Creates a 2x5 grid layout to display the content (videos/pictures) available for viewing
+        /// <param name="width">Preferred Grid Panel width</param>
+        /// <param name="height">Preferred Grid Panel height</param>
+        private Grid createContentGrid(double width, double height)
+        {
+            Grid content = new Grid();
+            content.Width = width;
+            content.Height = height;
+            content.HorizontalAlignment = HorizontalAlignment.Center;
+            content.VerticalAlignment = VerticalAlignment.Center;
+            content.ShowGridLines = false;
+
+            // Define the columns and rows for the content selection.
+            // This GUI is using 2 rows and 5 columns ( 3 for content and 2 for navigation)
+            ColumnDefinition colDef1 = new ColumnDefinition();
+            ColumnDefinition colDef2 = new ColumnDefinition();
+            ColumnDefinition colDef3 = new ColumnDefinition();
+            ColumnDefinition colDef4 = new ColumnDefinition();
+            ColumnDefinition colDef5 = new ColumnDefinition();
+            content.ColumnDefinitions.Add(colDef1);
+            content.ColumnDefinitions.Add(colDef2);
+            content.ColumnDefinitions.Add(colDef3);
+            content.ColumnDefinitions.Add(colDef4);
+            content.ColumnDefinitions.Add(colDef5);
+
+            RowDefinition rowDef1 = new RowDefinition();
+            RowDefinition rowDef2 = new RowDefinition();
+            content.RowDefinitions.Add(rowDef1);
+            content.RowDefinitions.Add(rowDef2);
+
+            // Get all the icons for the content
+            // TODO: Differentiate between a video and a photo for the proper icon. Just using video for now
+            Image icon1 = createImageIcon(CANVAS_WIDTH / 5 - CELL_PADDING, BASE_DIR + @"\Medias\VrGui\video_icon.png");
+            Grid.SetColumn(icon1, 1);
+            Grid.SetRow(icon1, 0);
+            content.Children.Add(icon1);
+
+            Image icon2 = createImageIcon(CANVAS_WIDTH / 5 - CELL_PADDING, BASE_DIR + @"\Medias\VrGui\video_icon.png");
+            Grid.SetColumn(icon2, 2);
+            Grid.SetRow(icon2, 0);
+            content.Children.Add(icon2);
+
+            Image icon3 = createImageIcon(CANVAS_WIDTH / 5 - CELL_PADDING, BASE_DIR + @"\Medias\VrGui\video_icon.png");
+            Grid.SetColumn(icon3, 3);
+            Grid.SetRow(icon3, 0);
+            content.Children.Add(icon3);
+
+            Image icon4 = createImageIcon(CANVAS_WIDTH / 5 - CELL_PADDING, BASE_DIR + @"\Medias\VrGui\video_icon.png");
+            Grid.SetColumn(icon4, 1);
+            Grid.SetRow(icon4, 1);
+            content.Children.Add(icon4);
+
+            Image icon5 = createImageIcon(CANVAS_WIDTH / 5 - CELL_PADDING, BASE_DIR + @"\Medias\VrGui\video_icon.png");
+            Grid.SetColumn(icon5, 2);
+            Grid.SetRow(icon5, 1);
+            content.Children.Add(icon5);
+
+            Image icon6 = createImageIcon(CANVAS_WIDTH / 5 - CELL_PADDING, BASE_DIR + @"\Medias\VrGui\video_icon.png");
+            Grid.SetColumn(icon6, 3);
+            Grid.SetRow(icon6, 1);
+            content.Children.Add(icon6);
+
+            // These will be the navigation buttons for the content grid
+            Image prevIcon = createImageIcon(CANVAS_WIDTH / 10 - CELL_PADDING, BASE_DIR + @"\Medias\VrGui\prev_icon.png");
+            Grid.SetColumn(prevIcon, 0);
+            Grid.SetRowSpan(prevIcon, 2);
+            content.Children.Add(prevIcon);
+
+            Image nextIcon = createImageIcon(CANVAS_WIDTH / 10 - CELL_PADDING, BASE_DIR + @"\Medias\VrGui\next_icon.png");
+            Grid.SetColumn(nextIcon, 5);
+            Grid.SetRowSpan(nextIcon, 2);
+            content.Children.Add(nextIcon);
+
+            return content;
+        }
+
+        ///
+        /// Creates an image of specified width from the URI provided
+        /// <param name="width">Preferred image width</param>
+        /// <param name="uri">File location for the image resource</param>
+        private Image createImageIcon(double width, string uri)
+        {
+            Image img = new Image();
+            img.Width = width;
+
+            // Create source
+            BitmapImage bmpImg = new BitmapImage();
+
+            // BitmapImage.UriSource must be in a BeginInit/EndInit block
+            bmpImg.BeginInit();
+            bmpImg.UriSource = new Uri(uri);
+
+            // To save significant application memory, set the DecodePixelWidth or
+            // DecodePixelHeight of the BitmapImage value of the image source to the desired
+            // height or width of the rendered image. If you don't do this, the application will
+            // cache the image as though it were rendered as its normal size rather then just
+            // the size that is displayed.
+            // Note: In order to preserve aspect ratio, set DecodePixelWidth
+            // or DecodePixelHeight but not both.
+            bmpImg.DecodePixelWidth = 200;
+            bmpImg.EndInit();
+            //set image source
+            img.Source = bmpImg;
+
+            return img;
+        }
+
+        // TODO: Implement some sort of handler for mouse clicks
+        void MouseUpHandler(Object sender, RoutedEventArgs args)
+        {
+            if (sender.GetType() == typeof(Canvas))
+            {
+                Canvas rec = (Canvas)sender;
+                SolidColorBrush transparent = new SolidColorBrush(Color.FromArgb(0xff, 0xff, 0xff, 0xff));
+            }
         }


no longer needed

no longer needed

--- WhiteMagic/MagicExtensions.cs
+++ WhiteMagic/MagicExtensions.cs
@@ -36,17 +36,12 @@
         /// <param name="array"></param>
         /// <param name="reverse"></param>
         /// <returns></returns>
-        public static string AsHexString(this byte[] array, bool reverse = false)
+        public static string AsHexString(this byte[] array, bool reverse = false, string separator = " ")
         {
             if (array.Length == 0)
                 return string.Empty;

-            return string.Join(" ", (reverse ? array.Reverse() : array).Select(_ => string.Format("{0:X2}", _)));
-        }
-
-        public static bool IsValid(this IntPtr p)
-        {
-            return p != new IntPtr(int.MaxValue);
+            return string.Join(separator, (reverse ? array.Reverse() : array).Select(_ => string.Format("{0:X2}", _)));
         }

         public static uint ToUInt32(this IntPtr p)


ConnectTimeout for FtpConnection

ConnectTimeout for FtpConnection

--- Zergatul.Ftp/FtpConnection.cs
+++ Zergatul.Ftp/FtpConnection.cs
@@ -26,10 +26,18 @@
     // Extensions to FTP https://tools.ietf.org/html/rfc3659
     // Securing FTP with TLS https://tools.ietf.org/html/rfc4217

+    // TODO: ConnectTimeout with proxy
+
     public class FtpConnection : IDisposable
     {
+        #region private static
+
         private static readonly Regex DataPortRegex = new Regex(@"\((\d+),(\d+),(\d+),(\d+),(\d+),(\d+)\)");
         private static readonly Regex ExPassiveModeRegex = new Regex(@"\(\|\|\|(\d+)\|\)");
+
+        #endregion
+
+        #region private instance

         private TcpClient _tcpClient;
         private string _host;
@@ -57,17 +65,75 @@

         private bool _asyncOperationInProcess;

+        #endregion
+
+        #region public properties
+
+        /// <summary>
+        /// All comunication via control connection will be logged here
+        /// </summary>
         public TextWriter Log { get; set; }
+
+        /// <summary>
+        /// Client certificates for secure connection
+        /// </summary>
         public X509CertificateCollection X509CertificateCollection { get; set; }
+
+        /// <summary>
+        /// Overrides default cerification validation
+        /// </summary>
         public RemoteCertificateValidationCallback CertificateValidationCallback { get; set; }
+
+        /// <summary>
+        /// When connecting by host name, which IP address should be preffered
+        /// Default: true
+        /// </summary>
         public bool PreferIPv4 { get; set; }
+
+        /// <summary>
+        /// Proxy for both control and data channels
+        /// </summary>
         public ProxyBase Proxy { get; set; }
+
+        /// <summary>
+        /// When false, error responces will be stored in LastError property
+        /// Default: true
+        /// </summary>
         public bool ThrowExceptionOnServerErrors { get; set; }
+
+        /// <summary>
+        /// Validate server reply codes accordingly to RFC specifications
+        /// If false, the validation only take into account first digit from 3-digit code
+        /// Default: true
+        /// </summary>
+        public bool StrictMode { get; set; }
+
+        /// <summary>
+        /// When ThrowExceptionOnServerErrors is false, error server rely will be stored here
+        /// </summary>
+        public FtpServerReply LastError { get; private set; }
+
+        /// <summary>
+        /// Connection timeout in milliseconds, after which exception will be thrown
+        /// Default: 15000
+        /// </summary>
+        public int ConnectTimeout { get; set; }
+
+        /// <summary>
+        /// When you connect to FTP server by using host name, this host name will be used for vertificate validation.
+        /// If you connect by using IP address, you need to specify this property for certificate validation.
+        /// You may use it for any other reason, if you connect by using one host name, but need validation using other host name.
+        /// </summary>
+        public string OverrideHostNameForCertificateValidation { get; set; }
+
+        public Encoding ControlConnectionEncoding { get; set; }
+        public Encoding DataConnectionEncoding { get; set; }

         public string Greeting { get; private set; }
         public string OperatingSystem { get; private set; }
         public FtpTransferMode TransferMode { get; private set; }
-        public string LastServerReply { get; private set; }
+
+        #endregion

         #region ctor + connection establishment

@@ -79,6 +145,8 @@
             this.X509CertificateCollection = new X509CertificateCollection();
             this.ThrowExceptionOnServerErrors = true;
             this.PreferIPv4 = true;
+            this.StrictMode = true;
+            this.ConnectTimeout = 15000;
         }

         public void Connect(string host, int port)
@@ -96,7 +164,8 @@
                     if (this._address != null)
                     {
                         _tcpClient = new TcpClient(AddressFamily.InterNetwork);
-                        _tcpClient.Connect(this._address, port);
+                        if (!_tcpClient.ConnectAsync(this._address, port).Wait(ConnectTimeout))
+                            throw new FtpException(string.Format("Connection timeout failed to {0} (using IP {1}).", host, this._address));
                     }
                 }
                 else
@@ -105,18 +174,20 @@
                     if (this._address != null)
                     {
                         _tcpClient = new TcpClient(AddressFamily.InterNetworkV6);
-                        _tcpClient.Connect(this._address, port);
+                        if (!_tcpClient.ConnectAsync(this._address, port).Wait(ConnectTimeout))
+                            throw new FtpException(string.Format("Connection timeout failed to {0} (using IP {1}).", host, this._address));
                     }
                 }
                 if (this._address == null)
                 {
                     this._address = ipHE.AddressList.First();
                     _tcpClient = new TcpClient(this._address.AddressFamily);
-                    _tcpClient.Connect(this._address, port);
+                    if (!_tcpClient.ConnectAsync(this._address, port).Wait(ConnectTimeout))
+                        throw new FtpException(string.Format("Connection timeout failed to {0} (using IP {1}).", host, this._address));
                 }
             }
             if (!_tcpClient.Connected)
-                throw new Exception("");
+                throw new Exception("Unknown error");
             CommandStream = _tcpClient.GetStream();
             Greeting = _controlStreamReader.ReadServerReply().Message;
             TransferMode = FtpTransferMode.Stream;
@@ -130,10 +201,11 @@
             else
             {
                 _tcpClient = new TcpClient(address.AddressFamily);
-                _tcpClient.Connect(address, port);
+                if (!_tcpClient.ConnectAsync(address, port).Wait(ConnectTimeout))
+                    throw new FtpException(string.Format("Connection timeout failed to {0}.", _address));
             }
             if (!_tcpClient.Connected)
-                throw new Exception("");
+                throw new Exception("Unknown error");
             CommandStream = _tcpClient.GetStream();
             Greeting = _controlStreamReader.ReadServerReply().Message;
             TransferMode = FtpTransferMode.Stream;
@@ -781,8 +853,11 @@
         private Stream AuthenticateStreamWithTls(Stream innerStream)
         {
             SslStream stream = new SslStream(innerStream, true, CertificateValidationCallback);
+            string host = this._host ?? this.OverrideHostNameForCertificateValidation;
+            if (host == null)
+                throw new FtpException("Cannot validate certificate, because you connected using IP address. Please specify OverrideHostNameForCertificateValidation property.");
             stream.AuthenticateAsClient(
-                this._host,
+                host,
                 this.X509CertificateCollection,
                 SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls,
                 true);
@@ -801,7 +876,8 @@
                 else
                 {
                     passiveConnection = new TcpClient(_dataConnectionIPEndPoint.Address.AddressFamily);
-                    passiveConnection.Connect(_dataConnectionIPEndPoint.Address, _dataConnectionIPEndPoint.Port);
+                    if (!passiveConnection.ConnectAsync(_dataConnectionIPEndPoint.Address, _dataConnectionIPEndPoint.Port).Wait(ConnectTimeout))
+                        throw new FtpException("Data connection timeout failed");
                 }

                 Stream result = passiveConnection.GetStream();
@@ -819,7 +895,10 @@

                 activeConnectionListener = new TcpListener(_dataConnectionIPEndPoint);
                 activeConnectionListener.Start();
-                TcpClient activeConnection = activeConnectionListener.AcceptTcpClient();
+                var task = activeConnectionListener.AcceptTcpClientAsync();
+                if (!task.Wait(ConnectTimeout))
+                    throw new FtpException("Data connection timeout failed");
+                TcpClient activeConnection = task.Result;
                 activeConnectionListener.Stop();

                 Stream result = activeConnection.GetStream();


Make readonly

Make readonly

--- NuGet.Extensions/ReferenceAnalysers/ReferenceNugetifier.cs
+++ NuGet.Extensions/ReferenceAnalysers/ReferenceNugetifier.cs
@@ -17,7 +17,7 @@
         private readonly IPackageRepository _packageRepository;
         private readonly Lazy<IList<IReference>> _references;
         private readonly Lazy<IList<KeyValuePair<string, List<IPackage>>>> _resolveReferenceMappings;
-        private static string PackageReferenceFilename = Constants.PackageReferenceFile;
+        private static readonly string PackageReferenceFilename = Constants.PackageReferenceFile;

         public ReferenceNugetifier(IVsProject vsProject, IPackageRepository packageRepository, IFileSystem projectFileSystem, IConsole console)
         {


v2.0.0-beta5

--- src/SharedAssemblyInfo.cs
+++ src/SharedAssemblyInfo.cs
@@ -4,7 +4,7 @@
 [assembly: AssemblyProduct("Cassette")]
 [assembly: AssemblyCopyright("Copyright © 2011 Andrew Davey")]

-[assembly: AssemblyInformationalVersion("2.0.0-beta4")]
+[assembly: AssemblyInformationalVersion("2.0.0-beta5")]

 [assembly: AssemblyVersion("2.0.0.*")]
 [assembly: AssemblyFileVersion("2.0.0.0")]


Don't calculate code size twice in the same method.

--- src/AsmResolver.PE/DotNet/Cil/CilRawTinyMethodBody.cs
+++ src/AsmResolver.PE/DotNet/Cil/CilRawTinyMethodBody.cs
@@ -65,10 +65,11 @@
         /// <inheritdoc />
         public override void Write(IBinaryStreamWriter writer)
         {
-            if (Code.GetPhysicalSize() > 0x3F)
+            uint codeSize = Code.GetPhysicalSize();
+            if (codeSize > 0x3F)
                 throw new ArgumentException("Code of a tiny method body cannot be 64 bytes or larger.");

-            byte flag = (byte) ((byte) CilMethodBodyAttributes.Tiny | (Code.GetPhysicalSize() << 2));
+            byte flag = (byte) ((byte) CilMethodBodyAttributes.Tiny | (codeSize << 2));
             writer.WriteByte(flag);
             Code.Write(writer);
         }


Remove unused variable.

Remove unused variable.

Former-commit-id: 014e14f1e9e3c164ef59fd9796df66361ff357b0

--- src/CorrugatedIron.Tests/Messages/MessageCodeTests.cs
+++ src/CorrugatedIron.Tests/Messages/MessageCodeTests.cs
@@ -35,8 +35,7 @@

             var currentDir = Environment.CurrentDirectory;
             string riak_pb_messages_file =
-                Path.Combine(Environment.CurrentDirectory,
-                    "..", "..", "..", "riak_pb", "src", "riak_pb_messages.csv");
+                Path.Combine(currentDir, "..", "..", "..", "riak_pb", "src", "riak_pb_messages.csv");

             string[] msg_csv = File.ReadAllLines(riak_pb_messages_file);
             foreach (string line in msg_csv)


Fixed unit tests

Fixed unit tests

--- src/DatenMeister.Tests/Runtime/Extents/ExtentTests.cs
+++ src/DatenMeister.Tests/Runtime/Extents/ExtentTests.cs
@@ -105,7 +105,7 @@
             var zipCodeExample = dm.Resolve<ZipCodeExampleManager>();
             var typesWorkspace = workspaceLogic.GetTypesWorkspace();
             var zipCodeModel =
-                typesWorkspace.FindElementByUri("dm:///_internal/types/internal?" +
+                typesWorkspace.FindElementByUri("dm:///_internal/types/internal?fn=" +
                                                 ZipCodeModel.PackagePath);

             var dataWorkspace = workspaceLogic.GetDataWorkspace();
@@ -177,7 +177,7 @@
             var zipCodeExample = dm.Resolve<ZipCodeExampleManager>();
             var typesWorkspace = workspaceLogic.GetTypesWorkspace();
             var zipCodeModel =
-                typesWorkspace.FindElementByUri("dm:///_internal/types/internal?" +
+                typesWorkspace.FindElementByUri("dm:///_internal/types/internal?fn=" +
                                                 ZipCodeModel.PackagePath) as IElement;
             Assert.That(zipCodeModel, Is.Not.Null);

@@ -443,13 +443,12 @@
         public void TestQueryItemByFullname()
         {
             var uriExtent = CreateLittleExtent();
-            var package1 = uriExtent.element("dm:///test#fn=package1");
+            var package1 = uriExtent.element("dm:///test?fn=package1");
             Assert.That(package1, Is.Not.Null);
             Assert.That(package1.getOrDefault<string>(_UML._CommonStructure._NamedElement.name),
                 Is.EqualTo("package1"));

-
-            var element1 = uriExtent.element("dm:///test#fn=package1::element1");
+            var element1 = uriExtent.element("dm:///test?fn=package1::element1");
             Assert.That(element1, Is.Not.Null);
             Assert.That(element1.getOrDefault<string>(_UML._CommonStructure._NamedElement.name),
                 Is.EqualTo("element1"));
@@ -466,21 +465,21 @@

             var package1 = factory.create(null);
             var package2 = factory.create(null);
-            var package3 = factory.create(null);
+            var element1 = factory.create(null);

             (package1 as ICanSetId)!.Id = "p1";
             (package2 as ICanSetId)!.Id = "p2";
-            (package3 as ICanSetId)!.Id = "e1";
+            (element1 as ICanSetId)!.Id = "e1";

             package1.set(_UML._CommonStructure._NamedElement.name, "package1");
             package2.set(_UML._CommonStructure._NamedElement.name, "package2");
-            package3.set(_UML._CommonStructure._NamedElement.name, "element1");
-
-            package1.set(_UML._Packages._Package.packagedElement, new[] {package2});
+            element1.set(_UML._CommonStructure._NamedElement.name, "element1");
+
+            package1.set(_UML._Packages._Package.packagedElement, new[] {element1});

             uriExtent.elements().add(package1);
             uriExtent.elements().add(package2);
-            uriExtent.elements().add(package3);
+            uriExtent.elements().add(element1);

             return uriExtent;
         }


Removed unnecessary comment.

Removed unnecessary comment.

--- src/FireworksNet/Generation/EliteStrategyGenerator.cs
+++ src/FireworksNet/Generation/EliteStrategyGenerator.cs
@@ -62,7 +62,6 @@
             Debug.Assert(this.dimensions != null, "Dimension collection is null");
             Debug.Assert(this.polynomialFit != null, "Polynomial fit is null");

-            // 12. Obtain a spark from approximated curves by Elite Strategy
             IDictionary<Dimension, Func<double, double>> fitnessLandscapes = this.ApproximateFitnessLandscapes(explosion.Fireworks);
             IDictionary<Dimension, double> elitePointCoordinates = new Dictionary<Dimension, double>();


Use the title of the connection (domain name or IP)

--- src/GitHub.VisualStudio/Base/EnsureLoggedInSection.cs
+++ src/GitHub.VisualStudio/Base/EnsureLoggedInSection.cs
@@ -54,7 +54,7 @@
             bool loggedIn = await connectionManager.IsLoggedIn(hosts, add);
             if (!loggedIn)
             {
-                var msg = string.Format(CultureInfo.CurrentUICulture, Resources.NotLoggedInMessage, add.Title, add.ApiUri);
+                var msg = string.Format(CultureInfo.CurrentUICulture, Resources.NotLoggedInMessage, add.Title, add.Title);
                 vsServices.ShowMessage(
                     msg,
                     new RelayCommand(() => StartFlow(UIControllerFlow.Authentication))


Update code style

Update code style

--- src/III.Tests/IntegrationTests/BaseRepositoryTests.cs
+++ src/III.Tests/IntegrationTests/BaseRepositoryTests.cs
@@ -1,4 +1,4 @@
-// Copyright 2020 by PeopleWare n.v..
+// Copyright 2020-2022 by PeopleWare n.v..
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
@@ -43,7 +43,7 @@

         [NotNull]
         protected CancellationTokenSource CancellationTokenSource
-            => _cancellationTokenSource ?? (_cancellationTokenSource = new CancellationTokenSource());
+            => _cancellationTokenSource ??= new CancellationTokenSource();

         protected CancellationToken CancellationToken
             => CancellationTokenSource.Token;


Update DefaultEntityRepository.cs

Update DefaultEntityRepository.cs

--- src/JsonApiDotNetCore/Data/DefaultEntityRepository.cs
+++ src/JsonApiDotNetCore/Data/DefaultEntityRepository.cs
@@ -376,7 +376,7 @@
             var entity = await GetAsync(id);
             if (entity == null) return false;
             _dbSet.Remove(entity);
-             await _context.SaveChangesAsync();
+            await _context.SaveChangesAsync();
             return true;
         }


fixed endless loop in skill index action

--- src/LearningSystem.App/Controllers/SkillController.cs
+++ src/LearningSystem.App/Controllers/SkillController.cs
@@ -36,7 +36,7 @@
                 HashSet<Lesson> added = new HashSet<Lesson>();
                 var parentlessLessons = lessons.Where(x => x.Requirements.Count == 0).ToList();

-                learnedLessons  = user.Lessons.Where(x => x.SkillId == skill.SkillId && lessons.Any(y => y.LessonId == x.LessonId));
+                learnedLessons = user.Lessons.Where(x => x.SkillId == skill.SkillId && lessons.Any(y => y.LessonId == x.LessonId));

                 sortedLessons.AddRange(parentlessLessons.ToLessonViewModel(0));
                 parentlessLessons.ForEach(x => added.Add(x));
@@ -58,8 +58,17 @@
                             }
                         }
                     }
+
+                    if (levelInSkillTree > notInPlace)
+                    {
+                        break;
+                    }
+
                     levelInSkillTree++;
                 }
+                var left = lessons.Except(added);
+                sortedLessons.AddRange(left.ToLessonViewModel(levelInSkillTree));
+
             }
             else
             {
@@ -75,7 +84,7 @@

             foreach (var item in sortedLessons)
             {
-                if(learnedLessons.Any(x => x.LessonId == item.Id))
+                if (learnedLessons.Any(x => x.LessonId == item.Id))
                 {
                     item.IsLearned = true;
                 }
@@ -124,6 +133,6 @@
             return PartialView("_SignUpForSkill");
         }

-
+
     }
 }


PERFORMANCE: Lucene.Net.Facet.Taxonomy.CachedOrdinalsReader: Factored out call to EnterUpgradeableReadLock() so reads can happen concurrently.

--- src/Lucene.Net.Facet/Taxonomy/CachedOrdinalsReader.cs
+++ src/Lucene.Net.Facet/Taxonomy/CachedOrdinalsReader.cs
@@ -84,29 +84,30 @@
 #if FEATURE_CONDITIONALWEAKTABLE_ENUMERATOR
             return ordsCache.GetValue(cacheKey, (cacheKey) => new CachedOrds(source.GetReader(context), context.Reader.MaxDoc));
 #else
-            syncLock.EnterUpgradeableReadLock();
+            CachedOrds ords;
+            syncLock.EnterReadLock();
             try
             {
-                if (!ordsCache.TryGetValue(cacheKey, out CachedOrds ords))
-                {
-                    ords = new CachedOrds(source.GetReader(context), context.Reader.MaxDoc);
-                    syncLock.EnterWriteLock();
-                    try
-                    {
-                        ordsCache[cacheKey] = ords;
-                    }
-                    finally
-                    {
-                        syncLock.ExitWriteLock();
-                    }
-                }
-
-                return ords;
+                if (ordsCache.TryGetValue(cacheKey, out ords))
+                    return ords;
             }
             finally
             {
-                syncLock.ExitUpgradeableReadLock();
-            }
+                syncLock.ExitReadLock();
+            }
+
+            ords = new CachedOrds(source.GetReader(context), context.Reader.MaxDoc);
+            syncLock.EnterWriteLock();
+            try
+            {
+                ordsCache[cacheKey] = ords;
+            }
+            finally
+            {
+                syncLock.ExitWriteLock();
+            }
+
+            return ords;
 #endif
         }


Resolve #5

Resolve #5

--- src/Magnanibot.Discord/Extensions/SystemExtensions.cs
+++ src/Magnanibot.Discord/Extensions/SystemExtensions.cs
@@ -32,7 +32,7 @@
         }

         public static bool ShouldBeSeen(this string s)
-            => s != "Unknown command" && s != "A task was canceled.";
+            => s != "Unknown command." && s != "A task was canceled.";

         public static (string, string, string, string) ToSubredditDisplay(
             this string sub, IEnumerable<Post> posts, RedditResult.PostCategory postCategory)


Error page middleware returns a truncated response on OSX

Fixes the bug:
https://katanaproject.codeplex.com/workitem/333

This is fixed by porting the following vnext fixes:
https://github.com/aspnet/Diagnostics/pull/35
https://github.com/aspnet/Diagnostics/issues/49

--- src/Microsoft.Owin.Diagnostics/ErrorPageMiddleware.cs
+++ src/Microsoft.Owin.Diagnostics/ErrorPageMiddleware.cs
@@ -139,7 +139,7 @@
             var stackTrace = ex.StackTrace;
             if (!string.IsNullOrEmpty(stackTrace))
             {
-                var heap = new Chunk { Text = stackTrace + Environment.NewLine, End = stackTrace.Length + 2 };
+                var heap = new Chunk { Text = stackTrace + Environment.NewLine, End = stackTrace.Length + Environment.NewLine.Length };
                 for (Chunk line = heap.Advance(Environment.NewLine); line.HasValue; line = heap.Advance(Environment.NewLine))
                 {
                     yield return StackFrame(line, showSource);
@@ -155,7 +155,7 @@
             int lineNumber = line.ToInt32();

             return string.IsNullOrEmpty(file)
-                ? LoadFrame(line.ToString(), string.Empty, 0, showSource)
+                ? LoadFrame(function, string.Empty, 0, showSource)
                 : LoadFrame(function, file, lineNumber, showSource);
         }


ProcessInfoLayoutRenderer - Applied usage of LateBoundMethod (Fixed Format documentation)

--- src/NLog/LayoutRenderers/ProcessInfoLayoutRenderer.cs
+++ src/NLog/LayoutRenderers/ProcessInfoLayoutRenderer.cs
@@ -52,6 +52,7 @@
         private Process process;

         private PropertyInfo propertyInfo;
+        private ReflectionHelpers.LateBoundMethod lateBoundPropertyGet;

         /// <summary>
         /// Initializes a new instance of the <see cref="ProcessInfoLayoutRenderer" /> class.
@@ -71,7 +72,8 @@
         /// <summary>
         /// Gets or sets the format-string to use if the property supports it (Ex. DateTime / TimeSpan / Enum)
         /// </summary>
-        [DefaultValue(null), DefaultParameter]
+        /// <docgen category='Rendering Options' order='10' />
+        [DefaultValue(null)]
         public string Format { get; set; }

         /// <summary>
@@ -85,6 +87,8 @@
             {
                 throw new ArgumentException("Property '" + this.propertyInfo + "' not found in System.Diagnostics.Process");
             }
+
+            lateBoundPropertyGet = ReflectionHelpers.CreateLateBoundMethod(this.propertyInfo.GetGetMethod());

             this.process = Process.GetCurrentProcess();
         }
@@ -110,10 +114,10 @@
         /// <param name="logEvent">Logging event.</param>
         protected override void Append(StringBuilder builder, LogEventInfo logEvent)
         {
-            if (this.propertyInfo != null)
+            if (this.lateBoundPropertyGet != null)
             {
                 var formatProvider = GetFormatProvider(logEvent);
-                var value = this.propertyInfo.GetValue(this.process, null);
+                var value = this.lateBoundPropertyGet(this.process, null);
                 builder.Append(value.ToStringWithOptionalFormat(this.Format, formatProvider));
             }
         }


fixed bug that some tree could not be loaded because the querystring did not contain the key application

--- src/Opten.Umbraco.ListView/Events/TreeEventHandler.cs
+++ src/Opten.Umbraco.ListView/Events/TreeEventHandler.cs
@@ -6,7 +6,7 @@
 using Umbraco.Web.Models.ContentEditing;
 using Umbraco.Web.Trees;

-namespace ClassLibrary1
+namespace Opten.Umbraco.ListView
 {
 	public class TreeEventHandler : ApplicationEventHandler
 	{
@@ -39,7 +39,7 @@

 		private void ContentTreeController_TreeNodesRendering(TreeControllerBase sender, TreeNodesRenderingEventArgs e)
 		{
-			if (e.QueryStrings["application"].Equals("content") &&
+			if (e.QueryStrings.Contains(new System.Collections.Generic.KeyValuePair<string, string>("application", "content")) &&
 				e.QueryStrings["isDialog"].Equals("false") &&
 				string.IsNullOrWhiteSpace(e.QueryStrings["id"]) == false &&
 				e.QueryStrings["id"] != "-1")


set ETag to overwrite when updating or deleting a registration

The ETag needs to be set to "*" when updating or deleting a
registration, otherwise it returns
"Error 412 Precondition Failed–ETag header missing or invalid"

This is according to the code in Microsoft.WindowsAzure.Messaging.dll,
which is the Notification Hub client for Windows Phone

--- source/ByteSmith.WindowsAzure.Messaging/NotificationHub.cs
+++ source/ByteSmith.WindowsAzure.Messaging/NotificationHub.cs
@@ -126,6 +126,7 @@
 				if (String.IsNullOrEmpty(registration.RegistrationId))
 					throw new ArgumentException("RegistrationId missing.", "registration");

+				registration.ETag = "*";
 				return DeleteRegistration(registration);
 			}
 			catch (Exception ex)
@@ -301,6 +302,7 @@

 			if (localRegistration != null) {
 				try {
+					localRegistration.ETag = "*";
 					registration = await UpdateRegistration (localRegistration);
 				} catch (WebException ex) {
 					if (((HttpWebResponse)ex.Response).StatusCode == HttpStatusCode.NotFound)
@@ -324,6 +326,7 @@
 			if (registration == null)
 				return;

+			registration.ETag = "*";
 			await DeleteRegistration(registration);

 			DeleteLocalRegistration(templateName);


Map Guid to char(36)

Map Guid to char(36)

The standard string-format Guid is a fixed, 36-character string.

--- src/FluentMigrator.Runner/Generators/MySql/MySqlTypeMap.cs
+++ src/FluentMigrator.Runner/Generators/MySql/MySqlTypeMap.cs
@@ -37,7 +37,7 @@
             SetTypeMap(DbType.Decimal, "DECIMAL(19,5)");
             SetTypeMap(DbType.Decimal, "DECIMAL($size,$precision)", DecimalCapacity);
             SetTypeMap(DbType.Double, "DOUBLE");
-            SetTypeMap(DbType.Guid, "VARCHAR(40)");
+            SetTypeMap(DbType.Guid, "CHAR(36)");
             SetTypeMap(DbType.Int16, "SMALLINT");
             SetTypeMap(DbType.Int32, "INTEGER");
             SetTypeMap(DbType.Int64, "BIGINT");


MongoFeatureManager adds behavior to the Id IsEmpty and IsTemporary methods, including support for ObjectId.

--- src/Kephas.Data.MongoDB/Application/MongoFeatureManager.cs
+++ src/Kephas.Data.MongoDB/Application/MongoFeatureManager.cs
@@ -15,6 +15,8 @@
     using Kephas.Application;
     using Kephas.Threading.Tasks;

+    using global::MongoDB.Bson;
+
     /// <summary>
     /// Feature manager for MongoDB.
     /// </summary>
@@ -30,6 +32,19 @@
         /// </returns>
         protected override Task InitializeCoreAsync(IAppContext appContext, CancellationToken cancellationToken)
         {
+            var originalIsTemporary = Id.IsTemporary;
+            Id.IsTemporary = value =>
+                {
+                    if (value is ObjectId)
+                    {
+                        return (ObjectId)value < ObjectId.Empty;
+                    }
+
+                    return originalIsTemporary(value);
+                };
+
+            Id.AddEmptyValue(ObjectId.Empty);
+
             return TaskHelper.CompletedTask;
         }
     }


Update Program.cs

Update Program.cs

修改dotnet core server 没有注册执行实体的错误

--- src/examples/performances/Performances.NetCoreApp.Server/Program.cs
+++ src/examples/performances/Performances.NetCoreApp.Server/Program.cs
@@ -36,6 +36,8 @@
                 .AddServiceRuntime()
                 .UseSharedFileRouteManager("d:\\routes.txt")
                 .UseDotNettyTransport();
+
+            serviceCollection.AddTransient<IUserService, UserService>();

             IServiceProvider serviceProvider = null;
             do
@@ -90,4 +92,4 @@
             Console.ReadLine();
         }
     }
-}+}


Fix PR

Fix PR

--- src/Microsoft.AspNet.Identity.EntityFramework/UserStore.cs
+++ src/Microsoft.AspNet.Identity.EntityFramework/UserStore.cs
@@ -979,7 +979,7 @@
             ThrowIfDisposed();
             if (String.IsNullOrEmpty(roleName))
             {
-                throw new ArgumentNullException(nameof(role));
+                throw new ArgumentNullException(nameof(roleName));
             }

             var role = await Roles.Where(x => x.Name.Equals(roleName)).FirstOrDefaultAsync(cancellationToken);


Fix debug string

Fix debug string

--- src/Microsoft.AspNet.Mvc.Core/ReflectedActionDescriptor.cs
+++ src/Microsoft.AspNet.Mvc.Core/ReflectedActionDescriptor.cs
@@ -1,10 +1,9 @@
-using System;
-using System.Diagnostics;
+using System.Diagnostics;
 using System.Reflection;

 namespace Microsoft.AspNet.Mvc
 {
-    [DebuggerDisplay("CA {Path}:{Name}(RC-{RouteConstraints.Count})")]
+    [DebuggerDisplay("CA {ControllerName}:{Name}(RC-{RouteConstraints.Count})")]
     public class ReflectedActionDescriptor : ActionDescriptor
     {
         public string ControllerName


Remove GetHtmlEncoder usage

Remove GetHtmlEncoder usage

--- src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs
+++ src/Microsoft.AspNet.StaticFiles/HtmlDirectoryFormatter.cs
@@ -10,7 +10,7 @@
 using System.Threading.Tasks;
 using Microsoft.AspNet.FileProviders;
 using Microsoft.AspNet.Http;
-using Microsoft.Extensions.WebEncoders;
+using Microsoft.Extensions.DependencyInjection;

 namespace Microsoft.AspNet.StaticFiles
 {
@@ -21,7 +21,7 @@
     {
         private const string TextHtmlUtf8 = "text/html; charset=utf-8";

-        private static HtmlEncoder _htmlEncoder;
+        private HtmlEncoder _htmlEncoder;

         /// <summary>
         /// Generates an HTML view for a directory.
@@ -39,7 +39,7 @@

             if (_htmlEncoder == null)
             {
-                _htmlEncoder = context.RequestServices.GetHtmlEncoder();
+                _htmlEncoder = context.RequestServices.GetRequiredService<HtmlEncoder>();
             }

             context.Response.ContentType = TextHtmlUtf8;
@@ -160,7 +160,7 @@
             return context.Response.Body.WriteAsync(bytes, 0, bytes.Length);
         }

-        private static string HtmlEncode(string body)
+        private string HtmlEncode(string body)
         {
             return _htmlEncoder.Encode(body);
         }


fix HttpRequesterMiddleware does not call next bug (#830)

call next so that we can do something with the response, such as add some custom header etc...

--- src/Ocelot/Requester/Middleware/HttpRequesterMiddleware.cs
+++ src/Ocelot/Requester/Middleware/HttpRequesterMiddleware.cs
@@ -33,6 +33,8 @@
             Logger.LogDebug("setting http response message");

             context.DownstreamResponse = new DownstreamResponse(response.Data);
+
+            await _next.Invoke(context);
         }
     }
-}
+}


is GL_FLOAT_RG32_NV same with GL_RG32F？

is GL_FLOAT_RG32_NV same with GL_RG32F？


(*) Fixed a broken test case for TS

(*) Fixed a broken test case for TS

--- src/Orc.Sort.Tests/TopologicalSort/TopologicalSortTests.cs
+++ src/Orc.Sort.Tests/TopologicalSort/TopologicalSortTests.cs
@@ -228,8 +228,8 @@

             AssertOrdering(sorted, result, sorter.Sequences);

-            Assert.True("F".ComesBefore(sorted.Skip(1), result));
-            Assert.True("B".ComesAfter(sorted.Take(sorted.Count - 1), result));
+            Assert.True("A".ComesBefore(sorted.Skip(1), result));
+            Assert.True("C".ComesAfter(sorted.Take(sorted.Count - 1), result));
         }

         [Test]


Avoid importing RS keyboard

Avoid importing RS keyboard

--- src/Package/Impl/Options/R/Tools/ImportRSettingsCommand.cs
+++ src/Package/Impl/Options/R/Tools/ImportRSettingsCommand.cs
@@ -27,7 +27,7 @@

                 string asmDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetAssemblyPath());
                 string settingsFilePath1 = Path.Combine(asmDirectory, @"Profiles\", "R.vssettings");
-                string settingsFilePath2 = Path.Combine(asmDirectory, @"Profiles\", "RStudioKeyboard.vssettings");
+                //string settingsFilePath2 = Path.Combine(asmDirectory, @"Profiles\", "RStudioKeyboard.vssettings");
                 if (!File.Exists(settingsFilePath1)) {
                     string ideFolder = asmDirectory.Substring(0, asmDirectory.IndexOf(@"\Extensions", StringComparison.OrdinalIgnoreCase));
                     settingsFilePath1 = Path.Combine(ideFolder, @"Profiles\", "R.vssettings");
@@ -36,10 +36,10 @@
                 object arguments = string.Format(CultureInfo.InvariantCulture, "-import:\"{0}\"", settingsFilePath1);
                 shell.PostExecCommand(ref group, (uint)VSConstants.VSStd2KCmdID.ManageUserSettings, 0, ref arguments);

-                if (MessageButtons.Yes == VsAppShell.Current.ShowMessage(Resources.Warning_RStudioKeyboardShortcuts, MessageButtons.YesNo)) {
-                    arguments = string.Format(CultureInfo.InvariantCulture, "-import:\"{0}\"", settingsFilePath2);
-                    shell.PostExecCommand(ref group, (uint)VSConstants.VSStd2KCmdID.ManageUserSettings, 0, ref arguments);
-                }
+                //if (MessageButtons.Yes == VsAppShell.Current.ShowMessage(Resources.Warning_RStudioKeyboardShortcuts, MessageButtons.YesNo)) {
+                //    arguments = string.Format(CultureInfo.InvariantCulture, "-import:\"{0}\"", settingsFilePath2);
+                //    shell.PostExecCommand(ref group, (uint)VSConstants.VSStd2KCmdID.ManageUserSettings, 0, ref arguments);
+                //}
             }
         }
     }


Fix error when writing error to status bar

A change to highlight errors on the status bar did not take into account the fact that
logError could be called off the GUI thread and needs to explicitly switch threads when
it does GUI operations.   Fixed this.

--- src/PerfView/GuiUtilities/StatusBar/StatusBar.xaml.cs
+++ src/PerfView/GuiUtilities/StatusBar/StatusBar.xaml.cs
@@ -69,16 +69,20 @@
             if (errorMessage.IndexOf('\n') < 0)     // Is it a one line error message?
             {
                 if (Dispatcher.CheckAccess())
+                {
+
                     Status = errorMessage;
+                    m_StatusMessage.RaiseEvent(new RoutedEventArgs(StatusBar.HighlightMessageEvent, this));
+                }
                 else
-                    Dispatcher.BeginInvoke((Action)delegate()
+                    Dispatcher.BeginInvoke((Action)delegate ()
                     {
                         Status = errorMessage;
+                        m_StatusMessage.RaiseEvent(new RoutedEventArgs(StatusBar.HighlightMessageEvent, this));
                     });
             }
             LoggedError = true;

-            m_StatusMessage.RaiseEvent(new RoutedEventArgs(StatusBar.HighlightMessageEvent, this));
         }

         public static readonly RoutedEvent HighlightMessageEvent = EventManager.RegisterRoutedEvent("HighlightMessage", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(StatusBar));


conversion of alias to array

conversion of alias to array

--- src/Peachpie.CodeAnalysis/CodeGen/CodeGenerator.Convert.cs
+++ src/Peachpie.CodeAnalysis/CodeGen/CodeGenerator.Convert.cs
@@ -592,7 +592,13 @@
             }
             else if (from == CoreTypes.PhpValue)
             {
-                EmitCall(ILOpCode.Call, CoreMethods.Operators.ToArray_PhpValue);        // TODO: ToArray(), not AsArray()
+                EmitCall(ILOpCode.Call, CoreMethods.Operators.ToArray_PhpValue);
+            }
+            else if (from == CoreTypes.PhpAlias)
+            {
+                // <PhpAlias>.Value.ToArray()
+                this.Emit_PhpAlias_GetValueRef();
+                this.EmitCall(ILOpCode.Call, CoreMethods.PhpValue.ToArray);
             }
             else if (   // TODO: helper method for builtin types
                 from.SpecialType != SpecialType.None ||


fixes

fixes

--- src/Qooba.Framework.Bot.Azure.Tests/BotRunnerTests.cs
+++ src/Qooba.Framework.Bot.Azure.Tests/BotRunnerTests.cs
@@ -30,7 +30,7 @@
         [Fact]
         public void RunShopping()
         {
-            Run("Jad do Arkadii chc kupi spodnie");
+            Run("Jad� do Arkadii chc� kupi� spodnie");
         }

         [Fact]
@@ -138,7 +138,7 @@
             BotRunner.Run(queueItem).Wait();
         }

-        private string QueueItem(string message) => ("{\"connectorType\": \"Messanger\", \"message\":{\"sender\": {\"id\": \"USER_ID\"},\"recipient\": {\"id\": \"PAGE_ID\"},\"timestamp\": 1458692752478,\"message\": {\"mid\": \"mid.1457764197618:41d102a3e1ae206a38\",\"text\": \"" + message + "\",\"quick_reply\": {\"payload\": \"DEVELOPER_DEFINED_PAYLOAD\"}}}}").Replace("USER_ID", this.UserId);
+        private string QueueItem(string message) => ("{\"connectorType\": \"Messanger\", \"message\":{\"sender\": {\"id\": \"USER_ID\"},\"recipient\": {\"id\": \"PAGE_ID\"},\"timestamp\": 1458692752478,\"message\": {\"mid\": \"mid.1457764197618:41d102a3e1ae206a38\",\"text\": \"" + message + "\",\"quick_reply\": {}}}}").Replace("USER_ID", this.UserId);
     }

     [Route("Show test reply action")]


Useless parameter removed

Useless parameter removed

--- src/RElmah.Web.Server/Controllers/RElmahController.cs
+++ src/RElmah.Web.Server/Controllers/RElmahController.cs
@@ -10,7 +10,7 @@
     {
         private readonly IErrorsInbox _inbox;

-        public RElmahController(IErrorsInbox inbox, IErrorsDispatcher dispatcher)
+        public RElmahController(IErrorsInbox inbox)
         {
             _inbox = inbox;
         }


Added [DataContract] to the DTO's

Added [DataContract] to the DTO's

--- src/ServiceStack.ServiceInterface/Auth/AuthService.cs
+++ src/ServiceStack.ServiceInterface/Auth/AuthService.cs
@@ -24,6 +24,7 @@
     /// <returns>Response DTO; non-null will short-circuit execution and return that response</returns>
     public delegate object ValidateFn(IServiceBase service, string httpMethod, object requestDto);

+    [DataContract]
     public class Auth
     {
         [DataMember(Order=1)] public string provider { get; set; }
@@ -43,6 +44,7 @@
         [DataMember(Order=14)] public string cnonce { get; set; }
     }

+    [DataContract]
     public class AuthResponse
     {
         public AuthResponse()


AML-2389 Added payment registry to account worker container config

--- src/SFA.DAS.EAS.Account.Worker/DependencyResolution/IoC.cs
+++ src/SFA.DAS.EAS.Account.Worker/DependencyResolution/IoC.cs
@@ -13,6 +13,7 @@
                 c.AddRegistry<CachesRegistry>();
                 c.AddRegistry<CommitmentsRegistry>();
                 c.AddRegistry<ConfigurationRegistry>();
+                c.AddRegistry<ExecutionPoliciesRegistry>();
                 c.AddRegistry<HashingRegistry>();
                 c.AddRegistry<LevyRegistry>();
                 c.AddRegistry<LoggerRegistry>();
@@ -20,6 +21,7 @@
                 c.AddRegistry<MediatorRegistry>();
                 c.AddRegistry<MessagePublisherRegistry>();
                 c.AddRegistry<NotificationsRegistry>();
+                c.AddRegistry<PaymentsRegistry>();
                 c.AddRegistry<ReferenceDataRegistry>();
                 c.AddRegistry<TokenServiceRegistry>();
                 c.AddRegistry<ValidationRegistry>();


Add an Open File command for imported projects.

--- src/StructuredLogViewer/Controls/BuildControl.xaml.cs
+++ src/StructuredLogViewer/Controls/BuildControl.xaml.cs
@@ -38,6 +38,7 @@
         private MenuItem copyNameItem;
         private MenuItem copyValueItem;
         private MenuItem viewItem;
+        private MenuItem openFileItem;
         private MenuItem preprocessItem;
         private MenuItem runItem;
         private MenuItem debugItem;
@@ -96,6 +97,7 @@
             copyNameItem = new MenuItem() { Header = "Copy name" };
             copyValueItem = new MenuItem() { Header = "Copy value" };
             viewItem = new MenuItem() { Header = "View" };
+            openFileItem = new MenuItem() { Header = "Open File" };
             preprocessItem = new MenuItem() { Header = "Preprocess" };
             hideItem = new MenuItem() { Header = "Hide" };
             runItem = new MenuItem() { Header = "Run" };
@@ -109,6 +111,7 @@
             copyNameItem.Click += (s, a) => CopyName();
             copyValueItem.Click += (s, a) => CopyValue();
             viewItem.Click += (s, a) => Invoke(treeView.SelectedItem as ParentedNode);
+            openFileItem.Click += (s, a) => OpenFile();
             preprocessItem.Click += (s, a) => Preprocess(treeView.SelectedItem as IPreprocessable);
             runItem.Click += (s, a) => Run(treeView.SelectedItem as Task, debug: false);
             debugItem.Click += (s, a) => Run(treeView.SelectedItem as Task, debug: true);
@@ -117,6 +120,7 @@
             contextMenu.Items.Add(runItem);
             contextMenu.Items.Add(debugItem);
             contextMenu.Items.Add(viewItem);
+            contextMenu.Items.Add(openFileItem);
             contextMenu.Items.Add(preprocessItem);
             contextMenu.Items.Add(searchInSubtreeItem);
             contextMenu.Items.Add(copyItem);
@@ -402,6 +406,7 @@
             copyNameItem.Visibility = visibility;
             copyValueItem.Visibility = visibility;
             viewItem.Visibility = CanView(node) ? Visibility.Visible : Visibility.Collapsed;
+            openFileItem.Visibility = CanOpenFile(node) ? Visibility.Visible : Visibility.Collapsed;
             var hasChildren = node is TreeNode t && t.HasChildren;
             copySubtreeItem.Visibility = hasChildren ? Visibility.Visible : Visibility.Collapsed;
             viewSubtreeTextItem.Visibility = copySubtreeItem.Visibility;
@@ -799,6 +804,15 @@
             }
         }

+        public void OpenFile()
+        {
+            var treeNode = treeView.SelectedItem;
+            if (treeNode != null && treeNode is Import import)
+            {
+                DisplayFile(import.ImportedProjectFilePath);
+            }
+        }
+
         public void SearchInSubtree()
         {
             var treeNode = treeView.SelectedItem as TimedNode;
@@ -960,6 +974,11 @@
                 || (node is IHasSourceFile ihsf && ihsf.SourceFilePath != null && sourceFileResolver.HasFile(ihsf.SourceFilePath))
                 || (node is NameValueNode nvn && nvn.IsValueShortened)
                 || (node is TextNode tn && tn.IsTextShortened);
+        }
+
+        private bool CanOpenFile(ParentedNode node)
+        {
+            return node is Import i && sourceFileResolver.HasFile(i.ImportedProjectFilePath);
         }

         private bool Invoke(ParentedNode treeNode)


Move parameters to class.

Move parameters to class.

--- src/Server/FileSystemSnapshot/FileSystemSnapshotBuilder.cs
+++ src/Server/FileSystemSnapshot/FileSystemSnapshotBuilder.cs
@@ -48,7 +48,14 @@
             .Where(project => project != null)
             .Distinct(new ProjectPathComparer())
             .Select(project => {
-              var rootSnapshot = ProcessProject(fileNameFactory, oldSnapshot, pathChanges, project, progress);
+              var data = new ProjectProcessingData {
+                FileSystemNameFactory = fileNameFactory,
+                Project = project,
+                Progress = progress,
+                OldSnapshot = oldSnapshot,
+                PathChanges = pathChanges,
+              };
+              var rootSnapshot = ProcessProject(data);
               return new ProjectRootSnapshot(project, rootSnapshot);
             })
             .OrderBy(projectRoot => projectRoot.Directory.DirectoryName)
@@ -58,45 +65,46 @@
       }
     }

-    private DirectorySnapshot ProcessProject(
-      IFileSystemNameFactory fileNameFactory,
-      FileSystemTreeSnapshot oldSnapshot,
-      FullPathChanges pathChanges,
-      IProject project,
-      IProgressTracker progress) {
-
-      if (pathChanges != null) {
+    private class ProjectProcessingData {
+      public IFileSystemNameFactory FileSystemNameFactory;
+      public FileSystemTreeSnapshot OldSnapshot;
+      public IProject Project;
+      public IProgressTracker Progress;
+      public FullPathChanges PathChanges;
+    }
+
+    private DirectorySnapshot ProcessProject(ProjectProcessingData data) {
+
+      if (data.PathChanges != null) {
         // If we have a project with the same root in the old snapshot, use that
         // snapshot instead of traversing the file system.
-        var oldRoot = oldSnapshot.ProjectRoots
-          .FirstOrDefault(x => x.Project.RootPath.Equals(project.RootPath));
+        var oldRoot = data.OldSnapshot.ProjectRoots
+          .FirstOrDefault(x => x.Project.RootPath.Equals(data.Project.RootPath));
         if (oldRoot != null) {
-          return ApplyDirectorySnapshotDelta(fileNameFactory, project, progress, oldRoot.Directory, pathChanges);
-        }
-      }
-
-      var projectPath = fileNameFactory.CreateAbsoluteDirectoryName(project.RootPath);
-      return CreateDirectorySnapshot(fileNameFactory, project, progress, projectPath, false);
+          return ApplyDirectorySnapshotDelta(data, oldRoot.Directory);
+        }
+      }
+
+      var projectPath = data.FileSystemNameFactory.CreateAbsoluteDirectoryName(data.Project.RootPath);
+      return CreateDirectorySnapshot(data, projectPath, false);
     }

     private DirectorySnapshot CreateDirectorySnapshot(
-      IFileSystemNameFactory fileNameFactory,
-      IProject project,
-      IProgressTracker progress,
+      ProjectProcessingData data,
       DirectoryName directory,
       bool isSymLink) {

       // Create list of pairs (DirectoryName, List[FileNames])
-      var directoriesWithFiles = TraverseFileSystem(_fileSystem, fileNameFactory, project, directory, isSymLink)
+      var directoriesWithFiles = TraverseFileSystem(data, directory, isSymLink)
         .AsParallel()
         .WithExecutionMode(ParallelExecutionMode.ForceParallelism)
         .Select(traversedDirectoryEntry => {
           var directoryName = traversedDirectoryEntry.DirectoryData.DirectoryName;
-          if (progress.Step()) {
-            progress.DisplayProgress((i, n) => string.Format("Traversing directory: {0}\\{1}", project.RootPath.Value, directoryName.RelativePath.Value));
+          if (data.Progress.Step()) {
+            data.Progress.DisplayProgress((i, n) => string.Format("Traversing directory: {0}\\{1}", data.Project.RootPath.Value, directoryName.RelativePath.Value));
           }
           var fileNames = traversedDirectoryEntry.ChildFileNames
-            .Where(childFilename => project.FileFilter.Include(childFilename.RelativePath))
+            .Where(childFilename => data.Project.FileFilter.Include(childFilename.RelativePath))
             .OrderBy(x => x.RelativePath)
             .ToReadOnlyCollection();

@@ -154,11 +162,8 @@
     }

     private DirectorySnapshot ApplyDirectorySnapshotDelta(
-      IFileSystemNameFactory fileSystemNameFactory,
-      IProject project,
-      IProgressTracker progress,
-      DirectorySnapshot oldDirectory,
-      FullPathChanges pathChanges) {
+      ProjectProcessingData data,
+      DirectorySnapshot oldDirectory) {

       var oldDirectoryPath = oldDirectory.DirectoryName.FullPath;

@@ -166,7 +171,7 @@
       // if each path is a file or a directory.
       List<IFileInfoSnapshot> createDirs = null;
       List<IFileInfoSnapshot> createdFiles = null;
-      foreach (var path in pathChanges.GetCreatedEntries(oldDirectoryPath).ToForeachEnum()) {
+      foreach (var path in data.PathChanges.GetCreatedEntries(oldDirectoryPath).ToForeachEnum()) {
         var info = _fileSystem.GetFileInfoSnapshot(path);
         if (info.IsDirectory) {
           if (createDirs == null)
@@ -182,15 +187,15 @@
       // Recursively create new directory entires for previous (non deleted)
       // entries.
       var childDirectories = oldDirectory.ChildDirectories
-        .Where(x => !pathChanges.IsDeleted(x.DirectoryName.FullPath))
-        .Select(x => ApplyDirectorySnapshotDelta(fileSystemNameFactory, project, progress, x, pathChanges))
+        .Where(dir => !data.PathChanges.IsDeleted(dir.DirectoryName.FullPath))
+        .Select(dir => ApplyDirectorySnapshotDelta(data, dir))
         .ToList();

       // Add created directories
       if (createDirs != null) {
         foreach (var info in createDirs.ToForeachEnum()) {
-          var name = fileSystemNameFactory.CreateDirectoryName(oldDirectory.DirectoryName, info.Path.FileName);
-          var childSnapshot = CreateDirectorySnapshot(fileSystemNameFactory, project, progress, name, info.IsSymLink);
+          var name = data.FileSystemNameFactory.CreateDirectoryName(oldDirectory.DirectoryName, info.Path.FileName);
+          var childSnapshot = CreateDirectorySnapshot(data, name, info.IsSymLink);

           // Note: File system change notifications are not always 100%
           // reliable. We may get a "create" event for directory we already know
@@ -211,18 +216,18 @@
       // Match non deleted files
       // Sepcial case: if no file deleted or created, just re-use the list.
       IList<FileName> newFileList;
-      if (pathChanges.GetDeletedEntries(oldDirectoryPath).Count == 0 && createdFiles == null) {
+      if (data.PathChanges.GetDeletedEntries(oldDirectoryPath).Count == 0 && createdFiles == null) {
         newFileList = oldDirectory.ChildFiles;
       } else {
         // Copy the list of previous children, minus deleted files.
         var newFileListTemp = oldDirectory.ChildFiles
-          .Where(x => !pathChanges.IsDeleted(x.FullPath))
+          .Where(x => !data.PathChanges.IsDeleted(x.FullPath))
           .ToList();

         // Add created files
         if (createdFiles != null) {
           foreach (var info in createdFiles.ToForeachEnum()) {
-            var name = fileSystemNameFactory.CreateFileName(oldDirectory.DirectoryName, info.Path.FileName);
+            var name = data.FileSystemNameFactory.CreateFileName(oldDirectory.DirectoryName, info.Path.FileName);
             newFileListTemp.Add(name);
           }

@@ -239,10 +244,10 @@
         newFileList = newFileListTemp;
       }

-      var data = new DirectoryData(oldDirectory.DirectoryName, oldDirectory.IsSymLink);
+      var newData = new DirectoryData(oldDirectory.DirectoryName, oldDirectory.IsSymLink);

       return new DirectorySnapshot(
-        data,
+        newData,
         childDirectories.ToReadOnlyCollection(),
         newFileList.ToReadOnlyCollection());
     }
@@ -268,10 +273,8 @@
     /// <summary>
     /// Enumerate directories and files under the project path of |projet|.
     /// </summary>
-    private static IEnumerable<TraversedDirectoryEntry> TraverseFileSystem(
-      IFileSystem fileSystem,
-      IFileSystemNameFactory fileNameFactory,
-      IProject project,
+    private IEnumerable<TraversedDirectoryEntry> TraverseFileSystem(
+      ProjectProcessingData data,
       DirectoryName startDirectoryName,
       bool isSymLink) {

@@ -279,16 +282,16 @@
       stack.Push(new DirectoryData(startDirectoryName, isSymLink));
       while (stack.Count > 0) {
         var head = stack.Pop();
-        if (head.DirectoryName.IsAbsoluteName || project.DirectoryFilter.Include(head.DirectoryName.RelativePath)) {
-          var childEntries = fileSystem.GetDirectoryEntries(project.RootPath.Combine(head.DirectoryName.RelativePath));
+        if (head.DirectoryName.IsAbsoluteName || data.Project.DirectoryFilter.Include(head.DirectoryName.RelativePath)) {
+          var childEntries = _fileSystem.GetDirectoryEntries(data.Project.RootPath.Combine(head.DirectoryName.RelativePath));
           var childFileNames = new List<FileName>();
           // Note: Use "for" loop to avoid memory allocations.
           for (var i = 0; i < childEntries.Count; i++) {
             DirectoryEntry entry = childEntries[i];
             if (entry.IsDirectory) {
-              stack.Push(new DirectoryData(fileNameFactory.CreateDirectoryName(head.DirectoryName, entry.Name), entry.IsSymLink));
+              stack.Push(new DirectoryData(data.FileSystemNameFactory.CreateDirectoryName(head.DirectoryName, entry.Name), entry.IsSymLink));
             } else if (entry.IsFile) {
-              childFileNames.Add(fileNameFactory.CreateFileName(head.DirectoryName, entry.Name));
+              childFileNames.Add(data.FileSystemNameFactory.CreateFileName(head.DirectoryName, entry.Name));
             }
           }
           yield return new TraversedDirectoryEntry(head, childFileNames);


Clear fixme

Clear fixme

--- src/Umbraco.Core/Services/Implement/ContentService.cs
+++ src/Umbraco.Core/Services/Implement/ContentService.cs
@@ -1988,28 +1988,28 @@
                 var culturesChanging = content.ContentType.VariesByCulture()
                     ? string.Join(",", content.CultureInfos.Where(x => x.Value.IsDirty()).Select(x => x.Key))
                     : null;
+
                 //TODO: Currently there's no way to change track which variant properties have changed, we only have change
                 // tracking enabled on all values on the Property which doesn't allow us to know which variants have changed.
                 // in this particular case, determining which cultures have changed works with the above with names since it will
                 // have always changed if it's been saved in the back office but that's not really fail safe.

                 //Save before raising event
-                // fixme - nesting uow?
                 var saveResult = Save(content, userId);

-                if (saveResult.Success)
-                {
-                    sendToPublishEventArgs.CanCancel = false;
-                    scope.Events.Dispatch(SentToPublish, this, sendToPublishEventArgs);
-
-                    if (culturesChanging != null)
-                        Audit(AuditType.SendToPublishVariant, userId, content.Id, $"Send To Publish for cultures: {culturesChanging}", culturesChanging);
-                    else
-                        Audit(AuditType.SendToPublish, content.WriterId, content.Id);
-                }
-
-                // fixme here, on only on success?
+                // always complete (but maybe return a failed status)
                 scope.Complete();
+
+                if (!saveResult.Success)
+                    return saveResult.Success;
+
+                sendToPublishEventArgs.CanCancel = false;
+                scope.Events.Dispatch(SentToPublish, this, sendToPublishEventArgs);
+
+                if (culturesChanging != null)
+                    Audit(AuditType.SendToPublishVariant, userId, content.Id, $"Send To Publish for cultures: {culturesChanging}", culturesChanging);
+                else
+                    Audit(AuditType.SendToPublish, content.WriterId, content.Id);

                 return saveResult.Success;
             }


Commenting out 2 GetModelFromMultipartRequest() and ReadAsMultipart() as for the moment they are not used and we need to rethink how to handle them

--- src/Umbraco.Web/WebApi/HttpActionContextExtensions.cs
+++ src/Umbraco.Web/WebApi/HttpActionContextExtensions.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.IO;
 using System.Net;
 using System.Net.Http;
@@ -23,29 +23,29 @@
         /// <param name="requestKey"></param>
         /// <param name="validationKeyPrefix"></param>
         /// <returns></returns>
-        public static T GetModelFromMultipartRequest<T>(this HttpActionContext actionContext, MultipartFormDataStreamProvider result, string requestKey, string validationKeyPrefix = "")
-        {
-            if (result.FormData[requestKey/*"contentItem"*/] == null)
-            {
-                var response = actionContext.Request.CreateResponse(HttpStatusCode.BadRequest);
-                response.ReasonPhrase = $"The request was not formatted correctly and is missing the '{requestKey}' parameter";
-                throw new HttpResponseException(response);
-            }
+        //public static T GetModelFromMultipartRequest<T>(this HttpActionContext actionContext, MultipartFormDataStreamProvider result, string requestKey, string validationKeyPrefix = "")
+        //{
+        //    if (result.FormData[requestKey/*"contentItem"*/] == null)
+        //    {
+        //        var response = actionContext.Request.CreateResponse(HttpStatusCode.BadRequest);
+        //        response.ReasonPhrase = $"The request was not formatted correctly and is missing the '{requestKey}' parameter";
+        //        throw new HttpResponseException(response);
+        //    }

-            //get the string json from the request
-            var contentItem = result.FormData[requestKey];
+        //    //get the string json from the request
+        //    var contentItem = result.FormData[requestKey];

-            //deserialize into our model
-            var model = JsonConvert.DeserializeObject<T>(contentItem);
+        //    //deserialize into our model
+        //    var model = JsonConvert.DeserializeObject<T>(contentItem);

-            //get the default body validator and validate the object
-            var bodyValidator = actionContext.ControllerContext.Configuration.Services.GetBodyModelValidator();
-            var metadataProvider = actionContext.ControllerContext.Configuration.Services.GetModelMetadataProvider();
-            //by default all validation errors will not contain a prefix (empty string) unless specified
-            bodyValidator.Validate(model, typeof(T), metadataProvider, actionContext, validationKeyPrefix);
+        //    //get the default body validator and validate the object
+        //    var bodyValidator = actionContext.ControllerContext.Configuration.Services.GetBodyModelValidator();
+        //    var metadataProvider = actionContext.ControllerContext.Configuration.Services.GetModelMetadataProvider();
+        //    //by default all validation errors will not contain a prefix (empty string) unless specified
+        //    bodyValidator.Validate(model, typeof(T), metadataProvider, actionContext, validationKeyPrefix);

-            return model;
-        }
+        //    return model;
+        //}

         /// <summary>
         /// Helper method to get the <see cref="MultipartFormDataStreamProvider"/> from the request in a non-async manner
@@ -53,54 +53,54 @@
         /// <param name="actionContext"></param>
         /// <param name="rootVirtualPath"></param>
         /// <returns></returns>
-        public static MultipartFormDataStreamProvider ReadAsMultipart(this HttpActionContext actionContext, string rootVirtualPath)
-        {
-            if (actionContext.Request.Content.IsMimeMultipartContent() == false)
-            {
-                throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType);
-            }
+        //public static MultipartFormDataStreamProvider ReadAsMultipart(this HttpActionContext actionContext, string rootVirtualPath)
+        //{
+        //    if (actionContext.Request.Content.IsMimeMultipartContent() == false)
+        //    {
+        //        throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType);
+        //    }

-            var hostingEnvironment = Current.Factory.GetRequiredService<IHostingEnvironment>();
-            var root = hostingEnvironment.MapPathContentRoot(rootVirtualPath);
-            //ensure it exists
-            Directory.CreateDirectory(root);
-            var provider = new MultipartFormDataStreamProvider(root);
+        //    var hostingEnvironment = Current.Factory.GetRequiredService<IHostingEnvironment>();
+        //    var root = hostingEnvironment.MapPathContentRoot(rootVirtualPath);
+        //    //ensure it exists
+        //    Directory.CreateDirectory(root);
+        //    var provider = new MultipartFormDataStreamProvider(root);

-            var request = actionContext.Request;
-            var content = request.Content;
+        //    var request = actionContext.Request;
+        //    var content = request.Content;

-            // Note: YES this is super strange, ugly, and weird.
-            // One would think that you could just do:
-            //
-            //var result = content.ReadAsMultipartAsync(provider).Result;
-            //
-            // But it deadlocks. See https://stackoverflow.com/questions/15201255 for details, which
-            // points to https://msdn.microsoft.com/en-us/magazine/jj991977.aspx which contains more
-            // details under "Async All the Way" - see also https://olitee.com/2015/01/c-async-await-common-deadlock-scenario/
-            // which contains a simplified explanation: ReadAsMultipartAsync is meant to be awaited,
-            // not used in the non-async .Result way, and there is nothing we can do about it.
-            //
-            // Alas, model binders cannot be async "all the way", so we have to wrap in a task, to
-            // force proper threading, and then it works.
+        //    // Note: YES this is super strange, ugly, and weird.
+        //    // One would think that you could just do:
+        //    //
+        //    //var result = content.ReadAsMultipartAsync(provider).Result;
+        //    //
+        //    // But it deadlocks. See https://stackoverflow.com/questions/15201255 for details, which
+        //    // points to https://msdn.microsoft.com/en-us/magazine/jj991977.aspx which contains more
+        //    // details under "Async All the Way" - see also https://olitee.com/2015/01/c-async-await-common-deadlock-scenario/
+        //    // which contains a simplified explanation: ReadAsMultipartAsync is meant to be awaited,
+        //    // not used in the non-async .Result way, and there is nothing we can do about it.
+        //    //
+        //    // Alas, model binders cannot be async "all the way", so we have to wrap in a task, to
+        //    // force proper threading, and then it works.

-            MultipartFormDataStreamProvider result = null;
-            var task = Task.Run(() => content.ReadAsMultipartAsync(provider))
-                .ContinueWith(x =>
-                {
-                    if (x.IsFaulted && x.Exception != null)
-                    {
-                        throw x.Exception;
-                    }
-                    result = x.ConfigureAwait(false).GetAwaiter().GetResult();
-                },
-                // Must explicitly specify this, see https://blog.stephencleary.com/2013/10/continuewith-is-dangerous-too.html
-                TaskScheduler.Default);
-            task.Wait();
+        //    MultipartFormDataStreamProvider result = null;
+        //    var task = Task.Run(() => content.ReadAsMultipartAsync(provider))
+        //        .ContinueWith(x =>
+        //        {
+        //            if (x.IsFaulted && x.Exception != null)
+        //            {
+        //                throw x.Exception;
+        //            }
+        //            result = x.ConfigureAwait(false).GetAwaiter().GetResult();
+        //        },
+        //        // Must explicitly specify this, see https://blog.stephencleary.com/2013/10/continuewith-is-dangerous-too.html
+        //        TaskScheduler.Default);
+        //    task.Wait();

-            if (result == null)
-                throw new InvalidOperationException("Could not read multi-part message");
+        //    if (result == null)
+        //        throw new InvalidOperationException("Could not read multi-part message");

-            return result;
-        }
+        //    return result;
+        //}
     }
 }


fixing CA error

fixing CA error

--- src/VsConsole/PowerShellCmdlets/JsonApiCommandBase.cs
+++ src/VsConsole/PowerShellCmdlets/JsonApiCommandBase.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Diagnostics;
+using System.Globalization;
 using System.IO;
 using System.Linq;
 using System.Management.Automation;
@@ -113,7 +114,7 @@
                 return string.Empty;
             }

-            return String.Join("&", queryParameters.Select(param => string.Format("{0}={1}", param.Key, Uri.EscapeDataString(param.Value))));
+            return String.Join("&", queryParameters.Select(param => string.Format(CultureInfo.InvariantCulture, "{0}={1}", param.Key, Uri.EscapeDataString(param.Value))));
         }

         private IEnumerable<T> GetResults(IPackageRepository packageRepository)


Fix handling of chained generic parameters

--- src/WebApiToTypeScript/Interfaces/InterfaceService.cs
+++ src/WebApiToTypeScript/Interfaces/InterfaceService.cs
@@ -1,8 +1,8 @@
-using Mono.Cecil;
-using System.Collections.Generic;
+using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
 using System.Text.RegularExpressions;
+using Mono.Cecil;
 using WebApiToTypeScript.Block;
 using WebApiToTypeScript.Types;

@@ -139,7 +139,9 @@
                     {
                         var baseTypeInstance = typeDefinition.BaseType as GenericInstanceType;
                         var genericArguments = baseTypeInstance.GenericArguments
-                            .Select(p => TypeService.GetTypeScriptType(p.GetElementType(), p.Name).TypeName);
+                            .Select(p => p.IsGenericParameter
+                                ? p.Name
+                                : TypeService.GetTypeScriptType(p.GetElementType(), p.Name).TypeName);

                         extendsString = WrapInAngledBrackets(string.Join(", ", genericArguments));
                     }


Fix leak in DbCommand's use of CancellationToken

We're only disposing of the registration on error; we should also dispose of it on success. While doing this, I've also avoided a delegate allocation per operation.

--- src/System.Data.Common/src/System/Data/Common/DbCommand.cs
+++ src/System.Data.Common/src/System/Data/Common/DbCommand.cs
@@ -128,7 +128,7 @@
                 CancellationTokenRegistration registration = new CancellationTokenRegistration();
                 if (cancellationToken.CanBeCanceled)
                 {
-                    registration = cancellationToken.Register(CancelIgnoreFailure);
+                    registration = cancellationToken.Register(s => ((DbCommand)s).CancelIgnoreFailure(), this);
                 }

                 try
@@ -137,8 +137,11 @@
                 }
                 catch (Exception e)
                 {
+                    return Task.FromException<int>(e);
+                }
+                finally
+                {
                     registration.Dispose();
-                    return Task.FromException<int>(e);
                 }
             }
         }
@@ -166,7 +169,7 @@
                 CancellationTokenRegistration registration = new CancellationTokenRegistration();
                 if (cancellationToken.CanBeCanceled)
                 {
-                    registration = cancellationToken.Register(CancelIgnoreFailure);
+                    registration = cancellationToken.Register(s => ((DbCommand)s).CancelIgnoreFailure(), this);
                 }

                 try
@@ -175,8 +178,11 @@
                 }
                 catch (Exception e)
                 {
+                    return Task.FromException<DbDataReader>(e);
+                }
+                finally
+                {
                     registration.Dispose();
-                    return Task.FromException<DbDataReader>(e);
                 }
             }
         }
@@ -195,7 +201,7 @@
                 CancellationTokenRegistration registration = new CancellationTokenRegistration();
                 if (cancellationToken.CanBeCanceled)
                 {
-                    registration = cancellationToken.Register(CancelIgnoreFailure);
+                    registration = cancellationToken.Register(s => ((DbCommand)s).CancelIgnoreFailure(), this);
                 }

                 try
@@ -204,8 +210,11 @@
                 }
                 catch (Exception e)
                 {
+                    return Task.FromException<object>(e);
+                }
+                finally
+                {
                     registration.Dispose();
-                    return Task.FromException<object>(e);
                 }
             }
         }


Adding mapping to resource object from homepage.

--- crisischeckin/Services/DisasterService.cs
+++ crisischeckin/Services/DisasterService.cs
@@ -34,6 +34,8 @@
             {
                 Allocator = organization,
                 Person = person,
+                PersonId = person.Id,
+                EntryMade = DateTime.Now,
                 DisasterId = disasterId,
                 Description = description,
                 Qty = qty,


Fixed issue number 402

Fixed issue number 402

Added a check for the foreign key constraint of clusterId. Need to check
on a live DB (we had connectivity issues at our codathon).

--- crisischeckin/Services/DisasterService.cs
+++ crisischeckin/Services/DisasterService.cs
@@ -45,6 +45,13 @@
             if (hasExistingCommitment)
             {
                 throw new ArgumentException("There is already a commitment for this date range");
+            }
+
+            var hasCluster = _dataService.Clusters.Any(c => c.Id == clusterId);
+
+            if (!hasCluster)
+            {
+                throw new ArgumentException("There is no cluster for this disaster. Please pick a different disaster.");
             }

             _dataService.AddCommitment(new Commitment


Update ServiceEventsInstaller.cs

Update ServiceEventsInstaller.cs

--- src/Templates.Service/Installers/ServiceEventsInstaller.cs
+++ src/Templates.Service/Installers/ServiceEventsInstaller.cs
@@ -31,8 +31,8 @@
             container.Register(
                 Classes.FromThisAssembly().BasedOn<IStartServiceEvent>()
                 .WithServiceFromInterface(typeof(IStartServiceEvent)),
-                Classes.FromThisAssembly().BasedOn<IStartServiceEvent>()
-                .WithServiceFromInterface(typeof(IStartServiceEvent))
+                Classes.FromThisAssembly().BasedOn<IStopServiceEvent>()
+                .WithServiceFromInterface(typeof(IStopServiceEvent))
             );
         }
     }


Fixed assertion test on bad connector ctor

--- src/Tests/DevOpsFlex.Core.Tests/DiscoveryExtensionsTest.cs
+++ src/Tests/DevOpsFlex.Core.Tests/DiscoveryExtensionsTest.cs
@@ -65,7 +65,7 @@
                     new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));

                 var compilationResult = compilationOld.Emit(ms);
-                Assert.True(compilationResult.Success, $"OldReference assembly generation failed, inspect {nameof(compilationResult)}.Diagnostics");
+                Assert.True(compilationResult.Success, $"Assembly generation failed, inspect {nameof(compilationResult)}.Diagnostics");

                 ms.Seek(0, SeekOrigin.Begin);


Don't create BYOND directory unless the download succeeds

--- src/Tgstation.Server.Host/Components/Byond/ByondManager.cs
+++ src/Tgstation.Server.Host/Components/Byond/ByondManager.cs
@@ -150,11 +150,11 @@
 				var downloadTask = byondInstaller.DownloadVersion(version, cancellationToken);

 				await ioManager.DeleteDirectory(versionKey, cancellationToken).ConfigureAwait(false);
-				await ioManager.CreateDirectory(versionKey, cancellationToken).ConfigureAwait(false);

 				try
 				{
 					var download = await downloadTask.ConfigureAwait(false);
+					await ioManager.CreateDirectory(versionKey, cancellationToken).ConfigureAwait(false);

 					var extractPath = ioManager.ResolvePath(versionKey);
 					logger.LogTrace("Extracting downloaded BYOND zip to {0}...", extractPath);


Added additional logging to migration runner.

--- src/Umbraco.Core/Persistence/Migrations/MigrationRunner.cs
+++ src/Umbraco.Core/Persistence/Migrations/MigrationRunner.cs
@@ -61,10 +61,12 @@
                 if (isUpgrade)
                 {
                     migration.GetUpExpressions(context);
+                    LogHelper.Info<MigrationRunner>(string.Format("Added UPGRADE migration '{0}' to context", migration.GetType().Name));
                 }
                 else
                 {
                     migration.GetDownExpressions(context);
+                    LogHelper.Info<MigrationRunner>(string.Format("Added DOWNGRADE migration '{0}' to context", migration.GetType().Name));
                 }
             }


Update

Update

--- main/dbms_gui_02/dbms_gui_02/Test_Functions/Program.cs
+++ main/dbms_gui_02/dbms_gui_02/Test_Functions/Program.cs
@@ -67,5 +67,11 @@

         }
+
+        static void TestRegex2()
+        {
+
+        }
+
     }
 }


Update DataTableExtensions.cs

Update DataTableExtensions.cs

allow mixed (object) type column conversion from string

--- src/DataTableExtensions.cs
+++ src/DataTableExtensions.cs
@@ -50,7 +50,7 @@
 				// x	dt.Columns[col].ConvertFromString();
 				Parallel.ForEach(dt.Columns.OfType<DataColumn>().ToList(), col => {
 					try {
-						dt.Columns[col.ColumnName].ConvertFromString();
+						dt.Columns[col.ColumnName].ConvertFromString(false);
 					} catch (InvalidOperationException) {
 					}
 				});
@@ -196,28 +196,31 @@
 		}

 		// infer the data type if same for all values in a column
-		public static void ConvertFromString (this DataColumn column) {
+		public static void ConvertFromString (this DataColumn column, bool toMixed) {
 			if (! column.DataType.Equals(typeof(string)))
 				throw new ArgumentException("Column DataType is not String", "column");

 			var rows = column.Table.Rows.OfType<DataRow>().Select(row => ConvertValueFromString((string)row[column]));
 			var items = new List<object>(column.Table.Rows.Count);
-			object firstNonNull = null;
+			Type newType = null;
 			foreach (var row in rows) {
-				if (row != null) {
-					firstNonNull = firstNonNull ?? row;
-					if (items.Any() && !row.GetType().Equals(firstNonNull.GetType())) // data type of all items don't match
-						throw new InvalidOperationException("Not all items are of the same type when converted from a string");
+				if (row != null && newType != typeof(object)) {
+					newType = newType ?? row.GetType();
+					if (!row.GetType().Equals(newType)) { // data type of all items don't match
+						if (toMixed)
+							newType = typeof(object);
+						else
+							throw new InvalidOperationException("Not all items are of the same type when converted from a string");
+					}
 				}
 				items.Add(row);
 			}
-			if (firstNonNull != null) {
+			if (newType != null) {
 				lock (column.Table) {
 					var ordinal = column.Ordinal;
 					var table = column.Table;
 					table.BeginLoadData();

-					var newType = firstNonNull.GetType();
 					if (newType.Equals(typeof(decimal)))
 						if (! items.Any(value => value != null && ((decimal)value > int.MaxValue || value.ToString().Contains(@"."))))
 							newType = typeof(int);
@@ -331,7 +334,7 @@
 		public static string GetValueForSQL(object value)
 		{
 			return GetValueBase(value, @"null", @"0x", s => {
-				if (value is decimal || value is int || value is long || value is float) // if it is a numeric type, no need to escape it
+				if (value is decimal || value is int || value is long || value is float || value is bool) // if it is a numeric type, no need to escape it
 					return s;
 				else
 					return @"'" + s.Replace(@"'", @"''") + @"'"; // escape the value


added PivotData

added PivotData

--- src/DataTableExtensions.cs
+++ src/DataTableExtensions.cs
@@ -43,6 +43,28 @@
 			return rows.OfType<DataRow>().Select(dr => dr[columnOrdinal]);
 		}
 		#endregion
+
+		public static DataTable PivotData (DataTable source, IEnumerable<string> pivotColumns, Func<string, object, object, object> aggregate)
+		{
+			var pivotCols = pivotColumns.ToArray();
+			var copy = source.DefaultView.ToTable(true, source.Columns.OfType<DataColumn>().Select(c => c.ColumnName).Where(c => !pivotCols.Contains(c)).ToArray());
+			copy.PrimaryKey = copy.Columns.OfType<DataColumn>().ToArray();
+
+			var unique = OrderByNatural(source.Rows.OfType<DataRow>().Select(dr => dr[pivotCols[0]].ToString()).Distinct(), s => s).ToArray();
+			copy.Columns.AddRange(unique.Select(s => pivotCols.Skip(1).Select(c => new DataColumn(s + " " + c, source.Columns[c].DataType))).SelectMany(c => c).ToArray());
+
+			foreach (var row in source.Rows.OfType<DataRow>())
+			{
+				var existingRow = copy.Rows.Find(copy.PrimaryKey.Select(c => row[c.ColumnName]).ToArray());
+				var productName = row.Field<string>(pivotCols[0]);
+				foreach (var col in pivotCols.Skip(1))
+				{
+					existingRow.SetField(productName + " " + col, aggregate(col, existingRow[productName + " " + col], row[col]));
+				}
+			}
+
+			return copy;
+		}

 		#region Conversion
 		public static void ConvertColumnsFromString (this DataTable dt, bool toMixed)


Update DefaultTableService.cs

Update DefaultTableService.cs


fix for allowing arrow keys to modify selection

--- RelhaxModpack/RelhaxModpack/Windows/DatabaseEditor.xaml.cs
+++ RelhaxModpack/RelhaxModpack/Windows/DatabaseEditor.xaml.cs
@@ -662,7 +662,8 @@
             if (DatabaseTreeView.SelectedItem is TreeViewItem selectedTreeViewItem)
             {
                 //if the mouse is not over, then it was not user initiated
-                if (!(selectedTreeViewItem.IsMouseOver || Keyboard.IsKeyDown(Key.Enter)))
+                bool anyUserKyesDown = Keyboard.IsKeyDown(Key.Enter) || Keyboard.IsKeyDown(Key.Up) || Keyboard.IsKeyDown(Key.Down) || Keyboard.IsKeyDown(Key.Left) || Keyboard.IsKeyDown(Key.Right);
+                if (!(selectedTreeViewItem.IsMouseOver || anyUserKyesDown))
                     return;
                 Logging.Editor("SelectedItemChanged(), selectedTreeViewItem.Header={0}", LogLevel.Info, selectedTreeViewItem.Header);
                 SelectDatabaseObject(selectedTreeViewItem.Header, e.OldValue as TreeViewItem);


Added OnModelCreating

Added OnModelCreating

--- vNext/VS2013/EF7/HelloEf7/HelloEf7.TraditionalDotNet/Contexts/NorthwindSlim.cs
+++ vNext/VS2013/EF7/HelloEf7/HelloEf7.TraditionalDotNet/Contexts/NorthwindSlim.cs
@@ -1,5 +1,8 @@
+using System;
 using HelloEf7.TraditionalDotNet.Models;
 using Microsoft.Data.Entity;
+using Microsoft.Data.Entity.Metadata;
+using Microsoft.Data.Entity.Query;

 namespace HelloEf7.TraditionalDotNet.Contexts
 {
@@ -13,5 +16,11 @@
         {
             options.UseSqlServer(@"data source=.\sqlexpress;initial catalog=NorthwindSlim;integrated security=True");
         }
+
+        protected override void OnModelCreating(ModelBuilder modelBuilder)
+        {
+            //foreach (var convention in modelBuilder.EntityTypeConventions)
+            //    Console.WriteLine(convention);
+        }
     }
 }


GSF.Core: Added ManagedThreadID to LogMessage for better filtering in LogFileViewer.

--- Source/Libraries/GSF.Core.Shared/Diagnostics/LogMessage.cs
+++ Source/Libraries/GSF.Core.Shared/Diagnostics/LogMessage.cs
@@ -26,6 +26,7 @@
 using System.Data;
 using System.IO;
 using System.Text;
+using System.Threading;
 using GSF.IO;

 namespace GSF.Diagnostics
@@ -120,6 +121,13 @@
         /// this field will have the string representation of <see cref="Exception"/>
         /// </summary>
         public readonly string ExceptionString;
+
+        /// <summary>
+        /// The Managed Thread ID of the thread that created this message. This
+        /// is primarily to assist in future log viewing applications
+        /// where it is beneficial to track the thread.
+        /// </summary>
+        public readonly int ManagedThreadID;

         /// <summary>
         /// Loads a log messages from the supplied stream
@@ -146,6 +154,21 @@
                     Details = stream.ReadString();
                     Exception = null;
                     ExceptionString = stream.ReadString();
+                    ManagedThreadID = -1;
+                    break;
+                case 2:
+                    EventPublisherDetails = saveHelper.LoadEventPublisherDetails(stream);
+                    InitialStackMessages = saveHelper.LoadStackMessages(stream);
+                    InitialStackTrace = saveHelper.LoadStackTrace(stream);
+                    CurrentStackMessages = saveHelper.LoadStackMessages(stream);
+                    CurrentStackTrace = saveHelper.LoadStackTrace(stream);
+                    UtcTime = stream.ReadDateTime();
+                    LogMessageAttributes = new LogMessageAttributes(stream);
+                    Message = stream.ReadString();
+                    Details = stream.ReadString();
+                    Exception = null;
+                    ExceptionString = stream.ReadString();
+                    ManagedThreadID = stream.ReadInt32();
                     break;
                 default:
                     throw new VersionNotFoundException();
@@ -179,6 +202,7 @@
             Message = message ?? string.Empty;
             Details = details ?? string.Empty;
             Exception = exception;
+            ManagedThreadID = Thread.CurrentThread.ManagedThreadId;
         }

         /// <summary>Returns a string that represents the current object.</summary>
@@ -199,7 +223,7 @@
             if (saveHelper == null)
                 saveHelper = LogMessageSaveHelper.Create(true);

-            stream.Write((byte)1);
+            stream.Write((byte)2);
             saveHelper.SaveEventPublisherDetails(stream, EventPublisherDetails);
             saveHelper.SaveStackMessages(stream, InitialStackMessages);
             saveHelper.SaveStackTrace(stream, InitialStackTrace);
@@ -210,6 +234,7 @@
             stream.Write(Message);
             stream.Write(Details);
             stream.Write(ExceptionString);
+            stream.Write(ManagedThreadID);
         }

         /// <summary>


Fix album matching

Fix album matching