(GH-702) Fully qualify shutdown.exe

(GH-702) Fully qualify shutdown.exe

Previously, choco would use the first shutdown that it came across in
the path, which may not be the shutdown that it should be looking to
use. This could cause issues.

With this change, choco will fully qualify the path to the
shutdown.exe. If a user is running under SysWOW, the shutdown they will
find will be in the redirected path, but it is still valid to handle
the canceling of any shutdown/restart operations in progress.

--- src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs
+++ src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs
@@ -48,6 +48,8 @@
         private readonly IXmlService _xmlService;
         private readonly IConfigTransformService _configTransformService;

+        private readonly string _shutdownExe = Environment.ExpandEnvironmentVariables("%systemroot%\\System32\\shutdown.exe");
+
         public ChocolateyPackageService(INugetService nugetService, IPowershellService powershellService,
             IEnumerable<ISourceRunner> sourceRunners, IShimGenerationService shimgenService,
             IFileSystem fileSystem, IRegistryService registryService,
@@ -259,7 +261,7 @@
                     if (powerShellRan)
                     {
                         // we don't care about the exit code
-                        if (config.Information.PlatformType == PlatformType.Windows) CommandExecutor.execute_static("shutdown", "/a", config.CommandExecutionTimeoutSeconds, _fileSystem.get_current_directory(), (s, e) => { }, (s, e) => { }, false, false);
+                        if (config.Information.PlatformType == PlatformType.Windows) CommandExecutor.execute_static(_shutdownExe, "/a", config.CommandExecutionTimeoutSeconds, _fileSystem.get_current_directory(), (s, e) => { }, (s, e) => { }, false, false);
                     }

                     var installersDifferences = _registryService.get_installer_key_differences(installersBefore, _registryService.get_installer_keys());
@@ -689,7 +691,7 @@
             }

             // we don't care about the exit code
-            if (config.Information.PlatformType == PlatformType.Windows) CommandExecutor.execute_static("shutdown", "/a", config.CommandExecutionTimeoutSeconds, _fileSystem.get_current_directory(), (s, e) => { }, (s, e) => { }, false, false);
+            if (config.Information.PlatformType == PlatformType.Windows) CommandExecutor.execute_static(_shutdownExe, "/a", config.CommandExecutionTimeoutSeconds, _fileSystem.get_current_directory(), (s, e) => { }, (s, e) => { }, false, false);

             if (packageResult.Success)
             {


Added CreateSharedMaterial extension method to Texture2D

--- Texture2DExtensions.cs
+++ Texture2DExtensions.cs
@@ -11,4 +11,27 @@
 		GUI.DrawTexture (new Rect (xOffset, yOffset, tex.width, tex.height), tex);
 	}

+
+	/// <summary>
+	/// Create a basic material from this texture. Any materials created with this
+	/// method from the same texture will be shared and can be batched.
+	/// </summary>
+	public static Material CreateSharedMaterial (this Texture2D texture, string shader)
+	{
+		Shader targetShader = Shader.Find (shader);
+		Material[] mats = Object.FindObjectsOfType (typeof(Material)) as Material[];
+		// Return existing material
+		foreach (var mat in mats) {
+			if (mat.shader != targetShader)
+				continue;
+			if (mat.mainTexture == null)
+				continue;
+			if (mat.mainTexture == texture)
+				return mat;
+		}
+		// Create new material
+		Material newMat = new Material (targetShader);
+		newMat.mainTexture = texture;
+		return newMat;
+	}
 }


Do more perf runs.

Do more perf runs.

--- Turing.Perf/Program.cs
+++ Turing.Perf/Program.cs
@@ -12,7 +12,7 @@
     class Program
     {
         const int Size = ((10000000 / TuringTransform.BlockSizeBytes) + 1) * TuringTransform.BlockSizeBytes;
-        const int NumberOfRuns = 5;
+        const int NumberOfRuns = 10;

         Tuple<TimeSpan,int> DoRun(ICryptoTransform transform, byte [] clear, byte [] cipher)
         {


Fix CS0067.

Fix CS0067.

--- Logger/NullLogger.cs
+++ Logger/NullLogger.cs
@@ -4,7 +4,7 @@
 {
 	class NullLogger : ILogger
 	{
-		public event NewLogEntryEventHandler NewLogEntry;
+		public event NewLogEntryEventHandler NewLogEntry { add { throw new NotSupportedException(); } remove { } }

 		public void Log(Exception ex)
 		{


8 . 1 . 2 Parsing statements

8 . 1 . 2 Parsing statements

--- Lox/Parser/Parser.cs
+++ Lox/Parser/Parser.cs
@@ -59,7 +59,9 @@

         public Stmt ExpressionStatement()
         {
-            return null;
+            Expr expr = Expression();
+            Consume(TokenType.Semicolon, "Expect ':' after expression.");
+            return new Stmt.Expression(expr);
         }

         private Expr Conditional()


Added debugging messages and other small changes

--- Chat/Chat.cs
+++ Chat/Chat.cs
@@ -13,7 +13,6 @@
 		private byte[] receivedData = new byte[1024];
 		private Socket client;
 		private Socket server;
-		private Socket remoteClient;

 		/// <summary>
 		/// Initialise the form.
@@ -29,7 +28,7 @@
 		/// <param name="sender">Button Object</param>
 		/// <param name="e">EventArgs arguments of the event</param>
 		private void connect_Click(object sender, EventArgs e) {
-			SetButtons(true, connect, disconnect, sendMessage);
+			SetButtons(true);
 			try {

 				if(!remoteIp.Text.Contains(":")) {
@@ -100,7 +99,7 @@
 		/// <param name="e">EventArgs of the button</param>
 		private void disconnect_Click(object sender, EventArgs e) {
 			CloseConnection();
-			SetButtons(true, connect, disconnect, sendMessage);
+			SetButtons(true);
 			status.Text = "Disconnected";
 		}

@@ -156,6 +155,8 @@
 			if (client.Connected) {
 				client.Close();
 			}
+
+			SetButtons(false);
 		}

 		/// <summary>
@@ -195,6 +196,7 @@
 				client.BeginReceive(data, 0, 1024, SocketFlags.None, new AsyncCallback(OnDataReceived), null);
 			} catch (SocketException ex) {
 				status.Text = $"Could not connect to {remoteIp.Text}";
+				Debug.WriteLine(ex.Message);
 			}
 		}

@@ -217,7 +219,7 @@
 			return new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
 		}

-		private void SetButtons(bool enabled, Button connect, Button disconnect, Button sendMessage) {
+		private void SetButtons(bool enabled) {
 			if (enabled) {
 				disconnect.Enabled = true;
 				sendMessage.Enabled = true;


Added file and exit buttons

Added file and exit buttons

--- MainForm.Designer.cs
+++ MainForm.Designer.cs
@@ -27,6 +27,9 @@
       this.inputBox = new System.Windows.Forms.TextBox();
       this.sendButton = new System.Windows.Forms.Button();
       this.toolbar = new System.Windows.Forms.ToolStrip();
+      this.fileButton = new System.Windows.Forms.ToolStripDropDownButton();
+      this.exitButton = new System.Windows.Forms.ToolStripMenuItem();
+      this.toolbar.SuspendLayout();
       this.SuspendLayout();
       //
       // messageBox
@@ -66,11 +69,29 @@
       //
       // toolbar
       //
+      this.toolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.fileButton});
       this.toolbar.Location = new System.Drawing.Point(0, 0);
       this.toolbar.Name = "toolbar";
       this.toolbar.Size = new System.Drawing.Size(284, 25);
       this.toolbar.TabIndex = 3;
       this.toolbar.Text = "toolbar";
+      //
+      // fileButton
+      //
+      this.fileButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+      this.fileButton.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.exitButton});
+      this.fileButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+      this.fileButton.Name = "fileButton";
+      this.fileButton.Size = new System.Drawing.Size(36, 22);
+      this.fileButton.Text = "file";
+      //
+      // exitButton
+      //
+      this.exitButton.Name = "exitButton";
+      this.exitButton.Size = new System.Drawing.Size(152, 22);
+      this.exitButton.Text = "exit";
       //
       // MainForm
       //
@@ -84,6 +105,8 @@
       this.MinimumSize = new System.Drawing.Size(300, 300);
       this.Name = "MainForm";
       this.Text = "udpit";
+      this.toolbar.ResumeLayout(false);
+      this.toolbar.PerformLayout();
       this.ResumeLayout(false);
       this.PerformLayout();

@@ -95,5 +118,7 @@
     private System.Windows.Forms.TextBox inputBox;
     private System.Windows.Forms.Button sendButton;
     private System.Windows.Forms.ToolStrip toolbar;
+    private System.Windows.Forms.ToolStripDropDownButton fileButton;
+    private System.Windows.Forms.ToolStripMenuItem exitButton;
   }
 }


Fix setting imports for native pdb scopes

--- symbols/pdb/Mono.Cecil.Pdb/NativePdbReader.cs
+++ symbols/pdb/Mono.Cecil.Pdb/NativePdbReader.cs
@@ -212,6 +212,7 @@
 				} else {
 					import = GetImport (scope, info.Method.Module);
 					imports.Add (scope, import);
+					parent.import = import;
 				}
 			}


Refactor logic to suck a bit less

Refactor logic to suck a bit less

--- osu.Game/Screens/OnlinePlay/Multiplayer/Participants/StateDisplay.cs
+++ osu.Game/Screens/OnlinePlay/Multiplayer/Participants/StateDisplay.cs
@@ -1,6 +1,7 @@
 // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
 // See the LICENCE file in the repository root for full licence text.

+using System;
 using System.Diagnostics;
 using osu.Framework.Allocation;
 using osu.Framework.Extensions.Color4Extensions;
