ADDED: Main Window - Title shows the name of the current map file being edited.

--- Source/LevelEditor/Control/App.xaml.cs
+++ Source/LevelEditor/Control/App.xaml.cs
@@ -8,6 +8,7 @@
     using System;
     using System.Collections.Generic;
     using System.ComponentModel;
+    using System.IO;
     using System.Threading;
     using System.Windows;
     using System.Windows.Media.Imaging;
@@ -22,16 +23,20 @@
     using Microsoft.Win32;

     /// <summary>
-    /// Main application controller.
+    ///   Main application controller.
     /// </summary>
     public partial class App
     {
         #region Constants

+        private const string MainWindowTitle = "Level Editor";
+
         private const string MapFileExtension = ".map";

         private const string MapFileFilter = "Map files (.map)|*.map";

+        private const string UnsavedMapFileName = "Untitled";
+
         private const string XmlElementHeight = "Height";

         private const string XmlElementPositionX = "X";
@@ -49,52 +54,62 @@
         #region Fields

         /// <summary>
-        /// Stack of commands that can be redone.
+        ///   Stack of commands that can be redone.
         /// </summary>
         private readonly Stack<ICommand> redoStack = new Stack<ICommand>();

         /// <summary>
-        /// Stack of commands that can be undone.
+        ///   Stack of commands that can be undone.
         /// </summary>
         private readonly Stack<ICommand> undoStack = new Stack<ICommand>();

         /// <summary>
-        /// Window showing information about the application.
+        ///   Window showing information about the application.
         /// </summary>
         private AboutWindow aboutWindow;

         /// <summary>
-        /// Current active brush.
+        ///   Current active brush.
         /// </summary>
         private MapTileType currentBrush;

         /// <summary>
-        /// Current draw command that will be pushed on Undo stack.
+        ///   Current draw command that will be pushed on Undo stack.
         /// </summary>
         private DrawCommand currentDrawCommand;

         /// <summary>
-        /// Main application window.
+        ///   Current map file being edited.
+        /// </summary>
+        private Stream currentMapFile;
+
+        /// <summary>
+        ///   Name of the current map file being edited.
+        /// </summary>
+        private string currentMapFileName;
+
+        /// <summary>
+        ///   Main application window.
         /// </summary>
         private MainWindow mainWindow;

         /// <summary>
-        /// Current map being edited by the user.
+        ///   Current map being edited by the user.
         /// </summary>
         private Map map;

         /// <summary>
-        /// Window allowing to specify the properties of a new map to create.
+        ///   Window allowing to specify the properties of a new map to create.
         /// </summary>
         private NewMapWindow newMapWindow;

         /// <summary>
-        /// Available map tile images.
+        ///   Available map tile images.
         /// </summary>
         private Dictionary<string, BitmapImage> tileImages;

         /// <summary>
-        /// Available map tile types.
+        ///   Available map tile types.
         /// </summary>
         private Dictionary<string, MapTileType> tileTypes;

@@ -103,10 +118,10 @@
         #region Public Methods and Operators

         /// <summary>
-        /// Whether the application can be shut down.
+        ///   Whether the application can be shut down.
         /// </summary>
         /// <returns>
-        /// <c>true</c>, if the application can be shut down, and <c>false</c> otherwise.
+        ///   <c>true</c>, if the application can be shut down, and <c>false</c> otherwise.
         /// </returns>
         public bool CanExecuteClose()
         {
@@ -114,10 +129,10 @@
         }

         /// <summary>
-        /// Whether the About window of the application can be shown.
+        ///   Whether the About window of the application can be shown.
         /// </summary>
         /// <returns>
-        /// <c>true</c>, if the About window of the application can be shown, and <c>false</c> otherwise.
+        ///   <c>true</c>, if the About window of the application can be shown, and <c>false</c> otherwise.
         /// </returns>
         public bool CanExecuteHelp()
         {
@@ -125,10 +140,10 @@
         }

         /// <summary>
-        /// Whether the window that allows specifying the properties of a new map to create can be shown.
+        ///   Whether the window that allows specifying the properties of a new map to create can be shown.
         /// </summary>
         /// <returns>
-        /// <c>true</c>, if the New Map window can be shown, and <c>false</c> otherwise.
+        ///   <c>true</c>, if the New Map window can be shown, and <c>false</c> otherwise.
         /// </returns>
         public bool CanExecuteNew()
         {
@@ -136,10 +151,10 @@
         }

         /// <summary>
-        /// Whether an existing map can be opened.
+        ///   Whether an existing map can be opened.
         /// </summary>
         /// <returns>
-        /// <c>true</c>, if an existing map can be opened, and <c>false</c> otherwise.
+        ///   <c>true</c>, if an existing map can be opened, and <c>false</c> otherwise.
         /// </returns>
         public bool CanExecuteOpen()
         {
@@ -147,10 +162,10 @@
         }

         /// <summary>
-        /// Whether there is any command to redo.
+        ///   Whether there is any command to redo.
         /// </summary>
         /// <returns>
-        /// <c>true</c>, if there's any command to redo, and <c>false</c> otherwise.
+        ///   <c>true</c>, if there's any command to redo, and <c>false</c> otherwise.
         /// </returns>
         public bool CanExecuteRedo()
         {
@@ -158,10 +173,10 @@
         }

         /// <summary>
-        /// Whether the current map can be saved.
+        ///   Whether the current map can be saved.
         /// </summary>
         /// <returns>
-        /// <c>true</c>, the current map can be saved, and <c>false</c> otherwise.
+        ///   <c>true</c>, the current map can be saved, and <c>false</c> otherwise.
         /// </returns>
         public bool CanExecuteSaveAs()
         {
@@ -169,10 +184,10 @@
         }

         /// <summary>
-        /// Whether there is any command to undo.
+        ///   Whether there is any command to undo.
         /// </summary>
         /// <returns>
-        /// <c>true</c>, if there's any command to undo, and <c>false</c> otherwise.
+        ///   <c>true</c>, if there's any command to undo, and <c>false</c> otherwise.
         /// </returns>
         public bool CanExecuteUndo()
         {
@@ -180,7 +195,7 @@
         }

         /// <summary>
-        /// Creates a new map based on the properties of the New Map window.
+        ///   Creates a new map based on the properties of the New Map window.
         /// </summary>
         public void CreateMap()
         {
@@ -223,7 +238,7 @@
         }

         /// <summary>
-        /// Shuts down the application.
+        ///   Shuts down the application.
         /// </summary>
         public void ExecuteClose()
         {
@@ -231,7 +246,7 @@
         }

         /// <summary>
-        /// Shows the About window of the application.
+        ///   Shows the About window of the application.
         /// </summary>
         public void ExecuteHelp()
         {
@@ -245,7 +260,7 @@
         }

         /// <summary>
-        /// Shows the window that allows specifying the properties of a new map to create.
+        ///   Shows the window that allows specifying the properties of a new map to create.
         /// </summary>
         public void ExecuteNew()
         {
@@ -260,7 +275,7 @@
         }

         /// <summary>
-        /// Shows an open file dialog box and opens the specified map file.
+        ///   Shows an open file dialog box and opens the specified map file.
         /// </summary>
         public void ExecuteOpen()
         {
@@ -283,47 +298,60 @@
                 return;
             }

+            // Close current file.
+            if (this.currentMapFile != null)
+            {
+                this.currentMapFile.Close();
+            }
+
+            // Update main window title.
+            this.currentMapFileName = openFileDialog.FileName;
+            this.mainWindow.Title = string.Format("{0} - {1}", MainWindowTitle, this.currentMapFileName);
+
             // Open map file.
-            using (var stream = openFileDialog.OpenFile())
-            {
-                try
+            FileInfo fileInfo = new FileInfo(this.currentMapFileName);
+            this.currentMapFile = fileInfo.Open(FileMode.Open, FileAccess.ReadWrite, FileShare.Read);
+
+            try
+            {
+                // Validate schema.
+                XmlReaderSettings readerSettings = new XmlReaderSettings();
+                readerSettings.Schemas.Add("http://www.npruehs.de/teaching", "XML/MapSchema.xsd");
+                readerSettings.ValidationType = ValidationType.Schema;
+
+                using (var reader = XmlReader.Create(this.currentMapFile, readerSettings))
                 {
-                    // Validate schema.
-                    XmlReaderSettings readerSettings = new XmlReaderSettings();
-                    readerSettings.Schemas.Add("http://www.npruehs.de/teaching", "XML/MapSchema.xsd");
-                    readerSettings.ValidationType = ValidationType.Schema;
-
-                    using (var reader = XmlReader.Create(openFileDialog.FileName, readerSettings))
+                    while (reader.Read())
                     {
-                        while (reader.Read())
-                        {
-                        }
                     }
-
-                    // Deserialize map.
-                    XmlSerializer serializer = new XmlSerializer(typeof(Map));
-                    this.map = (Map)serializer.Deserialize(stream);
-
-                    // Show new map tiles.
-                    this.UpdateMapCanvas();
                 }
-                catch (InvalidOperationException)
-                {
-                    this.ShowErrorMessage("Incorrect map file", "Please specify a valid map file!");
-                }
-                catch (XmlException)
-                {
-                    this.ShowErrorMessage("Incorrect map file", "Please specify a valid map file!");
-                }
-                catch (XmlSchemaValidationException)
-                {
-                    this.ShowErrorMessage("Incorrect map file", "Please specify a valid map file!");
-                }
-            }
-        }
-
-        /// <summary>
-        /// Executes the most recent undone command.
+
+                // Rewind stream.
+                this.currentMapFile.Seek(0, SeekOrigin.Begin);
+
+                // Deserialize map.
+                XmlSerializer serializer = new XmlSerializer(typeof(Map));
+                this.map = (Map)serializer.Deserialize(this.currentMapFile);
+
+                // Show new map tiles.
+                this.UpdateMapCanvas();
+            }
+            catch (InvalidOperationException)
+            {
+                this.ShowErrorMessage("Incorrect map file", "Please specify a valid map file!");
+            }
+            catch (XmlException)
+            {
+                this.ShowErrorMessage("Incorrect map file", "Please specify a valid map file!");
+            }
+            catch (XmlSchemaValidationException)
+            {
+                this.ShowErrorMessage("Incorrect map file", "Please specify a valid map file!");
+            }
+        }
+
+        /// <summary>
+        ///   Executes the most recent undone command.
         /// </summary>
         public void ExecuteRedo()
         {
@@ -337,7 +365,7 @@
         }

         /// <summary>
-        /// Shows a save file dialog box and saves the current map to the specified file.
+        ///   Shows a save file dialog box and saves the current map to the specified file.
         /// </summary>
         public void ExecuteSaveAs()
         {
@@ -359,20 +387,31 @@
                 return;
             }

+            // Close current file.
+            if (this.currentMapFile != null)
+            {
+                this.currentMapFile.Close();
+            }
+
+            // Update main window title.
+            this.currentMapFileName = saveFileDialog.FileName;
+            this.mainWindow.Title = string.Format("{0} - {1}", MainWindowTitle, this.currentMapFileName);
+
             // Open file stream.
-            using (var stream = saveFileDialog.OpenFile())
-            {
-                XmlSerializer serializer = new XmlSerializer(typeof(Map));
-
-                XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces();
-                namespaces.Add("np", "http://www.npruehs.de/teaching");
-
-                serializer.Serialize(stream, this.map, namespaces);
-            }
-        }
-
-        /// <summary>
-        /// Undoes the last command.
+            FileInfo fileInfo = new FileInfo(this.currentMapFileName);
+            this.currentMapFile = fileInfo.Create();
+
+            // Serialize map.
+            XmlSerializer serializer = new XmlSerializer(typeof(Map));
+
+            XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces();
+            namespaces.Add("np", "http://www.npruehs.de/teaching");
+
+            serializer.Serialize(this.currentMapFile, this.map, namespaces);
+        }
+
+        /// <summary>
+        ///   Undoes the last command.
         /// </summary>
         public void ExecuteUndo()
         {
@@ -386,7 +425,7 @@
         }

         /// <summary>
