グローバルコレクションの親に関するテストを修正．

グローバルコレクションの親に関するテストを修正．

定理が間違っていたものを修正．
関数名を定理に合わせて修正．

--- UnitTest/ParserTests/ParentTheory.cs
+++ UnitTest/ParserTests/ParentTheory.cs
@@ -15,42 +15,44 @@

         [Theory]
-        public void AllElSetParentTest(Input data)
+        public void ParentOfGlobalElSetItemsShouldBeNull(Input data)
         {
             //Assert.Fail();
             Assume.That(data.Value, Is.Not.Null.Or.Empty);
             var model = parser.parse_string(data);
-            model.all_elsets.ForEach(kv => Assert.AreSame(model.all_elsets, kv.Value.parent));
+            model.global_elsets.ForEach(kv => Assert.That(kv.Value.parent, Is.Null));
         }

         [Theory]
-        public void AllNSetsParentTest(Input data)
+        public void ParentOfGlobalNSetsItemsShouldBeNull(Input data)
         {
             //Assert.Fail();
             Assume.That(data.Value, Is.Not.Null.Or.Empty);
             var model = parser.parse_string(data);
-            model.all_nsets.ForEach(kv => Assert.AreSame(model.all_nsets, kv.Value.parent));
+            model.global_nsets.ForEach(kv => Assert.That(kv.Value.parent, Is.Null));
         }

         [Theory]
-        public void AllElementParentTest(Input data)
+        public void ParentOfGlobalElementItemShouldNotBeNullAndSelf(Input data)
         {
             //Assert.Fail();
             Assume.That(data.Value, Is.Not.Null.Or.Empty);
             var model = parser.parse_string(data);

             // 要素は共通の為親は一致しない．
-            model.all_elements.ForEach(kv => Assert.That(kv.Value.parent, Is.Not.SameAs(model.all_elements)));
+            model.global_elements.ForEach(kv => Assert.That(kv.Value.parent, Is.Not.Null));
+            model.global_elements.ForEach(kv => Assert.That(kv.Value.parent, Is.Not.SameAs(model.global_elements)));
         }

         [Theory]
-        public void AllNodeParentTest(Input data)
+        public void ParentOfAllNodesItemsShouldNotBeNullAndSelf(Input data)
         {
             //Assert.Fail();
             Assume.That(data.Value, Is.Not.Null.Or.Empty);
             var model = parser.parse_string(data);
             // 節点は共通の為親は一致しない．
-            model.all_nodes.ForEach(kv => Assert.That(kv.Value.parent, Is.Not.SameAs(model.all_nodes)));
+            model.global_nodes.ForEach(kv => Assert.That(kv.Value.parent, Is.Not.Null));
+            model.global_nodes.ForEach(kv => Assert.That(kv.Value.parent, Is.Not.SameAs(model.global_nodes)));
         }

     }


Instead of creating one target per imported targets file, create one target for all imported targets files.

--- Common/MsBuildProjectUtility.cs
+++ Common/MsBuildProjectUtility.cs
@@ -1,61 +1,64 @@
 using System;
-using System.Collections.Generic;
 using System.Globalization;
 using System.Linq;
-using System.Runtime.Remoting.Metadata.W3cXsd2001;
-using System.Text;
-using System.Threading.Tasks;
+using Microsoft.Build.Construction;
 using MsBuildProject = Microsoft.Build.Evaluation.Project;

 namespace NuGet
 {
     public static class MSBuildProjectUtility
     {
+        private const string targetName = "EnsureNuGetPackageBuildImports";
+
         public static void AddEnsureImportedTarget(MsBuildProject buildProject, string targetsPath)
         {
-            // first remove the target if it already exits.
-            RemoveEnsureImportedTarget(buildProject, targetsPath);
+            // get the target
+            var targetElement = buildProject.Xml.Targets.FirstOrDefault(
+                target => target.Name.Equals(targetName, StringComparison.OrdinalIgnoreCase));

-            var targetName = GetNameOfEnsureImportedTarget(targetsPath);
-            var target = buildProject.Xml.AddTarget(targetName);
-            target.Condition = "!Exists('" + targetsPath + "')";
+            // if the target does not exist, create the target
+            if (targetElement == null)
+            {
+                targetElement = buildProject.Xml.AddTarget(targetName);

-            // PrepareForBuild is used here because BeforeBuild does not work for VC++ projects.
-            target.BeforeTargets = "PrepareForBuild";
+                // PrepareForBuild is used here because BeforeBuild does not work for VC++ projects.
+                targetElement.BeforeTargets = "PrepareForBuild";

-            var errorTask = target.AddTask("Error");
+                var propertyGroup = targetElement.AddPropertyGroup();
+                propertyGroup.AddProperty("ErrorText", CommonResources.EnsureImportedMessage);
+            }
+
+            var errorTask = targetElement.AddTask("Error");
+            errorTask.Condition = "!Exists('" + targetsPath + "')";
             var errorText = string.Format(
                 CultureInfo.InvariantCulture,
-                CommonResources.EnsureImportedMessage,
+                @"$([System.String]::Format('$(ErrorText)', '{0}'))",
                 targetsPath);
             errorTask.SetParameter("Text", errorText);
         }

         public static void RemoveEnsureImportedTarget(MsBuildProject buildProject, string targetsPath)
         {
-            if (buildProject.Xml.Targets != null)
+            var targetElement = buildProject.Xml.Targets.FirstOrDefault(
+                target => string.Equals(target.Name, targetName, StringComparison.OrdinalIgnoreCase));
+            if (targetElement == null)
             {
-                var targetName = GetNameOfEnsureImportedTarget(targetsPath);
-                var targetElement = buildProject.Xml.Targets.FirstOrDefault(
-                    target => target.Name.Equals(targetName, StringComparison.OrdinalIgnoreCase));
-                if (targetElement != null)
-                {
-                    targetElement.Parent.RemoveChild(targetElement);
-                }
+                return;
             }
-        }

-        /// <summary>
-        /// Returns the name of the target that is used to ensure targetsPath is imported.
-        /// </summary>
-        /// <param name="targetsPath">The targetsPath.</param>
-        /// <returns>the name of the target.</returns>
-        private static string GetNameOfEnsureImportedTarget(string targetsPath)
-        {
-            var pathBytes = Encoding.UTF8.GetBytes(targetsPath);
-            var hashProvider = new CryptoHashProvider("SHA256");
-            var hash = new SoapHexBinary(hashProvider.CalculateHash(pathBytes)).ToString();
-            return "EnsureImported" + hash;
+            string errorCondition = "!Exists('" + targetsPath + "')";
+            var taskElement = targetElement.Tasks.FirstOrDefault(
+                task => string.Equals(task.Condition, errorCondition, StringComparison.OrdinalIgnoreCase));
+            if (taskElement == null)
+            {
+                return;
+            }
+
+            taskElement.Parent.RemoveChild(taskElement);
+            if (targetElement.Tasks.Count == 0)
+            {
+                targetElement.Parent.RemoveChild(targetElement);
+            }
         }
     }
 }


updated vertical series

updated vertical series

--- WpfView/Series/VerticalLineSeries.cs
+++ WpfView/Series/VerticalLineSeries.cs
@@ -128,7 +128,7 @@
             {
                 pbv.IsNew = false;
                 point.SeriesView.Model.Chart.View
-                    .EnsureElementBelongsToCurrentDrawMargin(pbv.Ellipse);
+                    .EnsureElementBelongsToCurrentDrawMargin(pbv.Shape);
                 point.SeriesView.Model.Chart.View
                     .EnsureElementBelongsToCurrentDrawMargin(pbv.HoverShape);
                 point.SeriesView.Model.Chart.View
@@ -155,27 +155,27 @@
                 Model.Chart.View.AddToDrawMargin(pbv.HoverShape);
             }