@@ -87,85 +88,89 @@

         public void UpdateStatus(MultiplayerUserState state, BeatmapAvailability availability)
         {
-            if (availability.State != DownloadState.LocallyAvailable)
+            // the only case where the progress bar is used does its own local fade in.
+            // starting by fading out is a sane default.
+            progressBar.FadeOut(fade_time);
+            this.FadeIn(fade_time);
+
+            switch (state)
             {
-                switch (availability.State)
-                {
-                    case DownloadState.NotDownloaded:
-                        progressBar.FadeOut(fade_time);
-                        text.Text = "no map";
-                        icon.Icon = FontAwesome.Solid.MinusCircle;
-                        icon.Colour = colours.RedLight;
-                        break;
+                case MultiplayerUserState.Idle:
+                    showBeatmapAvailability(availability);
+                    break;

-                    case DownloadState.Downloading:
-                        Debug.Assert(availability.DownloadProgress != null);
+                case MultiplayerUserState.Ready:
+                    text.Text = "ready";
+                    icon.Icon = FontAwesome.Solid.CheckCircle;
+                    icon.Colour = Color4Extensions.FromHex("#AADD00");
+                    break;

-                        progressBar.FadeIn(fade_time);
-                        progressBar.CurrentTime = availability.DownloadProgress.Value;
+                case MultiplayerUserState.WaitingForLoad:
+                    text.Text = "loading";
+                    icon.Icon = FontAwesome.Solid.PauseCircle;
+                    icon.Colour = colours.Yellow;
+                    break;

-                        text.Text = "downloading map";
-                        icon.Icon = FontAwesome.Solid.ArrowAltCircleDown;
-                        icon.Colour = colours.Blue;
-                        break;
+                case MultiplayerUserState.Loaded:
+                    text.Text = "loaded";
+                    icon.Icon = FontAwesome.Solid.DotCircle;
+                    icon.Colour = colours.YellowLight;
+                    break;

-                    case DownloadState.Importing:
-                        progressBar.FadeOut(fade_time);
-                        text.Text = "importing map";
-                        icon.Icon = FontAwesome.Solid.ArrowAltCircleDown;
-                        icon.Colour = colours.Yellow;
-                        break;
-                }
+                case MultiplayerUserState.Playing:
+                    text.Text = "playing";
+                    icon.Icon = FontAwesome.Solid.PlayCircle;
+                    icon.Colour = colours.BlueLight;
+                    break;
+
+                case MultiplayerUserState.FinishedPlay:
+                    text.Text = "results pending";
+                    icon.Icon = FontAwesome.Solid.ArrowAltCircleUp;
+                    icon.Colour = colours.BlueLighter;
+                    break;
+
+                case MultiplayerUserState.Results:
+                    text.Text = "results";
+                    icon.Icon = FontAwesome.Solid.ArrowAltCircleUp;
+                    icon.Colour = colours.BlueLighter;
+                    break;
+
+                default:
+                    throw new ArgumentOutOfRangeException(nameof(state), state, null);
             }
-            else
+        }
+
+        private void showBeatmapAvailability(BeatmapAvailability availability)
+        {
+            switch (availability.State)
             {
-                progressBar.FadeOut(fade_time);
+                default:
+                    this.FadeOut(fade_time);
+                    break;

-                switch (state)
-                {
-                    default:
-                        this.FadeOut(fade_time);
-                        return;
+                case DownloadState.NotDownloaded:
+                    text.Text = "no map";
+                    icon.Icon = FontAwesome.Solid.MinusCircle;
+                    icon.Colour = colours.RedLight;
+                    break;

-                    case MultiplayerUserState.Ready:
-                        text.Text = "ready";
-                        icon.Icon = FontAwesome.Solid.CheckCircle;
-                        icon.Colour = Color4Extensions.FromHex("#AADD00");
-                        break;
+                case DownloadState.Downloading:
+                    Debug.Assert(availability.DownloadProgress != null);

-                    case MultiplayerUserState.WaitingForLoad:
-                        text.Text = "loading";
-                        icon.Icon = FontAwesome.Solid.PauseCircle;
-                        icon.Colour = colours.Yellow;
-                        break;
+                    progressBar.FadeIn(fade_time);
+                    progressBar.CurrentTime = availability.DownloadProgress.Value;

-                    case MultiplayerUserState.Loaded:
-                        text.Text = "loaded";
-                        icon.Icon = FontAwesome.Solid.DotCircle;
-                        icon.Colour = colours.YellowLight;
-                        break;
+                    text.Text = "downloading map";
+                    icon.Icon = FontAwesome.Solid.ArrowAltCircleDown;
+                    icon.Colour = colours.Blue;
+                    break;

-                    case MultiplayerUserState.Playing:
-                        text.Text = "playing";
-                        icon.Icon = FontAwesome.Solid.PlayCircle;
-                        icon.Colour = colours.BlueLight;
-                        break;
-
-                    case MultiplayerUserState.FinishedPlay:
-                        text.Text = "results pending";
-                        icon.Icon = FontAwesome.Solid.ArrowAltCircleUp;
-                        icon.Colour = colours.BlueLighter;
-                        break;
-
-                    case MultiplayerUserState.Results:
-                        text.Text = "results";
-                        icon.Icon = FontAwesome.Solid.ArrowAltCircleUp;
-                        icon.Colour = colours.BlueLighter;
-                        break;
-                }
+                case DownloadState.Importing:
+                    text.Text = "importing map";
+                    icon.Icon = FontAwesome.Solid.ArrowAltCircleDown;
+                    icon.Colour = colours.Yellow;
+                    break;
             }
-
-            this.FadeIn(fade_time);
         }
     }
 }


Revert "son example upd"

Revert "son example upd"

This reverts commit a00f64b7330c23f07e0ce7e6b42326dfbf3e5e5d.

--- test_tasks/code/JSONExample/JSONExample/Program.cs
+++ test_tasks/code/JSONExample/JSONExample/Program.cs
@@ -3,13 +3,6 @@
 using SimpleJson;
 using System.Collections.Generic;
 using System.Net;