-        /// Gets the image for the map tile of the specified type.
+        ///   Gets the image for the map tile of the specified type.
         /// </summary>
         /// <param name="tileType">Type of the tile to get the image for.</param>
         /// <returns>Image for the map tile of the specified type.</returns>
@@ -396,7 +435,7 @@
         }

         /// <summary>
-        /// Prepares a new command that can be undone later.
+        ///   Prepares a new command that can be undone later.
         /// </summary>
         public void OnBrushDown()
         {
@@ -409,7 +448,7 @@
         }

         /// <summary>
-        /// Pushes the current command, enabling Undo.
+        ///   Pushes the current command, enabling Undo.
         /// </summary>
         public void OnBrushUp()
         {
@@ -495,6 +534,10 @@
             // Reset undo stack.
             this.undoStack.Clear();
             this.redoStack.Clear();
+
+            // Update main window title.
+            this.currentMapFileName = UnsavedMapFileName;
+            this.mainWindow.Title = string.Format("{0} - {1}", MainWindowTitle, this.currentMapFileName);
         }

         private void BackgroundCreateMapProgressChanged(object sender, ProgressChangedEventArgs e)
@@ -546,7 +589,7 @@
         }

         /// <summary>
-        /// Shows an error message with the specified title and text.
+        ///   Shows an error message with the specified title and text.
         /// </summary>
         /// <param name="title">Title of the error message.</param>
         /// <param name="text">Text of the error message.</param>
@@ -556,7 +599,7 @@
         }

         /// <summary>
-        /// Passes the current map to the canvas for rendering.
+        ///   Passes the current map to the canvas for rendering.
         /// </summary>
         private void UpdateMapCanvas()
         {


Do not dispose http client

Do not dispose http client

--- WpfNative.Tryouts/MyService.cs
+++ WpfNative.Tryouts/MyService.cs
@@ -11,7 +11,7 @@
         public static async Task<int> DownloadAndCountBytesAsync(string url, CancellationToken token = default(CancellationToken))
         {
             await Task.Delay(TimeSpan.FromSeconds(3), token).ConfigureAwait(false);
-            using (var client = new HttpClient())
+            var client = new HttpClient();
             using (var response = await client.GetAsync(url, token).ConfigureAwait(false))
             {
                 var data = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false);


ShowScaleBar default true

ShowScaleBar default true

--- Xamarin.Forms.BaiduMaps/Map.cs
+++ Xamarin.Forms.BaiduMaps/Map.cs
@@ -59,7 +59,7 @@
             propertyName: nameof(ShowUserLocation),
             returnType: typeof(bool),
             declaringType: typeof(Map),
-            defaultValue: false
+            defaultValue: true
         );

         public bool ShowUserLocation {
@@ -156,7 +156,7 @@
             propertyName: nameof(ShowScaleBar),
             returnType: typeof(bool),
             declaringType: typeof(Map),
-            defaultValue: false
+            defaultValue: true
         );

         public bool ShowScaleBar


Remove warning column concept from mutable table.

--- Sources/DataAccess/MutableDataTable.cs
+++ Sources/DataAccess/MutableDataTable.cs
@@ -48,12 +48,6 @@

             }
             this.Columns = keep;
-
-            // Always keep the warning column.
-            // This assumes warning was not in the original name list
-            if (m_warning != null) {
-                this.AddColumnFirst(m_warning);
-            }
         }

         private void VerifyColumnIndex(int index)
@@ -75,27 +69,6 @@
             List<Column> cs = new List<Column>(this.Columns);
             cs.RemoveAt(index);
             this.Columns = cs.ToArray();
-
-            // Always keep the warning column.
-            // This assumes warning was not in the original name list
-            if (m_warning != null)
-            {
-                this.AddColumnFirst(m_warning);
-            }
-        }
-
-        Column m_warning = null;
-        const string WarningName = "Warnings";
-
-        // $$$
-        // For warnings, have a special column.
-        // Technically a normal column, so normal operations work on it (like save)
-        private Column GetWarningColumn() {
-            if (m_warning == null) {
-                m_warning = new Column(WarningName, this.NumRows);
-                this.AddColumnFirst(m_warning); // for cosmetic purposes, add to leftmost
-            }
-            return m_warning;
         }

         /// <summary>
@@ -186,25 +159,10 @@

                 var result = fpSplit(row);

-                if (result.Warning != null) {
-                    AppendWarning(r, result.Warning);
-                }
-
                 // Place results into new columns
                 for (int i = 0; i < fields.Length; i++) {
                     newColumns[i].Values[r] = result.GetValue(i);
                 }
-            }
-        }
-
-        // Append a warning to the row in the warning column.
-        // Be sure to append since we can have multiple warnings in a row.
-        public void AppendWarning(int row, string message) {
-            var values = this.GetWarningColumn().Values;
-            if (string.IsNullOrEmpty(values[row])) {
-                values[row] = message;
-            } else {
-                values[row] = values[row] + ";" + message;
             }
         }

@@ -294,15 +252,6 @@
             }
         }

-        // Get all columns except the warning column
-        static IEnumerable<Column> NoWarning(IEnumerable<Column> columns) {
-            foreach (var c in columns) {
-                if (c.Name == WarningName)
-                    continue;
-                yield return c;
-            }
-        }
-
         /// <summary>
         /// Enumerate the rows in the table. The rows provide mutable access to the underlying storage
         /// </summary>
@@ -374,29 +323,11 @@

         }

-        void WarnIfNotEmpty(string name) {
-            var c = this.GetColumn(name);
-            for(int row = 0; row < c.Values.Length; row++){
-                string v = c.Values[row];
-                if (!string.IsNullOrEmpty(v)) {
-                    this.GetWarningColumn();
-                    this.AppendWarning(row, string.Format("Column '{0}' had value '{1}'.", name, v));
-                }
-            }
-        }
-
         /// <summary>
         /// Remove columns with given names. This is the opposite of <see cref="KeepColumns"/>
         /// </summary>
         /// <param name="names">names of rows to delete</param>
         public void DeleteColumns(params string[] names) {
-            // add a warning if not empty
-#if false
-            foreach (var name in names) {
-                WarnIfNotEmpty(name);
-            }
-#endif
-
             int numColumnsOld = this.Columns.Length;

             int idxNew = 0;


Added ClientStatus

Added ClientStatus

--- Yggdrasil/Network/TcpClient.cs
+++ Yggdrasil/Network/TcpClient.cs
@@ -17,7 +17,7 @@
 		/// <summary>
 		/// Current status of the connection.
 		/// </summary>
-		public ConnectionStatus Status { get; private set; }
+		public ClientStatus Status { get; private set; }

 		/// <summary>
 		/// Address of the local end point.
@@ -88,7 +88,7 @@
 			_socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
 			_socket.Connect(remoteEndPoint);

-			this.Status = ConnectionStatus.Open;
+			this.Status = ClientStatus.Connected;
 			this.BeginReceive();
 		}

@@ -97,10 +97,10 @@
 		/// </summary>
 		public void Disconnect()
 		{
-			if (this.Status == ConnectionStatus.Closed)
+			if (this.Status == ClientStatus.NotConected)
 				return;

-			this.Status = ConnectionStatus.Closed;
+			this.Status = ClientStatus.NotConected;

 			try { _socket.Shutdown(SocketShutdown.Both); }
 			catch { }
@@ -142,7 +142,7 @@

 				if (length == 0)
 				{
-					this.Status = ConnectionStatus.Closed;
+					this.Status = ClientStatus.NotConected;
 					this.OnDisconnect(ConnectionCloseType.Disconnected);

 					return;
@@ -157,7 +157,7 @@
 			}
 			catch (SocketException)
 			{
-				this.Status = ConnectionStatus.Closed;
+				this.Status = ClientStatus.NotConected;
 				this.OnDisconnect(ConnectionCloseType.Lost);
 			}
 			catch (Exception ex)
@@ -191,8 +191,21 @@
 		/// <param name="data"></param>
 		public virtual void Send(byte[] data)
 		{
-			if (this.Status == ConnectionStatus.Open)
+			if (this.Status == ClientStatus.Connected)
 				_socket.Send(data);
 		}
+	}
+
+	public enum ClientStatus
+	{
+		/// <summary>
+		/// Client is not connected.
+		/// </summary>
+		NotConected,
+
+		/// <summary>
+		/// Cliet is connected.
+		/// </summary>
+		Connected,
 	}
 }


CustomerController starting up dawg

CustomerController starting up dawg

--- CreateCookiesSolution/CreateCookies/Controller/CustomerController.cs
+++ CreateCookiesSolution/CreateCookies/Controller/CustomerController.cs
@@ -4,9 +4,24 @@
 using System.Text;
 using System.Threading.Tasks;

+
 namespace CreateCookies.Controller
 {
     class CustomerController
     {
+        private Form1 gui;
+        private CreateCookiesDataSet db;
+
+
+        public CustomerController(Form1 gui, CreateCookiesDataSet db)
+        {
+
+            this.db = db;
+            this.gui = gui;
+
+
+
+        }
+
     }
 }


Update

Update

--- media-functions-for-logic-app/return-analytics/run.csx
+++ media-functions-for-logic-app/return-analytics/run.csx
@@ -443,7 +443,7 @@
                         }
                     }
                 }
-                //outputAsset.Delete();
+                outputAsset.Delete();
             }
         }


Removed unneeded variable gazeActivated as Julia suggested

--- Assets/MRTK/SDK/Features/Utilities/Solvers/HandConstraintPalmUp.cs
+++ Assets/MRTK/SDK/Features/Utilities/Solvers/HandConstraintPalmUp.cs
@@ -261,10 +261,10 @@
                         Vector3 gazePosOnPlane = gazeRay.origin + gazeRay.direction.normalized * distanceToHandPlane;
                         Vector3 planePos = handPlane.ClosestPointOnPlane(gazePosOnPlane);
                         float gazePosDistToActivationPosition = (activationPoint - planePos).sqrMagnitude;
-                        float gazeActivationThreshold = usedEyeGaze ? eyeGazeProximityThreshold : headGazeProximityThreshold;
-                        bool gazeActivated = gazeActivationAlreadyTriggered = (gazePosDistToActivationPosition < gazeActivationThreshold);
-
-                        return gazeActivated;
+                        float gazeActivationThreshold = usedEyeGaze ? eyeGazeProximityThreshold : headGazeProximityThreshold;
+                        gazeActivationAlreadyTriggered = (gazePosDistToActivationPosition < gazeActivationThreshold);
+
+                        return gazeActivationAlreadyTriggered;
                     }
                 }


sea witch brain can now cast delayedeternaldeath if it has the spell