-            if (Math.Abs(PointDiameter) > 0.1 && pbv.Ellipse == null)
-            {
-                pbv.Ellipse = new Ellipse();
-
-                BindingOperations.SetBinding(pbv.Ellipse, Shape.FillProperty,
+            if (Math.Abs(PointDiameter) > 0.1 && pbv.Shape == null)
+            {
+                pbv.Shape = new Ellipse();
+
+                BindingOperations.SetBinding(pbv.Shape, Shape.FillProperty,
                     new Binding { Path = new PropertyPath(PointForeroundProperty), Source = this });
-                BindingOperations.SetBinding(pbv.Ellipse, Shape.StrokeProperty,
+                BindingOperations.SetBinding(pbv.Shape, Shape.StrokeProperty,
                     new Binding { Path = new PropertyPath(StrokeProperty), Source = this });
-                BindingOperations.SetBinding(pbv.Ellipse, Shape.StrokeThicknessProperty,
+                BindingOperations.SetBinding(pbv.Shape, Shape.StrokeThicknessProperty,
                     new Binding { Path = new PropertyPath(StrokeThicknessProperty), Source = this });
-                BindingOperations.SetBinding(pbv.Ellipse, WidthProperty,
+                BindingOperations.SetBinding(pbv.Shape, WidthProperty,
                     new Binding { Path = new PropertyPath(PointDiameterProperty), Source = this });
-                BindingOperations.SetBinding(pbv.Ellipse, HeightProperty,
+                BindingOperations.SetBinding(pbv.Shape, HeightProperty,
                     new Binding { Path = new PropertyPath(PointDiameterProperty), Source = this });

-                BindingOperations.SetBinding(pbv.Ellipse, VisibilityProperty,
+                BindingOperations.SetBinding(pbv.Shape, VisibilityProperty,
                     new Binding { Path = new PropertyPath(VisibilityProperty), Source = this });

-                Panel.SetZIndex(pbv.Ellipse, int.MaxValue - 2);
-
-                Model.Chart.View.AddToDrawMargin(pbv.Ellipse);
+                Panel.SetZIndex(pbv.Shape, int.MaxValue - 2);
+
+                Model.Chart.View.AddToDrawMargin(pbv.Shape);
             }

             if (DataLabels && pbv.DataLabel == null)


combining engine should write logs

combining engine should write logs

--- Recorder/Utilities/CombiningEngine.cs
+++ Recorder/Utilities/CombiningEngine.cs
@@ -47,7 +47,8 @@

             Directory.CreateDirectory(ObjectModel.OutputFolder);
             Process.StartInfo.Arguments = string.Format(ArgumentFormat, CombineFilePath, ObjectModel.OutputFile);
-
+            Process.StartInfo.EnvironmentVariables["FFREPORT"] = $"file={ObjectModel.ProjectCode}_{ ObjectModel.Barcode}.log:level=32";
+            Process.StartInfo.WorkingDirectory = ObjectModel.OutputFolder;
             Process.Start();

             Process.BeginErrorReadLine();


Fix test

Fix test

(should've been done in the last commit when JsonReader's ReadProperties method was modified)

--- XSerializer.Tests/JsonReaderTests.cs
+++ XSerializer.Tests/JsonReaderTests.cs
@@ -125,6 +125,9 @@

             var reader = new JsonReader(new StringReader(json), new JsonSerializeOperationInfo());

+            Assert.That(reader.ReadContent(), Is.True);
+            Assert.That(reader.NodeType, Is.EqualTo(JsonNodeType.OpenObject));
+
             var enumerator = reader.ReadProperties().GetEnumerator();

             Assert.That(enumerator.MoveNext(), Is.True);


Create OnPropertyChanged for generated nullable properties

--- XmlSchemaClassGenerator/TypeModel.cs
+++ XmlSchemaClassGenerator/TypeModel.cs
@@ -524,7 +524,30 @@
                     var setValueStatement = new CodeAssignStatement(valueExpression, getValueOrDefaultExpression);
                     var hasValueExpression = new CodePropertyReferenceExpression(new CodePropertySetValueReferenceExpression(), "HasValue");
                     var setSpecifiedStatement = new CodeAssignStatement(specifiedExpression, hasValueExpression);
-                    nullableMember.SetStatements.AddRange(new CodeStatement[] { setValueStatement, setSpecifiedStatement });
+
+                    var statements = new List<CodeStatement>();
+                    if (withDataBinding)
+                    {
+                        var ifNotEquals = new CodeConditionStatement(
+                            new CodeBinaryOperatorExpression(
+                                new CodeMethodInvokeExpression(valueExpression, "Equals", getValueOrDefaultExpression),
+                                CodeBinaryOperatorType.ValueEquality,
+                                new CodePrimitiveExpression(false)
+                                ),
+                            setValueStatement,
+                            setSpecifiedStatement,
+                            new CodeExpressionStatement(new CodeMethodInvokeExpression(null, "OnPropertyChanged",
+                                new CodePrimitiveExpression(Name)))
+                            );
+                        statements.Add(ifNotEquals);
+                    }
+                    else
+                    {
+                        statements.Add(setValueStatement);
+                        statements.Add(setSpecifiedStatement);
+                    }
+
+                    nullableMember.SetStatements.AddRange(statements.ToArray());

                     typeDeclaration.Members.Add(nullableMember);

@@ -646,7 +669,7 @@
                 attribute.Arguments.Add(new CodeAttributeArgument("IsNullable", new CodePrimitiveExpression(true)));

             var simpleModel = Type as SimpleModel;
-            if (simpleModel != null && (simpleModel.XmlSchemaType.IsDataTypeAttributeAllowed() ?? simpleModel.UseDataTypeAttribute))
+            if (simpleModel != null && simpleModel.UseDataTypeAttribute)
             {
                 var name = Type.XmlSchemaType.GetQualifiedName();
                 if (name.Namespace == XmlSchema.Namespace)


Minor bug with line drawing on 3d button

--- SadConsole/UI/Themes/Button3dTheme.cs
+++ SadConsole/UI/Themes/Button3dTheme.cs
@@ -70,7 +70,7 @@

                 // Side line 1
                 button.Surface.DrawLine(new Point(shadowBounds.MaxExtentX - 1, shadowBounds.Y),
-                    new Point(shadowBounds.MaxExtentX, shadowBounds.MaxExtentY), _shade.Glyph, _shade.Foreground, _shade.Background);
+                    new Point(shadowBounds.MaxExtentX - 1, shadowBounds.MaxExtentY), _shade.Glyph, _shade.Foreground, _shade.Background);

                 // Side line 2
                 button.Surface.DrawLine(new Point(shadowBounds.MaxExtentX, shadowBounds.Y),


[fix] generating xml element attributes was wrong when derived types are defined in different namespaces compared to owning type namespace

--- XmlSchemaClassGenerator/TypeModel.cs
+++ XmlSchemaClassGenerator/TypeModel.cs
@@ -1025,7 +1025,8 @@
                         {
                             var derivedAttribute = new CodeAttributeDeclaration(new CodeTypeReference(typeof(XmlElementAttribute), Configuration.CodeTypeReferenceOptions),
                                 new CodeAttributeArgument(new CodePrimitiveExpression((derivedType.SubstitutionName ?? derivedType.XmlSchemaName).Name)),
-                                new CodeAttributeArgument("Type", new CodeTypeOfExpression(derivedType.GetReferenceFor(OwningType.Namespace))));
+                                new CodeAttributeArgument("Type", new CodeTypeOfExpression(derivedType.GetReferenceFor(OwningType.Namespace))),
+                                new CodeAttributeArgument("Namespace", new CodePrimitiveExpression(derivedType.XmlSchemaName.Namespace)));
                             if (Order != null)
                             {
                                 derivedAttribute.Arguments.Add(new CodeAttributeArgument("Order",
@@ -1056,19 +1057,23 @@

             foreach (var attribute in attributes)
             {
-                if (XmlNamespace != null)
-                {
-                    attribute.Arguments.Add(new CodeAttributeArgument("Namespace", new CodePrimitiveExpression(XmlNamespace)));
-                }
-                else if (Form == XmlSchemaForm.Qualified)
-                {
-                    attribute.Arguments.Add(new CodeAttributeArgument("Namespace", new CodePrimitiveExpression(OwningType.XmlSchemaName.Namespace)));
-                }
-                else if (!IsAny)
-                {
-                    attribute.Arguments.Add(new CodeAttributeArgument("Form",
-                        new CodeFieldReferenceExpression(new CodeTypeReferenceExpression(new CodeTypeReference(typeof(XmlSchemaForm), Configuration.CodeTypeReferenceOptions)),
-                            "Unqualified")));
+                bool namespacePrecalculated = attribute.Arguments.OfType<CodeAttributeArgument>().Any(a => a.Name == "Namespace");
+                if (!namespacePrecalculated)
+                {
+                    if (XmlNamespace != null)
+                    {
+                        attribute.Arguments.Add(new CodeAttributeArgument("Namespace", new CodePrimitiveExpression(XmlNamespace)));
+                    }
+                    else if (Form == XmlSchemaForm.Qualified)
+                    {
+                        attribute.Arguments.Add(new CodeAttributeArgument("Namespace", new CodePrimitiveExpression(OwningType.XmlSchemaName.Namespace)));
+                    }
+                    else if (!IsAny)
+                    {
+                        attribute.Arguments.Add(new CodeAttributeArgument("Form",
+                            new CodeFieldReferenceExpression(new CodeTypeReferenceExpression(new CodeTypeReference(typeof(XmlSchemaForm), Configuration.CodeTypeReferenceOptions)),
+                                "Unqualified")));
+                    }
                 }

                 if (IsNillable)


ENHANCE: Channel get count method

ENHANCE: Channel get count method

Method to get the number of elements in the underlying queue of a
channel.

--- ConcurrencyUtilities/Channel.cs
+++ ConcurrencyUtilities/Channel.cs
@@ -41,7 +41,7 @@
         }

 		/// <summary>
-		/// Take an item from the Channel
+		/// 	Take an item from the Channel
 		/// </summary>
         public virtual T Take()
         {
@@ -51,5 +51,18 @@
                 return channelQueue.Dequeue();
             }
         }
+
+		/// <summary>
+		/// 	Safely get the number of elements in the underlying queue.
+		/// </summary>
+		public int count()
+		{
+			int count;
+			lock (lockObject)
+			{
+				count = channelQueue.Count;
+			}
+			return count;
+		}
     }
 }


Sort errors by Start, then Length property.

--- Sandra.UI.WF.Chess/SettingsTextBox.cs
+++ Sandra.UI.WF.Chess/SettingsTextBox.cs
@@ -219,6 +219,13 @@
             }
             else
             {
+                errors.Sort((x, y)
+                    => x.Start < y.Start ? -1
+                    : x.Start > y.Start ? 1
+                    : x.Length < y.Length ? -1
+                    : x.Length > y.Length ? 1
+                    : 0);
+
                 currentErrors = errors;

                 foreach (var error in errors)


fixes #71

fixes #71

--- ZUGFeRD/InvoiceDescriptor21Writer.cs
+++ ZUGFeRD/InvoiceDescriptor21Writer.cs
@@ -176,9 +176,12 @@
                         #region IssueDateTime
                         if (tradeLineItem.BuyerOrderReferencedDocument.IssueDateTime.HasValue)
                         {
-                            Writer.WriteStartElement("ram:IssueDateTime");
-                            Writer.WriteValue(_formatDate(tradeLineItem.BuyerOrderReferencedDocument.IssueDateTime.Value, false));
-                            Writer.WriteEndElement(); // !ram:IssueDateTime
+                            Writer.WriteStartElement("ram:FormattedIssueDateTime");
+                            Writer.WriteStartElement("qdt:DateTimeString");
+                            Writer.WriteAttributeString("format", "102");
+                            Writer.WriteValue(_formatDate(tradeLineItem.BuyerOrderReferencedDocument.IssueDateTime.Value));
+                            Writer.WriteEndElement(); // !qdt:DateTimeString
+                            Writer.WriteEndElement(); // !ram:FormattedIssueDateTime
                         }
                         #endregion


Calculate indent inside comment nullcheck.

--- Sandra.UI.WF/Storage/SettingWriter.cs
+++ Sandra.UI.WF/Storage/SettingWriter.cs
@@ -162,10 +162,11 @@

         private List<string> GetCommentLines(SettingComment comment)
         {
-            int indent = currentDepth * Indentation;
             List<string> lines = new List<string>();
             if (comment != null)
             {
+                int indent = currentDepth * Indentation;
+
                 bool first = true;
                 foreach (var paragraph in comment.Paragraphs)
                 {


Fixed minor issue with select menu item + Refactoring.

--- ScorpicoreRush/ScorpicoreRush/Menu.cs
+++ ScorpicoreRush/ScorpicoreRush/Menu.cs
@@ -49,32 +49,18 @@
                     key = cki.KeyChar;

                     if (cki.Key == ConsoleKey.DownArrow)
-                    {
-                        if (choice >= 0 && choice <= numItems)
-                        {
-                           choice++;
-                        }
-                        else if (choice > numItems)
+                    {
+                        choice++;
+                        if (choice > numItems)
                         {
                             choice = 0;
                         }
-                        else if (choice < 0)
-                        {
-                            choice = numItems;
-                        }
                         DisplayMenuOptions(choice);
                     }
                     else if (cki.Key == ConsoleKey.UpArrow)
-                    {
-                        if (choice >= 0 && choice <= numItems)
-                        {
-                            choice--;
-                        }
-                        else if (choice > numItems)
-                        {
-                            choice = 0;
-                        }
-                        else if (choice < 0)
+                    {
+                        choice--;
+                        if (choice < 0)
                         {
                             choice = numItems;
                         }


Two fixes for resolving paths on Unix-like systems: 1. Use Path.DirectorySeparatorChar instead of “\” when assigning BaseDirectory and OutputDirectory. 2. It’s possible that dnlib could provide the location of a module as a path relative to the current directory (in my observation).  Since Utils.GetRelativePath throws an exception when “filespec” is a relative path, the parameter must be made into an absolute path first.

--- Confuser.Core/ConfuserEngine.cs
+++ Confuser.Core/ConfuserEngine.cs
@@ -75,8 +75,8 @@
 				asmResolver.EnableTypeDefCache = true;
 				asmResolver.DefaultModuleContext = new ModuleContext(asmResolver);
 				context.Resolver = asmResolver;
-				context.BaseDirectory = Path.Combine(Environment.CurrentDirectory, parameters.Project.BaseDirectory + "\\");
-				context.OutputDirectory = Path.Combine(parameters.Project.BaseDirectory, parameters.Project.OutputDirectory + "\\");
+				context.BaseDirectory = Path.Combine(Environment.CurrentDirectory, parameters.Project.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar);
+				context.OutputDirectory = Path.Combine(parameters.Project.BaseDirectory, parameters.Project.OutputDirectory.TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar);
 				foreach (string probePath in parameters.Project.ProbePaths)
 					asmResolver.PostSearchPaths.Add(Path.Combine(context.BaseDirectory, probePath));

@@ -322,16 +322,19 @@

 		private static void EndModule(ConfuserContext context) {
 			string output = context.Modules[context.CurrentModuleIndex].Location;
-			if (output != null)
+			if (output != null) {
+				if (!Path.IsPathRooted(output))
+					output = Path.Combine(Environment.CurrentDirectory, output);
 				output = Utils.GetRelativePath(output, context.BaseDirectory);
-			else
+			} else {
 				output = context.CurrentModule.Name;
+			}
 			context.OutputPaths[context.CurrentModuleIndex] = output;
 		}

 		private static void WriteModule(ConfuserContext context) {
 			context.Logger.InfoFormat("Writing module '{0}'...", context.CurrentModule.Name);
-
+
 			MemoryStream pdb = null, output = new MemoryStream();

 			if (context.CurrentModule.PdbState != null) {


timer input event constants

timer input event constants

--- Sensus.Shared/UI/Inputs/TimerInput.cs
+++ Sensus.Shared/UI/Inputs/TimerInput.cs
@@ -11,6 +11,13 @@
 {
 	public class TimerInput : Input, IVariableDefiningInput
 	{
+		private const string STARTED = "Started";
+		private const string USER_STARTED = "UserStarted";
+		private const string USER_PAUSED = "UserPaused";
+		private const string USER_STOPPED = "UserStopped";
+		private const string USER_SUBMITTED = "UserSubmitted";
+
+
 		private struct TimerEvent
 		{
 			public DateTimeOffset Timestamp { get; set; }
@@ -143,7 +150,7 @@

 				if (result == NavigationResult.Submit)
 				{
-					_events.Add(new TimerEvent { Timestamp = DateTimeOffset.UtcNow, ElapsedTime = _elapsedTime, Event = "UserSubmitted" });
+					_events.Add(new TimerEvent { Timestamp = DateTimeOffset.UtcNow, ElapsedTime = _elapsedTime, Event = USER_SUBMITTED });

 					Complete = true;
 				}
@@ -185,7 +192,7 @@
 					{
 						_timer.Start();

-						_events.Add(new TimerEvent { Timestamp = DateTimeOffset.UtcNow, ElapsedTime = _elapsedTime, Event = "UserStarted" });
+						_events.Add(new TimerEvent { Timestamp = DateTimeOffset.UtcNow, ElapsedTime = _elapsedTime, Event = USER_STARTED });

 						_startButton.IsEnabled = false;

@@ -207,7 +214,7 @@
 				{
 					_timer.Start();

-					_events.Add(new TimerEvent { Timestamp = DateTimeOffset.UtcNow, ElapsedTime = _elapsedTime, Event = "Started" });
+					_events.Add(new TimerEvent { Timestamp = DateTimeOffset.UtcNow, ElapsedTime = _elapsedTime, Event = STARTED });
 				}

 				if (ShowPauseButton)
@@ -227,7 +234,7 @@
 					{
 						_timer.Stop();

-						_events.Add(new TimerEvent { Timestamp = DateTimeOffset.UtcNow, ElapsedTime = _elapsedTime, Event = "UserPaused" });
+						_events.Add(new TimerEvent { Timestamp = DateTimeOffset.UtcNow, ElapsedTime = _elapsedTime, Event = USER_PAUSED });

 						_startButton.IsEnabled = true;
 						_pauseButton.IsEnabled = false;
@@ -253,7 +260,7 @@
 					{
 						_timer.Stop();

-						_events.Add(new TimerEvent { Timestamp = DateTimeOffset.UtcNow, ElapsedTime = _elapsedTime, Event = "UserStopped" });
+						_events.Add(new TimerEvent { Timestamp = DateTimeOffset.UtcNow, ElapsedTime = _elapsedTime, Event = USER_STOPPED });

 						_stopButton.IsEnabled = false;


comii

comii

--- Ztop.Todo.WindowsClient/LoginForm.cs
+++ Ztop.Todo.WindowsClient/LoginForm.cs
@@ -69,11 +69,10 @@
                     {
                         LoginHelper.Remeber(token);
                     }
-
-                    new MainForm(_uploadFile).Show();
-
-                    this.Hide();
-
+                    MShow();
+                    //MainForm mainform =  new MainForm(_uploadFile);
+                    //this.Hide();
+                    //mainform.ShowDialog();
                     btnLogin.Text = "登陆";
                     btnLogin.Enabled = true;
                 }));
@@ -112,5 +111,33 @@
                 this.LoginButton_Click(sender, e);
             }
         }
+        private void MShow()
+        {
+            var mainForm = new MainForm(_uploadFile);
+            this.Hide();
+            var result = mainForm.ShowDialog();
+            if (result == DialogResult.OK)
+            {
+                Thread.Sleep(500);
+                mainForm.Close();
+                this.Show();
+            }
+            else if (result == DialogResult.Cancel)
+            {
+                mainForm.Close();
+                this.Close();
+                Application.Exit();
+                System.Environment.Exit(0);
+            }
+        }
+
+        private void LoginForm_Load(object sender, EventArgs e)
+        {
+            var token = LoginHelper.GetToken();
+            if (!string.IsNullOrEmpty(token))
+            {
+                MShow();
+            }
+        }
     }
 }


Bump Version

Bump Version

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


remove ID from read-only checkbox (imitating non read-only one)

--- Signum.Web/HtmlHelpers/HtmlHelpers.cs
+++ Signum.Web/HtmlHelpers/HtmlHelpers.cs
@@ -156,7 +156,6 @@
                     checkbox.Attr("checked", "checked");

                 HtmlTag hidden = new HtmlTag("input")
-                        .Id(name)
                         .Attrs(new
                         {
                             type = "hidden",


Typos fixed in exception messages.

Typos fixed in exception messages.

--- SimpleInjector.NET/StringResources.cs
+++ SimpleInjector.NET/StringResources.cs
@@ -105,7 +105,7 @@
         internal static string CollectionTypeAlreadyRegistered(Type serviceType)
         {
             return string.Format(CultureInfo.InvariantCulture,
-                "Collection of items for type {0} has already been registeredand " +
+                "Collection of items for type {0} has already been registered and " +
                 "and the container is currently not configured to allow overriding registrations. " +
                 "To allow overriding the current registration, please create the container using the " +
                 "constructor overload that takes a {1} instance and set the " +
@@ -474,7 +474,7 @@

         internal static string TheCollectionShouldContainAtleastOneElement()
         {
-            return "The supplied collection should contain atleast one element.";
+            return "The supplied collection should contain at least one element.";
         }

         internal static string AppendingRegistrationsToContainerUncontrolledCollectionsIsNotSupported(


Fix compile warning when compiling via msbuild

--- Source/Eto/Forms/Controls/Splitter.cs
+++ Source/Eto/Forms/Controls/Splitter.cs
@@ -97,7 +97,7 @@
 		/// </summary>
 		/// <remarks>
 		/// This defines the orientation of the panels, with a splitter of the opposite orientation between them.
-		/// For example, when set to <see cref="Orientation.Horizontal"/>, Panel1 and Panel2 will be horizontal to
+		/// For example, when set to <see cref="T:Orientation.Horizontal"/>, Panel1 and Panel2 will be horizontal to
 		/// eachother with a vertical splitter/gutter between them.
 		/// </remarks>
 		/// <value>The orientation of the panels.</value>


Removed some curlies.

Removed some curlies.

--- Src/AutoFakeItEasy/FakeItEasyRelay.cs
+++ Src/AutoFakeItEasy/FakeItEasyRelay.cs
@@ -30,9 +30,7 @@
         public FakeItEasyRelay(IRequestSpecification fakeableSpecification)
         {
             if (fakeableSpecification == null)
-            {
                 throw new ArgumentNullException("fakeableSpecification");
-            }

             this.shouldBeFaked = fakeableSpecification;
         }
@@ -69,14 +67,10 @@
         public object Create(object request, ISpecimenContext context)
         {
             if (context == null)
-            {
                 throw new ArgumentNullException("context");
-            }

             if (!this.shouldBeFaked.IsSatisfiedBy(request))
-            {
                 return new NoSpecimen(request);
-            }

             var type = request as Type;
             if (type == null)
@@ -86,9 +80,7 @@

             var fake = context.Resolve(fakeType) as FakeItEasy.Configuration.IHideObjectMembers;
             if (fake == null)
-            {
                 return new NoSpecimen(request);
-            }

             return fake.GetType().GetProperty("FakedObject").GetValue(fake, null);
         }


Fixed NOT being evaluated as a function

Fixed NOT being evaluated as a function

--- TBASIC/Runtime/Evaluator/Evaluator.cs
+++ TBASIC/Runtime/Evaluator/Evaluator.cs
@@ -265,6 +265,15 @@
                 val = str_parsed;
             }

+            //Check Unary Operator
+            if (mRet == null || mRet.Index > nIdx) {
+                m = DefinedRegex.UnaryOp.Match(Expression, nIdx);
+                if (m.Success && (mRet == null || m.Index < mRet.Index)) {
+                    mRet = m;
+                    val = new UnaryOperator(m.Value);
+                }
+            }
+
             //Check Function
             if (mRet == null || mRet.Index > nIdx) {
                 m = DefinedRegex.Function.Match(Expression, nIdx);
@@ -296,15 +305,6 @@
                     Variable v = new Variable(m.Value, CurrentExecution);
                     mRet.Value = v.Expression;
                     val = v;
-                }
-            }
-
-            //Check Unary Operator
-            if (mRet == null || mRet.Index > nIdx) {
-                m = DefinedRegex.UnaryOp.Match(Expression, nIdx);
-                if (m.Success && (mRet == null || m.Index < mRet.Index)) {
-                    mRet = m;
-                    val = new UnaryOperator(m.Value);
                 }
             }


Fix small issue with java accounts

Fix small issue with java accounts

--- src/Alex/Worlds/Multiplayer/Java/JavaServerType.cs
+++ src/Alex/Worlds/Multiplayer/Java/JavaServerType.cs
@@ -136,34 +136,30 @@
 					{
 						Log.Warn($"Java authentication failed...");

-						if (p.TryGet(AuthTypeIdentifier, out bool isMicrosoftAccount))
+						if (p.TryGet(AuthTypeIdentifier, out bool isMicrosoftAccount) && isMicrosoftAccount)
 						{
-							if (isMicrosoftAccount)
+							var codeFlow = new JavaCodeFlowLoginState(
+								this, skyBox, c =>
+								{
+									callBack?.Invoke(c);
+								}, p);
+							codeFlow.SetSubText($"{ChatColors.Red}Your session has expired, please re-authenticate.");
+
+							Alex.GameStateManager.SetActiveState(codeFlow);
+
+							return;
+						}
+
+						var javaLoginState = new MojangLoginState(
+							this, skyBox, c =>
 							{
-								var codeFlow = new JavaCodeFlowLoginState(
-									this, skyBox, c =>
-									{
-										callBack?.Invoke(c);
-									}, p);
-								codeFlow.SetSubText($"{ChatColors.Red}Your session has expired, please re-authenticate.");
-
-								Alex.GameStateManager.SetActiveState(codeFlow);
-
-								return;
-							}
-							else
-							{
-								var javaLoginState = new MojangLoginState(
-									this, skyBox, c =>
-									{
-										callBack?.Invoke(c);
-									}, p);
-								javaLoginState.LoginFailed($"Your session has expired, please re-authenticate.");
-								Alex.GameStateManager.SetActiveState(javaLoginState);
-
-								return;
-							}
-						}
+								callBack?.Invoke(c);
+							}, p);
+						javaLoginState.LoginFailed($"Your session has expired, please re-authenticate.");
+						Alex.GameStateManager.SetActiveState(javaLoginState);
+
+						return;
+
 						pss.ReloadData(profileManager.GetProfiles(ProfileType));
 						Alex.GameStateManager.SetActiveState(pss);
 					}


:boom: Improving EnforceRequired() readability

--- src/CommandLine/Core/SpecificationPropertyRules.cs
+++ src/CommandLine/Core/SpecificationPropertyRules.cs
@@ -41,13 +41,21 @@
             return specProps =>
             {
                 List<string> setsWithTrue =
-                    specProps.Where(sp => sp.Specification.IsOption() && sp.Value.IsJust() && sp.Specification.Required)
-                        .Select(x => x.Specification.GetSetName()).ToList();
+                    specProps
+                        .Where(sp => sp.Specification.IsOption()
+                            && sp.Value.IsJust() && sp.Specification.Required)
+                        .Select(s => ((OptionSpecification)s.Specification).SetName).ToList();

                 var requiredButEmpty =
-                    specProps.Where(sp => sp.Value.IsNothing() &&
-                                          sp.Specification.Required &&
-                                          !setsWithTrue.Contains(sp.Specification.GetSetName())).ToList();
+                    specProps
+                        .Where(sp => sp.Specification.IsOption())
+                        .Where(sp => sp.Value.IsNothing()
+                            && sp.Specification.Required
+                            && !setsWithTrue.Contains(((OptionSpecification)sp.Specification).SetName))
+                    .Concat(specProps
+                        .Where(sp => sp.Specification.IsValue()
+                            && sp.Value.IsNothing()
+                            && sp.Specification.Required)).ToList();
                     if (requiredButEmpty.Any()) {
                         return requiredButEmpty.Select(s => Maybe.Just<Error>(new MissingRequiredOptionError(
                             NameInfo.FromSpecification(s.Specification))));


Update SelectionTool.Edit.cs

Update SelectionTool.Edit.cs

--- src/Draw2D.Core/Editor/Tools/SelectionTool.Edit.cs
+++ src/Draw2D.Core/Editor/Tools/SelectionTool.Edit.cs
@@ -105,7 +105,6 @@
                 case ScribbleShape scribble:
                     {
                         var copy = scribble.Copy();
-                        copy.Start = distinctPointsCopy[scribble.Start];
                         foreach (var point in scribble.Points)
                         {
                             copy.Points.Add(distinctPointsCopy[point]);


Close application after tests

Close application after tests

--- src/FlaUI.Core.UITests/TestFramework/UITestBase.cs
+++ src/FlaUI.Core.UITests/TestFramework/UITestBase.cs
@@ -70,6 +70,7 @@
         public void BaseTeardown()
         {
             Automation.Dispose();
+            App.Close();
             App.Dispose();
             App = null;
         }


Publics UseScope for better API

Publics UseScope for better API

--- src/FluentModelBuilder/Builder/AutoModelBuilder.cs
+++ src/FluentModelBuilder/Builder/AutoModelBuilder.cs
@@ -64,7 +64,7 @@
         /// </summary>
         /// <param name="scope">Scope to use</param>
         /// <returns>AutoModelBuilder</returns>
-        internal AutoModelBuilder SetScope(BuilderScope scope)
+        public AutoModelBuilder UseScope(BuilderScope scope)
         {
             _scope = scope;
             return this;


Improved the exception message for marshaling failures.

--- src/Generator/Generators/CLI/CLISourcesTemplate.cs
+++ src/Generator/Generators/CLI/CLISourcesTemplate.cs
@@ -943,7 +943,8 @@
                 param.Visit(marshal);

                 if (string.IsNullOrEmpty(marshal.Context.Return))
-                    throw new Exception("Cannot marshal argument of function");
+                    throw new Exception(string.Format("Cannot marshal argument of function '{0}'",
+                        function.QualifiedOriginalName));

                 if (!string.IsNullOrWhiteSpace(marshal.Context.SupportBefore))
                     Write(marshal.Context.SupportBefore);


More street names

More street names

--- src/GiveCRM.DummyDataGenerator/Data/AddressData.cs
+++ src/GiveCRM.DummyDataGenerator/Data/AddressData.cs
@@ -10,6 +10,7 @@
                 "",
                 "",
                 "Upper",
+                "Upper",
                 "Lower"
             };

@@ -21,7 +22,11 @@
                 "Church",
                 "London",
                 "Victoria",
-                "Green Lane",
+                "Green",
+                "Blue",
+                "Red",
+                "Black",
+                "White",
                 "Manor",
                 "Queens",
                 "New",
@@ -42,8 +47,7 @@
                 "Manchester",
                 "Richmond",
                 "South",
-                "School Lane",
-                "The Drive",
+                "School",
                 "Stanley",
                 "Chester",
                 "Mill",
@@ -92,7 +96,8 @@
                 "Mews",
                 "Boulevard",
                 "Crescent",
-                "Lane"
+                "Lane",
+                "Drive"
             };


Added DNX support in the NancyBootstrapperLocator

--- src/Nancy/Bootstrapper/NancyBootstrapperLocator.cs
+++ src/Nancy/Bootstrapper/NancyBootstrapperLocator.cs
@@ -3,6 +3,7 @@
     using System;
     using System.Collections.Generic;
     using System.Linq;
+    using System.Reflection;
     using Nancy.Extensions;

     /// <summary>
@@ -14,6 +15,7 @@
     public static class NancyBootstrapperLocator
     {
         private static INancyBootstrapper instance;
+        private static readonly AssemblyName NancyAssemblyName = typeof(INancyEngine).GetTypeInfo().Assembly.GetName();

         /// <summary>
         /// Gets the located bootstrapper
@@ -41,9 +43,9 @@

         private static IReadOnlyCollection<Type> GetAvailableBootstrapperTypes()
         {
-            var assemblies = AppDomain.CurrentDomain
-                .GetAssemblies()
-                .Where(x => !x.IsDynamic && !x.ReflectionOnly);
+            var assemblies = GetNancyReferencingAssemblies()
+                .Where(x => !x.IsDynamic && !x.ReflectionOnly)
+                .ToArray();

             return assemblies
                 .SelectMany(x => x.SafeGetExportedTypes())
@@ -51,6 +53,55 @@
                 .Where(x => typeof(INancyBootstrapper).IsAssignableFrom(x))
                 .ToArray();
         }
+
+        private static IEnumerable<Assembly> GetNancyReferencingAssemblies()
+        {
+#if DNX
+            var libraryManager = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.LibraryManager;
+
+            var results = new HashSet<Assembly>
+            {
+                typeof (INancyEngine).Assembly
+            };
+
+            var referencingLibraries = libraryManager.GetReferencingLibraries(NancyAssemblyName.Name);
+
+            foreach (var assemblyName in referencingLibraries.SelectMany(referencingLibrary => referencingLibrary.Assemblies))
+            {
+                try
+                {
+                    results.Add(Assembly.Load(assemblyName));
+                }
+                catch
+                {
+                }
+            }
+
+            return results.ToArray();
+#else
+            return AppDomain.CurrentDomain.GetAssemblies().Where(IsNancyReferencing);
+#endif
+        }
+
+#if !DNX
+        private static bool IsNancyReferencing(Assembly assembly)
+        {
+            if (AssemblyName.ReferenceMatchesDefinition(assembly.GetName(), NancyAssemblyName))
+            {
+                return true;
+            }
+
+            foreach (var referencedAssemblyName in assembly.GetReferencedAssemblies())
+            {
+                if (AssemblyName.ReferenceMatchesDefinition(referencedAssemblyName, NancyAssemblyName))
+                {
+                    return true;
+                }
+            }
+
+            return false;
+        }
+#endif

         private static Type GetBootstrapperType()
         {


I'd like to be able to iterate fields from outside nest.

--- src/Nest/CommonAbstractions/Infer/Fields/Fields.cs
+++ src/Nest/CommonAbstractions/Infer/Fields/Fields.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq.Expressions;
@@ -7,7 +8,7 @@
 namespace Nest
 {
 	[ContractJsonConverter(typeof(FieldsJsonConverter))]
-	public class Fields : IUrlParameter
+	public class Fields : IUrlParameter, IEnumerable<Field>
 	{
 		internal readonly List<Field> ListOfFields;

@@ -43,5 +44,14 @@
 			return this;
 		}

-	}
+        public IEnumerator<Field> GetEnumerator()
+        {
+            return ((IEnumerable<Field>)this.ListOfFields).GetEnumerator();
+        }
+
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return ((IEnumerable<Field>)this.ListOfFields).GetEnumerator();
+        }
+    }
 }


Refactor compiler to support conditionals

--- Lang/RumorCompiler.cs
+++ Lang/RumorCompiler.cs
@@ -19,6 +19,11 @@
 		private delegate Node NodeParser
 			(LogicalLine line, ref int pos, List<Node> children);
 		private readonly Dictionary<string, NodeParser> handlers;
+
+		private delegate Conditional ConditionalParser
+			(LogicalLine line, ref int pos, List<Node> children,
+			List<LogicalLine> lines, ref int index, int depth);
+		private readonly Dictionary<string, ConditionalParser> conditions;

 		/// <summary>
 		/// Creates a new Rumor compiler.
@@ -60,10 +65,12 @@
 			handlers["$"] = CompileStatement;
 			handlers["add"] = CompileAdd;
 			handlers["choice"] = CompileChoice;
-			handlers["if"] = CompileIf;
 			handlers["label"] = CompileLabel;
 			handlers["pause"] = CompilePause;
 			handlers["say"] = CompileSay;
+
+			conditions = new Dictionary<string, ConditionalParser>();
+			conditions["if"] = CompileIf;
 		}

 		public IEnumerable<Node> Compile(string code)
@@ -105,6 +112,21 @@
 			return key;
 		}

+		private List<Node> GetChildren(List<LogicalLine> lines, ref int index, int depth)
+		{
+			var children = new List<Node>();
+			if (index + 1 < lines.Count) {
+				int nextPos, nextDepth;
+				GetKey(lines[index + 1], out nextPos, out nextDepth);
+
+				if (nextDepth > depth) {
+					index++;
+					children = CompileNodes(lines, ref index, nextDepth);
+				}
+			}
+			return children;
+		}
+
 		private List<Node> CompileNodes
 			(List<LogicalLine> lines, ref int index, int depth)
 		{
@@ -125,27 +147,45 @@
 					throw new CompilerError(line, "Unexpected block");
 				}

+				if (conditions.ContainsKey(key)) {
+					var conditional = CompileConditional(lines, ref index, depth);
+					nodes.Add(new Condition(conditional));
+					continue;
+				}
+
 				if (!handlers.ContainsKey(key)) {
 					throw new CompilerError(line.tokens[pos],
 						string.Format("Unknown keyword \"{0}\"", key));
 				}

-				// Check for children on the next line
-				var children = new List<Node>();
-				if (index + 1 < lines.Count) {
-					int nextPos, nextDepth;
-					GetKey(lines[index + 1], out nextPos, out nextDepth);
-
-					if (nextDepth > depth) {
-						index++;
-						children = CompileNodes(lines, ref index, nextDepth);
-					}
-				}
-
+				var children = GetChildren(lines, ref index, depth);
 				nodes.Add(handlers[key](line, ref pos, children));
 			}

 			return nodes;
+		}
+
+		public Conditional CompileConditional
+			(List<LogicalLine> lines, ref int index, int depth)
+		{
+			var line = lines[index];
+			int pos, currentDepth;
+			var key = GetKey(line, out pos, out currentDepth);
+
+			// Check if the line is at the same depth
+			if (currentDepth != depth) {
+				return null;
+			}
+
+			if (!conditions.ContainsKey(key)) {
+				throw new CompilerError(line.tokens[pos],
+					string.Format("Unknown keyword \"{0}\"", key));
+			}
+
+			var children = GetChildren(lines, ref index, depth);
+
+			return conditions[key](line, ref pos, children,
+				lines, ref index, depth);
 		}

 		public Expression CompileExpression(List<LogicalToken> tokens)
@@ -280,20 +320,6 @@
 			return new Choice(text, children);
 		}

-		private Node CompileIf(LogicalLine line, ref int pos, List<Node> children)
-		{
-			int end = Seek(line, pos, ":");
-
-			var tokens = Slice(line.tokens, pos, end);
-			var expression = CompileExpression(tokens);
-
-			pos = end;
-
-			Expect(line, pos++, ":");
-
-			return new Condition(new If(expression, children));
-		}
-
 		private Node CompileLabel(LogicalLine line, ref int pos, List<Node> children)
 		{
 			var label = Expect(line, pos++);
@@ -328,6 +354,36 @@
 			var tokens = Slice(line.tokens, pos);
 			var expression = CompileExpression(tokens);
 			return new Statement(expression);
+		}
+
+		#endregion
+
+		#region Conditional Compilation Functions
+
+		private Conditional CompileIf(LogicalLine line, ref int pos, List<Node> children,
+			List<LogicalLine> lines, ref int index, int depth)
+		{
+			int end = Seek(line, pos, ":");
+
+			var tokens = Slice(line.tokens, pos, end);
+			var expression = CompileExpression(tokens);
+
+			pos = end;
+
+			Expect(line, pos++, ":");
+
+			var condition = CompileConditional(lines, ref index, depth);
+			if (condition == null) {
+				return new If(expression, children);
+			} else if (condition is If) {
+				return new If(expression, children, (If)condition);
+			} else if (condition is Else) {
+				return new If(expression, children, (Else)condition);
+			} else {
+				throw new CompilerError(lines[index],
+					string.Format("Unexpected conditional of type \"{0}\"",
+						lines[index].GetType()));
+			}
 		}

 		#endregion


Update EAP implementation to correctly deal with a socket operation that is completed synchronously.

Fixes #571.

--- src/Renci.SshNet/Abstractions/SocketAbstraction.cs
+++ src/Renci.SshNet/Abstractions/SocketAbstraction.cs
@@ -148,10 +148,10 @@
             var receiveCompleted = new ManualResetEvent(false);
             var sendReceiveToken = new PartialSendReceiveToken(socket, receiveCompleted);
             var args = new SocketAsyncEventArgs
-            {
-                RemoteEndPoint = socket.RemoteEndPoint,
-                UserToken = sendReceiveToken
-            };
+                {
+                    RemoteEndPoint = socket.RemoteEndPoint,
+                    UserToken = sendReceiveToken
+                };
             args.Completed += ReceiveCompleted;
             args.SetBuffer(buffer, offset, size);

@@ -165,6 +165,10 @@
                                 CultureInfo.InvariantCulture,
                                 "Socket read operation has timed out after {0:F0} milliseconds.",
                                 timeout.TotalMilliseconds));
+                }
+                else
+                {
+                    sendReceiveToken.Process(args);
                 }

                 if (args.SocketError != SocketError.Success)
@@ -359,10 +363,10 @@
             var sendReceiveToken = new BlockingSendReceiveToken(socket, buffer, offset, size, receiveCompleted);

             var args = new SocketAsyncEventArgs
-            {
-                UserToken = sendReceiveToken,
-                RemoteEndPoint = socket.RemoteEndPoint
-            };
+                {
+                    UserToken = sendReceiveToken,
+                    RemoteEndPoint = socket.RemoteEndPoint
+                };
             args.Completed += ReceiveCompleted;
             args.SetBuffer(buffer, offset, size);

@@ -373,6 +377,10 @@
                     if (!receiveCompleted.WaitOne(timeout))
                         throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture,
                             "Socket read operation has timed out after {0:F0} milliseconds.", timeout.TotalMilliseconds));
+                }
+                else
+                {
+                    sendReceiveToken.Process(args);
                 }

                 if (args.SocketError != SocketError.Success)
@@ -443,6 +451,10 @@
                     if (!sendCompleted.WaitOne())
                         throw new SocketException((int) SocketError.TimedOut);
                 }
+                else
+                {
+                    sendReceiveToken.Process(socketAsyncSendArgs);
+                }

                 if (socketAsyncSendArgs.SocketError != SocketError.Success)
                     throw new SocketException((int) socketAsyncSendArgs.SocketError);


Saw some unnecessary complexty in the Machine class

--- src/SessionWatch.Service/Session/SessionWatcher.cs
+++ src/SessionWatch.Service/Session/SessionWatcher.cs
@@ -14,7 +14,8 @@
          // NOTE: this is obviously crude, but accomplishes my goal for now
          // TODO: load configuration and respond accordingly

-         var currentUser = Machine.Current.GetUsername();
+         var machine = new Machine();
+         var currentUser = machine.GetUsername();

          switch(description.Reason)
          {


More comment/doc fixes

More comment/doc fixes

--- src/StackExchange.Exceptional.Shared/ErrorStore.cs
+++ src/StackExchange.Exceptional.Shared/ErrorStore.cs
@@ -59,15 +59,15 @@
         protected abstract void LogError(Error error);

         /// <summary>
-        /// Retrieves a single error based on Id
-        /// </summary>
-        /// <param name="guid">The guid of the error to retrieve.</param>
+        /// Retrieves a single error based on Id.
+        /// </summary>
+        /// <param name="guid">The GUID of the error to retrieve.</param>
         protected abstract Error GetError(Guid guid);

         /// <summary>
         /// Prevents error identified by <paramref name="guid"/> from being deleted when the error log is full, if the store supports it.
         /// </summary>
-        /// <param name="guid">The guid of the error to protect.</param>
+        /// <param name="guid">The GUID of the error to protect.</param>
         protected abstract bool ProtectError(Guid guid);

         /// <summary>
@@ -90,7 +90,7 @@
         /// <summary>
         /// Deletes a specific error from the log.
         /// </summary>
-        /// <param name="guid">The guid of the error to delete.</param>
+        /// <param name="guid">The GUID of the error to delete.</param>
         protected abstract bool DeleteError(Guid guid);

         /// <summary>
@@ -242,7 +242,7 @@
         /// <summary>
         /// Deletes all non-protected errors from the log.
         /// </summary>
-        /// <param name="guid">The guid of the error to protect.</param>
+        /// <param name="guid">The GUID of the error to protect.</param>
         public bool Protect(Guid guid)
         {
             if (_isInRetry) return false; // no protecting allowed when failing, since we don't respect it in the queue anyway
@@ -278,7 +278,7 @@
         /// <summary>
         /// Deletes an error from the log with the specified <paramref name="guid"/>.
         /// </summary>
-        /// <param name="guid">The guid of the error to delete.</param>
+        /// <param name="guid">The GUID of the error to delete.</param>
         public bool Delete(Guid guid)
         {
             if (_isInRetry) return false; // no deleting from the retry queue
@@ -348,7 +348,7 @@
         /// <summary>
         /// Gets a specific exception with the specified GUID.
         /// </summary>
-        /// <param name="guid">The guid of the error to retrieve.</param>
+        /// <param name="guid">The GUID of the error to retrieve.</param>
         public Error Get(Guid guid)
         {
             if (_isInRetry)
@@ -503,7 +503,7 @@
             if (settings.Type.IsNullOrEmpty())
                 throw new ArgumentOutOfRangeException(nameof(settings), "ErrorStore 'type' must be specified");
             if (settings.Size < 1)
-                throw new ArgumentOutOfRangeException(nameof(settings), "ErrorStore 'size' must be positive");
+                throw new ArgumentOutOfRangeException(nameof(settings), "ErrorStore 'size' must be at least 1");

             var storeTypes = GetErrorStores();
             // Search by convention first


Fixing first page parsing for ValidFrom

Fixing first page parsing for ValidFrom

--- SpiritAirlineTimeTableParser/Program.cs
+++ SpiritAirlineTimeTableParser/Program.cs
@@ -50,7 +50,7 @@
             Regex rgxFlightNumber = new Regex(@"(\d{3,4})");
             Regex rgxIATAAirport = new Regex(@"\[[A-Z]{3}\]");
             Regex rgxdate1 = new Regex(@"(([0-9])|([0-2][0-9])|([3][0-1])) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)");
-            Regex rgxdate2 = new Regex(@"(([0-9])|([0-2][0-9])|([3][0-1])) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ([0-9]{4})");
+            Regex rgxdate2 = new Regex(@"Effective (?:(((Jan(uary)?|Ma(r(ch)?|y)|Jul(y)?|Aug(ust)?|Oct(ober)?|Dec(ember)?)\ 31)|((Jan(uary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|(Sept|Nov|Dec)(ember)?)\ (0?[1-9]|([12]\d)|30))|(Feb(ruary)?\ (0?[1-9]|1\d|2[0-8]|(29(?=,\ ((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))))\,\ ((1[6-9]|[2-9]\d)\d{2}))");
             Regex rgxFlightDay = new Regex(@"[1234567]");
             Regex rgxFlightTime = new Regex(@"^([0-9]|0[0-9]|1[0-9]|2[0-3])H([0-9]|0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])M$");
             List<CIFLight> CIFLights = new List<CIFLight> { };
@@ -114,10 +114,12 @@

                 MatchCollection matches = rgxdate2.Matches(fpcurrentText);

-                //string validfrom = matches[0].Value;
+                string validfrom = matches[0].Value;
+                validfrom = validfrom.Replace("Effective ", "");
                 //string validto = matches[1].Value;
-                DateTime ValidFrom = new DateTime(2015, 8, 6);
-                DateTime ValidTo = new DateTime(2015, 11, 11);
+                DateTime ValidFrom = DateTime.ParseExact(validfrom, "MMMM d, yyyy", ci);
+                //DateTime ValidFrom = new DateTime(2015, 8, 6);
+                //DateTime ValidTo = new DateTime(2015, 11, 11);
                 //DateTime ValidFrom = DateTime.ParseExact(validfrom, "dd MMM yyyy", ci);
                 //DateTime ValidTo = DateTime.ParseExact(validto, "dd MMM yyyy", ci);
                 // Loop through each page of the document
@@ -151,7 +153,7 @@
                         string[] lines = Regex.Split(currentText, "\r\n");
                         string TEMP_FromIATA = null;
                         string TEMP_ToIATA = null;
-                        DateTime TEMP_ValidFrom = new DateTime();
+                        DateTime TEMP_ValidFrom = ValidFrom;
                         DateTime TEMP_ValidTo = new DateTime();
                         int TEMP_Conversie = 0;
                         Boolean TEMP_FlightMonday = false;
@@ -411,7 +413,7 @@
                                             FlightDirect = TEMP_FlightDirect
                                         });
                                         // Cleaning All but From and To
-                                        TEMP_ValidFrom = new DateTime();
+                                        TEMP_ValidFrom = ValidFrom;
                                         TEMP_ValidTo = new DateTime();
                                         TEMP_Conversie = 0;
                                         TEMP_FlightMonday = false;
@@ -464,6 +466,7 @@
                                         {
                                             temp_string = temp_string.Replace("DIS ", "");
                                             CIFLights[CIFLights.Count - 1].ToDate = DateTime.ParseExact(temp_string.Trim(), "MM/dd/yy", ci);
+                                            CIFLights[CIFLights.Count - 1].FromDate = ValidFrom;
                                         }
                                     }
                                     //if (temp_string.Contains("Operated by: "))


Bye Git

Bye Git

--- Suplanus.Sepla/Helper/ObjectsUtility.cs
+++ Suplanus.Sepla/Helper/ObjectsUtility.cs
@@ -21,8 +21,6 @@

 		public static List<StorableObject> GetSelectedStorableObjects()
 		{
-         // hello git
-
 			SelectionSet selectionSet = new SelectionSet();

 			// navigators


msg piece refactor

msg piece refactor

--- TCC.Core/Data/Chat/BrokerChatMessage.cs
+++ TCC.Core/Data/Chat/BrokerChatMessage.cs
@@ -60,7 +60,7 @@
             ListingId = p.Listing;
             PlayerId = p.PlayerId;

-            Amount = new MessagePiece("Offer for " + p.Amount.ToString(), MessagePieceType.Simple, Channel, Settings.Settings.FontSize, false);
+            Amount = new MessagePiece("Offer for " + p.Amount.ToString(), MessagePieceType.Simple, Settings.Settings.FontSize, false);
             OfferedPrice = new MessagePiece(new Money(p.OfferedPrice));
             StartingPrice = new MessagePiece(new Money(p.SellerPrice));
             Listing = new MessagePiece("");


TestFileStream() assertion fix

TestFileStream() assertion fix

--- Tests/Cosmos.Kernel.Tests.Fat/Kernel.cs
+++ Tests/Cosmos.Kernel.Tests.Fat/Kernel.cs
@@ -217,7 +217,6 @@

             mDebugger.Send("START TEST");
             xStringResult = Path.GetFileNameWithoutExtension(@"0:\file.txt");
-            mDebugger.Send("xStringResult is " + xStringResult);
             xStringExpectedResult = "file";
             xMessage = "Path.GetFileNameWithoutExtension (file with extension) failed.";
             Assert.IsTrue(xStringResult == xStringExpectedResult, xMessage);
@@ -442,8 +441,10 @@
                 xFS.Position = 0;
                 Byte[] xReadBuff = new byte[xWriteBuff.Length];
                 xFS.Read(xReadBuff, 0, xWriteBuff.Length);
-
-                Assert.IsTrue(xWriteBuff.ToString() == xReadBuff.ToString(), "Failed to write and read file");
+                mDebugger.Send("xWriteBuff " + xWriteBuff.GetUtf8String(0, (uint)xWriteBuff.Length) + " xReadBuff " + xReadBuff.GetUtf8String(0, (uint)xWriteBuff.Length));
+                String xWriteBuffAsString = xWriteBuff.GetUtf8String(0, (uint)xWriteBuff.Length);
+                String xReadBuffAsString = xReadBuff.GetUtf8String(0, (uint)xReadBuff.Length);
+                Assert.IsTrue(xWriteBuffAsString == xReadBuffAsString, "Failed to write and read file");
                 mDebugger.Send("END TEST");
             }
         }


Trivial: Ishy had an extra line to start for testing that wasn't needed.

--- UWPBox/org/rufwork/UI/widgets/UWPBox.cs
+++ UWPBox/org/rufwork/UI/widgets/UWPBox.cs
@@ -804,8 +804,7 @@

             if (result.Equals(0))
             {
-                this.Text = @"
-###Call me Ishmael.
+                this.Text = @"###Call me Ishmael.

 <img alt=""Jumping Ahead"" src=""https://upload.wikimedia.org/wikipedia/commons/7/7b/Moby_Dick_p510_illustration.jpg"" style=""display:block;margin:0 auto;max-width:150px;"" />


Added unary negate operator -

Added unary negate operator -

--- UnitClassLibrary/UnitComponents/Unit.cs
+++ UnitClassLibrary/UnitComponents/Unit.cs
@@ -264,6 +264,10 @@
         {
             return unit1.Add(unit2);
         }
+        public static Unit<T> operator -(Unit<T> unit)
+        {
+            return unit.Negate();
+        }
         public static Unit<T> operator -(Unit<T> unit1, Unit<T> unit2)
         {
             return unit1.Subtract(unit2);


Added a try catch Block for Screen Rotation

--- lib/commonAPI/mediacapture/ext/platform/wp8/src/Camera_impl.cs
+++ lib/commonAPI/mediacapture/ext/platform/wp8/src/Camera_impl.cs
@@ -1128,27 +1128,34 @@

             void SetCameraRotation(PageOrientation OrientationStyle)
             {
-                CRhoRuntime.getInstance().logEvent("Camera class-->SetCameraRotation");
-                double rotation = Rho_StillCamera.Orientation;
-
-
-
-               // double strvalue = CameraRotation[OrientationStyle]["rotation"];
-                rotation =Rho_StillCamera.Orientation + CameraRotation[OrientationStyle]["rotation"];
-                Rho_PhotoCameraCanvas.Height = CameraRotation[OrientationStyle]["Height"];
-                Rho_PhotoCameraCanvas.Width = CameraRotation[OrientationStyle]["Width"];
-                try
-                {
-                    rotation =Rho_StillCamera.Orientation + CameraRotation[OrientationStyle][_strID];
-                }
-                catch (Exception ex)
-                {
-                    CRhoRuntime.getInstance().logEvent("Camera class-->SetCameraRotation-->LandScapeMode" + ex.ToString());
-                }
-
-
-
-                Rho_Camera_Rotation.Rotation = rotation;
+                try
+                {
+                    CRhoRuntime.getInstance().logEvent("Camera class-->SetCameraRotation");
+                    double rotation = Rho_StillCamera.Orientation;
+
+
+
+                    // double strvalue = CameraRotation[OrientationStyle]["rotation"];
+                    rotation = Rho_StillCamera.Orientation + CameraRotation[OrientationStyle]["rotation"];
+                    Rho_PhotoCameraCanvas.Height = CameraRotation[OrientationStyle]["Height"];
+                    Rho_PhotoCameraCanvas.Width = CameraRotation[OrientationStyle]["Width"];
+                    try
+                    {
+                        rotation = Rho_StillCamera.Orientation + CameraRotation[OrientationStyle][_strID];
+                    }
+                    catch (Exception ex)
+                    {
+                        CRhoRuntime.getInstance().logEvent("Camera class-->SetCameraRotation-->LandScapeMode" + ex.ToString());
+                    }
+
+
+
+                    Rho_Camera_Rotation.Rotation = rotation;
+                }
+                catch (Exception ex)
+                {
+                    CRhoRuntime.getInstance().logEvent("Camera class-->SetCameraRotation-->Exception" + ex.ToString());
+                }
             }
             # region Set the camera layout
             /// <summary>


Fix include resolving which points to embedded package for 2019.4+

--- resharper/resharper-unity/src/HlslSupport/Integration/Cpp/UnityGameEngineDirectiveResolver.cs
+++ resharper/resharper-unity/src/HlslSupport/Integration/Cpp/UnityGameEngineDirectiveResolver.cs
@@ -7,6 +7,8 @@
 using JetBrains.ReSharper.Psi.Cpp.Parsing.Preprocessor;
 using JetBrains.ReSharper.Psi.Cpp.Util;
 using JetBrains.Util;
+using JetBrains.Util.Extension;
+using Newtonsoft.Json.Linq;

 namespace JetBrains.ReSharper.Plugins.Unity.HlslSupport.Integration.Cpp
 {
@@ -18,7 +20,9 @@
         private readonly UnityReferencesTracker myReferencesTracker;
         private readonly ILogger myLogger;
         private readonly object myLockObject = new object();
-        private ConcurrentDictionary<string, string> myCacheSuffixes;
+        private readonly ConcurrentDictionary<string, string> myVersionsFromDirectories = new ConcurrentDictionary<string, string>();
+        private readonly ConcurrentDictionary<string, string> myPackageLockPaths = new ConcurrentDictionary<string, string>();
+        private bool myCacheInitialized = false;

         public UnityGameEngineDirectiveResolver(ISolution solution, UnitySolutionTracker solutionTracker,
                                                 UnityReferencesTracker referencesTracker, ILogger logger)
@@ -51,85 +55,154 @@

             var packageName = path.Substring(pos, endPos - pos);

-            var suffix = GetCacheSuffix(packageName);
-            if (suffix == null)
+            var packagePath = GetPackagePath(packageName);
+            if (packagePath == null)
+                return path;
+
+            return packagePath + path.Substring(endPos);
+        }
+
+        private void ParsePackageLock()
+        {
+            try
+            {
+                var packagesLockPath = mySolution.SolutionDirectory.Combine("Packages").Combine("packages-lock.json");
+                if (packagesLockPath.Exists == FileSystemPath.Existence.File)
+                {
+                    var json = JObject.Parse(packagesLockPath.ReadAllText2().Text);
+                    var dependencies = json["dependencies"]?.AsArray();
+                    if (dependencies != null)
+                    {
+                        foreach (var dependency in dependencies)
+                        {
+                            if (!(dependency is JProperty jProperty))
+                                continue;
+                            var packageName = jProperty.Name;
+                            var source = (jProperty.Value["source"] as JValue)?.Value as string;
+                            var version = (jProperty.Value["version"] as JValue)?.Value as string;
+                            if (source == null || version == null)
+                                continue;
+
+                            if (source.Equals("embedded"))
+                            {
+                                var packagePath = FileSystemPath.TryParse(version.RemoveStart("file:"));
+                                if (packagePath.IsEmpty)
+                                    continue;
+
+                                if (packagePath.IsAbsolute)
+                                {
+                                    myPackageLockPaths[packageName] = packagePath.FullPath;
+                                }
+                                else
+                                {
+                                    var relativePackagePath = FileSystemPath.Parse("Packages").Combine(packagePath);
+                                    myPackageLockPaths[packageName] = relativePackagePath.FullPath;
+                                }
+                            }
+                            else if (source.Equals("registry"))
+                            {
+                                var cachedPackagePath = FileSystemPath.Parse("Library").Combine("PackageCache")
+                                    .Combine(packageName + "@" + version);
+                                myPackageLockPaths[packageName] = cachedPackagePath.FullPath;
+                            }
+                        }
+                    }
+                }
+            }
+            catch (Exception e)
+            {
+                myLogger.Error(e, "An error occurred while parsing package-lock.json");
+            }
+        }
+
+        [CanBeNull]
+        private string GetPackagePath(string packageName)
+        {
+            // TODO: This cache should be based on resolved packages, like we have in the frontend for PackageManager
+            // TODO: Invalidate this cache when Packages/manifest.json or Packages/packages-lock.json changes
+            if (!myCacheInitialized)
+            {
+                lock (myLockObject)
+                {
+                    if (!myCacheInitialized)
+                    {
+
+                        try
+                        {
+                            ParsePackageLock();
+                            ProcessPackagesDirectories();
+                        }
+                        finally
+                        {
+                            myCacheInitialized = true;
+                        }
+                    }
+                }
+            }
+
+            if (myPackageLockPaths.TryGetValue(packageName, out var path))
                 return path;

+            if (!myVersionsFromDirectories.TryGetValue(packageName, out var version))
+                return null;
+
+            var solutionFolder = mySolution.SolutionDirectory;
             var localPackagePath = FileSystemPath.Parse("Packages")
-                .Combine(packageName + "@" + suffix + path.Substring(endPos));
+                .Combine(packageName + "@" + version);
             if (solutionFolder.Combine(localPackagePath).Exists == FileSystemPath.Existence.File)
                 return localPackagePath.FullPath;

             var cachedPackagePath = FileSystemPath.Parse("Library").Combine("PackageCache")
-                .Combine(packageName + "@" + suffix + path.Substring(endPos));
+                .Combine(packageName + "@" + version);
             return cachedPackagePath.FullPath;
         }

-        [CanBeNull]
-        private string GetCacheSuffix(string packageName)
-        {
-            // TODO: This cache should be based on resolved packages, like we have in the frontend for PackageManager
-            // TODO: Invalidate this cache when Packages/manifest.json or Packages/packages-lock.json changes
-            if (myCacheSuffixes == null)
-            {
-                lock (myLockObject)
+        private void ProcessPackagesDirectories()
+        {
+            try
+            {
+                var solutionFolder = mySolution.SolutionDirectory;
+                var packagesFolder = solutionFolder.Combine("Packages");
+                var packagesCacheFolder = solutionFolder.Combine("Library").Combine("PackageCache");
+
+                var candidates = new[] {packagesFolder, packagesCacheFolder};
+                foreach (var candidate in candidates)
                 {
-                    if (myCacheSuffixes == null)
+                    foreach (var folder in candidate.GetDirectoryEntries())
                     {
-                        var result = new ConcurrentDictionary<string, string>();
-                        try
-                        {
-                            var solutionFolder = mySolution.SolutionDirectory;
-                            var packagesFolder = solutionFolder.Combine("Packages");
-                            var packagesCacheFolder = solutionFolder.Combine("Library").Combine("PackageCache");
-
-                            var candidates = new[] {packagesFolder, packagesCacheFolder};
-                            foreach (var candidate in candidates)
-                            {
-                                foreach (var folder in candidate.GetDirectoryEntries())
-                                {
-                                    if (!folder.IsDirectory)
-                                        continue;
-
-                                    // Cache entries are usually name@version, but git and local tarball packages don't
-                                    // have versions, so are name@hash and name@hash-timestamp, respectively. Packages
-                                    // in the Packages folder don't usually have a version, but can do, and things will
-                                    // still work, so try and find one
-                                    var nameAndSuffix = folder.RelativePath.Name.Split('@');
-                                    if (nameAndSuffix.Length != 2)
-                                        continue;
-
-                                    var name = nameAndSuffix[0];
-                                    var suffix = nameAndSuffix[1];
-
-                                    // If the suffix is a version, use it to pick the latest version. If not, pick an
-                                    // arbitrary cache entry. There is no guarantee that either method gets the right
-                                    // cache entry, but it's the best we can do without proper package details
-                                    if (JetSemanticVersion.TryParse(suffix, out var version) &&
-                                        result.TryGetValue(name, out var oldSuffix) &&
-                                        JetSemanticVersion.TryParse(oldSuffix, out var oldVersion) &&
-                                        oldVersion > version)
-                                    {
-                                        continue;
-                                    }
-
-                                    result[name] = suffix;
-                                }
-                            }
-                        }
-                        catch (Exception e)
-                        {
-                            myLogger.Error(e, "Exception during calculating unity shader include paths");
-                        }
-                        finally
-                        {
-                            myCacheSuffixes = result;
-                        }
+                        if (!folder.IsDirectory)
+                            continue;
+
+                        // Cache entries are usually name@version, but git and local tarball packages don't
+                        // have versions, so are name@hash and name@hash-timestamp, respectively. Packages
+                        // in the Packages folder don't usually have a version, but can do, and things will
+                        // still work, so try and find one
+                        var nameAndSuffix = folder.RelativePath.Name.Split('@');
+                        if (nameAndSuffix.Length != 2)
+                            continue;
+
+                        var name = nameAndSuffix[0];
+                        var suffix = nameAndSuffix[1];
+
+                        // If the suffix is a version, use it to pick the latest version. If not, pick an
+                        // arbitrary cache entry. There is no guarantee that either method gets the right
+                        // cache entry, but it's the best we can do without proper package details
+                        if (JetSemanticVersion.TryParse(suffix, out var version) &&
+                            myVersionsFromDirectories.TryGetValue(name, out var oldSuffix) &&
+                            JetSemanticVersion.TryParse(oldSuffix, out var oldVersion) &&
+                            oldVersion > version)
+                        {
+                            continue;
+                        }
+
+                        myVersionsFromDirectories[name] = suffix;
                     }
                 }
             }
-
-            return myCacheSuffixes.GetValueSafe(packageName);
+            catch (Exception e)
+            {
+                myLogger.Error(e, "Exception during calculating unity shader include paths");
+            }
         }
     }
 }


Add test.

Add test.

--- src/EditorFeatures/CSharpTest/UseIsNullCheck/UseIsNullCheckForCastAndEqualityOperatorTests.cs
+++ src/EditorFeatures/CSharpTest/UseIsNullCheck/UseIsNullCheckForCastAndEqualityOperatorTests.cs
@@ -209,5 +209,31 @@
     }
 }");
         }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseIsNullCheck)]
+        public async Task TestTrivia2()
+        {
+            await TestInRegularAndScriptAsync(
+@"using System;
+
+class C
+{
+    void M(string s)
+    {
+        if ( /*1*/ [||]null /*2*/ == /*3*/ ( /*4*/ object /*5*/ ) /*6*/ s /*7*/ )
+            return;
+    }
+}",
+@"using System;
+
+class C
+{
+    void M(string s)
+    {
+        if ( /*1*/ s /*2*/ is /*3*/ null /*7*/ )
+            return;
+    }
+}");
+        }
     }
 }


Code formatting and code comments.

Code formatting and code comments.

--- src/EditorFeatures/Core/Implementation/IntelliSense/QuickInfo/IntellisenseQuickInfoBuilder.cs
+++ src/EditorFeatures/Core/Implementation/IntelliSense/QuickInfo/IntellisenseQuickInfoBuilder.cs
@@ -110,6 +110,8 @@
                     var lastSpan = i == quickInfoItem.RelatedSpans.Length - 1;
                     if (!lastSpan)
                     {
+                        // If there is more than one relatedSpan, the single spans need to be separated.
+                        // This marker is used to track, where the separator needs to be inserted.
                         classifiedSpanList.Add(new ClassifiedSpan(span, RelatedSpanSeparatorClassification));
                     }
                 }
@@ -120,8 +122,8 @@
                 var textRuns = spans.Select(s =>
                 {
                     return s.ClassificationType == RelatedSpanSeparatorClassification
-                                        ? new ClassifiedTextRun(ClassificationTypeNames.WhiteSpace, "\r\n")
-                                        : new ClassifiedTextRun(s.ClassificationType, text.GetSubText(s.TextSpan).ToString(), ClassifiedTextRunStyle.UseClassificationFont);
+                        ? new ClassifiedTextRun(ClassificationTypeNames.WhiteSpace, "\r\n")
+                        : new ClassifiedTextRun(s.ClassificationType, text.GetSubText(s.TextSpan).ToString(), ClassifiedTextRunStyle.UseClassificationFont);
                 });

                 if (textRuns.Any())


Replacing TABs with SPACEs in WindowsLinkStep

--- src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Windows/WindowsLinkStep.cs
+++ src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Windows/WindowsLinkStep.cs
@@ -10,19 +10,19 @@

 namespace Microsoft.DotNet.Tools.Compiler.Native
 {
-	public class WindowsLinkStep : IPlatformNativeStep
-	{
-		private readonly string LinkerName = "link.exe";
-		private readonly string LinkerOutputExtension = ".exe";
+    public class WindowsLinkStep : IPlatformNativeStep
+    {
+        private readonly string LinkerName = "link.exe";
+        private readonly string LinkerOutputExtension = ".exe";
         private readonly string VSBin = "..\\..\\VC\\bin\\amd64";

         private readonly string InputExtension = ".obj";

         private static readonly Dictionary<BuildConfiguration, string> ConfigurationLinkerOptionsMap = new Dictionary<BuildConfiguration, string>
-		{
-			{ BuildConfiguration.debug, "/NOLOGO /ERRORREPORT:PROMPT /MANIFEST /MANIFESTUAC:\"level='asInvoker' uiAccess='false'\" /manifest:embed /Debug /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT" },
-			{ BuildConfiguration.release, "/NOLOGO /ERRORREPORT:PROMPT /INCREMENTAL:NO /OPT:REF /OPT:ICF /LTCG:incremental /MANIFEST /MANIFESTUAC:\"level='asInvoker' uiAccess='false'\" /manifest:embed /Debug /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT" }
-		};
+        {
+            { BuildConfiguration.debug, "/NOLOGO /ERRORREPORT:PROMPT /MANIFEST /MANIFESTUAC:\"level='asInvoker' uiAccess='false'\" /manifest:embed /Debug /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT" },
+            { BuildConfiguration.release, "/NOLOGO /ERRORREPORT:PROMPT /INCREMENTAL:NO /OPT:REF /OPT:ICF /LTCG:incremental /MANIFEST /MANIFESTUAC:\"level='asInvoker' uiAccess='false'\" /manifest:embed /Debug /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT" }
+        };

         private static readonly Dictionary<NativeIntermediateMode, string[]> ModeLibMap = new Dictionary<NativeIntermediateMode, string[]>
         {
@@ -48,108 +48,108 @@

         private static readonly Dictionary<BuildConfiguration, string[]> ConfigurationLinkLibMap = new Dictionary<BuildConfiguration, string[]>()
         {
-        	{ BuildConfiguration.debug , new string[] { "msvcrtd.lib" } },
-        	{ BuildConfiguration.release , new string[] { "msvcrt.lib" } }
+            { BuildConfiguration.debug , new string[] { "msvcrtd.lib" } },
+            { BuildConfiguration.release , new string[] { "msvcrt.lib" } }
         };
-
-		private string ArgStr { get; set; }
-		private NativeCompileSettings config;
-
-		public WindowsLinkStep(NativeCompileSettings config)
-		{
-			this.config = config;
-			InitializeArgs(config);
-		}
-
-		public int Invoke()
-		{
-			var result = WindowsCommon.SetVCVars();
-			if (result != 0)
-			{
-				Reporter.Error.WriteLine("vcvarsall.bat invocation failed.");
-				return result;
-			}
-
-			result = InvokeLinker();
-			if (result != 0)
-			{
+
+        private string ArgStr { get; set; }
+        private NativeCompileSettings config;
+
+        public WindowsLinkStep(NativeCompileSettings config)
+        {
+            this.config = config;
+            InitializeArgs(config);
+        }
+
+        public int Invoke()
+        {
+            var result = WindowsCommon.SetVCVars();
+            if (result != 0)
+            {
+                Reporter.Error.WriteLine("vcvarsall.bat invocation failed.");
+                return result;
+            }
+
+            result = InvokeLinker();
+            if (result != 0)
+            {
                 Reporter.Error.WriteLine("Linking of intermediate files failed.");
-			}
-			return result;
-		}
-
-		public bool CheckPreReqs()
-		{
+            }
+            return result;
+        }
+
+        public bool CheckPreReqs()
+        {
             var vcInstallDir = Environment.GetEnvironmentVariable("VS140COMNTOOLS");
             return !string.IsNullOrEmpty(vcInstallDir);
         }
-
-		private void InitializeArgs(NativeCompileSettings config)
-		{
-			var argsList = new List<string>();
-
-			// Configuration Based Linker Options
-			argsList.Add(ConfigurationLinkerOptionsMap[config.BuildType]);
-
-			//Output
-			var outFile = DetermineOutputFile(config);
-			argsList.Add($"/out:\"{outFile}\"");
-
-			// Constant Libs
-			argsList.Add(string.Join(" ", ConstantLinkLibs));
+
+        private void InitializeArgs(NativeCompileSettings config)
+        {
+            var argsList = new List<string>();
+
+            // Configuration Based Linker Options
+            argsList.Add(ConfigurationLinkerOptionsMap[config.BuildType]);
+
+            //Output
+            var outFile = DetermineOutputFile(config);
+            argsList.Add($"/out:\"{outFile}\"");
+
+            // Constant Libs
+            argsList.Add(string.Join(" ", ConstantLinkLibs));

             // SDK Libs
             var SDKLibs = ModeLibMap[config.NativeMode];
-			foreach (var lib in SDKLibs)
-			{
-				argsList.Add(Path.Combine(config.IlcPath, lib));
-			}
+            foreach (var lib in SDKLibs)
+            {
+                argsList.Add(Path.Combine(config.IlcPath, lib));
+            }

-			// Configuration Based Libs
-			var configLibs = ConfigurationLinkLibMap[config.BuildType];
-			foreach (var lib in configLibs)
-			{
-				argsList.Add(lib);
-			}
+            // Configuration Based Libs
+            var configLibs = ConfigurationLinkLibMap[config.BuildType];
+            foreach (var lib in configLibs)
+            {
+                argsList.Add(lib);
+            }

-			// Link Libs
-			foreach(var path in config.LinkLibPaths){
-				argsList.Add($"\"{path}\"");
-			}
-
-			//arch
-			argsList.Add($"/MACHINE:{config.Architecture}");
+            // Link Libs
+            foreach(var path in config.LinkLibPaths){
+                argsList.Add($"\"{path}\"");
+            }
+
+            //arch
+            argsList.Add($"/MACHINE:{config.Architecture}");

             //Input Obj file
             var inputFile = DetermineInputFile(config);
-			argsList.Add($"\"{inputFile}\"");
-
-			this.ArgStr = string.Join(" ", argsList);
-		}
-
-		private int InvokeLinker()
-		{
-			var vcInstallDir = Environment.GetEnvironmentVariable("VS140COMNTOOLS");
-			var linkerPath = Path.Combine(vcInstallDir, VSBin, LinkerName);
-
-			var result = Command.Create(linkerPath, ArgStr)
-				.ForwardStdErr()
-				.ForwardStdOut()
-				.Execute();
-
-			return result.ExitCode;
-		}
-
-		public string DetermineOutputFile(NativeCompileSettings config)
-		{
-			var outputDirectory = config.OutputDirectory;
-
-			var filename = Path.GetFileNameWithoutExtension(config.InputManagedAssemblyPath);
-
-			var outFile = Path.Combine(outputDirectory, filename + LinkerOutputExtension);
-
-			return outFile;
-		}
+            argsList.Add($"\"{inputFile}\"");
+
+            this.ArgStr = string.Join(" ", argsList);
+        }
+
+        private int InvokeLinker()
+        {
+            var vcInstallDir = Environment.GetEnvironmentVariable("VS140COMNTOOLS");
+            var linkerPath = Path.Combine(vcInstallDir, VSBin, LinkerName);
+
+            var result = Command.Create(linkerPath, ArgStr)
+                .ForwardStdErr()
+                .ForwardStdOut()
+                .Execute();
+
+            return result.ExitCode;
+        }
+
+        public string DetermineOutputFile(NativeCompileSettings config)
+        {
+            var outputDirectory = config.OutputDirectory;
+
+            var filename = Path.GetFileNameWithoutExtension(config.InputManagedAssemblyPath);
+
+            var outFile = Path.Combine(outputDirectory, filename + LinkerOutputExtension);
+
+            return outFile;
+        }

         private string DetermineInputFile(NativeCompileSettings config)
         {
@@ -161,6 +161,6 @@

             return infile;
         }
-
-	}
+
+    }
 }


Add TripPin test data.

Add TripPin test data.

--- test/ODataEndToEndTests/Microsoft.Restier.WebApi.Test.Services.Trippin/Models/TrippinModel.cs
+++ test/ODataEndToEndTests/Microsoft.Restier.WebApi.Test.Services.Trippin/Models/TrippinModel.cs
@@ -3,6 +3,7 @@

 using System;
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.Data.Entity;

 namespace Microsoft.Restier.WebApi.Test.Services.Trippin.Models
@@ -23,6 +24,15 @@
                 c.ToTable("TripAndFlights");
             });

+            modelBuilder.Entity<Person>().HasMany<Person>(p => p.Friends).WithMany().Map(
+                c =>
+                {
+                    c.MapLeftKey("Friend1Id");
+                    c.MapRightKey("Friend2Id");
+                    c.ToTable("PersonFriends");
+                }
+            );
+
             base.OnModelCreating(modelBuilder);
         }

@@ -49,6 +59,9 @@
         public static void ResetDataSource()
         {
             instance = new TrippinModel();
+
+            // As per kb321843, manually handle dropping Friends constraint before cleaning up People table.
+            instance.Database.ExecuteSqlCommand("DELETE FROM PersonFriends");
             instance.People.RemoveRange(instance.People);
             instance.Flights.RemoveRange(instance.Flights);
             instance.Airlines.RemoveRange(instance.Airlines);
@@ -259,39 +272,42 @@

             #region People

+            #region Friends russellwhyte & scottketchum & ronaldmundy
+            var person1 = new Person
+            {
+                PersonId = 1,
+                FirstName = "Russell",
+                LastName = "Whyte",
+                UserName = "russellwhyte",
+            };
+
+
+            var person2 = new Person
+            {
+                PersonId = 2,
+                FirstName = "Scott",
+                LastName = "Ketchum",
+                UserName = "scottketchum",
+                Friends = new Collection<Person> { person1 }
+            };
+
+            var person3 = new Person
+            {
+                PersonId = 3,
+                FirstName = "Ronald",
+                LastName = "Mundy",
+                UserName = "ronaldmundy",
+                Friends = new Collection<Person> { person1, person2 }
+            };
+
+            person1.Friends = new Collection<Person> { person2 };
+            #endregion
+
             instance.People.AddRange(new List<Person>
             {
-                #region russellwhyte
-                new Person
-                {
-                    PersonId = 1,
-                    FirstName = "Russell",
-                    LastName = "Whyte",
-                    UserName = "russellwhyte",
-                },
-
-                #endregion
-
-                #region scottketchum
-                new Person
-                {
-                    PersonId = 2,
-                    FirstName = "Scott",
-                    LastName = "Ketchum",
-                    UserName = "scottketchum",
-                },
-
-                #endregion
-
-                #region ronaldmundy
-                new Person
-                {
-                    PersonId = 3,
-                    FirstName = "Ronald",
-                    LastName = "Mundy",
-                    UserName = "ronaldmundy",
-                },
-                #endregion
+                person1,
+                person2,
+                person3,

                 new Person
                 {
@@ -364,6 +380,8 @@
                     UserName = "jonirosales",
                 }
             });
+
+

             #endregion

@@ -462,6 +480,20 @@

             #endregion

+            #region Events
+
+            instance.Events.AddRange(new[]
+            {
+                new Event
+                {
+                    OccursAt = new Location
+                    {
+                        Address = "Address1"
+                    }
+                },
+            });
+            #endregion
+
             instance.SaveChanges();
         }
     }