-
-struct XY
-{
-	public int x;
-	public int y;
-}
-

 namespace JSONExample
 {
@@ -50,11 +43,6 @@
 			Console.WriteLine (jsonString);
 			Console.WriteLine (obj["name"]);

-			XY first = new XY();
-			first.y = 21;
-
-			Console.WriteLine (first.y);
-
 		}

 		private static Dictionary<string, string> parsePost (string postString) {


Change namespace to TestCases

Change namespace to TestCases

--- testcases/main/SS/UserModel/TestHSSFBorderStyle.cs
+++ testcases/main/SS/UserModel/TestHSSFBorderStyle.cs
@@ -15,11 +15,10 @@
    limitations under the License.
 ==================================================================== */

-namespace NPOI.SS.UserModel
+namespace TestCases.SS.UserModel
 {
     using NUnit.Framework;
     using TestCases.HSSF;
-    using TestCases.SS.UserModel;

     /**
      * @author Yegor Kozlov


Should distinguish between events having same name

--- tests/Moq.Tests/Regressions/IssueReportsFixture.cs
+++ tests/Moq.Tests/Regressions/IssueReportsFixture.cs
@@ -2875,6 +2875,89 @@

 		#endregion

+		#region 893
+
+		public class Issue893
+		{
+			[Fact]
+			public void Csharp_can_distinguish_between_two_events_having_same_name()
+			{
+				var ab = new AB();
+				var a = (IA)ab;
+				var b = (IB)ab;
+
+				var aeRaiseCount = 0;
+				a.E += () => aeRaiseCount++;
+
+				var beRaiseCount = 0;
+				b.E += () => beRaiseCount++;
+
+				ab.RaiseAE();
+				Assert.Equal(1, aeRaiseCount);
+				Assert.Equal(0, beRaiseCount);
+
+				ab.RaiseBE();
+				Assert.Equal(1, aeRaiseCount);
+				Assert.Equal(1, beRaiseCount);
+			}
+
+			[Fact]
+			public void Moq_can_distinguish_between_two_events_having_same_name()
+			{
+				var ab = new Mock<object>();
+				var a = ab.As<IA>();
+				var b = ab.As<IB>();
+
+				var aeRaiseCount = 0;
+				(a.Object).E += () => aeRaiseCount++;
+
+				var beRaiseCount = 0;
+				(b.Object).E += () => beRaiseCount++;
+
+				a.Raise(m => m.E += null);
+				Assert.Equal(1, aeRaiseCount);
+				Assert.Equal(0, beRaiseCount);
+
+				b.Raise(m => m.E += null);
+				Assert.Equal(1, aeRaiseCount);
+				Assert.Equal(1, beRaiseCount);
+			}
+
+			public interface IA
+			{
+				event Action E;
+			}
+
+			public interface IB
+			{
+				event Action E;
+			}
+
+			public class AB : IA, IB
+			{
+				private Action ae;
+				private Action be;
+
+				event Action IA.E
+				{
+					add => this.ae = (Action)Delegate.Combine(this.ae, value);
+					remove => this.ae = (Action)Delegate.Combine(this.ae, value);
+				}
+
+				event Action IB.E
+				{
+					add => this.be = (Action)Delegate.Combine(this.be, value);
+					remove => this.be = (Action)Delegate.Combine(this.be, value);
+				}
+
+				public void RaiseAE() => this.ae?.Invoke();
+
+				public void RaiseBE() => this.be?.Invoke();
+			}
+		}
+
+		#endregion
+
 		#region 897

 		public class Issue897


Fix IsEmail

Fix IsEmail

--- Validator/Validator.cs
+++ Validator/Validator.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Linq;
 using System.Net;
+using System.Net.Mail;
 using System.Net.Sockets;
 using System.Text.RegularExpressions;
 using System.Web.Script.Serialization;
@@ -114,7 +115,14 @@

         public static bool IsEmail(string input)
         {
-            throw new NotImplementedException();
+            try
+            {
+                return new MailAddress(input).Address == input;
+            }
+            catch
+            {
+                return false;
+            }
         }

         public static bool IsHexadecimal(string input)


Document a couple things.

Document a couple things.

--- GUIHelper.cs
+++ GUIHelper.cs
@@ -1,13 +1,16 @@
 using UnityEngine;

 public static class GUIHelper {
+  // Don't create new instances every time we need an option -- just pre-create the permutations:
   public static GUILayoutOption ExpandWidth     = GUILayout.ExpandWidth(true),
                                 NoExpandWidth   = GUILayout.ExpandWidth(false),
                                 ExpandHeight    = GUILayout.ExpandHeight(true),
                                 NoExpandHeight  = GUILayout.ExpandHeight(false);

+  // Provided for consistency of interface, but not actually a savings/win:
   public static GUILayoutOption Width(float w) { return GUILayout.Width(w); }

+  // Again, don't create instances when we don't need to:
   public static GUIStyle NoStyle = GUIStyle.none;
   public static GUIContent NoContent = GUIContent.none;
 }


Fix winner detection algoritm

Fix winner detection algoritm

--- GameState.cs
+++ GameState.cs
@@ -71,7 +71,7 @@
                 fails[1] = fails[1] || BoardState[y, i] != state;

                 // Move is in diagonal, check current diagonal
-                fails[2] = fails[2] || (x == y && BoardState[i, i] != state);
+                fails[2] = fails[2] || x != y || BoardState[i, i] != state;

                 // Check current anti diagonal
                 fails[3] = fails[3] || BoardState[i, (BoardSize - 1) - i] != state;


Handle DQ_ConceptualConsistency

Handle DQ_ConceptualConsistency

--- MetadataCSW.cs
+++ MetadataCSW.cs
@@ -11267,6 +11267,38 @@
             }
         }
     }
+
+
+    /// <remarks/>
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://www.w3.org/2001/XMLSchema")]
+    public partial class integer
+    {
+
+        private string valueField;
+
+        /// <remarks/>
+        [System.Xml.Serialization.XmlTextAttribute(DataType = "integer")]
+        public string Value
+        {
+            get
+            {
+                return this.valueField;
+            }
+            set
+            {
+                this.valueField = value;
+            }
+        }
+
+        public override string ToString()
+        {
+            return Value;
+        }
+    }
+

     /// <remarks/>
     [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.17929")]
@@ -16790,6 +16822,7 @@
         private string nilReasonField;

         /// <remarks/>
+        [System.Xml.Serialization.XmlElement(Namespace = "http://www.w3.org/2001/XMLSchema")]
         public object Record
         {
             get
@@ -22466,7 +22499,7 @@
     public abstract partial class AbstractDQ_Element_Type : AbstractObject_Type
     {

-        private CharacterString_PropertyType[] nameOfMeasureField;
+        private Measure_Type[] nameOfMeasureField;

         private MD_Identifier_PropertyType measureIdentificationField;

@@ -22484,7 +22517,7 @@

         /// <remarks/>
         [System.Xml.Serialization.XmlElementAttribute("nameOfMeasure")]
-        public CharacterString_PropertyType[] nameOfMeasure
+        public Measure_Type[] nameOfMeasure
         {
             get
             {
@@ -22586,6 +22619,27 @@
             set
             {
                 this.resultField = value;
+            }
+        }
+    }
+
+    [System.SerializableAttribute()]
+    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://www.isotc211.org/2005/gmd")]
+    [System.Xml.Serialization.XmlRootAttribute("nameOfMeasure", Namespace = "http://www.isotc211.org/2005/gmd")]
+    public partial class Measure_Type
+    {
+        private Anchor_Type typeField;
+
+        [System.Xml.Serialization.XmlElement("Anchor", Namespace = "http://www.isotc211.org/2005/gmx")]
+        public Anchor_Type type
+        {
+            get
+            {
+                return this.typeField;
+            }
+            set
+            {
+                this.typeField = value;
             }
         }
     }
@@ -22778,6 +22832,7 @@
     [System.SerializableAttribute()]
     [System.Diagnostics.DebuggerStepThroughAttribute()]
     [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlIncludeAttribute(typeof(integer))]
     [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://www.isotc211.org/2005/gco")]
     public partial class RecordType_PropertyType
     {
@@ -23048,6 +23103,8 @@

         private string nilReasonField;

+        private string hrefField;
+
         /// <remarks/>
         [System.Xml.Serialization.XmlElementAttribute(Namespace = "http://www.opengis.net/gml")]
         public UnitDefinitionType UnitDefinition
@@ -23087,6 +23144,20 @@
             set
             {
                 this.nilReasonField = value;
+            }
+        }
+
+        /// <remarks/>
+        [System.Xml.Serialization.XmlAttributeAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://www.w3.org/1999/xlink", DataType = "anyURI")]
+        public string href
+        {
+            get
+            {
+                return this.hrefField;
+            }
+            set
+            {
+                this.hrefField = value;
             }
         }
     }


add Base64 decoding

add Base64 decoding

--- Net/Rfc2045.cs
+++ Net/Rfc2045.cs
@@ -9,6 +9,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.IO;

 namespace McSherry.Zener.Net
 {
@@ -178,9 +179,137 @@
         /// </summary>
         /// <param name="data">The data to decode.</param>
         /// <returns>The bytes decoded from the string.</returns>
+        /// <exception cref="System.ArgumentNullException">
+        ///     Thrown when the provided data is null.
+        /// </exception>
+        /// <exception cref="System.ArgumentException">
+        ///     Thrown when the provided string does not contain
+        ///     any valid Base64 characters.
+        ///
+        ///     Thrown when the number of valid Base64 characters
+        ///     in the provided string is not a multiple of four.
+        /// </exception>
+        /// <exception cref="System.IO.InvalidDataException">
+        ///     Thrown when the data contains padding characters
+        ///     in an invalid location.
+        /// </exception>
         public static IEnumerable<byte> Base64Decode(string data)
         {
-            throw new NotImplementedException();
+            // We need to make sure that the string isn't null before
+            // we attempt to filter it. If we don't do this, we may end
+            // up with a leaky abstraction throwing NullReferenceException.
+            if (data == null)
+            {
+                throw new ArgumentException(
+                    "The provided string must not be null."
+                    );
+            }
+
+            var alpha = BASE64_ALPHA.ToCharArray();
+            var fdata = data
+                .Where(c => alpha.Contains(c) || c == BASE64_PADCHAR)
+                .ToArray();
+
+            // We couldn't test length before because it was possible that
+            // the string contained non-Base64 characters. Now that we've
+            // removed these characters, if the enumerable is empty we know
+            // that there are no valid characters in the string.
+            if (fdata.Length == 0)
+            {
+                throw new ArgumentException(
+                    "The provided string does not contain any valid characters."
+                    );
+            }
+            // Base64 transforms 24 bits of data in to 32 bits of data, padding
+            // where required. This means that the length of the Base64 string
+            // needs to be a multiple of 32 bits (4 bytes) to be valid. If it
+            // isn't a multiple of 4 bytes, it isn't valid Base64.
+            if (fdata.Length % 4 != 0)
+            {
+                throw new ArgumentException(
+                    "The number of valid Base64 characters is not a multiple of four."
+                    );
+            }
+
+            char[] cbuf = new char[4];
+            var ms = new MemoryStream();
+            for (int i = 0; i < fdata.Length; i += 4)
+            {
+                // Copy the characters in to the buffer.
+                Array.ConstrainedCopy(fdata, i, cbuf, 0, cbuf.Length);
+
+                // The padding characters will never be first or second in a
+                // four-character group. If it is there, something's gone wrong.
+                if (cbuf[0] == BASE64_PADCHAR || cbuf[1] == BASE64_PADCHAR)
+                {
+                    throw new System.IO.InvalidDataException(
+                        "The data contains padding characters in an invalid location."
+                        );
+                }
+                int padCount = 0;
+                // Similarly, we need to make sure that the padding characters are
+                // at the end of the string. If there are padding characters in the
+                // middle of the string, again, something's gone wrong.
+                if (cbuf[2] == BASE64_PADCHAR || cbuf[3] == BASE64_PADCHAR)
+                {
+                    // We're in the middle of the string.
+                    if (i + 4 < fdata.Length)
+                    {
+                        throw new System.IO.InvalidDataException(
+                            "The data contains padding characters in an invalid location."
+                            );
+                    }
+                    else
+                    {
+                        // We're at the end. We need to know how many padding characters
+                        // there are.
+                        padCount = cbuf.Count(BASE64_PADCHAR.Equals);
+                    }
+                }
+
+                // No padding characters, or four data characters.
+                if (padCount == 0)
+                {
+                    uint cat =
+                        (((uint)BASE64_ALPHA.IndexOf(cbuf[0])) << 0x12) |
+                        (((uint)BASE64_ALPHA.IndexOf(cbuf[1])) << 0x0C) |
+                        (((uint)BASE64_ALPHA.IndexOf(cbuf[2])) << 0x06) |
+                        (((uint)BASE64_ALPHA.IndexOf(cbuf[3])) << 0x00) ;
+
+                    ms.Write(new[] {
+                        (byte)((cat & 0x00FF0000) >> 0x10),
+                        (byte)((cat & 0x0000FF00) >> 0x08),
+                        (byte)((cat & 0x000000FF) >> 0x00)
+                    }, 0, 3);
+                }
+                else if (padCount == 1)
+                {
+                    uint cat =
+                        (((uint)BASE64_ALPHA.IndexOf(cbuf[0])) << 0x0C) |
+                        (((uint)BASE64_ALPHA.IndexOf(cbuf[1])) << 0x06) |
+                        (((uint)BASE64_ALPHA.IndexOf(cbuf[2])) << 0x00) ;
+
+                    ms.Write(new[] {
+                        (byte)((cat & 0x0000FF00) >> 0x08),
+                        (byte)((cat & 0x000000FF) >> 0x00)
+                    }, 0, 2);
+                }
+                else
+                {
+                    uint cat =
+                        (((uint)BASE64_ALPHA.IndexOf(cbuf[0])) << 0x06) |
+                        (((uint)BASE64_ALPHA.IndexOf(cbuf[1])) << 0x00) ;
+
+                    ms.Write(new[] {
+                        (byte)((cat & 0xFF0) >> 0x04)
+                    }, 0, 1);
+                }
+            }
+
+            using (ms)
+            {
+                return ms.ToArray();
+            }
         }
     }
 }


Restructured the demo a little bit to exercise the common security packages.

--- NsspiDemo/Program.cs
+++ NsspiDemo/Program.cs
@@ -9,10 +9,12 @@
     {
         public static void Main( string[] args )
         {
-            CredTest();
+            CredTest( PackageNames.Negotiate );
+            CredTest( PackageNames.Kerberos );
+            CredTest( PackageNames.Ntlm );
         }

-        private static void CredTest()
+        private static void CredTest( string packageName )
         {
             ClientCredential clientCred = null;
             ClientContext client = null;
@@ -28,12 +30,14 @@

             try
             {
-                clientCred = new ClientCredential( PackageNames.Negotiate );
+                clientCred = new ClientCredential( packageName );
+                serverCred = new ServerCredential( packageName );
+
                 Console.Out.WriteLine( clientCred.Name );

                 client = new ClientContext(
                     clientCred,
-                    "",
+                    serverCred.Name,
                     ContextAttrib.MutualAuth |
                     ContextAttrib.InitIdentify |
                     ContextAttrib.Confidentiality |
@@ -43,7 +47,6 @@
                     ContextAttrib.Delegate
                 );

-                serverCred = new ServerCredential( PackageNames.Negotiate );

                 server = new ServerContext(
                     serverCred,


minor refactoring

minor refactoring

--- resharper/src/resharper-unity/Rider/UnityPluginProtocolController.cs
+++ resharper/src/resharper-unity/Rider/UnityPluginProtocolController.cs
@@ -32,6 +32,9 @@
         public UnityPluginProtocolController(Lifetime lifetime, ILogger logger,
             IScheduler dispatcher, IShellLocks locks, ISolution solution)
         {
+            if (!ProjectExtensions.IsSolutionGeneratedByUnity(solution.SolutionFilePath.Directory))
+                return;
+
             myLifetime = lifetime;
             myLogger = logger;
             myDispatcher = dispatcher;
@@ -47,16 +50,11 @@
             {
                 if (args.HasNew && UnityModel != null) UnityModel.Play.Value = args.New;
             });
-
-            var solFilePath = mySolution.SolutionFilePath;
-            if (!ProjectExtensions.IsSolutionGeneratedByUnity(solFilePath.Directory))
-                return;
-
+
             SubscribeToPlay(mySolution.GetProtocolSolution());

-            var protocolInstancePath =
-                solFilePath.Directory.Combine(
-                    "Library/ProtocolInstance.json"); // consider non-Unity Solution with Unity-generated projects
+            var protocolInstancePath = mySolution.SolutionFilePath.Directory.Combine(
+                    "Library/ProtocolInstance.json"); // todo: consider non-Unity Solution with Unity-generated projects

             if (!protocolInstancePath.ExistsFile)
                 File.Create(protocolInstancePath.FullPath);


Renderer: Change Transform(ref CCV3F_C4B_T2F quadPoint) to not create so many intermediate objects.

--- src/cocoa/CCAffineTransform.cs
+++ src/cocoa/CCAffineTransform.cs
@@ -275,9 +275,11 @@

         public void Transform(ref CCV3F_C4B_T2F quadPoint)
         {
-            CCPoint projectedPoint = Transform(new CCPoint(quadPoint.Vertices.X, quadPoint.Vertices.Y));
-
-            quadPoint.Vertices = new CCVertex3F(projectedPoint.X, projectedPoint.Y, quadPoint.Vertices.Z);
+            var x = 0.0f;
+            var y = 0.0f;
+            Transform(quadPoint.Vertices.X, quadPoint.Vertices.Y, out x, out y);
+            quadPoint.Vertices.X = x;
+            quadPoint.Vertices.Y = y;
         }

         public CCV3F_C4B_T2F_Quad Transform(CCV3F_C4B_T2F_Quad quad)


[KMS] CharaSim: Support third column of CashPackage (Fix #71)

--- WzComparerR2/CharaSimControl/CashPackageRender.cs
+++ WzComparerR2/CharaSimControl/CashPackageRender.cs
@@ -64,12 +64,8 @@
             if (CharaSimLoader.LoadedCommoditiesByItemId.ContainsKey(CashPackage.ItemID))
                 commodityPackage = CharaSimLoader.LoadedCommoditiesByItemId[CashPackage.ItemID];

-            SizeF titleSize = TextRenderer.MeasureText(g, CashPackage.name, GearGraphics.ItemNameFont2, new Size(int.MaxValue, int.MaxValue), TextFormatFlags.NoPrefix);
-            titleSize.Width += 12 * 2;
-
-            if (titleSize.Width < 220)
-                titleSize.Width = 220;
-            titleSize.Height = 220;
+            int fullWidth = Math.Max(220, TextRenderer.MeasureText(g, CashPackage.name, GearGraphics.ItemNameFont2, new Size(int.MaxValue, int.MaxValue), TextFormatFlags.NoPrefix).Width + 12 * 2);
+            int[] columnWidth = { CashPackage.SN.Count < 8 ? fullWidth : 220, 220, 220 };

             for (int i = 0; i < CashPackage.SN.Count; ++i)
             {
@@ -97,46 +93,53 @@
                     name = "(null)";
                 }

-                SizeF nameSize = TextRenderer.MeasureText(g, name.Replace(Environment.NewLine, ""), GearGraphics.ItemDetailFont, new Size(int.MaxValue, int.MaxValue), TextFormatFlags.NoPadding | TextFormatFlags.NoPrefix);
+                int nameWidth = TextRenderer.MeasureText(g, name.Replace(Environment.NewLine, ""), GearGraphics.ItemDetailFont, new Size(int.MaxValue, int.MaxValue), TextFormatFlags.NoPadding | TextFormatFlags.NoPrefix).Width;
                 if (commodity.Bonus == 0)
                 {
                     if (commodity.originalPrice > 0 && commodity.Price < commodity.originalPrice)
-                        nameSize.Width += 55 + 31 + 6 + 8;
-                    else
-                        nameSize.Width += 55 + 8;
+                        nameWidth += 55 + 31 + 6 + 8;
+                    else
+                        nameWidth += 55 + 8;
                 }
                 else
-                    nameSize.Width += 55 + 38 + 6 + 8;
+                    nameWidth += 55 + 38 + 6 + 8;
+
                 if (CashPackage.SN.Count < 8)
                 {
-                    if (nameSize.Width > titleSize.Width)
-                        titleSize.Width = nameSize.Width;
+                    columnWidth[0] = Math.Max(columnWidth[0], nameWidth);
+                }
+                else if (CashPackage.SN.Count < 27)
+                {
+                    if (i < (CashPackage.SN.Count + 1) / 2)
+                        columnWidth[0] = Math.Max(columnWidth[0], nameWidth);
+                    else
+                        columnWidth[1] = Math.Max(columnWidth[1], nameWidth);
                 }
                 else
                 {
-                    if (i < CashPackage.SN.Count / 2)
-                    {
-                        if (nameSize.Width > titleSize.Height)
-                            titleSize.Height = nameSize.Width;
-                    }
-                    else
-                    {
-                        if (nameSize.Width > titleSize.Width)
-                            titleSize.Width = nameSize.Width;
-                    }
-                }
-            }
-
-            if (CashPackage.SN.Count >= 8)
-                titleSize.Width += titleSize.Height - 4;
-
-            if (titleSize.Width > 220)
+                    if (i < (CashPackage.SN.Count + 2) / 3)
+                        columnWidth[0] = Math.Max(columnWidth[0], nameWidth);
+                    else if (i < (2 * CashPackage.SN.Count + 2) / 3)
+                        columnWidth[1] = Math.Max(columnWidth[1], nameWidth);
+                    else
+                        columnWidth[2] = Math.Max(columnWidth[2], nameWidth);
+                }
+            }
+
+            if (CashPackage.SN.Count < 8)
+                fullWidth = Math.Max(fullWidth, columnWidth[0]);
+            else if (CashPackage.SN.Count < 27)
+                fullWidth = Math.Max(fullWidth, columnWidth[0] + columnWidth[1] - 4);
+            else
+                fullWidth = Math.Max(fullWidth, columnWidth[0] + columnWidth[1] + columnWidth[2] - 8);
+
+            if (fullWidth > 220)
             {
                 //重构大小
                 g.Dispose();
                 cashBitmap.Dispose();

-                cashBitmap = new Bitmap((int)Math.Ceiling(titleSize.Width), DefaultPicHeight);
+                cashBitmap = new Bitmap(fullWidth, DefaultPicHeight);
                 g = Graphics.FromImage(cashBitmap);
             }

@@ -203,21 +206,39 @@
             bool hasLine = false;
             picH -= 4;

-            int picStartH = picH, picEndH = 0, columnLeft = 0, columnRight;
-            if (CashPackage.SN.Count < 8)
-                columnRight = cashBitmap.Width;
-            else
-                columnRight = (int)Math.Ceiling(titleSize.Height);
+            int picStartH = picH, picEndH = 0, columnLeft = 0, columnRight = columnWidth[0];

             for (int i = 0; i < CashPackage.SN.Count; ++i)
             {
-                if (CashPackage.SN.Count >= 8 && i == (CashPackage.SN.Count + 1) / 2)
-                {
-                    hasLine = false;
-                    picEndH = picH;
-                    picH = picStartH;
-                    columnLeft = (int)Math.Ceiling(titleSize.Height) - 2;
-                    columnRight = cashBitmap.Width;
+                if (CashPackage.SN.Count >= 8 && CashPackage.SN.Count < 27)
+                {
+                    if (i == (CashPackage.SN.Count + 1) / 2)
+                    {
+                        hasLine = false;
+                        picEndH = picH;
+                        picH = picStartH;
+                        columnLeft = columnWidth[0] - 2;
+                        columnRight = columnWidth[0] + columnWidth[1] - 4;
+                    }
+                }
+                else if (CashPackage.SN.Count >= 27)
+                {
+                    if (i == (CashPackage.SN.Count + 2) / 3)
+                    {
+                        hasLine = false;
+                        picEndH = picH;
+                        picH = picStartH;
+                        columnLeft = columnWidth[0] - 2;
+                        columnRight = columnWidth[0] + columnWidth[1] - 4;
+                    }
+                    else if (i == (2 * CashPackage.SN.Count + 2) / 3)
+                    {
+                        hasLine = false;
+                        picEndH = picH;
+                        picH = picStartH;
+                        columnLeft = columnWidth[0] + columnWidth[1] - 6;
+                        columnRight = columnWidth[0] + columnWidth[1] + columnWidth[2] - 8;
+                    }
                 }

                 if (hasLine)


Fixed NullReferenceException

Fixed NullReferenceException

--- Yarn.InMemory/Data/InMemoryProvider/Repository.cs
+++ Yarn.InMemory/Data/InMemoryProvider/Repository.cs
@@ -19,6 +19,7 @@
         public Repository(IMetaDataProvider metaDataProvider = null)
         {
             _metaDataProvider = metaDataProvider ?? this;
+            _context = new DataContext();
         }

         public T GetById<T, ID>(ID id) where T : class


Commenting out permissions.

Commenting out permissions.

--- Permissions.cs
+++ Permissions.cs
@@ -7,18 +7,18 @@
         public static readonly Permission ManageForums = new Permission { Description = "Manage forums", Name = "ManageForums" };

         public static readonly Permission AddThread = new Permission { Description = "Add a thread", Name = "AddThread" };
-        public static readonly Permission EditThread = new Permission { Description = "Edit any thread", Name = "EditThread", ImpliedBy = new[] { AddThread } };
-        public static readonly Permission DeleteThread = new Permission { Description = "Delete any thread", Name = "DeleteThread", ImpliedBy = new [] { AddThread }};
-        public static readonly Permission CloseThread = new Permission { Description = "Can close a thread", Name = "CloseThread", ImpliedBy = new[] { ManageForums } };
-        public static readonly Permission OpenThread = new Permission { Description = "Can open a thread", Name = "OpenThread", ImpliedBy = new[] { ManageForums } };
-        public static readonly Permission ManageStickyThread = new Permission { Description = "Can create a thread that is sticky", Name = "CreateStickyThread", ImpliedBy = new[] { ManageForums } };
+        public static readonly Permission EditThread = new Permission { Description = "Edit any thread", Name = "EditThread" };
+        public static readonly Permission DeleteThread = new Permission { Description = "Delete any thread", Name = "DeleteThread" };
+        public static readonly Permission CloseThread = new Permission { Description = "Can close a thread", Name = "CloseThread" };
+        public static readonly Permission OpenThread = new Permission { Description = "Can open a thread", Name = "OpenThread" };
+        public static readonly Permission ManageStickyThread = new Permission { Description = "Can create a thread that is sticky", Name = "ManageStickyThread" };

         public static readonly Permission AddPost = new Permission { Description = "Add a post", Name = "AddPost" };
-        public static readonly Permission EditPost = new Permission { Description = "Edit a post", Name = "EditPost", ImpliedBy = new[] { AddPost } };
-        public static readonly Permission DeletePost = new Permission { Description = "Delete a post", Name = "DeletePost", ImpliedBy = new[] { AddPost } };
+        public static readonly Permission EditPost = new Permission { Description = "Edit a post", Name = "EditPost"  };
+        public static readonly Permission DeletePost = new Permission { Description = "Delete a post", Name = "DeletePost" };

-        public static readonly Permission MetaListForum = new Permission { ImpliedBy = new[] { AddThread, EditThread, DeleteThread, CloseThread, OpenThread, ManageStickyThread } };
-        public static readonly Permission MetaListThread = new Permission { ImpliedBy = new[] { AddPost, EditPost, DeletePost } };
+        //public static readonly Permission MetaListForum = new Permission { ImpliedBy = new[] { AddThread, EditThread, DeleteThread, CloseThread, OpenThread, ManageStickyThread } };
+        //public static readonly Permission MetaListThread = new Permission { ImpliedBy = new[] { AddPost, EditPost, DeletePost } };

         public virtual Feature Feature { get; set; }

@@ -38,35 +38,36 @@
         }

         public IEnumerable<PermissionStereotype> GetDefaultStereotypes() {
+
             return new[] {
                 new PermissionStereotype {
                     Name = "Administrator",
-                    Permissions = new[] {ManageForums, MetaListForum, MetaListThread}
+                    Permissions = new[] {ManageForums}
                 },
-                new PermissionStereotype {
-                    Name = "Anonymous",
-                    Permissions = new[] {MetaListForum, MetaListThread}
-                },
-                new PermissionStereotype {
-                    Name = "Authenticated",
-                    Permissions = new[] {MetaListForum, MetaListThread}
-                },
-                new PermissionStereotype {
-                    Name = "Editor",
-                    Permissions = new[] {MetaListForum, MetaListThread}
-                },
-                new PermissionStereotype {
-                    Name = "Moderator",
-                    Permissions = new[] {MetaListForum, MetaListThread}
-                },
-                new PermissionStereotype {
-                    Name = "Author",
-                    Permissions = new[] {MetaListForum, MetaListThread}
-                },
-                new PermissionStereotype {
-                    Name = "Contributor",
-                    Permissions = new[] {MetaListForum, MetaListThread}
-                },
+                //new PermissionStereotype {
+                //    Name = "Anonymous",
+                //    Permissions = new[] {MetaListForum, MetaListThread}
+                //},
+                //new PermissionStereotype {
+                //    Name = "Authenticated",
+                //    Permissions = new[] {MetaListForum, MetaListThread}
+                //},
+                //new PermissionStereotype {
+                //    Name = "Editor",
+                //    Permissions = new[] {MetaListForum, MetaListThread}
+                //},
+                //new PermissionStereotype {
+                //    Name = "Moderator",
+                //    Permissions = new[] {MetaListForum, MetaListThread}
+                //},
+                //new PermissionStereotype {
+                //    Name = "Author",
+                //    Permissions = new[] {MetaListForum, MetaListThread}
+                //},
+                //new PermissionStereotype {
+                //    Name = "Contributor",
+                //    Permissions = new[] {MetaListForum, MetaListThread}
+                //},
             };
         }


added another Lumia 540 model name

added another Lumia 540 model name

--- PhoneNameResolver.cs
+++ PhoneNameResolver.cs
@@ -551,6 +551,7 @@
             { "RM-1067", new CanonicalPhoneName() { CanonicalManufacturer="MICROSOFT", CanonicalModel = "Lumia 640 XL" } },
             { "RM-1096", new CanonicalPhoneName() { CanonicalManufacturer="MICROSOFT", CanonicalModel = "Lumia 640 XL" } },
             // Lumia 540
+            { "RM-1140", new CanonicalPhoneName() { CanonicalManufacturer="MICROSOFT", CanonicalModel = "Lumia 540" } },
             { "RM-1141", new CanonicalPhoneName() { CanonicalManufacturer="MICROSOFT", CanonicalModel = "Lumia 540" } },
             // Lumia 430
             { "RM-1099", new CanonicalPhoneName() { CanonicalManufacturer="MICROSOFT", CanonicalModel = "Lumia 430", Comments="DS" } },


Added first of series of tests about insertion/deletion

Test with strings of Node<char>s

--- tests/DataStructuresAlgorithms.Tests/DataStructures/LinkedListTests.cs
+++ tests/DataStructuresAlgorithms.Tests/DataStructures/LinkedListTests.cs
@@ -74,6 +74,13 @@
             {
                 list.AddLast(value);
             }
+
+            string toStrTest = "GBFADCE", toStr = "";
+            foreach(var node in list)
+            {
+                toStr += node.Value;
+            }
+            Assert.True(toStrTest.Equals(toStr));
         }
     }


Use GetRelativePathOrAbsolute in ShowLightningNodeInfo

--- BTCPayServer/Views/PublicLightningNodeInfo/ShowLightningNodeInfo.cshtml
+++ BTCPayServer/Views/PublicLightningNodeInfo/ShowLightningNodeInfo.cshtml
@@ -1,4 +1,4 @@
-@addTagHelper *, Meziantou.AspNetCore.BundleTagHelpers
+@addTagHelper *, Meziantou.AspNetCore.BundleTagHelpers
 @inject BTCPayServer.HostedServices.CssThemeManager themeManager

 @model BTCPayServer.Controllers.ShowLightningNodeInfoViewModel
@@ -18,7 +18,7 @@

     <link rel="manifest" href="~/manifest.json">

-    <link href="@this.Context.Request.GetAbsoluteUri(themeManager.BootstrapUri)" rel="stylesheet"/>
+    <link href="@this.Context.Request.GetRelativePathOrAbsolute(themeManager.BootstrapUri)" rel="stylesheet"/>
     <link href="~/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>

     <bundle name="wwwroot/bundles/lightning-node-info-bundle.min.js"/>


Rename header my vehicles

Rename header my vehicles

--- Battery-Commander.Web/Views/Shared/Components/Navigation/Default.cshtml
+++ Battery-Commander.Web/Views/Shared/Components/Navigation/Default.cshtml
@@ -20,7 +20,7 @@

@Html.RouteLink("My Soldiers", "Unit.Soldiers", new { Model.Soldier.UnitId }, new { @class = "nav-link" })

@Html.RouteLink("My Profile", "Soldier.Details", new { id = Model.Soldier.Id }, new { @class = "nav-link" })

@Html.ActionLink("Evaluations", "Index", "Evaluations", new { unitId = Model.Soldier.UnitId }, new { @class = "nav-link" })

-
@Html.ActionLink("Vehicles", "Index", "Vehicles", new VehicleService.Query { Units = new[] { Model.Soldier.UnitId } }, new { @class = "nav-link" })

+
@Html.ActionLink("My Vehicles", "Index", "Vehicles", new VehicleService.Query { Units = new[] { Model.Soldier.UnitId } }, new { @class = "nav-link" })

                     }
                     else
                     {


update

update

--- CSharpGL/0Foundations/OpenGLObjects/Shader/ShaderProgram.SetUniforms.cs
+++ CSharpGL/0Foundations/OpenGLObjects/Shader/ShaderProgram.SetUniforms.cs
@@ -1,9 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
+using System.ComponentModel;
 using System.Drawing.Design;
-using System.Text;

 namespace CSharpGL
 {


Device object Application software version property should be String not uint

--- CodeExamples/AnotherStorageImplementation/BacnetObjects/DeviceObject.cs
+++ CodeExamples/AnotherStorageImplementation/BacnetObjects/DeviceObject.cs
@@ -73,6 +73,12 @@
         }

         [BaCSharpType(BacnetApplicationTags.BACNET_APPLICATION_TAG_CHARACTER_STRING)]
+        public virtual String PROP_MODEL_NAME
+        {
+            get { return "Model A"; }
+        }
+
+        [BaCSharpType(BacnetApplicationTags.BACNET_APPLICATION_TAG_CHARACTER_STRING)]
         public virtual String PROP_FIRMWARE_REVISION
         {
             get { return "Version Beta 1"; }
@@ -84,10 +90,10 @@
             get { return 61440; }
         }

-        [BaCSharpType(BacnetApplicationTags.BACNET_APPLICATION_TAG_UNSIGNED_INT)]
-        public virtual uint PROP_APPLICATION_SOFTWARE_VERSION
-        {
-            get { return 1; }
+        [BaCSharpType(BacnetApplicationTags.BACNET_APPLICATION_TAG_CHARACTER_STRING)]
+        public virtual String PROP_APPLICATION_SOFTWARE_VERSION
+        {
+            get { return "1"; }
         }

         [BaCSharpType(BacnetApplicationTags.BACNET_APPLICATION_TAG_UNSIGNED_INT)]
@@ -130,6 +136,18 @@
         public virtual uint PROP_SEGMENTATION_SUPPORTED
         {
             get { return 0; } // Both
+        }
+
+        [BaCSharpType(BacnetApplicationTags.BACNET_APPLICATION_TAG_UNSIGNED_INT)]
+        public virtual uint PROP_MAX_SEGMENTS_ACCEPTED
+        {
+            get { return (uint)BacnetMaxSegments.MAX_SEG64; }
+        }
+
+        [BaCSharpType(BacnetApplicationTags.BACNET_APPLICATION_TAG_ENUMERATED)]
+        public virtual uint PROP_SYSTEM_STATUS
+        {
+            get { return (uint)BacnetDeviceStatus.OPERATIONAL; }
         }

         [BaCSharpType(BacnetApplicationTags.BACNET_APPLICATION_TAG_NULL)]


Formatting of invisible widget's HTML

Formatting of invisible widget's HTML

To make HTML output nicely formatted

--- core/p5.ajax/widgets/Widget.cs
+++ core/p5.ajax/widgets/Widget.cs
@@ -535,10 +535,11 @@
                     "outerHTML",
                     string.Format (@"<{0} id=""{1}"" style=""display:none !important;""></{0}>", Element, ClientID));

-            } else if (!AjaxPage.IsAjaxRequest || ancestorReRendering) {
-
-                // Rendering invisible HTML.
-                writer.Write (string.Format (@"<{0} id=""{1}"" style=""display:none !important;""></{0}>", Element, ClientID));
+            } else if (!AjaxPage.IsAjaxRequest || ancestorReRendering) {
+
+				// Rendering invisible HTML, making sure we indent invisible HTML.
+				IndentWidgetRendering (writer);
+				writer.Write (string.Format (@"<{0} id=""{1}"" style=""display:none !important;""></{0}>", Element, ClientID));
             }
         }


Certification validation callback

Certification validation callback

Since otherwise no SSL/TLS certificates will be accepted. Necessary to
among other things have POP3 with SSL working on Apache, etc.

--- core/p5.webapp/Default.aspx.cs
+++ core/p5.webapp/Default.aspx.cs
@@ -26,14 +26,32 @@
 using System.Web.UI;
 using p5.core;
 using p5.webapp.code;
+using System.Net;
+using System.Net.Security;
+using System.Security.Cryptography.X509Certificates;

 namespace p5.webapp
 {
     /// <summary>
-    ///     Main ASP.NET web page for your phosphorus five application
+    ///     Main ASP.NET web page for your Phosphorus Five application.
     /// </summary>
     public class Default : PhosphorusPage
     {
+        /*
+         * This one is necessary to make sure any HTTP requests is accepted if they're
+         * using SSL, such as for instance when a POP3 server does an TLS handshake, etc.
+         */
+        static Default ()
+        {
+			ServicePointManager.ServerCertificateValidationCallback = delegate (
+                object s,
+                X509Certificate certificate,
+                X509Chain chain,
+                SslPolicyErrors sslPolicyErrors) {
+                return true;
+            };
+        }
+
         protected override void OnInit(EventArgs e)
         {
             // Rewriting path, to what was actually requested, such that HTML form element's action doesn't become garbage.


add assembly cleanup method to dispose HttpMessageHandler

--- Examples/BingGeoCoder/BingGeoCoder.Client.UnitTests/AddressPartTests.cs
+++ Examples/BingGeoCoder/BingGeoCoder.Client.UnitTests/AddressPartTests.cs
@@ -39,6 +39,15 @@
             // pass a lambda that will indicate to the serialzier to filter that param out
             SimpleIoc.Default.Register<HttpMessageHandler>(() =>
                 MessageHandlerFactory.CreateMessageHandler(mockFolder, captureFolder, (name, value) => name.Equals("key", StringComparison.InvariantCultureIgnoreCase)));
+        }
+
+        [AssemblyCleanup]
+        public static void AssemblyCleanup()
+        {
+            if (SimpleIoc.Default.IsRegistered<HttpMessageHandler>())
+            {
+                SimpleIoc.Default.GetInstance<HttpMessageHandler>().Dispose();
+            }
         }

         [ClassInitialize]


removed extra files

removed extra files


Added Serialise to test class under Y key

--- Assets/Test.cs
+++ Assets/Test.cs
@@ -1,5 +1,9 @@
 using UnityEngine;
 using System.Collections.Generic;
+using System.Xml.Serialization;
+using System.Runtime.Serialization;
+using System.Runtime.Serialization.Formatters.Binary;
+using System.IO;

 public class Test : MonoBehaviour {

@@ -30,9 +34,11 @@

 		if (Input.GetKeyDown(KeyCode.Y))
 		{
-			Debug.Log(curve.keys[0] is System.ValueType);
-			var d = new Dictionary<int, float>();
-			d.DictToList();
+			var keyValuePairs = new KeyValuePair<int, float>[2]{new KeyValuePair<int, float>(1, 2f), new KeyValuePair<int, float>(3, 4f)};
+			var stream = new MemoryStream();
+			var formatter = new BinaryFormatter();
+			formatter.Serialize(stream, keyValuePairs);
+			Debug.Log(stream.Length);
 		}
 	}


Fix test

Fix test

--- src/AspectSharp.TestsExecutable/TraceAdviceAttribute.cs
+++ src/AspectSharp.TestsExecutable/TraceAdviceAttribute.cs
@@ -61,7 +61,7 @@
             Console.ResetColor();

             // invoke the intercepted method
-            object result = null;// dele.DynamicInvoke(parameters.AllParameterValues);
+            object result = dele.DynamicInvoke(parameters.AllParameterValues);

             Console.ForegroundColor = ConsoleColor.Green;


Add Hiding of Viewport Borders in Single Viewmode

--- open3mod/Renderer.cs
+++ open3mod/Renderer.cs
@@ -262,7 +262,7 @@
             _textOverlay.Draw();

             // draw viewport finishing (i.e. contours)
-            if (ui.ActiveScene != null)
+            if (ui.ActiveScene != null && ui.ActiveViewMode != Tab.ViewMode.Single)
             {
                 var index = Tab.ViewIndex.Index0;
                 foreach (var viewport in ui.ActiveViews)
@@ -353,8 +353,16 @@
                 return;
             }

-            var xPoint = (int) (x2*(double) RenderResolution.Width);
-            var yPoint = 3 + (int) ((1.0f - y2)*(double) RenderResolution.Height); // note: y is flipped
+            var xPoint = 3 + (int) (x2*(double) RenderResolution.Width);
+            var yPoint = (int) ((1.0f - y2)*(double) RenderResolution.Height); // note: y is flipped
+
+            //padding if bounds are drawn
+            if (ui.ActiveViewMode != Tab.ViewMode.Single)
+            {
+                xPoint -= 3;
+                yPoint += 3;
+            }
+
             const int xSpacing = 4;

             var imageWidth = _hudImages[0, 0].Width;


Ready for retrieve device name and manufacturer name in WP7

--- platform/wp7/RhoRubyLib/rubyext/RhoSystem.cs
+++ platform/wp7/RhoRubyLib/rubyext/RhoSystem.cs
@@ -54,6 +54,10 @@
             if(name == "platform") return "WP7";
             else if(name == "os_version") return "7.0";
             else if(name == "country") return "us";
+            else if (name == "vendor") return Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceManufacturer");
+            else if (name == "device_name") return Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceName");
+            else if (name == "real_screen_width") return "";
+            else if (name == "real_screen_height") return "";
             else if(name == "phone_id") {
               byte[] bytes = (byte[])Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId");
               return Convert.ToBase64String(bytes);


Fix typo: reaquire -> reacquire (#4342)

Fix typo: reaquire -> reacquire (#4342)

--- src/Build/BackEnd/Components/RequestBuilder/TaskHost.cs
+++ src/Build/BackEnd/Components/RequestBuilder/TaskHost.cs
@@ -336,7 +336,7 @@
         /// <summary>
         /// Requests to yield the node.
         /// Thread safe, however Yield cannot be called unless the
-        /// last call to Yield or Reaquire was Reaquire.
+        /// last call to Yield or Reacquire was Reacquire.
         /// </summary>
         public void Yield()
         {
@@ -351,8 +351,8 @@

         /// <summary>
         /// Requests to reacquire the node.
-        /// Thread safe, however Reaquire cannot be called unless the
-        /// last call to Yield or Reaquire was Yield.
+        /// Thread safe, however Reacquire cannot be called unless the
+        /// last call to Yield or Reacquire was Yield.
         /// </summary>
         public void Reacquire()
         {


Fixed a bug when reloading state from a file and trying to navigate backwards, there wouldn't be any viewmodels in the stack.


Quarantine CanUpdateValuesMatchedByName #33530 (#33531)

--- src/Components/test/E2ETest/Tests/CascadingValueTest.cs
+++ src/Components/test/E2ETest/Tests/CascadingValueTest.cs
@@ -6,6 +6,7 @@
 using Microsoft.AspNetCore.Components.E2ETest.Infrastructure;
 using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures;
 using Microsoft.AspNetCore.E2ETesting;
+using Microsoft.AspNetCore.Testing;
 using OpenQA.Selenium;
 using Xunit;
 using Xunit.Abstractions;
@@ -48,6 +49,7 @@
         }

         [Fact]
+        [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/33530")]
         public void CanUpdateValuesMatchedByName()
         {
             var currentFlag1Value = Browser.Exists(By.Id("flag-1"));


Fix browser language detection. #631

Fix browser language detection. #631

--- src/DotNetCore.CAP.Dashboard/CAP.DashboardMiddleware.cs
+++ src/DotNetCore.CAP.Dashboard/CAP.DashboardMiddleware.cs
@@ -2,12 +2,13 @@
 // Licensed under the MIT License. See License.txt in the project root for license information.

 using System;
-using System.Linq;
+using System.Globalization;
 using System.Net;
 using System.Threading.Tasks;
 using DotNetCore.CAP.Dashboard;
 using DotNetCore.CAP.Dashboard.GatewayProxy;
 using DotNetCore.CAP.Dashboard.NodeDiscovery;
+using DotNetCore.CAP.Dashboard.Resources;
 using DotNetCore.CAP.Persistence;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
@@ -36,7 +37,6 @@
                 {
                     app.UseMiddleware<GatewayProxyMiddleware>();
                 }
-
                 app.UseMiddleware<DashboardMiddleware>();
             }

@@ -77,7 +77,7 @@
                 app.UseCapDashboard();

                 next(app);
-            };
+            };
         }
     }

@@ -105,6 +105,9 @@
                 await _next(context);
                 return;
             }
+
+            var userLanguages = context.Request.Headers["Accept-Language"].ToString();
+            Strings.Culture = userLanguages.Contains("zh-") ? new CultureInfo("zh-CN") : new CultureInfo("en-US");

             // Update the path
             var path = context.Request.Path;


modified update progress redirect tests

modified update progress redirect tests

--- src/DotVVM.Samples.Tests/Control/UpdateProgressTests.cs
+++ src/DotVVM.Samples.Tests/Control/UpdateProgressTests.cs
@@ -211,8 +211,17 @@
                 sw.Start();
                 while (sw.ElapsedMilliseconds < 2100) // action should take only 2000ms
                 {
-                    spaTextElement = browser.Single("SPA-text", SelectByDataUi);
-                    var spaText = spaTextElement.GetInnerText();
+                    string spaText;
+                    try
+                    {
+                        spaText = browser.Single("SPA-text", SelectByDataUi).GetInnerText();
+                    }
+                    //element changed during retrieval of text.
+                    catch (StaleElementReferenceException)
+                    {
+                        continue;
+                    }
+
                     if (spaText != "SPA2")
                     {
                         AssertUI.IsDisplayed(progress);


Better log messages

Better log messages

--- src/Exceptionless.Core/Jobs/CloseInactiveSessionsJob.cs
+++ src/Exceptionless.Core/Jobs/CloseInactiveSessionsJob.cs
@@ -38,8 +38,10 @@
             var results = await _eventRepository.GetOpenSessionsAsync(SystemClock.UtcNow.SubtractMinutes(1), o => o.SnapshotPaging().PageLimit(100)).AnyContext();
             int sessionsClosed = 0;
             int totalSessions = 0;
-            if (results.Documents.Count == 0)
+            if (results.Documents.Count == 0) {
                 _logger.LogInformation("No open sessions to check.");
+                return JobResult.Success;
+            }

             while (results.Documents.Count > 0 && !context.CancellationToken.IsCancellationRequested) {
                 var inactivePeriodUtc = SystemClock.UtcNow.Subtract(DefaultInactivePeriod);
@@ -94,7 +96,7 @@
                     _lastActivity = SystemClock.UtcNow;
                 }
             }
-            _logger.LogInformation("Done processing active session. Closed {SessionClosedCount} of {SessionCount} sessions", sessionsClosed, totalSessions);
+            _logger.LogInformation("Done checking active sessions. Closed {SessionClosedCount} of {SessionCount} sessions", sessionsClosed, totalSessions);

             return JobResult.Success;
         }


When 404'ing the HttpFileServer now writes a pretty little message to the client.

--- src/Framework/Hadouken.Framework/Http/HttpFileServer.cs
+++ src/Framework/Hadouken.Framework/Http/HttpFileServer.cs
@@ -93,6 +93,11 @@
             else
             {
                 context.Response.StatusCode = 404;
+
+                using (var writer = new StreamWriter(context.Response.OutputStream))
+                {
+                    writer.Write("404 - Not found");
+                }
             }

             context.Response.OutputStream.Close();


Change DefaultGrantStore methods to virtual #1235

--- src/IdentityServer4/Stores/Default/DefaultGrantStore.cs
+++ src/IdentityServer4/Stores/Default/DefaultGrantStore.cs
@@ -18,11 +18,30 @@
     /// <typeparam name="T"></typeparam>
     public class DefaultGrantStore<T>
     {
-        private readonly string _grantType;
-        private readonly ILogger _logger;
-        private readonly IPersistedGrantStore _store;
-        private readonly IPersistentGrantSerializer _serializer;
-        private readonly IHandleGenerationService _handleGenerationService;
+        /// <summary>
+        /// The grant type being stored.
+        /// </summary>
+        protected string GrantType { get; }
+
+        /// <summary>
+        /// The logger.
+        /// </summary>
+        protected ILogger Logger { get; }
+
+        /// <summary>
+        /// The PersistedGrantStore.
+        /// </summary>
+        protected IPersistedGrantStore Store { get; }
+
+        /// <summary>
+        /// The PersistentGrantSerializer;
+        /// </summary>
+        protected IPersistentGrantSerializer Serializer { get; }
+
+        /// <summary>
+        /// The HandleGenerationService.
+        /// </summary>
+        protected IHandleGenerationService HandleGenerationService { get; }

         /// <summary>
         /// Initializes a new instance of the <see cref="DefaultGrantStore{T}"/> class.
@@ -41,11 +60,11 @@
         {
             if (grantType.IsMissing()) throw new ArgumentNullException(nameof(grantType));

-            _grantType = grantType;
-            _store = store;
-            _serializer = serializer;
-            _handleGenerationService = handleGenerationService;
-            _logger = logger;
+            GrantType = grantType;
+            Store = store;
+            Serializer = serializer;
+            HandleGenerationService = handleGenerationService;
+            Logger = logger;
         }

         const string KeySeparator = ":";
@@ -55,9 +74,9 @@
         /// </summary>
         /// <param name="value">The value.</param>
         /// <returns></returns>
-        protected string GetHashedKey(string value)
+        protected virtual string GetHashedKey(string value)
         {
-            return (value + KeySeparator + _grantType).Sha256();
+            return (value + KeySeparator + GrantType).Sha256();
         }

         /// <summary>
@@ -65,25 +84,25 @@
         /// </summary>
         /// <param name="key">The key.</param>
         /// <returns></returns>
-        protected async Task<T> GetItemAsync(string key)
+        protected virtual async Task<T> GetItemAsync(string key)
         {
             var hashedKey = GetHashedKey(key);

-            var grant = await _store.GetAsync(hashedKey);
-            if (grant != null && grant.Type == _grantType)
+            var grant = await Store.GetAsync(hashedKey);
+            if (grant != null && grant.Type == GrantType)
             {
                 try
                 {
-                    return _serializer.Deserialize<T>(grant.Data);
+                    return Serializer.Deserialize<T>(grant.Data);
                 }
                 catch (Exception ex)
                 {
-                    _logger.LogError("Failed to deserailize JSON from grant store. Exception: {0}", ex.Message);
+                    Logger.LogError("Failed to deserailize JSON from grant store. Exception: {0}", ex.Message);
                 }
             }
             else
             {
-                _logger.LogDebug("{grantType} grant with value: {key} not found in store.", _grantType, key);
+                Logger.LogDebug("{grantType} grant with value: {key} not found in store.", GrantType, key);
             }

             return default(T);
@@ -98,9 +117,9 @@
         /// <param name="created">The created.</param>
         /// <param name="lifetime">The lifetime.</param>
         /// <returns></returns>
-        protected async Task<string> CreateItemAsync(T item, string clientId, string subjectId, DateTime created, int lifetime)
+        protected virtual async Task<string> CreateItemAsync(T item, string clientId, string subjectId, DateTime created, int lifetime)
         {
-            var handle = await _handleGenerationService.GenerateAsync();
+            var handle = await HandleGenerationService.GenerateAsync();
             await StoreItemAsync(handle, item, clientId, subjectId, created, created.AddSeconds(lifetime));
             return handle;
         }
@@ -115,7 +134,7 @@
         /// <param name="created">The created.</param>
         /// <param name="lifetime">The lifetime.</param>
         /// <returns></returns>
-        protected Task StoreItemAsync(string key, T item, string clientId, string subjectId, DateTime created, int lifetime)
+        protected virtual Task StoreItemAsync(string key, T item, string clientId, string subjectId, DateTime created, int lifetime)
         {
             return StoreItemAsync(key, item, clientId, subjectId, created, created.AddSeconds(lifetime));
         }
@@ -130,16 +149,16 @@
         /// <param name="created">The created.</param>
         /// <param name="expiration">The expiration.</param>
         /// <returns></returns>
-        protected async Task StoreItemAsync(string key, T item, string clientId, string subjectId, DateTime created, DateTime? expiration)
+        protected virtual async Task StoreItemAsync(string key, T item, string clientId, string subjectId, DateTime created, DateTime? expiration)
         {
             key = GetHashedKey(key);

-            var json = _serializer.Serialize(item);
+            var json = Serializer.Serialize(item);

             var grant = new PersistedGrant
             {
                 Key = key,
-                Type = _grantType,
+                Type = GrantType,
                 ClientId = clientId,
                 SubjectId = subjectId,
                 CreationTime = created,
@@ -147,7 +166,7 @@
                 Data = json
             };

-            await _store.StoreAsync(grant);
+            await Store.StoreAsync(grant);
         }

         /// <summary>
@@ -155,10 +174,10 @@
         /// </summary>
         /// <param name="key">The key.</param>
         /// <returns></returns>
-        protected async Task RemoveItemAsync(string key)
+        protected virtual async Task RemoveItemAsync(string key)
         {
             key = GetHashedKey(key);
-            await _store.RemoveAsync(key);
+            await Store.RemoveAsync(key);
         }

         /// <summary>
@@ -167,9 +186,9 @@
         /// <param name="subjectId">The subject identifier.</param>
         /// <param name="clientId">The client identifier.</param>
         /// <returns></returns>
-        protected async Task RemoveAllAsync(string subjectId, string clientId)
+        protected virtual async Task RemoveAllAsync(string subjectId, string clientId)
         {
-            await _store.RemoveAllAsync(subjectId, clientId, _grantType);
+            await Store.RemoveAllAsync(subjectId, clientId, GrantType);
         }
     }
 }


Fix typo-related bug in DefinitionHandler that causes it to miss regular-style project imports.

--- src/LanguageServer.Engine/Handlers/DefinitionHandler.cs
+++ src/LanguageServer.Engine/Handlers/DefinitionHandler.cs
@@ -11,7 +11,7 @@
 using System.Linq;
 using System.Threading;
 using System.Threading.Tasks;
-
+
 namespace MSBuildProjectTools.LanguageServer.Handlers
 {
     using ContentProviders;
@@ -124,35 +124,32 @@
                 if (msbuildObjectAtPosition == null)
                     return null;

-                if (msbuildObjectAtPosition is MSBuildSdkImport import)
+                if (msbuildObjectAtPosition is MSBuildSdkImport sdkImportAtPosition)
                 {
-                    if (msbuildObjectAtPosition is MSBuildSdkImport sdkImportAtPosition)
-                    {
-                        // TODO: Parse imported project and determine location of root element (use that range instead).
-                        Location[] locations =
-                            sdkImportAtPosition.ImportedProjectRoots.Select(
-                                importedProjectRoot => new Location
-                                {
-                                    Range = Range.Empty.ToLsp(),
-                                    Uri = VSCodeDocumentUri.FromFileSystemPath(importedProjectRoot.Location.File)
-                                }
-                            )
-                            .ToArray();
-
-                        return new LocationOrLocations(locations);
-                    }
-                    else if (msbuildObjectAtPosition is MSBuildImport importAtPosition)
-                    {
-                        // TODO: Parse imported project and determine location of root element (use that range instead).
-                        return new LocationOrLocations(
-                            importAtPosition.ImportedProjectRoots.Select(
-                                importedProjectRoot => new Location
+                    // TODO: Parse imported project and determine location of root element (use that range instead).
+                    Location[] locations =
+                        sdkImportAtPosition.ImportedProjectRoots.Select(
+                            importedProjectRoot => new Location
                             {
                                 Range = Range.Empty.ToLsp(),
                                 Uri = VSCodeDocumentUri.FromFileSystemPath(importedProjectRoot.Location.File)
                             }
-                        ));
-                    }
+                        )
+                        .ToArray();
+
+                    return new LocationOrLocations(locations);
+                }
+                else if (msbuildObjectAtPosition is MSBuildImport importAtPosition)
+                {
+                    // TODO: Parse imported project and determine location of root element (use that range instead).
+                    return new LocationOrLocations(
+                        importAtPosition.ImportedProjectRoots.Select(
+                            importedProjectRoot => new Location
+                            {
+                                Range = Range.Empty.ToLsp(),
+                                Uri = VSCodeDocumentUri.FromFileSystemPath(importedProjectRoot.Location.File)
+                            }
+                    ));
                 }
             }

@@ -175,7 +172,7 @@
         {
             if (parameters == null)
                 throw new ArgumentNullException(nameof(parameters));
-
+
             try
             {
                 return await OnDefinition(parameters, cancellationToken);


Remove old comment

Remove old comment

svn path=/trunk/banshee/; revision=3993

--- src/Libraries/Hyena.Gui/Hyena.Widgets/RatingMenuItem.cs
+++ src/Libraries/Hyena.Gui/Hyena.Widgets/RatingMenuItem.cs
@@ -115,9 +115,6 @@

         private void OnEntryChanged (object o, EventArgs args)
         {
-            // TODO: See what's really better - hiding the menu when the
-            // value is set, or keeping it up; I like it staying up --Aaron
-            //
             if (can_activate) {
                 Activate ();
             }


Allow EditorAttribute on a type

Allow EditorAttribute on a type

--- src/Meziantou.AspNetCore.Components/GenericFormField.cs
+++ src/Meziantou.AspNetCore.Components/GenericFormField.cs
@@ -192,6 +192,7 @@
         [SuppressMessage("Style", "MA0003:Add argument name to improve readability", Justification = "Not needed")]
         private static (Type ComponentType, IEnumerable<KeyValuePair<string, object>>? AdditonalAttributes) GetEditorType(PropertyInfo property)
         {
+            // Check EditorAttribute declared on the property
             var editorAttributes = property.GetCustomAttributes<EditorAttribute>();
             foreach (var editorAttribute in editorAttributes)
             {
@@ -199,6 +200,15 @@
                     return (Type.GetType(editorAttribute.EditorTypeName, throwOnError: true)!, null);
             }

+            // Check EditorAttribute declared on the property type
+            editorAttributes = property.PropertyType.GetCustomAttributes<EditorAttribute>();
+            foreach (var editorAttribute in editorAttributes)
+            {
+                if (editorAttribute.EditorBaseTypeName == typeof(InputBase<>).AssemblyQualifiedName)
+                    return (Type.GetType(editorAttribute.EditorTypeName, throwOnError: true)!, null);
+            }
+
+            // Infer the editor based on the property type and other annotations
             if (property.PropertyType == typeof(bool))
                 return (typeof(InputCheckbox), null);


fix hash message (#3787)

fix hash message (#3787)

--- src/Microsoft.DocAsCode.Build.Engine/DocumentBuilder.cs
+++ src/Microsoft.DocAsCode.Build.Engine/DocumentBuilder.cs
@@ -462,7 +462,7 @@
                     select item)
                 {
                     builder.AppendLine(item);
-                    Logger.LogVerbose($"New assembly info added: 'item'");
+                    Logger.LogVerbose($"New assembly info added: '{item}'");
                 }
                 result = builder.ToString().GetMd5String();
             }


Hard-code CommandBehavior.Default.

Hard-code CommandBehavior.Default.

The only CommandBehavior value that is currently handled is CommandBehavior.CloseConnection, which isn't valid inside a batch.

Signed-off-by: Bradley Grainger <dae7ff431bf350b84a58dc5360c13b9e7c97b48a@gmail.com>

--- src/MySqlConnector/MySql.Data.MySqlClient/MySqlBatch.cs
+++ src/MySqlConnector/MySql.Data.MySqlClient/MySqlBatch.cs
@@ -123,7 +123,7 @@
 				batchCommand.Batch = this;

 			var payloadCreator = Connection.Session.SupportsComMulti ? BatchedCommandPayloadCreator.Instance : SingleCommandPayloadCreator.Instance;
-			return CommandExecutor.ExecuteReaderAsync(BatchCommands, payloadCreator, default /* TODO: */, ioBehavior, cancellationToken);
+			return CommandExecutor.ExecuteReaderAsync(BatchCommands, payloadCreator, CommandBehavior.Default, ioBehavior, cancellationToken);
 		}

 		public override int ExecuteNonQuery() => ExecuteNonQueryAsync(IOBehavior.Synchronous, CancellationToken.None).GetAwaiter().GetResult();
@@ -189,7 +189,7 @@
 			((ICancellableCommand) this).ResetCommandTimeout();
 			var hasSetResult = false;
 			object result = null;
-			using (var reader = (MySqlDataReader) await ExecuteReaderAsync(/* TODO: CommandBehavior.SingleResult | CommandBehavior.SingleRow, */ioBehavior, cancellationToken).ConfigureAwait(false))
+			using (var reader = (MySqlDataReader) await ExecuteReaderAsync(ioBehavior, cancellationToken).ConfigureAwait(false))
 			{
 				do
 				{


LoggingConfigurationChangedEventArgs: remove obsolete OldConfiguration and NewConfiguration

Replaced with ActivatedConfiguration and DeactivatedConfiguration in NLog 4.5

--- src/NLog/Config/LoggingConfigurationChangedEventArgs.cs
+++ src/NLog/Config/LoggingConfigurationChangedEventArgs.cs
@@ -55,26 +55,12 @@
         /// Gets the old configuration.
         /// </summary>
         /// <value>The old configuration.</value>
-        public LoggingConfiguration DeactivatedConfiguration { get; private set; }
+        public LoggingConfiguration DeactivatedConfiguration { get; }

         /// <summary>
         /// Gets the new configuration.
         /// </summary>
         /// <value>The new configuration.</value>
-        public LoggingConfiguration ActivatedConfiguration { get; private set; }
-
-        /// <summary>
-        /// Gets the new configuration
-        /// </summary>
-        /// <value>The new configuration.</value>
-        [Obsolete("This option will be removed in NLog 5. Marked obsolete on NLog 4.5")]
-        public LoggingConfiguration OldConfiguration => ActivatedConfiguration;
-
-        /// <summary>
-        /// Gets the old configuration
-        /// </summary>
-        /// <value>The old configuration.</value>
-        [Obsolete("This option will be removed in NLog 5. Marked obsolete on NLog 4.5")]
-        public LoggingConfiguration NewConfiguration => DeactivatedConfiguration;
+        public LoggingConfiguration ActivatedConfiguration { get; }
     }
 }


Forgot to implement free method in int32array

--- src/NativeTypes/rosidl_generator_c__primitive_arrays.cs
+++ src/NativeTypes/rosidl_generator_c__primitive_arrays.cs
@@ -311,6 +311,12 @@
 		{
 			get{ return Marshal.PtrToStructure<Int32[]> (Data);}
 		}
+		public void Free()
+		{
+			if(Data != IntPtr.Zero)
+				Marshal.FreeHGlobal (Data);
+
+		}
 	}
 	[StructLayout(LayoutKind.Sequential)]
 	public struct rosidl_generator_c__primitive_array_uint32:IRosTransportItem


Adding constructor changes

Adding constructor changes

--- src/Nether.Analytics.EventHubs/EventHubOutputManager.cs
+++ src/Nether.Analytics.EventHubs/EventHubOutputManager.cs
@@ -10,10 +10,21 @@
     public class EventHubOutputManager : IOutputManager
     {
         private string _outputEventHubConnectionString;
+        private IOutputFormatter _serializer;
+        private string _ehConnectionString;

-        public EventHubOutputManager(string outputEventHubConnectionString)
+        /// <summary>
+        /// Creates a new instance, with a JSON output formatter as the default serializer.
+        /// </summary>
+        /// <param name="outputEventHubConnectionString">The connection string for the event hub output.</param>
+        public EventHubOutputManager(string outputEventHubConnectionString) : this(outputEventHubConnectionString, new JsonOutputFormatter())
         {
-            _outputEventHubConnectionString = outputEventHubConnectionString;
+        }
+
+        public EventHubOutputManager(string outputEventHubConnectionString, IOutputFormatter serializer)
+        {
+            _serializer = serializer;
+            _ehConnectionString = outputEventHubConnectionString;
         }

         public Task FlushAsync()


Adding Recycle Bin local nav to admin menu.

--- src/Orchard.Web/Modules/Orchard.AuditTrail/AdminMenu.cs
+++ src/Orchard.Web/Modules/Orchard.AuditTrail/AdminMenu.cs
@@ -7,9 +7,15 @@

         public void GetNavigation(NavigationBuilder builder) {
             builder.AddImageSet("audittrail")
-                .Add(T("Audit Trail"), "12", menuItem => menuItem
+                .Add(T("Audit Trail"), "12", auditTrail => auditTrail
                     .Action("Index", "Admin", new { area = "Orchard.AuditTrail" })
-                    .Permission(Permissions.ManageAuditTrailSettings));
+                    .Permission(Permissions.ManageAuditTrailSettings)
+                    .Add(T("History"), "1", history => history
+                        .Action("Index", "Admin", new { area = "Orchard.AuditTrail" })
+                        .LocalNav())
+                    .Add(T("Recycle Bin"), "2", history => history
+                        .Action("Index", "RecycleBin", new { area = "Orchard.AuditTrail" })
+                        .LocalNav()));
         }
     }
 }


Add handlers to verify route

Add handlers to verify route

--- src/Stormpath.Owin.Middleware/Route/VerifyEmailRoute.cs
+++ src/Stormpath.Owin.Middleware/Route/VerifyEmailRoute.cs
@@ -38,10 +38,17 @@
         private async Task<bool> ResendVerification(
             string email,
             IClient client,
+            IOwinEnvironment environment,
             Func<ResourceException, CancellationToken, Task<bool>> errorHandler,
             Func<CancellationToken, Task<bool>> successHandler,
             CancellationToken cancellationToken)
         {
+            var preVerifyEmailContext = new PreVerifyEmailContext(environment)
+            {
+                Email = email
+            };
+            await _handlers.PreVerifyEmailHandler(preVerifyEmailContext, cancellationToken);
+
             var application = await client.GetApplicationAsync(_configuration.Application.Href, cancellationToken);

             try
@@ -54,6 +61,7 @@
                 // address.  We don't want to leak information about the account
                 // list, so allow this continue without error.
                 _logger.Info($"A user tried to resend their account verification email, but failed: {rex.DeveloperMessage}");
+                return await successHandler(cancellationToken);
             }
             catch (ResourceException rex) when (errorHandler != null)
             {
@@ -79,7 +87,10 @@

             try
             {
-                await client.VerifyAccountEmailAsync(spToken, cancellationToken);
+                var account = await client.VerifyAccountEmailAsync(spToken, cancellationToken);
+
+                var postVerifyEmailContext = new PostVerifyEmailContext(context, account);
+                await _handlers.PostVerifyEmailHandler(postVerifyEmailContext, cancellationToken);

                 return await HttpResponse.Redirect(context, $"{_configuration.Web.VerifyEmail.NextUri}?status=verified");
             }
@@ -110,14 +121,12 @@
                 return true;
             });

-            var htmlSuccessHandler = new Func<CancellationToken, Task<bool>>(ct =>
-            {
-                return HttpResponse.Redirect(context, $"{_configuration.Web.VerifyEmail.NextUri}?status=unverified");
-            });
+            var htmlSuccessHandler = new Func<CancellationToken, Task<bool>>(ct => HttpResponse.Redirect(context, $"{_configuration.Web.VerifyEmail.NextUri}?status=unverified"));

             return await ResendVerification(
                 model.Email,
                 client,
+                context,
                 htmlErrorHandler,
                 htmlSuccessHandler,
                 cancellationToken);
@@ -133,8 +142,11 @@
                 return await Error.Create(context, new BadRequest("sptoken parameter not provided."), cancellationToken);
             }

-            await client.VerifyAccountEmailAsync(spToken, cancellationToken);
+            var account = await client.VerifyAccountEmailAsync(spToken, cancellationToken);
             // Errors are caught in AbstractRouteMiddleware
+
+            var postVerifyEmailContext = new PostVerifyEmailContext(context, account);
+            await _handlers.PostVerifyEmailHandler(postVerifyEmailContext, cancellationToken);

             return await JsonResponse.Ok(context);
         }