--- Assets/Scripts/Game/Defined/Serialized/Brains/Areas/OceanBrains.cs
+++ Assets/Scripts/Game/Defined/Serialized/Brains/Areas/OceanBrains.cs
@@ -82,6 +82,7 @@

         protected override IList<Spell> GetPriorityPlays() {
             return new Spell[] {
+                CastOnRandom(new CastDelayedEternalDeath()),
                 CastOnRandom(new CastDelayedDeath()),
                 CastOnRandom(new Attack())
             };


Message null check

Message null check

--- src/Take.Blip.Client/BlipChannelListener.cs
+++ src/Take.Blip.Client/BlipChannelListener.cs
@@ -224,7 +224,7 @@
             }
             catch (Exception ex)
             {
-                using (LogContext.PushProperty(nameof(Message.Type), message.Type))
+                using (LogContext.PushProperty(nameof(Message.Type), message?.Type))
                 {
                     LogException(message, ex);
                 }


- Issue #271: Any Special considerations running in a linux docker container?

--- src/cscs/Utils/Globals.cs
+++ src/cscs/Utils/Globals.cs
@@ -18,8 +18,8 @@
     {
         static internal string DynamicWrapperClassName = "DynamicClass";
         static internal string RootClassName = "css_root";
-        // Roslyn still does not support anything else but `Submission#0` (17 Jul 2019)
-        // [update] Roslyn now does support alternative class names (1 Jan 2020)
+        // Roslyn still does not support anything else but `Submission#0` (17 Jul 2019) [update]
+        // Roslyn now does support alternative class names (1 Jan 2020)

         static internal void StartBuildServer(bool report = false)
         {
@@ -152,29 +152,14 @@
             Console.WriteLine(BuildServer.PingRemoteInstance(null));
         }

-        // static internal bool IsRemoteInstanceRunning()
-        // {
-        //     try
-        //     {
-        //         using (var clientSocket = new TcpClient())
-        //         {
-        //             return clientSocket
-        //                 .ConnectAsync(IPAddress.Loopback, port ?? serverPort)
-        //                 .Wait(TimeSpan.FromMilliseconds(20));
-        //         }
-        //     }
-        //     catch
-        //     {
-        //         return false;
-        //     }
-        // }
+        // static internal bool IsRemoteInstanceRunning() { try { using (var clientSocket = new
+        // TcpClient()) { return clientSocket .ConnectAsync(IPAddress.Loopback, port ?? serverPort)
+        // .Wait(TimeSpan.FromMilliseconds(20)); } } catch { return false; } }

         /// <summary>
         /// Gets a value indicating whether build server is deployed.
         /// </summary>
-        /// <value>
-        ///   <c>true</c> if build server is deployed; otherwise, <c>false</c>.
-        /// </value>
+        /// <value><c>true</c> if build server is deployed; otherwise, <c>false</c>.</value>
         static public bool BuildServerIsDeployed
         {
             get
@@ -201,20 +186,20 @@
         /// <summary>
         /// Gets the path to the dotnet executable.
         /// </summary>
-        /// <value>
-        /// The dotnet executable path.
-        /// </value>
+        /// <value>The dotnet executable path.</value>
         static public string dotnet
         {
             get
             {
+                var dotnetExeName = Runtime.IsLinux ? "dotnet" : "dotnet.exe";
+
                 var file = "".GetType().Assembly.Location
                   .Split(Path.DirectorySeparatorChar)
                   .TakeWhile(x => x != "dotnet")
                   .JoinBy(Path.DirectorySeparatorChar.ToString())
-                  .PathJoin("dotnet", "dotnet.exe");
-
-                return File.Exists(file) ? file : "dotnet.exe";
+                  .PathJoin("dotnet", dotnetExeName);
+
+                return File.Exists(file) ? file : dotnetExeName;
             }
         }

@@ -224,9 +209,7 @@
         /// <summary>
         /// Gets or sets the path to the C# compiler executable (e.g. csc.exe or csc.dll)
         /// </summary>
-        /// <value>
-        /// The CSC.
-        /// </value>
+        /// <value>The CSC.</value>
         static public string csc
         {
             set
@@ -247,8 +230,8 @@
 #endif
                     {
                         // Win: C:\Program Files\dotnet\sdk\6.0.100-rc.2.21505.57\Roslyn\bincore\csc.dll
-                        //      C:\Program Files (x86)\dotnet\sdk\5.0.402\Roslyn\bincore\csc.dll
-                        // linux ~dotnet/.../3.0.100-preview5-011568/Roslyn/... (cannot find in preview)
+                        // C:\Program Files (x86)\dotnet\sdk\5.0.402\Roslyn\bincore\csc.dll linux
+                        // ~dotnet/.../3.0.100-preview5-011568/Roslyn/... (cannot find in preview)
                         // win: program_files/dotnet/sdk/<version>/Roslyn/csc.exe
                         var dotnet_root = "".GetType().Assembly.Location;


Add Check

Add Check

--- Src/Asp.Net/SqlSugar/SqlSugarClient.cs
+++ Src/Asp.Net/SqlSugar/SqlSugarClient.cs
@@ -794,6 +794,9 @@
         {
             try
             {
+                if (this.CurrentConnectionConfig.DbType == DbType.Oracle) {
+                    throw new Exception("Oracle no support SaveQueues");
+                }
                 if (this.Queues == null || this.Queues.Count == 0) return default(T);
                 isTran = isTran && this.Ado.Transaction == null;
                 if (isTran) this.Ado.BeginTran();


Fixes #45

Fixes #45

--- src/TextToSpeech.Plugin.UWP/TextToSpeech.cs
+++ src/TextToSpeech.Plugin.UWP/TextToSpeech.cs
@@ -128,7 +128,7 @@
                 try
                 {
                     var player = BackgroundMediaPlayer.Current;
-                    var stream = await speechSynthesizer.SynthesizeTextToStreamAsync(text);
+                    var stream = await speechSynthesizer.SynthesizeSsmlToStreamAsync(ssmlText);

                     player.MediaEnded += handler;
                     player.SetStreamSource(stream);


cosmetic changes

cosmetic changes

--- src/Textamina.Markdig/Helpers/HtmlHelper.cs
+++ src/Textamina.Markdig/Helpers/HtmlHelper.cs
@@ -440,8 +440,8 @@
             }
         }

-        private static readonly char[] SearchBackAndAmp = new[] {'\\', '&'};
-        private static readonly char[] SearchAmp = new[] {'&'};
+        private static readonly char[] SearchBackAndAmp = {'\\', '&'};
+        private static readonly char[] SearchAmp = {'&'};

         /// <summary>
         /// Destructively unescape a string: remove backslashes before punctuation or symbol characters.
@@ -474,7 +474,7 @@
                         break;

                     c = text[searchPos];
-                    if (CharHelper.IsEscapableSymbol(c))
+                    if (c.IsEscapableSymbol())
                     {
                         sb.Append(text, lastPos, searchPos - lastPos - 1);
                         lastPos = searchPos;


reformatted error message and prevent crash in case of incorrect command parameter initialization

--- TIKSN.Core/Shell/ShellCommandEngine.cs
+++ TIKSN.Core/Shell/ShellCommandEngine.cs
@@ -6,6 +6,7 @@
 using System.Linq;
 using System.Reflection;
 using System.Security;
+using System.Text;
 using System.Threading.Tasks;
 using TIKSN.Localization;

@@ -126,6 +127,15 @@
             }
         }

+        private void AppendException(StringBuilder messageBuilder, Exception exception)
+        {
+            messageBuilder.Append(exception.Message);
+            messageBuilder.Append(". ");
+
+            if (exception.InnerException != null)
+                AppendException(messageBuilder, exception.InnerException);
+        }
+
         private string NormalizeCommandName(string command)
         {
             if (command != null)
@@ -139,6 +149,20 @@
             }

             return command;
+        }
+
+        private void PrintError(EventId eventId, Exception exception, string message)
+        {
+            var messageBuilder = new StringBuilder();
+            messageBuilder.Append(message);
+            messageBuilder.Append(". ");
+
+            AppendException(messageBuilder, exception);
+
+            var builtMessage = messageBuilder.ToString();
+
+            _consoleService.WriteError(builtMessage);
+            _logger.LogError(eventId, exception, builtMessage);
         }

         private object ReadCommandParameter(Tuple<ShellCommandParameterAttribute, PropertyInfo> property)
@@ -175,40 +199,48 @@
         {
             using (var commandScope = _serviceProvider.CreateScope())
             {
-                var commandContextStore = commandScope.ServiceProvider.GetRequiredService<IShellCommandContext>() as IShellCommandContextStore;
-
-                commandContextStore.SetCommandName(commandName);
-
-                var args = new List<object>();
-
-                foreach (var parameterInfo in commandInfo.Item3.GetParameters())
-                {
-                    args.Add(commandScope.ServiceProvider.GetRequiredService(parameterInfo.ParameterType));
-                }
-
-                var obj = Activator.CreateInstance(commandInfo.Item1, args.ToArray());
-
-                foreach (var property in commandInfo.Item4)
-                {
-                    var parameter = ReadCommandParameter(property);
-
-                    if (parameter != null)
-                        property.Item2.SetValue(obj, parameter);
-
-                    _logger.LogTrace($"Parameter '{property.Item1.GetName(_stringLocalizer)}' has value '{property.Item2.GetValue(obj)}'");
-                }
-
-                var command = obj as IShellCommand;
-
                 try
                 {
-                    await command.ExecuteAsync();
-                }
-                catch (ShellCommandSuspendedException) { }
+                    var commandContextStore = commandScope.ServiceProvider.GetRequiredService<IShellCommandContext>() as IShellCommandContextStore;
+
+                    commandContextStore.SetCommandName(commandName);
+
+                    var args = new List<object>();
+
+                    foreach (var parameterInfo in commandInfo.Item3.GetParameters())
+                    {
+                        args.Add(commandScope.ServiceProvider.GetRequiredService(parameterInfo.ParameterType));
+                    }
+
+                    var obj = Activator.CreateInstance(commandInfo.Item1, args.ToArray());
+
+                    foreach (var property in commandInfo.Item4)
+                    {
+                        var parameter = ReadCommandParameter(property);
+
+                        if (parameter != null)
+                            property.Item2.SetValue(obj, parameter);
+
+                        _logger.LogTrace($"Parameter '{property.Item1.GetName(_stringLocalizer)}' has value '{property.Item2.GetValue(obj)}'");
+                    }
+
+                    var command = obj as IShellCommand;
+
+                    try
+                    {
+                        await command.ExecuteAsync();
+                    }
+#pragma warning disable CC0004 // Catch block cannot be empty
+                    catch (ShellCommandSuspendedException) { }
+#pragma warning restore CC0004 // Catch block cannot be empty
+                    catch (Exception ex)
+                    {
+                        PrintError(1815744366, ex, _stringLocalizer.GetRequiredString(LocalizationKeys.Key163077375));
+                    }
+                }
                 catch (Exception ex)
                 {
-                    _consoleService.WriteError(_stringLocalizer.GetRequiredString(LocalizationKeys.Key163077375));
-                    _logger.LogError(1815744366, ex, _stringLocalizer.GetRequiredString(LocalizationKeys.Key163077375));
+                    PrintError(1999436483, ex, _stringLocalizer.GetRequiredString(LocalizationKeys.Key548430597));
                 }
             }
         }


Update

Update

--- TTWebClient/Properties/AssemblyInfo.cs
+++ TTWebClient/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.8.0")]
-[assembly: AssemblyFileVersion("1.0.8.0")]
+[assembly: AssemblyVersion("1.0.9.0")]
+[assembly: AssemblyFileVersion("1.0.9.0")]


SkipList: simple test for Range

SkipList: simple test for Range

--- Tests/FunctionalTests/SkipListTests.cs
+++ Tests/FunctionalTests/SkipListTests.cs
@@ -354,5 +354,25 @@
             }
             Assert.AreEqual(0, target.Ceiling(8));
         }
+
+        [TestMethod]
+        public void RangeSimple()
+        {
+            var target = GetCollection();
+            Assert.AreEqual(0, target.Count);
+
+            for (var i = 0; i < 10; i++)
+            {
+                target.Add(i);
+            }
+
+            Assert.AreEqual("0,1,2,3,4,5,6,7,8,9", string.Join(",", target.Range(-1, 10)));
+            Assert.AreEqual("0,1,2,3,4,5,6,7,8,9", string.Join(",", target.Range(0, 9)));
+            Assert.AreEqual("1,2,3,4,5,6,7,8,9", string.Join(",", target.Range(0, 9, false)));
+            Assert.AreEqual("1,2,3,4,5,6,7,8", string.Join(",", target.Range(0, 9, false, false)));
+            Assert.AreEqual("2,3,4,5,6,7", string.Join(",", target.Range(2, 7)));
+            Assert.AreEqual("2,3,4,5,6", string.Join(",", target.Range(2, 7, true, false)));
+            Assert.AreEqual("3,4,5,6,7", string.Join(",", target.Range(2, 7, false, true)));
+        }
     }
 }