Add Ctrl+A to select all and Escape to deselect all (#6803)

Add Ctrl+A to select all and Escape to deselect all

Co-authored-by: Dean Herbert <1db828bcd41de75377dce59825af73ae7fca5651@ppy.sh>

--- osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs
+++ osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs
@@ -10,6 +10,7 @@
 using osu.Framework.Graphics.Containers;
 using osu.Framework.Graphics.Primitives;
 using osu.Framework.Input;
+using osu.Framework.Input.Bindings;
 using osu.Framework.Input.Events;
 using osu.Framework.Timing;
 using osu.Game.Rulesets.Edit;
@@ -21,7 +22,7 @@

 namespace osu.Game.Screens.Edit.Compose.Components
 {
-    public class BlueprintContainer : CompositeDrawable
+    public class BlueprintContainer : CompositeDrawable, IKeyBindingHandler<PlatformAction>
     {
         public event Action<IEnumerable<HitObject>> SelectionChanged;

@@ -185,6 +186,37 @@
             return true;
         }

+        protected override bool OnKeyDown(KeyDownEvent e)
+        {
+            switch (e.Key)
+            {
+                case Key.Escape:
+                    if (!selectionHandler.SelectedBlueprints.Any())
+                        return false;
+
+                    deselectAll();
+                    return true;
+            }
+
+            return false;
+        }
+
+        protected override bool OnKeyUp(KeyUpEvent e) => false;
+
+        public bool OnPressed(PlatformAction action)
+        {
+            switch (action.ActionType)
+            {
+                case PlatformActionType.SelectAll:
+                    selectAll();
+                    return true;
+            }
+
+            return false;
+        }
+
+        public bool OnReleased(PlatformAction action) => false;
+
         protected override void Update()
         {
             base.Update();
@@ -331,6 +363,15 @@
         }

         /// <summary>
+        /// Selects all <see cref="SelectionBlueprint"/>s.
+        /// </summary>
+        private void selectAll()
+        {
+            selectionBlueprints.ToList().ForEach(m => m.Select());
+            selectionHandler.UpdateVisibility();
+        }
+
+        /// <summary>
         /// Deselects all selected <see cref="SelectionBlueprint"/>s.
         /// </summary>
         private void deselectAll() => selectionHandler.SelectedBlueprints.ToList().ForEach(m => m.Deselect());


Fix room duration not being set

Fix room duration not being set

--- osu.Game/Screens/Multi/Match/Components/RoomSettingsOverlay.cs
+++ osu.Game/Screens/Multi/Match/Components/RoomSettingsOverlay.cs
@@ -237,6 +237,8 @@
             else
                 maxParticipantsBind.Value = null;

+            durationBind.Value = DurationField.Current.Value;
+
             manager?.CreateRoom(room);
         }


Format docs

Format docs

--- Enums/Mode.cs
+++ Enums/Mode.cs
@@ -1,13 +1,13 @@
 public enum Mode {

     /// <summary>
-    /// Camera moves with the target transform instantly.
+    ///     Camera moves with the target transform instantly.
     /// </summary>
     Instantenous,

     /// <summary>
-    /// If target transform moves withing defined dead zone, camera
-    /// will not follow.
+    ///     If target transform moves withing defined dead zone, camera
+    ///     will not follow.
     /// </summary>
     DeadZone


Fixes so RELEASE builds

Fixes so RELEASE builds

--- FalconPeer.cs
+++ FalconPeer.cs
@@ -84,7 +84,9 @@
         private Dictionary<IPEndPoint, RemotePeer> peersByIp;   // same RemotePeers as peersById
         private Dictionary<int, RemotePeer> peersById;          // same RemotePeers as peersByIp
         private LogLevel            logLvl;
+#if DEBUG
         private LogCallback         logger;
+#endif
         private string              joinPass;
         private PunchThroughCallback punchThroughCallback;
         private  bool               stopped;
@@ -712,10 +714,11 @@
                     Port,
                     lvl,
                     msg);
-
+#if DEBUG
                 if (logger != null)
                     logger(lvl, line);
                 else
+#endif
                     Debug.WriteLine(line);
             }
         }