@@ -143,14 +155,12 @@
         {
             var model = await PostBodyParser.ToModel<VerifyEmailPostModel>(context, bodyContentType, _logger, cancellationToken);

-            var jsonSuccessHandler = new Func<CancellationToken, Task<bool>>(ct =>
-            {
-                return JsonResponse.Ok(context);
-            });
+            var jsonSuccessHandler = new Func<CancellationToken, Task<bool>>(ct => JsonResponse.Ok(context));

             return await ResendVerification(
                 email: model.Email,
                 client: client,
+                environment: context,
                 errorHandler: null, // Errors are caught in AbstractRouteMiddleware
                 successHandler: jsonSuccessHandler,
                 cancellationToken: cancellationToken);


Fix when received RSS items.

Fix when received RSS items.

--- Applications/Rss/Reader/Models/Rss/RssSubscriber.cs
+++ Applications/Rss/Reader/Models/Rss/RssSubscriber.cs
@@ -195,8 +195,8 @@
             var dest = Find<RssFeed>(src.Uri);
             if (dest == null) return;

-            var items = src.Items.Shrink(dest.LastChecked);
-            foreach (var item in items) dest.Items.Insert(0, item);
+            src.Items = src.Items.Shrink(dest.LastChecked).ToList();
+            foreach (var item in src.Items) dest.Items.Insert(0, item);

             dest.Description   = src.Description;
             dest.Link          = src.Link;


Added partial support for wireless security profiles.

--- tik4net.objects/Interface/InterfaceWireless.cs
+++ tik4net.objects/Interface/InterfaceWireless.cs
@@ -17,6 +17,125 @@
     {
         #region Submenu classes
         /// <summary>
+        /// Wireless security profiles
+        /// </summary>
+        [TikEntity("interface/wireless/security-profiles")]
+        public class WirelessSecurityProfile
+        {
+            /// <summary>
+            /// .id: primary key of row
+            /// </summary>
+            [TikProperty(".id", IsReadOnly = true, IsMandatory = true)]
+            public string Id { get; private set; }
+
+            /// <summary>
+            /// comment
+            /// </summary>
+            [TikProperty("comment")]
+            public String Comment { get; set; }
+
+            /// <summary>
+            /// Mode for <see cref="Mode"/>.
+            /// </summary>
+            public enum SecurityMode
+            {
+                /// <summary>
+                /// dynamic-keys - WPA mode.
+                /// </summary>
+                [TikEnum("dynamic-keys")]
+                DynamicKeys,
+
+                /// <summary>
+                /// none - Encryption is not used. Encrypted frames are not accepted.
+                /// </summary>
+                [TikEnum("none")]
+                None,
+
+                /// <summary>
+                /// static-keys-optional - WEP mode. Support encryption and decryption, but allow also to receive and send unencrypted frames. Device will send unencrypted frames if encryption algorithm is specified as none.
+                /// Station in static-keys-optional mode will not connect to an access point in static-keys-required mode.
+                /// </summary>
+                [TikEnum("static-keys-optional")]
+                StaticKeysOptional,
+
+                /// <summary>
+                /// static-keys-required - WEP mode. Do not accept and do not send unencrypted frames.
+                /// </summary>
+                [TikEnum("static-keys-required")]
+                StaticKeysRequiered
+            }
+
+            /// <summary>
+            /// mode
+            /// </summary>
+            [TikProperty("mode", IsMandatory = true)]
+            public SecurityMode /* none, static-keys-optional, static-keys-required, dynamic-keys*/Mode { get; set; }
+
+            /// <summary>
+            /// name
+            /// </summary>
+            [TikProperty("name", IsMandatory = true)]
+            public String Name { get; set; }
+
+            /// <summary>
+            /// management-protection
+            /// </summary>
+            [TikProperty("management-protection")]
+            public bool ManagementProtection { get; set; }
+
+            /// <summary>
+            /// management-protection-key
+            /// </summary>
+            [TikProperty("management-protection-key")]
+            public String ManagementProtectionKey { get; set; }
+
+            /// <summary>
+            /// wpa-pre-shared-key
+            /// </summary>
+            [TikProperty("wpa-pre-shared-key")]
+            public String WpaPreSharedKey { get; set; }
+
+            /// <summary>
+            /// wpa2-pre-shared-key
+            /// </summary>
+            [TikProperty("wpa2-pre-shared-key")]
+            public String Wpa2PreSharedKey { get; set; }
+
+            /// <summary>
+            /// authentication-types
+            /// Comma seperated string
+            /// </summary>
+            [TikProperty("authentication-types")]
+            public String AuthenticationTypes { get; set; }
+
+            /// <summary>
+            /// group-ciphers
+            /// Comma seperated string
+            /// </summary>
+            [TikProperty("group-ciphers")]
+            public String /*tkip, aes-ccm*/GroupCiphers { get; set; }
+
+            /// <summary>
+            /// unicast-ciphers
+            /// Comma seperated string
+            /// </summary>
+            [TikProperty("unicast-ciphers")]
+            public String /*tkip, aes-ccm*/UnicastCiphers { get; set; }
+
+            /// <summary>
+            /// supplicant-identity
+            /// </summary>
+            [TikProperty("supplicant-identity")]
+            public String /*tkip, aes-ccm*/SupplicantIdentiy { get; set; }
+
+            /// <summary>
+            /// group-key-update - (time interval in the 30s..1h range; default value: 5m) : Controls how often access point updates group key. This key is used to encrypt all broadcast and multicast frames.
+            /// </summary>
+            [TikProperty("group-key-update")]
+            public String GroupKeyUpdate { get; set; }
+        }
+
+        /// <summary>
         /// Access list is used by access point to restrict allowed connections from other devices, and to control connection parameters.
         /// Operation:
         ///     Access list rules are checked sequentially.
@@ -378,13 +497,13 @@
             /// rx-rate: receive data rate
             /// </summary>
             [TikProperty("rx-rate", IsReadOnly = true)]
-            public int RxRate { get; private set; }
+            public string RxRate { get; private set; }

             /// <summary>
             /// signal-strength: average strength of the client signal recevied by the AP
             /// </summary>
             [TikProperty("signal-strength", IsReadOnly = true)]
-            public int SignalStrength { get; private set; }
+            public string SignalStrength { get; private set; }

             /// <summary>
             /// signal-strength-ch0:
@@ -741,7 +860,7 @@
         /// integer [0..4294967295]
         /// </summary>
         [TikProperty("frequency")]
-        public long/*integer [0..4294967295]*/ Frequency { get; set; }
+        public String/*integer [0..4294967295], string "auto"*/ Frequency { get; set; }

         /// <summary>
         /// frequency-mode


Fixes to (de)serialization of objects which are sub-types of given property type.

--- Source/Qi4CS.Extensions.Configuration.XML/XMLConfigurationSerializer.cs
+++ Source/Qi4CS.Extensions.Configuration.XML/XMLConfigurationSerializer.cs
@@ -313,7 +313,7 @@
                            // Parse recursively all content.
                            var resultBuilder = this._ssp.NewPlainCompositeBuilder( type );
                            var proto = resultBuilder.PrototypeFor( type );
-                           foreach ( var prop in type.GetAllParentTypes().SelectMany( t => t.GetProperties( System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public ) ) )
+                           foreach ( var prop in proto.GetType().GetAllParentTypes( false ).SelectMany( t => t.GetProperties( System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.DeclaredOnly ) ) )
                            {
                               var propElement = element.Element( prop.Name );
                               if ( propElement != null )
@@ -417,7 +417,8 @@
                      if ( !serialized )
                      {
                         // Serialize recursively all properties
-                        foreach ( var prop in type.GetAllParentTypes().SelectMany( t => t.GetProperties( BindingFlags.Instance | BindingFlags.Public ) ) )
+                        // Assume that this is Qi4CS composite instance -> get properties of all parent types (since this type is Qi4CS generated)
+                        foreach ( var prop in obj.GetType().GetAllParentTypes( false ).SelectMany( t => t.GetProperties( BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly ) ) )
                         {
                            result.AddIfNotNull( this.Serialize( prop.GetGetMethod().Invoke( obj, null ), prop.PropertyType, prop.Name, prop ) );
                         }


Give a little more time for queues to be created...

--- Source/Slinqy.Test.Functional/Models/ExampleAppPages/CreateQueueForm.cs
+++ Source/Slinqy.Test.Functional/Models/ExampleAppPages/CreateQueueForm.cs
@@ -100,7 +100,7 @@
             this.createQueueButton.Click();

             // Wait for it to finish
-            this.createQueueAjaxStatusSection.WaitForResult(maxDuration: TimeSpan.FromSeconds(15));
+            this.createQueueAjaxStatusSection.WaitForResult(maxDuration: TimeSpan.FromSeconds(30));

             // Return queue info
             return new ManageQueueSection(this.WebBrowserDriver);