Logo breytingar

Logo breytingar

--- TextDuck/Controllers/HomeController.cs
+++ TextDuck/Controllers/HomeController.cs
@@ -69,6 +69,7 @@
             Language.Add(new SelectListItem { Text = "Íslenska", Value = "Íslenska" });
             ViewBag.Language = Language;
         }
+        //hahah
         private void AddCategories()
         {
             List<SelectListItem> Categories = new List<SelectListItem>();


Added unit tests for ARC-AUthentication-Results header folding

--- UnitTests/HeaderTests.cs
+++ UnitTests/HeaderTests.cs
@@ -135,6 +135,28 @@
 			Assert.AreEqual (expected, raw, "The folded address header does not match the expected value.");
 		}

+		static readonly string[] ArcAuthenticationResultsHeaderValues = {
+			" i=1; lists.example.org;" + FormatOptions.Default.NewLine + "\tspf=pass smtp.mfrom=jqd@d1.example;" + FormatOptions.Default.NewLine + "\tdkim=pass (1024 - bit key) header.i=@d1.example; dmarc=pass",
+			" i=2; gmail.example;" + FormatOptions.Default.NewLine + "\tspf=fail smtp.from=jqd@d1.example;" + FormatOptions.Default.NewLine + "\tdkim=fail (512-bit key) header.i=@example.org; dmarc=fail;" + FormatOptions.Default.NewLine + "\tarc=pass (as.1.lists.example.org=pass, ams.1.lists.example.org=pass)",
+			" i=3; gmail.example;" + FormatOptions.Default.NewLine + "\tspf=fail smtp.from=jqd@d1.example;" + FormatOptions.Default.NewLine + "\tdkim=fail (512-bit key) header.i=@example.org;"+ FormatOptions.Default.NewLine + "\tdmarc=fail (this-is-a-reall-long-unbroken-comment-that-will-need-to-be-broken"+ FormatOptions.Default.NewLine + "\t-apart-somewhere---is-it-long-enough-yet?); arc=pass (as.1.lists.example.org=pass, ams.1.lists.example.org=pass)"
+		};
+
+		[Test]
+		public void TestArcAuthenticationResultsHeaderFolding ()
+		{
+			var header = new Header ("ARC-Authentication-Results", "");
+
+			foreach (var authResults in ArcAuthenticationResultsHeaderValues) {
+				header.SetValue (Encoding.ASCII, authResults.Replace (FormatOptions.Default.NewLine + "\t", " ").Trim ());
+
+				var raw = ByteArrayToString (header.RawValue);
+
+				Assert.IsTrue (raw[raw.Length - 1] == '\n', "The RawValue does not end with a new line.");
+
+				Assert.AreEqual (authResults + FormatOptions.Default.NewLine, raw, "The folded ARC-Authentication-Results header does not match the expected value.");
+			}
+		}
+
 		[Test]
 		public void TestMessageIdHeaderFolding ()
 		{


Implemented PortMessage.

Implemented PortMessage.

--- Torrent.Client/Messages/PortMessage.cs
+++ Torrent.Client/Messages/PortMessage.cs
@@ -9,20 +9,56 @@
     class PortMessage:PeerMessage
     {
         public static readonly int Id = 9;
+        public ushort Port { get; private set; }
+
+        public PortMessage()
+        {
+            this.Port = 0;
+        }
+
+        public PortMessage(ushort port)
+        {
+            this.Port = port;
+        }

         public override void FromBytes(byte[] buffer, int offset, int count)
         {
-            throw new NotImplementedException();
+            if (count != MessageLength)
+                throw new ArgumentException("Invalid message length.");
+            this.Port = (ushort)ReadShort(buffer, ref offset);
         }

         public override int MessageLength
         {
-            get { throw new NotImplementedException(); }
+            get { return 7; }
         }

         public override int ToBytes(byte[] buffer, int offset)
         {
-            throw new NotImplementedException();
+            int start = offset;
+            offset += Write(buffer, offset, (int)5);
+            offset += Write(buffer, offset, (byte)9);
+            offset += Write(buffer, offset, Port);
+            return offset - start;
+        }
+
+        public override string ToString()
+        {
+            return string.Format("Port message: {Port: {0}}", Port);
+        }
+
+        public override bool Equals(object obj)
+        {
+            PortMessage msg = obj as PortMessage;
+
+            if (msg == null)
+                return false;
+            return this.Port == msg.Port;
+        }
+
+        public override int GetHashCode()
+        {
+            return MessageLength.GetHashCode() ^ Id.GetHashCode() ^ Port.GetHashCode();
         }
     }
 }


App name

App name

--- Travel.Web/Views/Shared/_Layout.cshtml
+++ Travel.Web/Views/Shared/_Layout.cshtml
@@ -32,7 +32,7 @@

                 </button>
-                @Html.ActionLink("Travel Portal", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
+                @Html.ActionLink("Pocket Rep", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })


Added summary commend to CollectionBinding

--- UnityWeld/Binding/CollectionBinding.cs
+++ UnityWeld/Binding/CollectionBinding.cs
@@ -7,6 +7,13 @@

 namespace UnityWeld.Binding
 {
+    /// <summary>
+    /// Binds a property in the view-model that is a collection and instantiates copies
+    /// of template objects to bind to the items of the collection.
+    ///
+    /// Creates and destroys child objects when items are added and removed from a
+    /// collection that implements INotifyCollectionChanged, like ObservableList.
+    /// </summary>
     [HelpURL("https://github.com/Real-Serious-Games/Unity-Weld")]
     public class CollectionBinding : AbstractTemplateSelector
     {


update assembly

update assembly

--- UptimeSharp/Properties/AssemblyInfo.cs
+++ UptimeSharp/Properties/AssemblyInfo.cs
@@ -1,17 +1,14 @@
-using System.Resources;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
+using System.Reflection;

 // General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
 [assembly: AssemblyTitle("UptimeSharp")]
-[assembly: AssemblyDescription("UptimeSharp is a .NET class library that integrates the UptimeRobot API")]
+[assembly: AssemblyDescription("UptimeSharp is a .NET portable class library that integrates the UptimeRobot API")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("cee")]
 [assembly: AssemblyProduct("UptimeSharp")]
-[assembly: AssemblyCopyright("Copyright © cee 2013")]
+[assembly: AssemblyCopyright("Copyright © cee 2014")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

@@ -25,5 +22,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0")]
-[assembly: AssemblyFileVersion("1.0.0")]+[assembly: AssemblyVersion("2.0.0")]
+[assembly: AssemblyFileVersion("2.0.0")]


@ KeyValuePair enumerator is now explicit, NodeItem is now public

--- Utils/DataStructures/DictionaryBase.cs
+++ Utils/DataStructures/DictionaryBase.cs
@@ -136,12 +136,12 @@

         #region Enumeration

-        IEnumerator<NodeItem> IEnumerable<NodeItem>.GetEnumerator()
+        public virtual IEnumerator<NodeItem> GetEnumerator()
         {
             return Items().GetEnumerator();
         }

-        public virtual IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
+        IEnumerator<KeyValuePair<TKey, TValue>> IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator()
         {
             return Items().Select(node => new KeyValuePair<TKey, TValue>(node.Key, node.Value)).GetEnumerator();
         }


tests

tests

--- Fetcher.Core.Tests/Services/Fetcher/FetcherRepositoryServiceTests.cs
+++ Fetcher.Core.Tests/Services/Fetcher/FetcherRepositoryServiceTests.cs
@@ -257,6 +257,79 @@
             Assert.Greater(data.Count(), 0);
         }

+        [Test]
+        public async Task GetEntryForUrl_RequestContentTypeIsSet_ContentTypeIsReturned()
+        {
+            var request1 = new FetcherWebRequest
+            {
+                Url = "https://jsonplaceholder.typicode.com/posts",
+                Method = "POST",
+                Body = JsonPlaceholderPostFactory(),
+                ContentType = "application/json"
+            };
+
+            FetcherServiceStub fetcherService = new FetcherServiceStub();
+            IFetcherRepositoryService sut = fetcherService.RepositoryService;
+
+            await fetcherService.FetchAsync(request1);
+            IEnumerable<IUrlCacheInfo> data = await sut.GetUrlCacheInfoForRequest(request1);
+            FetcherWebRequest dbRequest = data.FirstOrDefault().FetcherWebRequest;
+
+            Assert.NotNull(data);
+            Assert.NotNull(dbRequest);
+            Assert.AreEqual(dbRequest.ContentType, request1.ContentType);
+        }
+
+        [Test]
+        public async Task GetEntryForUrl_RequestBodyIsSet_BodyIsReturned()
+        {
+            var request1 = new FetcherWebRequest
+            {
+                Url = "https://jsonplaceholder.typicode.com/posts",
+                Method = "POST",
+                Body = JsonPlaceholderPostFactory(),
+                ContentType = "application/json"
+            };
+
+            FetcherServiceStub fetcherService = new FetcherServiceStub();
+            IFetcherRepositoryService sut = fetcherService.RepositoryService;
+
+            await fetcherService.FetchAsync(request1);
+            IEnumerable<IUrlCacheInfo> data = await sut.GetUrlCacheInfoForRequest(request1);
+            FetcherWebRequest dbRequest = data.FirstOrDefault().FetcherWebRequest;
+
+            Assert.NotNull(data);
+            Assert.NotNull(dbRequest);
+            Assert.AreEqual(dbRequest.Body, request1.Body);
+        }
+
+        [Test]
+        public async Task GetEntryForUrl_RequestHeadersIsSet_HeadersIsReturned()
+        {
+            var request1 = new FetcherWebRequest
+            {
+                Url = "https://jsonplaceholder.typicode.com/posts",
+                Method = "POST",
+                Body = JsonPlaceholderPostFactory(),
+                Headers = new Dictionary<string, string>
+                {
+                    { "X-ZUMO-APPLICATION", "hello world" }
+                },
+                ContentType = "application/json"
+            };
+
+            FetcherServiceStub fetcherService = new FetcherServiceStub();
+            IFetcherRepositoryService sut = fetcherService.RepositoryService;
+
+            await fetcherService.FetchAsync(request1);
+            IEnumerable<IUrlCacheInfo> data = await sut.GetUrlCacheInfoForRequest(request1);
+            FetcherWebRequest dbRequest = data.FirstOrDefault().FetcherWebRequest;
+
+            Assert.NotNull(data);
+            Assert.NotNull(dbRequest);
+            Assert.AreEqual(dbRequest.Headers, request1.Headers);
+        }
+
         private static string JsonPlaceholderPostFactory()
         {
             var hero = new JsonPlaceholderPostDto


Remove unused "keys" from processtransaction

--- WalletWasabi/Services/WalletService.cs
+++ WalletWasabi/Services/WalletService.cs
@@ -138,7 +138,7 @@

 		private void MemPool_TransactionReceived(object sender, SmartTransaction tx)
 		{
-			ProcessTransaction(tx, keys: null);
+			ProcessTransaction(tx);
 		}

 		private async void IndexDownloader_ReorgedAsync(object sender, uint256 invalidBlockHash)
@@ -216,7 +216,7 @@
 						{
 							await SendTransactionAsync(tx);

-							ProcessTransaction(tx, keys: null);
+							ProcessTransaction(tx);
 						}
 						catch (Exception ex)
 						{
@@ -367,11 +367,9 @@

 		private void ProcessBlock(Height height, Block block)
 		{
-			var keys = KeyManager.GetKeys().ToList();
-
 			foreach (var tx in block.Transactions)
 			{
-				ProcessTransaction(new SmartTransaction(tx, height), keys);
+				ProcessTransaction(new SmartTransaction(tx, height));
 			}

 			ProcessedBlocks.TryAdd(block.GetHash(), (height, block.Header.BlockTime));
@@ -379,7 +377,7 @@
 			NewBlockProcessed?.Invoke(this, block);
 		}

-		private void ProcessTransaction(SmartTransaction tx, List<HdPubKey> keys = null)
+		private void ProcessTransaction(SmartTransaction tx)
 		{
 			uint256 txId = tx.GetHash();

@@ -475,12 +473,6 @@
 						RemoveCoinRecursively(doubleSpentCoin);
 					}
 				}
-			}
-
-			// If key list is not provided refresh the key list.
-			if (keys is null)
-			{
-				keys = KeyManager.GetKeys().ToList();
 			}

 			for (var i = 0U; i < tx.Transaction.Outputs.Count; i++)
@@ -518,20 +510,12 @@
 					}

 					// Make sure there's always 21 clean keys generated and indexed.
-					if (KeyManager.AssertCleanKeysIndexed(21, foundKey.IsInternal()))
-					{
-						// If it generated a new key refresh the keys:
-						keys = KeyManager.GetKeys().ToList();
-					}
+					KeyManager.AssertCleanKeysIndexed(21, foundKey.IsInternal());

 					if (foundKey.IsInternal())
 					{
 						// Make sure there's always 14 internal locked keys generated and indexed.
-						if (KeyManager.AssertLockedInternalKeysIndexed(14))
-						{
-							// If it generated a new key refresh the keys:
-							keys = KeyManager.GetKeys().ToList();
-						}
+						KeyManager.AssertLockedInternalKeysIndexed(14);
 					}
 				}
 			}