Read from log stream and use a simple filter

--- LogParser/Function.cs
+++ LogParser/Function.cs
@@ -1,35 +1,42 @@
 using System;
+using System.IO;
+using System.IO.Compression;
+using System.Linq;
+using System.Text.RegularExpressions;
 using Amazon.CloudWatchLogs;
 using Amazon.Lambda.Core;
+using LogParser.Model;
+using Newtonsoft.Json;

 namespace LogParser {
-
-    //--- Classes ---
-    public class CloudWatchLogsEvent {
-
-        //--- Properties ---
-        public Awslogs awslogs { get; set; }
-    }
-
-    public class Awslogs {
-
-        //--- Properties ---
-        public string data { get; set; }
-    }
-
     public class Function {

         //--- Fields ---
         private readonly IAmazonCloudWatchLogs _cloudWatchClient;
-
-        //--- Methods ---
+        private const string FILTER = @"^(\[[A-Z ]+\])";
+        private static readonly Regex filter = new Regex(FILTER, RegexOptions.Compiled | RegexOptions.CultureInvariant);
+
+        //--- Constructors ---
         public Function() {
             _cloudWatchClient = new AmazonCloudWatchLogsClient();
         }

+        //--- Methods ---
         [LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]
         public void Handler(CloudWatchLogsEvent cloudWatchLogsEvent, ILambdaContext context) {
-            Console.WriteLine(cloudWatchLogsEvent.awslogs.data);
+            // Level One
+            Console.WriteLine($"THIS IS THE DATA: {cloudWatchLogsEvent.AwsLogs.Data}");
+            var data = DecompressLogData(cloudWatchLogsEvent.AwsLogs.Data);
+            Console.WriteLine($"THIS IS THE DECODED, UNCOMPRESSED DATA: {data}");
+            var events = JsonConvert.DeserializeObject<DecompressedEvents>(data).LogEvents;
+            var filteredEvents = events.Where(x => filter.IsMatch(x.Message)).ToList();
+            filteredEvents.ForEach(x => Console.WriteLine(x.Message));
+        }
+
+        public static string DecompressLogData(string value) {
+            var gzip = Convert.FromBase64String(value);
+            using (GZipStream stream = new GZipStream(new MemoryStream(gzip), CompressionMode.Decompress))
+            return new StreamReader(stream).ReadToEnd();
         }
     }
 }