Accidentally removed class color instead of record color - reverting

--- src/EditorFeatures/Core.Wpf/Classification/ClassificationTypeFormatDefinitions.cs
+++ src/EditorFeatures/Core.Wpf/Classification/ClassificationTypeFormatDefinitions.cs
@@ -179,6 +179,7 @@
             public UserTypeClassesFormatDefinition()
             {
                 this.DisplayName = EditorFeaturesResources.User_Types_Classes;
+                this.ForegroundColor = Color.FromRgb(0x2B, 0x91, 0xAF);
             }
         }
         #endregion
@@ -198,7 +199,6 @@
             public UserTypeRecordsFormatDefinition()
             {
                 this.DisplayName = EditorFeaturesResources.User_Types_Records;
-                this.ForegroundColor = Color.FromRgb(0x2B, 0x91, 0xAF);
             }
         }
         #endregion


Fix #4998 - Resolve IViewComponentHelper every time

This change resolves the scoped IViewComponentHelper every time its
needed, rather than misusing a shared instance. IViewComponentHelper is
stateful, so sharing an instance was the cause of this bug.

--- src/Microsoft.AspNetCore.Mvc.ViewFeatures/Internal/ViewComponentResultExecutor.cs
+++ src/Microsoft.AspNetCore.Mvc.ViewFeatures/Internal/ViewComponentResultExecutor.cs
@@ -10,6 +10,7 @@
 using Microsoft.AspNetCore.Mvc.ModelBinding;
 using Microsoft.AspNetCore.Mvc.Rendering;
 using Microsoft.AspNetCore.WebUtilities;
+using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Options;

@@ -22,11 +23,9 @@
         private readonly ILogger<ViewComponentResult> _logger;
         private readonly IModelMetadataProvider _modelMetadataProvider;
         private readonly ITempDataDictionaryFactory _tempDataDictionaryFactory;
-        private readonly IViewComponentHelper _viewComponentHelper;

         public ViewComponentResultExecutor(
             IOptions<MvcViewOptions> mvcHelperOptions,
-            IViewComponentHelper viewComponentHelper,
             ILoggerFactory loggerFactory,
             HtmlEncoder htmlEncoder,
             IModelMetadataProvider modelMetadataProvider,
@@ -35,11 +34,6 @@
             if (mvcHelperOptions == null)
             {
                 throw new ArgumentNullException(nameof(mvcHelperOptions));
-            }
-
-            if (viewComponentHelper == null)
-            {
-                throw new ArgumentNullException(nameof(viewComponentHelper));
             }

             if (loggerFactory == null)
@@ -63,7 +57,6 @@
             }

             _htmlHelperOptions = mvcHelperOptions.Value.HtmlHelperOptions;
-            _viewComponentHelper = viewComponentHelper;
             _logger = loggerFactory.CreateLogger<ViewComponentResult>();
             _htmlEncoder = htmlEncoder;
             _modelMetadataProvider = modelMetadataProvider;
@@ -112,8 +105,11 @@
                     writer,
                     _htmlHelperOptions);

-                (_viewComponentHelper as IViewContextAware)?.Contextualize(viewContext);
-                var result = await GetViewComponentResult(_viewComponentHelper, _logger, viewComponentResult);
+                // IViewComponentHelper is stateful, we want to make sure to retrieve it every time we need it.
+                var viewComponentHelper = context.HttpContext.RequestServices.GetRequiredService<IViewComponentHelper>();
+                (viewComponentHelper as IViewContextAware)?.Contextualize(viewContext);
+
+                var result = await GetViewComponentResult(viewComponentHelper, _logger, viewComponentResult);

                 result.WriteTo(writer, _htmlEncoder);
             }


Replaced regex with a `while` loop

Replaced regex with a `while` loop

--- src/Orchard.Web/Modules/Orchard.ContentTypes/Services/ContentDefinitionService.cs
+++ src/Orchard.Web/Modules/Orchard.ContentTypes/Services/ContentDefinitionService.cs
@@ -358,7 +358,12 @@
         }

         private static string VersionName(string name) {
-            var substring = Regex.Match(name, @"\d+$").Value;
+            var i = name.Length - 1;
+            while (i >= 0 && char.IsDigit(name, i)) {
+                i--;
+            }
+
+            var substring = i != name.Length - 1 ? name.Substring(i + 1) : string.Empty;
             int version;

             if (int.TryParse(substring, out version)) {


#18255: Fixing field name sanitizing

#18255: Fixing field name sanitizing

Work Item: 18255

--HG--
branch : 1.x

--- src/Orchard.Web/Modules/Orchard.ContentTypes/Services/ContentDefinitionService.cs
+++ src/Orchard.Web/Modules/Orchard.ContentTypes/Services/ContentDefinitionService.cs
@@ -241,10 +241,8 @@
             name = name.Trim();

             // don't allow non A-Z chars as first letter, as they are not allowed in prefixes
-            if(name.Length > 0) {
-                if (!IsLetter(name[0])) {
-                    name = name.Substring(1);
-                }
+            while(name.Length > 0 && !IsLetter(name[0])) {
+                name = name.Substring(1);
             }

             if (name.Length > 128)


Fixes 1+n db call issue

Fixes 1+n db call issue

Adds

--- src/Orchard.Web/Modules/Orchard.Widgets/Services/DefaultLayerEvaluationService.cs
+++ src/Orchard.Web/Modules/Orchard.Widgets/Services/DefaultLayerEvaluationService.cs
@@ -41,7 +41,7 @@
             // Once the Rule Engine is done:
             // Get Layers and filter by zone and rule
             // NOTE: .ForType("Layer") is faster than .Query<LayerPart, LayerPartRecord>()
-            var activeLayers = _orchardServices.ContentManager.Query<LayerPart>().ForType("Layer").List();
+            var activeLayers = _orchardServices.ContentManager.Query<LayerPart>().WithQueryHints(new QueryHints().ExpandParts<LayerPart>()).ForType("Layer").List();

             var activeLayerIds = new List<int>();
             foreach (var activeLayer in activeLayers) {
@@ -59,4 +59,4 @@
             return activeLayerIds.ToArray();
         }
     }
-}+}


hintpath removed

hintpath removed

--- test/FalkonryTests.cs
+++ test/FalkonryTests.cs
@@ -16,7 +16,7 @@
     [TestClass()]
     public class FalkonryTestsDatastream
     {
-        Falkonry _falkonry = new Falkonry("https://dev.falkonry.ai", "tb0jdvmmubvg5s6jfgteg9ygyjauxcip");
+        Falkonry _falkonry = new Falkonry("https://dev.falkonry.ai", "rsupe5o687kjjiqk7ya6kdfhsa3hgp00");
         List<Datastream> _datastreams = new List<Datastream>();

         // Create StandAlone Datrastream with Wide format


1920: unused MsdfShaderSubpix

1920: unused MsdfShaderSubpix

--- src/PixelFarm/PixelFarm.DrawingGL/DrawingGL/GLShader/SignedDistanceFieldShader.cs
+++ src/PixelFarm/PixelFarm.DrawingGL/DrawingGL/GLShader/SignedDistanceFieldShader.cs
@@ -146,193 +146,193 @@
         }
     }

-#if DEBUG
-    class MsdfShaderSubpix : SimpleRectTextureShader
-    {
-
-        //not work!
-        ShaderUniformVar4 _bgColor;
-        ShaderUniformVar4 _fgColor;
-        public MsdfShaderSubpix(ShaderSharedResource shareRes)
-            : base(shareRes)
-        {
-            BuildProgramV1();
-            //BuildProgramV2();
-        }
-
-        void BuildProgramV1()
-        {
-            //credit: https://github.com/Chlumsky/msdfgen
-
-            string vs = @"
-                attribute vec4 a_position;
-                attribute vec2 a_texCoord;
-                uniform mat4 u_mvpMatrix;
-                varying vec2 v_texCoord;
-                void main()
-                {
-                    gl_Position = u_mvpMatrix* a_position;
-                    v_texCoord =  a_texCoord;
-                 }
-                ";
-            //enable derivative extension  for fwidth() function
-            //see
-            //https://www.khronos.org/registry/gles/extensions/OES/OES_standard_derivatives.txt
-            //https://github.com/AnalyticalGraphicsInc/cesium/issues/745
-            //https://developer.mozilla.org/en-US/docs/Web/API/OES_standard_derivatives
-            //https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Using_Extensions
-            string fs = @"
-                        #ifdef GL_OES_standard_derivatives
-                            #extension GL_OES_standard_derivatives : enable
-                        #endif
-                        precision mediump float;
-                        varying vec2 v_texCoord;
-                        uniform sampler2D s_texture; //msdf texture
-                        uniform vec4 bgColor;
-                        uniform vec4 fgColor;
-
-                        float median(float r, float g, float b) {
-                            return max(min(r, g), min(max(r, g), b));
-                        }
-                        void main() {
-                            vec4 sample = texture2D(s_texture, v_texCoord);
-                            float sigDist = median(sample[0], sample[1], sample[2]) - 0.5;
-                            float opacity = clamp(sigDist/fwidth(sigDist) + 0.5, 0.0, 1.0);
-                            float ddx= dFdx(sigDist);
-                            float ddy= dFdy(sigDist);
-                            //gl_FragColor = mix(bgColor, fgColor, opacity);//original
-
-                            //for study ***
-                            /*if(ddx>0.0){
-                                //uphill
-                                gl_FragColor = mix(bgColor, vec4(1.0,0,0,opacity), opacity);
-                            } else if(ddx<0.0){
-                                //downhill
-                                gl_FragColor = mix(bgColor, vec4(0.0,0,1.0,opacity), opacity);
-                            }else{
-                                //stable
-                                gl_FragColor = mix(bgColor, fgColor, opacity);
-                            }  */
-
-
-                            if(opacity == 1.0){
-                                //100%
-                                //gl_FragColor = mix(bgColor, fgColor, opacity);//original
-                                //gl_FragColor = mix(bgColor, fgColor, opacity);//original
-                                gl_FragColor = vec4(fgColor[0],fgColor[1],fgColor[2],opacity);//original
-                            }else if(opacity<= (1.0/3.0)){
-                                  if(ddx>0.0){
-                                     //uphill
-                                     float  c_r = bgColor[0];
-                                     float  c_g = (mix(bgColor[1],fgColor[1], opacity/2.0)); //*
-                                     float  c_b = (mix(bgColor[2],fgColor[2], opacity));
-                                     //gl_FragColor = mix(bgColor, vec4(c_r,c_g,c_b,1.0), opacity);
-                                     gl_FragColor =  vec4(c_r,c_g,c_b, opacity);
-                                  }else{
-                                     float  c_r = (mix(bgColor[0],fgColor[0], opacity));
-                                     float  c_g = (mix(bgColor[1],fgColor[1], opacity/2.0)); //***
-                                     float  c_b = bgColor[2];
-                                     //gl_FragColor = mix(bgColor, vec4(c_r,c_g,c_b,1.0), opacity);
-                                     gl_FragColor =  vec4(c_r,c_g,c_b, opacity);
-                                  }
-                            }else if(opacity<= (2.0/3.0)){
-                                  if(ddx>0.0){
-                                     //uphill
-                                     float  c_r = (mix(bgColor[0],fgColor[0], opacity/2.0));
-                                     float  c_g = (mix(bgColor[1],fgColor[1], opacity));
-                                     float  c_b = (mix(bgColor[2],fgColor[2], 1.0));
-
-                                     //gl_FragColor = mix(bgColor, vec4(c_r,c_g,c_b,1.0), opacity);
-                                     gl_FragColor =  vec4(c_r,c_g,c_b, opacity);
-                                  }else{
-                                     float  c_r = (mix(bgColor[0],fgColor[0], 1.0));
-                                     float  c_g = (mix(bgColor[1],fgColor[1], opacity));
-                                     float  c_b = (mix(bgColor[1],fgColor[1], opacity/2.0));
-                                     //gl_FragColor = mix(bgColor, vec4(c_r,c_g,c_b,1.0), opacity);
-                                     gl_FragColor =  vec4(c_r,c_g,c_b, opacity);
-                                  }
-                            }else{
-                                  if(ddx>0.0){
-                                     //uphill
-                                     float  c_r = (mix(bgColor[0],fgColor[0], opacity));
-                                     float  c_g = (mix(bgColor[1],fgColor[1], 1.0));
-                                     float  c_b = (mix(bgColor[2],fgColor[2], 1.0));
-                                     //gl_FragColor = mix(bgColor, vec4(c_r,c_g,c_b,1.0), opacity);
-                                    gl_FragColor = vec4(c_r,c_g,c_b, opacity);
-                                  }else{
-                                     float  c_r = (mix(bgColor[0],fgColor[0], 1.0));
-                                     float  c_g = (mix(bgColor[1],fgColor[1], 1.0));
-                                     float  c_b = (mix(bgColor[2],fgColor[2], opacity));
-                                     //gl_FragColor = mix(bgColor, vec4(c_r,c_g,c_b,1.0), opacity);
-                                     gl_FragColor =  vec4(c_r,c_g,c_b, opacity);
-                                  }
-                            }
-                        }
-             ";
-            BuildProgram(vs, fs);
-        }
-
-        void BuildProgramV2()
-        {
-            //credit: https://github.com/Chlumsky/msdfgen
-
-            string vs = @"
-                attribute vec4 a_position;
-                attribute vec2 a_texCoord;
-                uniform mat4 u_mvpMatrix;
-                varying vec2 v_texCoord;
-                void main()
-                {
-                    gl_Position = u_mvpMatrix* a_position;
-                    v_texCoord =  a_texCoord;
-                 }
-                ";
-            //enable derivative extension  for fwidth() function
-            //see
-            //https://www.khronos.org/registry/gles/extensions/OES/OES_standard_derivatives.txt
-            //https://github.com/AnalyticalGraphicsInc/cesium/issues/745
-            //https://developer.mozilla.org/en-US/docs/Web/API/OES_standard_derivatives
-            //https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Using_Extensions
-            string fs = @"
-                        #ifdef GL_OES_standard_derivatives
-                            #extension GL_OES_standard_derivatives : enable
-                        #endif
-                        precision mediump float;
-                        varying vec2 v_texCoord;
-                        uniform sampler2D s_texture; //msdf texture
-                        //uniform vec4 bgColor;
-                        uniform vec4 fgColor;
-
-                        float median(float r, float g, float b) {
-                            return max(min(r, g), min(max(r, g), b));
-                        }
-                        void main() {
-                            vec4 sample = texture2D(s_texture, v_texCoord);
-                            float dist = texture2D(s_texture, v_texCoord).r;
-                            //float alpha = smoothstep(u_buffer - u_gamma, u_buffer + u_gamma, dist);
-                            //float alpha = smoothstep(1.0 - 0.5, 1.0 + 0.5, dist);
-                            float opacity = smoothstep(0.1, 1.0, dist);
-                            //gl_FragColor = vec4(u_color.rgb, alpha * u_color.a);
-                            //float opacity = clamp(dist + 0.5, 0.0, 1.0);
-                            gl_FragColor = vec4(0.0,0.0,0.0,opacity);
-                        }
-             ";
-            BuildProgram(vs, fs);
-        }
-        protected override void OnProgramBuilt()
-        {
-            _bgColor = _shaderProgram.GetUniform4("bgColor");
-            _fgColor = _shaderProgram.GetUniform4("fgColor");
-        }
-        public PixelFarm.Drawing.Color BackgroundColor;
-        public PixelFarm.Drawing.Color ForegroundColor;
-        protected override void OnSetVarsBeforeRenderer()
-        {
-            PixelFarm.Drawing.Color bgColor = BackgroundColor;
-            PixelFarm.Drawing.Color fgColor = ForegroundColor;
-           // _bgColor.SetValue((float)bgColor.R / 255f, (float)bgColor.G / 255f, (float)bgColor.B / 255f, (float)bgColor.A / 255f);
-            _fgColor.SetValue((float)fgColor.R / 255f, (float)fgColor.G / 255f, (float)fgColor.B / 255f, (float)fgColor.A / 255f);
-        }
-    }
-#endif
+    //#if DEBUG
+    //    class MsdfShaderSubpix : SimpleRectTextureShader
+    //    {
+
+    //        //not work!
+    //        ShaderUniformVar4 _bgColor;
+    //        ShaderUniformVar4 _fgColor;
+    //        public MsdfShaderSubpix(ShaderSharedResource shareRes)
+    //            : base(shareRes)
+    //        {
+    //            BuildProgramV1();
+    //            //BuildProgramV2();
+    //        }
+
+    //        void BuildProgramV1()
+    //        {
+    //            //credit: https://github.com/Chlumsky/msdfgen
+
+    //            string vs = @"
+    //                attribute vec4 a_position;
+    //                attribute vec2 a_texCoord;
+    //                uniform mat4 u_mvpMatrix;
+    //                varying vec2 v_texCoord;
+    //                void main()
+    //                {
+    //                    gl_Position = u_mvpMatrix* a_position;
+    //                    v_texCoord =  a_texCoord;
+    //                 }
+    //                ";
+    //            //enable derivative extension  for fwidth() function
+    //            //see
+    //            //https://www.khronos.org/registry/gles/extensions/OES/OES_standard_derivatives.txt
+    //            //https://github.com/AnalyticalGraphicsInc/cesium/issues/745
+    //            //https://developer.mozilla.org/en-US/docs/Web/API/OES_standard_derivatives
+    //            //https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Using_Extensions
+    //            string fs = @"
+    //                        #ifdef GL_OES_standard_derivatives
+    //                            #extension GL_OES_standard_derivatives : enable
+    //                        #endif
+    //                        precision mediump float;
+    //                        varying vec2 v_texCoord;
+    //                        uniform sampler2D s_texture; //msdf texture
+    //                        uniform vec4 bgColor;
+    //                        uniform vec4 fgColor;
+
+    //                        float median(float r, float g, float b) {
+    //                            return max(min(r, g), min(max(r, g), b));
+    //                        }
+    //                        void main() {
+    //                            vec4 sample = texture2D(s_texture, v_texCoord);
+    //                            float sigDist = median(sample[0], sample[1], sample[2]) - 0.5;
+    //                            float opacity = clamp(sigDist/fwidth(sigDist) + 0.5, 0.0, 1.0);
+    //                            float ddx= dFdx(sigDist);
+    //                            float ddy= dFdy(sigDist);
+    //                            //gl_FragColor = mix(bgColor, fgColor, opacity);//original
+
+    //                            //for study ***
+    //                            /*if(ddx>0.0){
+    //                                //uphill
+    //                                gl_FragColor = mix(bgColor, vec4(1.0,0,0,opacity), opacity);
+    //                            } else if(ddx<0.0){
+    //                                //downhill
+    //                                gl_FragColor = mix(bgColor, vec4(0.0,0,1.0,opacity), opacity);
+    //                            }else{
+    //                                //stable
+    //                                gl_FragColor = mix(bgColor, fgColor, opacity);
+    //                            }  */
+
+
+    //                            if(opacity == 1.0){
+    //                                //100%
+    //                                //gl_FragColor = mix(bgColor, fgColor, opacity);//original
+    //                                //gl_FragColor = mix(bgColor, fgColor, opacity);//original
+    //                                gl_FragColor = vec4(fgColor[0],fgColor[1],fgColor[2],opacity);//original
+    //                            }else if(opacity<= (1.0/3.0)){
+    //                                  if(ddx>0.0){
+    //                                     //uphill
+    //                                     float  c_r = bgColor[0];
+    //                                     float  c_g = (mix(bgColor[1],fgColor[1], opacity/2.0)); //*
+    //                                     float  c_b = (mix(bgColor[2],fgColor[2], opacity));
+    //                                     //gl_FragColor = mix(bgColor, vec4(c_r,c_g,c_b,1.0), opacity);
+    //                                     gl_FragColor =  vec4(c_r,c_g,c_b, opacity);
+    //                                  }else{
+    //                                     float  c_r = (mix(bgColor[0],fgColor[0], opacity));
+    //                                     float  c_g = (mix(bgColor[1],fgColor[1], opacity/2.0)); //***
+    //                                     float  c_b = bgColor[2];
+    //                                     //gl_FragColor = mix(bgColor, vec4(c_r,c_g,c_b,1.0), opacity);
+    //                                     gl_FragColor =  vec4(c_r,c_g,c_b, opacity);
+    //                                  }
+    //                            }else if(opacity<= (2.0/3.0)){
+    //                                  if(ddx>0.0){
+    //                                     //uphill
+    //                                     float  c_r = (mix(bgColor[0],fgColor[0], opacity/2.0));
+    //                                     float  c_g = (mix(bgColor[1],fgColor[1], opacity));
+    //                                     float  c_b = (mix(bgColor[2],fgColor[2], 1.0));
+
+    //                                     //gl_FragColor = mix(bgColor, vec4(c_r,c_g,c_b,1.0), opacity);
+    //                                     gl_FragColor =  vec4(c_r,c_g,c_b, opacity);
+    //                                  }else{
+    //                                     float  c_r = (mix(bgColor[0],fgColor[0], 1.0));
+    //                                     float  c_g = (mix(bgColor[1],fgColor[1], opacity));
+    //                                     float  c_b = (mix(bgColor[1],fgColor[1], opacity/2.0));
+    //                                     //gl_FragColor = mix(bgColor, vec4(c_r,c_g,c_b,1.0), opacity);
+    //                                     gl_FragColor =  vec4(c_r,c_g,c_b, opacity);
+    //                                  }
+    //                            }else{
+    //                                  if(ddx>0.0){
+    //                                     //uphill
+    //                                     float  c_r = (mix(bgColor[0],fgColor[0], opacity));
+    //                                     float  c_g = (mix(bgColor[1],fgColor[1], 1.0));
+    //                                     float  c_b = (mix(bgColor[2],fgColor[2], 1.0));
+    //                                     //gl_FragColor = mix(bgColor, vec4(c_r,c_g,c_b,1.0), opacity);
+    //                                    gl_FragColor = vec4(c_r,c_g,c_b, opacity);
+    //                                  }else{
+    //                                     float  c_r = (mix(bgColor[0],fgColor[0], 1.0));
+    //                                     float  c_g = (mix(bgColor[1],fgColor[1], 1.0));
+    //                                     float  c_b = (mix(bgColor[2],fgColor[2], opacity));
+    //                                     //gl_FragColor = mix(bgColor, vec4(c_r,c_g,c_b,1.0), opacity);
+    //                                     gl_FragColor =  vec4(c_r,c_g,c_b, opacity);
+    //                                  }
+    //                            }
+    //                        }
+    //             ";
+    //            BuildProgram(vs, fs);
+    //        }
+
+    //        void BuildProgramV2()
+    //        {
+    //            //credit: https://github.com/Chlumsky/msdfgen
+
+    //            string vs = @"
+    //                attribute vec4 a_position;
+    //                attribute vec2 a_texCoord;
+    //                uniform mat4 u_mvpMatrix;
+    //                varying vec2 v_texCoord;
+    //                void main()
+    //                {
+    //                    gl_Position = u_mvpMatrix* a_position;
+    //                    v_texCoord =  a_texCoord;
+    //                 }
+    //                ";
+    //            //enable derivative extension  for fwidth() function
+    //            //see
+    //            //https://www.khronos.org/registry/gles/extensions/OES/OES_standard_derivatives.txt
+    //            //https://github.com/AnalyticalGraphicsInc/cesium/issues/745
+    //            //https://developer.mozilla.org/en-US/docs/Web/API/OES_standard_derivatives
+    //            //https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Using_Extensions
+    //            string fs = @"
+    //                        #ifdef GL_OES_standard_derivatives
+    //                            #extension GL_OES_standard_derivatives : enable
+    //                        #endif
+    //                        precision mediump float;
+    //                        varying vec2 v_texCoord;
+    //                        uniform sampler2D s_texture; //msdf texture
+    //                        //uniform vec4 bgColor;
+    //                        uniform vec4 fgColor;
+
+    //                        float median(float r, float g, float b) {
+    //                            return max(min(r, g), min(max(r, g), b));
+    //                        }
+    //                        void main() {
+    //                            vec4 sample = texture2D(s_texture, v_texCoord);
+    //                            float dist = texture2D(s_texture, v_texCoord).r;
+    //                            //float alpha = smoothstep(u_buffer - u_gamma, u_buffer + u_gamma, dist);
+    //                            //float alpha = smoothstep(1.0 - 0.5, 1.0 + 0.5, dist);
+    //                            float opacity = smoothstep(0.1, 1.0, dist);
+    //                            //gl_FragColor = vec4(u_color.rgb, alpha * u_color.a);
+    //                            //float opacity = clamp(dist + 0.5, 0.0, 1.0);
+    //                            gl_FragColor = vec4(0.0,0.0,0.0,opacity);
+    //                        }
+    //             ";
+    //            BuildProgram(vs, fs);
+    //        }
+    //        protected override void OnProgramBuilt()
+    //        {
+    //            _bgColor = _shaderProgram.GetUniform4("bgColor");
+    //            _fgColor = _shaderProgram.GetUniform4("fgColor");
+    //        }
+    //        public PixelFarm.Drawing.Color BackgroundColor;
+    //        public PixelFarm.Drawing.Color ForegroundColor;
+    //        protected override void OnSetVarsBeforeRenderer()
+    //        {
+    //            PixelFarm.Drawing.Color bgColor = BackgroundColor;
+    //            PixelFarm.Drawing.Color fgColor = ForegroundColor;
+    //           // _bgColor.SetValue((float)bgColor.R / 255f, (float)bgColor.G / 255f, (float)bgColor.B / 255f, (float)bgColor.A / 255f);
+    //            _fgColor.SetValue((float)fgColor.R / 255f, (float)fgColor.G / 255f, (float)fgColor.B / 255f, (float)fgColor.A / 255f);
+    //        }
+    //    }
+    //#endif
 }


modify

modify

--- src/Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample/Views/Document/Index.cshtml
+++ src/Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample/Views/Document/Index.cshtml
@@ -87,7 +87,9 @@

帮助文档已累计下载 @ViewData["DownloadCount"] 次

-
【点击这里 查看在线帮助文档】

+
【点击这里 查看在线帮助文档】
+
+            【点击这里 查看在线文档源代码】


Improve ArgumentNullExceptions on DiagnosticCounter.DisplayName/Unit (#26035)

--- src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/DiagnosticCounter.cs
+++ src/System.Private.CoreLib/shared/System/Diagnostics/Tracing/DiagnosticCounter.cs
@@ -83,7 +83,7 @@
             set
             {
                 if (value == null)
-                    throw new ArgumentException("Cannot set null as DisplayName");
+                    throw new ArgumentNullException(nameof(DisplayName));
                 _displayName = value;
             }
         }
@@ -95,7 +95,7 @@
             set
             {
                 if (value == null)
-                    throw new ArgumentException("Cannot set null as DisplayUnits");
+                    throw new ArgumentNullException(nameof(DisplayUnits));
                 _displayUnits = value;
             }
         }


394.4

--- src/Tests/TestWinForm_MiniAgg_GLES_SKIA/3_Samples/05_AlphaMask2/LionAlphaMask2.cs
+++ src/Tests/TestWinForm_MiniAgg_GLES_SKIA/3_Samples/05_AlphaMask2/LionAlphaMask2.cs
@@ -56,109 +56,19 @@
         }
         void GenerateMaskWithWinGdiPlus(int w, int h)
         {
-            //1. create 32 bits for mask image
-            this.a_alphaBmp = new System.Drawing.Bitmap(w, h);
-            //2. create graphics based on a_alphaBmp
-            using (System.Drawing.Graphics gfxBmp = System.Drawing.Graphics.FromImage(a_alphaBmp))
-            {
-                gfxBmp.Clear(System.Drawing.Color.Black);
-                //ClipProxyImage clippingProxy = new ClipProxyImage(image);
-                //clippingProxy.Clear(ColorRGBA.Black);
-                VertexSource.Ellipse ellipseForMask = new PixelFarm.Agg.VertexSource.Ellipse();
-                System.Random randGenerator = new Random(1432);
-                int num = (int)maskAlphaSliderValue;
-                int lim = num - 1;
-                for (int i = 0; i < lim; ++i)
-                {
-                    ellipseForMask.Reset(randGenerator.Next() % w,
-                                 randGenerator.Next() % h,
-                                 randGenerator.Next() % 100 + 20,
-                                 randGenerator.Next() % 100 + 20,
-                                 100);
-                    // set the color to draw into the alpha channel.
-                    // there is not very much reason to set the alpha as you will get the amount of
-                    // transparency based on the color you draw.  (you might want some type of different edeg effect but it will be minor).
-                    //rasterizer.AddPath(ellipseForMask.MakeVxs());
-                    //sclineRasToBmp.RenderWithColor(clippingProxy, rasterizer, sclnPack,
-                    //   ColorRGBA.Make((int)((float)i / (float)num * 255), 0, 0, 255));
-
-                    VectorToolBox.GetFreeVxs(out var v1);
-                    VxsHelper.FillVxsSnap(gfxBmp, ellipseForMask.MakeVertexSnap(v1), ColorEx.Make((int)((float)i / (float)num * 255), 0, 0, 255));
-                    VectorToolBox.ReleaseVxs(ref v1);
-
-                }
-                //the last one
-                ellipseForMask.Reset(Width / 2, Height / 2, 110, 110, 100);
-                //fill
-                VectorToolBox.GetFreeVxs(out var v2);
-                VxsHelper.FillVxsSnap(gfxBmp, ellipseForMask.MakeVertexSnap(v2), ColorEx.Make(0, 0, 0, 255));
-                v2.Clear();// reuse later
-                //rasterizer.AddPath(ellipseForMask.MakeVertexSnap());
-                //sclineRasToBmp.RenderWithColor(clippingProxy, rasterizer, sclnPack, new ColorRGBA(0, 0, 0, 255));
-                ellipseForMask.Reset(ellipseForMask.originX, ellipseForMask.originY, ellipseForMask.radiusX - 10, ellipseForMask.radiusY - 10, 100);
-                //rasterizer.AddPath(ellipseForMask.MakeVertexSnap());
-                //sclineRasToBmp.RenderWithColor(clippingProxy, rasterizer, sclnPack, new ColorRGBA(255, 0, 0, 255));
-
-                VxsHelper.FillVxsSnap(gfxBmp, ellipseForMask.MakeVertexSnap(v2), ColorEx.Make(255, 0, 0, 255));
-
-                VectorToolBox.ReleaseVxs(ref v2);
-
-                //for (i = 0; i < num; i++)
-                //{
-                //    if (i == num - 1)
-                //    {
-                //        ellipseForMask.Reset(Width / 2, Height / 2, 110, 110, 100);
-                //        //fill
-                //        VxsHelper.DrawVxsSnap(gfxBmp, ellipseForMask.MakeVertexSnap(), new ColorRGBA(0, 0, 0, 255));
-                //        //rasterizer.AddPath(ellipseForMask.MakeVertexSnap());
-                //        //sclineRasToBmp.RenderWithColor(clippingProxy, rasterizer, sclnPack, new ColorRGBA(0, 0, 0, 255));
-                //        ellipseForMask.Reset(ellipseForMask.originX, ellipseForMask.originY, ellipseForMask.radiusX - 10, ellipseForMask.radiusY - 10, 100);
-                //        //rasterizer.AddPath(ellipseForMask.MakeVertexSnap());
-                //        //sclineRasToBmp.RenderWithColor(clippingProxy, rasterizer, sclnPack, new ColorRGBA(255, 0, 0, 255));
-                //        VxsHelper.DrawVxsSnap(gfxBmp, ellipseForMask.MakeVertexSnap(), new ColorRGBA(255, 0, 0, 255));
-                //    }
-                //    else
-                //    {
-                //        ellipseForMask.Reset(randGenerator.Next() % w,
-                //                 randGenerator.Next() % h,
-                //                 randGenerator.Next() % 100 + 20,
-                //                 randGenerator.Next() % 100 + 20,
-                //                 100);
-                //        // set the color to draw into the alpha channel.
-                //        // there is not very much reason to set the alpha as you will get the amount of
-                //        // transparency based on the color you draw.  (you might want some type of different edeg effect but it will be minor).
-                //        //rasterizer.AddPath(ellipseForMask.MakeVxs());
-                //        //sclineRasToBmp.RenderWithColor(clippingProxy, rasterizer, sclnPack,
-                //        //   ColorRGBA.Make((int)((float)i / (float)num * 255), 0, 0, 255));
-                //        VxsHelper.DrawVxsSnap(gfxBmp, ellipseForMask.MakeVertexSnap(), ColorRGBA.Make((int)((float)i / (float)num * 255), 0, 0, 255));
-                //    }
-                //}
-            }
-        }
-        void generate_alpha_mask(ScanlineRasToDestBitmapRenderer sclineRasToBmp, ScanlinePacked8 sclnPack, ScanlineRasterizer rasterizer, int width, int height)
-        {
-
+
+        }
+        void GenAlphaMask(ScanlineRasToDestBitmapRenderer sclineRasToBmp, ScanlinePacked8 sclnPack, ScanlineRasterizer rasterizer, int width, int height)
+        {

             alphaBitmap = new ActualImage(width, height);
             //
             var bmpReaderWrtier = new MyImageReaderWriter();
             bmpReaderWrtier.ReloadImage(alphaBitmap);
-            alphaMaskImageBuffer = new SubImageRW(bmpReaderWrtier, new PixelBlenderBGRA());
-
-            //create mask from alpahMaskImageBuffer
-            //alphaMask = new AlphaMaskByteClipped(alphaMaskImageBuffer, 1, 0);
-#if USE_CLIPPING_ALPHA_MASK
-            //alphaMaskImageBuffer.AttachBuffer(alphaBitmap.GetBuffer(), 20 * width + 20, width - 40, height - 40, width, 8, 1);
-#else
-            alphaMaskImageBuffer.attach(alphaByteArray, (int)cx, (int)cy, cx, 1);
-#endif
-
+            alphaMaskImageBuffer = new SubImageRW(bmpReaderWrtier, new PixelBlenderGrey());
             //
-            var image = new SubImageRW(alphaMaskImageBuffer, new PixelBlenderGrey());
-            //
-            ClipProxyImage clippingProxy = new ClipProxyImage(image);
-            clippingProxy.Clear(Drawing.Color.Black);
-
+            ClipProxyImage clippingProxy = new ClipProxyImage(alphaMaskImageBuffer);
+            clippingProxy.Clear(Drawing.Color.Black);

             System.Random randGenerator = new Random(1432);
             int i;
@@ -167,23 +77,21 @@

             int elliseFlattenStep = 64;
             VectorToolBox.GetFreeVxs(out var v1);
+            VertexSource.Ellipse ellipseForMask = new PixelFarm.Agg.VertexSource.Ellipse();
+
             for (i = 0; i < num; i++)
             {
-                VertexSource.Ellipse ellipseForMask = new PixelFarm.Agg.VertexSource.Ellipse();
+
                 if (i == num - 1)
                 {
                     ////for the last one
-                    //VertexStore v1 = new VertexStore();
+
                     ellipseForMask.Reset(Width / 2, (Height / 2) - 90, 110, 110, elliseFlattenStep);
                     rasterizer.Reset();
                     rasterizer.AddPath(ellipseForMask.MakeVertexSnap(v1));
                     v1.Clear();
                     sclineRasToBmp.RenderWithColor(clippingProxy, rasterizer, sclnPack, new Color(255, 255, 255, 0));
-
-                    //
-                    //
-                    //ellipseForMask = new PixelFarm.Agg.VertexSource.Ellipse();
-                    //v1 = new VertexStore();
+
                     ellipseForMask.Reset(ellipseForMask.originX, ellipseForMask.originY, ellipseForMask.radiusX - 10, ellipseForMask.radiusY - 10, elliseFlattenStep);
                     rasterizer.Reset();
                     rasterizer.AddPath(ellipseForMask.MakeVertexSnap(v1));
@@ -202,7 +110,7 @@
                     // set the color to draw into the alpha channel.
                     // there is not very much reason to set the alpha as you will get the amount of
                     // transparency based on the color you draw.  (you might want some type of different edeg effect but it will be minor).
-                    //VertexStore v1 = new VertexStore();
+
                     rasterizer.Reset();
                     rasterizer.AddPath(ellipseForMask.MakeVxs(v1));
                     v1.Clear();
@@ -366,7 +274,7 @@
             //change value ***
             if (isMaskSliderValueChanged)
             {
-                generate_alpha_mask(aggsx.ScanlineRasToDestBitmap, aggsx.ScanlinePacked8, aggsx.ScanlineRasterizer, width, height);
+                GenAlphaMask(aggsx.ScanlineRasToDestBitmap, aggsx.ScanlinePacked8, aggsx.ScanlineRasterizer, width, height);
                 this.isMaskSliderValueChanged = false;
                 maskPixelBlender.SetMaskImage(alphaBitmap);


MD5 hash ergänzt.

MD5 hash ergänzt.

--- dff.Extensions/StringExtensions.cs
+++ dff.Extensions/StringExtensions.cs
@@ -2,6 +2,8 @@
 using System.Drawing;
 using System.Globalization;
 using System.IO;
+using System.Security.Cryptography;
+using System.Text;

 namespace dff.Extensions
 {
@@ -162,5 +164,26 @@
             }
         }

+        public static string GetMd5Hash(this string source)
+        {
+            try
+            {
+                if (source == null) return string.Empty;
+                var md5 = MD5.Create();
+                var inputBytes = Encoding.ASCII.GetBytes(source);
+                var hash = md5.ComputeHash(inputBytes);
+                var sb = new StringBuilder();
+                for (var i = 0; i < hash.Length; i++)
+                {
+                    sb.Append(hash[i].ToString("X2"));
+                }
+                return sb.ToString();
+            }
+            catch (Exception e)
+            {
+                Console.WriteLine(e);
+                return string.Empty;
+            }
+        }
     }
 }


Added null reference check to cope with race conditions caused by some filters reporting targets that are being destroyed

--- VisualScopeController.cs
+++ VisualScopeController.cs
@@ -41,6 +41,9 @@

 			foreach(var target in allTargets)
 			{
+				if(target == null)
+					continue;
+
 				var position = matrix.MultiplyPoint3x4(target.position);

 				if(position.z < camera.nearClipPlane)


艦隊番号アイコンのハッシュ値を変更

艦隊番号アイコンのハッシュ値を変更


Extract Convention-construction to a helper class resembling an IoC container, to ease upcoming support of arbitrary IoC containers.

--- src/Fixie/Runner.cs
+++ src/Fixie/Runner.cs
@@ -97,24 +97,9 @@

         static Convention ConstructConvention(Type conventionType, RunContext runContext)
         {
-            try
-            {
-                var constructors = conventionType.GetConstructors();
+            var container = new Container(runContext);

-                if (constructors.Length == 1)
-                {
-                    var parameters = constructors.Single().GetParameters();
-
-                    if (parameters.Length == 1 && parameters.Single().ParameterType == typeof(RunContext))
-                        return (Convention)Activator.CreateInstance(conventionType, runContext);
-                }
-
-                return (Convention)Activator.CreateInstance(conventionType);
-            }
-            catch (Exception ex)
-            {
-                throw new Exception("Could not construct an instance of convention type '"+conventionType.FullName+"'.", ex);
-            }
+            return (Convention)container.GetInstance(conventionType);
         }

         AssemblyResult Run(RunContext runContext, IEnumerable<Convention> conventions, params Type[] candidateTypes)
@@ -136,5 +121,44 @@

             return assemblyResult;
         }
+
+        class Container
+        {
+            readonly RunContext runContext;
+
+            public Container(RunContext runContext)
+            {
+                this.runContext = runContext;
+            }
+
+            public object GetInstance(Type type)
+            {
+                if (type == typeof(RunContext))
+                    return runContext;
+
+                var constructor = GetConstructor(type);
+
+                try
+                {
+                    return constructor.Invoke(constructor.GetParameters().Select(parameter => GetInstance(parameter.ParameterType)).ToArray());
+                }
+                catch (Exception ex)
+                {
+                    throw new Exception(String.Format("Could not construct an instance of type '{0}'.", type.FullName), ex);
+                }
+            }
+
+            static ConstructorInfo GetConstructor(Type type)
+            {
+                var constructors = type.GetConstructors();
+
+                if (constructors.Length == 1)
+                    return constructors.Single();
+
+                throw new Exception(
+                    String.Format("Could not construct an instance of type '{0}'.  Expected to find exactly 1 public constructor, but found {1}.",
+                        type.FullName, constructors.Length));
+            }
+        }
     }
 }


Fix scrolling for widgets inside a Paned

--- Xwt.WPF/Xwt.WPFBackend/PanedBackend.cs
+++ Xwt.WPF/Xwt.WPFBackend/PanedBackend.cs
@@ -374,6 +374,20 @@

 				panel1.Size = new GridLength (position, GridUnitType.Star);
 				panel2.Size = new GridLength (availableSize - position, GridUnitType.Star);
+
+				// The measure method has to be called on the children. Widgets like TreeView require
+				// a Measure call with the real size constraints, otherwise it can't decide if the
+				// scrollbars have to be shown or not
+				panel1.Widget.InvalidateMeasure ();
+				panel2.Widget.InvalidateMeasure ();
+				if (direction == Orientation.Horizontal) {
+					panel1.Widget.Measure (new SW.Size (position, size.Height));
+					panel2.Widget.Measure (new SW.Size (availableSize - position, size.Height));
+				}
+				else {
+					panel1.Widget.Measure (new SW.Size (size.Width, position));
+					panel2.Widget.Measure (new SW.Size (size.Width, availableSize - position));
+				}
 			}
 			else if (panel1.Widget != null)
 				panel1.Size = new GridLength (1, GridUnitType.Star);


Fixing native type compatibility checking

--- ZScript/Runtime/Typing/TypeProvider.cs
+++ ZScript/Runtime/Typing/TypeProvider.cs
@@ -347,7 +347,10 @@

             if (origin.IsNative && target.IsNative && nativeOrigin != null && nativeTarget != null)
             {
-                return nativeTarget.NativeType.IsAssignableFrom(nativeOrigin.NativeType) || CanImplicitCastPrimitive(nativeOrigin.NativeType, nativeTarget.NativeType);
+                Type typeOrigin = NativeTypeForTypeDef(nativeOrigin);
+                Type typeTarget = NativeTypeForTypeDef(nativeTarget);
+
+                return typeTarget.IsAssignableFrom(typeOrigin) || CanImplicitCastPrimitive(typeOrigin, typeTarget);
             }

             return false;


Fix Mvc tests.

Fix Mvc tests.

--- test/Microsoft.AspNetCore.Mvc.ViewFeatures.Test/ControllerUnitTestabilityTests.cs
+++ test/Microsoft.AspNetCore.Mvc.ViewFeatures.Test/ControllerUnitTestabilityTests.cs
@@ -560,7 +560,7 @@
             var controller = new TestabilityController();

             // Act
-            var result = controller.ViewComponent("TagCloud");
+            var result = controller.ViewComponent("TagCloud", arguments: null);

             // Assert
             Assert.NotNull(result);
@@ -575,7 +575,7 @@
             var controller = new TestabilityController();

             // Act
-            var result = controller.ViewComponent(typeof(TagCloudViewComponent));
+            var result = controller.ViewComponent(typeof(TagCloudViewComponent), arguments: null);

             // Assert
             Assert.NotNull(result);
@@ -590,13 +590,13 @@
             var controller = new TestabilityController();

             // Act
-            var result = controller.ViewComponent(typeof(TagCloudViewComponent), "Hi", "There");
+            var result = controller.ViewComponent(typeof(TagCloudViewComponent), new { Arg1 = "Hi", Arg2 = "There" });

             // Assert
             Assert.NotNull(result);

             Assert.Equal(typeof(TagCloudViewComponent), result.ViewComponentType);
-            Assert.Equal(new object[] { "Hi", "There" }, result.Arguments);
+            Assert.Equal(new { Arg1 = "Hi", Arg2 = "There" }, result.Arguments);
         }

         public static IEnumerable<object[]> TestabilityViewTestData