separate list and non-list property tests

--- src/MvbaMapperTests/MappingTesterTests.cs
+++ src/MvbaMapperTests/MappingTesterTests.cs
@@ -15,52 +15,22 @@
 	public class MappingTesterTests
 	{
 		[TestFixture]
-		public class When_asked_to_verify_an_object_mapping
+		public class When_asked_to_verify_an_object_mapping_for_list_fields
 		{
+			private OutputListClassContext _context;
 			private string _expectedDifferenceMessage;
 			private Notification _notification;

-			[Test]
-			public void Given_objects_where_only_a_boolean_property_is_different()
-			{
-				Test.Given(new MappingTester<OutputClass>())
-					.WithContext(new OutputClassContext())
-					.When(Verify_is_called)
-					.With(A_boolean_property_difference)
-					.Should(Detect_the_difference)
-					.Should(Give_the_name_of_the_property_that_has_the_value_difference)
-					.Verify();
-			}
-
-			[Test]
-			public void Given_objects_where_only_a_DateTime_property_is_different()
-			{
-				Test.Given(new MappingTester<OutputClass>())
-					.WithContext(new OutputClassContext())
-					.When(Verify_is_called)
-					.With(A_DateTime_property_difference)
-					.Should(Detect_the_difference)
-					.Should(Give_the_name_of_the_property_that_has_the_value_difference)
-					.Verify();
-			}
-
-			[Test]
-			public void Given_objects_where_only_a_decimal_property_is_different()
-			{
-				Test.Given(new MappingTester<OutputClass>())
-					.WithContext(new OutputClassContext())
-					.When(Verify_is_called)
-					.With(A_decimal_property_difference)
-					.Should(Detect_the_difference)
-					.Should(Give_the_name_of_the_property_that_has_the_value_difference)
-					.Verify();
+			[SetUp]
+			public void BeforeEachTest()
+			{
+				_context = new OutputListClassContext();
 			}

 			[Test]
 			public void Given_objects_where_only_a_List_property_is_different()
 			{
 				Test.Given(new MappingTester<OutputListClass>())
-					.WithContext(new OutputListClassContext())
 					.When(Verify_is_called)
 					.With(A_list_property_difference)
 					.Should(Detect_the_difference)
@@ -68,101 +38,9 @@
 					.Verify();
 			}

-			[Test]
-			public void Given_objects_where_only_a_string_property_is_different()
-			{
-				Test.Given(new MappingTester<OutputClass>())
-					.WithContext(new OutputClassContext())
-					.When(Verify_is_called)
-					.With(A_string_property_difference)
-					.Should(Detect_the_difference)
-					.Should(Give_the_name_of_the_property_that_has_the_value_difference)
-					.Verify();
-			}
-
-			[Test]
-			public void Given_objects_where_only_an_int_property_is_different()
-			{
-				Test.Given(new MappingTester<OutputClass>())
-					.WithContext(new OutputClassContext())
-					.When(Verify_is_called)
-					.With(An_int_property_difference)
-					.Should(Detect_the_difference)
-					.Should(Give_the_name_of_the_property_that_has_the_value_difference)
-					.Verify();
-			}
-
-			private void A_boolean_property_difference(MappingTester<OutputClass> obj, OutputClassContext context)
-			{
-				var source = new ClassFiller<InputClass>().Source;
-				context.Expected = new OutputClass
-					{
-						BooleanProperty = source.BooleanProperty,
-						IntegerProperty = source.IntegerProperty,
-						StringProperty = source.StringProperty,
-						DecimalProperty = source.DecimalProperty,
-						DateTimeProperty = source.DateTimeProperty
-					};
-
-				context.Destination = new OutputClass
-					{
-						BooleanProperty = !context.Expected.BooleanProperty,
-						StringProperty = context.Expected.StringProperty,
-						DecimalProperty = context.Expected.DecimalProperty,
-						DateTimeProperty = context.Expected.DateTimeProperty,
-						IntegerProperty = context.Expected.IntegerProperty
-					};
-
-				_expectedDifferenceMessage = "BooleanProperty";
-			}
-
-			private void A_DateTime_property_difference(MappingTester<OutputClass> obj, OutputClassContext context)
-			{
-				var source = new ClassFiller<InputClass>().Source;
-				context.Expected = new OutputClass
-					{
-						BooleanProperty = source.BooleanProperty,
-						IntegerProperty = source.IntegerProperty,
-						StringProperty = source.StringProperty,
-						DecimalProperty = source.DecimalProperty,
-						DateTimeProperty = source.DateTimeProperty
-					};
-				context.Destination = new OutputClass
-					{
-						BooleanProperty = context.Expected.BooleanProperty,
-						StringProperty = context.Expected.StringProperty,
-						DecimalProperty = context.Expected.DecimalProperty,
-						DateTimeProperty = context.Expected.DateTimeProperty.AddDays(1),
-						IntegerProperty = context.Expected.IntegerProperty
-					};
-				_expectedDifferenceMessage = "DateTimeProperty";
-			}
-
-			private void A_decimal_property_difference(MappingTester<OutputClass> obj, OutputClassContext context)
-			{
-				var source = new ClassFiller<InputClass>().Source;
-				context.Expected = new OutputClass
-					{
-						BooleanProperty = source.BooleanProperty,
-						IntegerProperty = source.IntegerProperty,
-						StringProperty = source.StringProperty,
-						DecimalProperty = source.DecimalProperty,
-						DateTimeProperty = source.DateTimeProperty
-					};
-				context.Destination = new OutputClass
-					{
-						BooleanProperty = context.Expected.BooleanProperty,
-						StringProperty = context.Expected.StringProperty,
-						DecimalProperty = context.Expected.DecimalProperty - 1,
-						DateTimeProperty = context.Expected.DateTimeProperty,
-						IntegerProperty = context.Expected.IntegerProperty
-					};
-				_expectedDifferenceMessage = "DecimalProperty";
-			}
-
-			private void A_list_property_difference(MappingTester<OutputListClass> obj, OutputListClassContext context)
-			{
-				context.Destination = new OutputListClass
+			private void A_list_property_difference(MappingTester<OutputListClass> obj)
+			{
+				_context.Destination = new OutputListClass
 					{
 						Items = new List<int>
 							{
@@ -171,7 +49,7 @@
 								6
 							}
 					};
-				context.Expected = new OutputListClass
+				_context.Expected = new OutputListClass
 					{
 						Items = new List<int>
 							{
@@ -184,46 +62,198 @@
 				_expectedDifferenceMessage = "Items";
 			}

-			private void A_string_property_difference(MappingTester<OutputClass> obj, OutputClassContext context)
-			{
-				var source = new ClassFiller<InputClass>().Source;
-				context.Expected = new OutputClass
-					{
-						BooleanProperty = source.BooleanProperty,
-						IntegerProperty = source.IntegerProperty,
-						StringProperty = source.StringProperty,
-						DecimalProperty = source.DecimalProperty,
-						DateTimeProperty = source.DateTimeProperty
-					};
-				context.Destination = new OutputClass
-					{
-						BooleanProperty = context.Expected.BooleanProperty,
-						StringProperty = context.Expected.StringProperty.ToUpper(),
-						DecimalProperty = context.Expected.DecimalProperty,
-						DateTimeProperty = context.Expected.DateTimeProperty,
-						IntegerProperty = context.Expected.IntegerProperty
+			private void Detect_the_difference()
+			{
+				_notification.IsValid.ShouldBeFalse();
+			}
+
+			private void Give_the_name_of_the_property_that_has_the_value_difference()
+			{
+				_notification.ToString().ShouldBeEqualTo(_expectedDifferenceMessage);
+			}
+
+			private void Verify_is_called(MappingTester<OutputListClass> obj)
+			{
+				_notification = obj.Verify(_context.Destination, _context.Expected);
+			}
+		}
+
+		[TestFixture]
+		public class When_asked_to_verify_an_object_mapping_for_non_list_fields
+		{
+			private OutputClassContext _context;
+			private string _expectedDifferenceMessage;
+			private Notification _notification;
+
+			[SetUp]
+			public void BeforeEachTest()
+			{
+				_context = new OutputClassContext();
+			}
+
+			[Test]
+			public void Given_objects_where_only_a_DateTime_property_is_different()
+			{
+				Test.Given(new MappingTester<OutputClass>())
+					.When(Verify_is_called)
+					.With(A_DateTime_property_difference)
+					.Should(Detect_the_difference)
+					.Should(Give_the_name_of_the_property_that_has_the_value_difference)
+					.Verify();
+			}
+
+			[Test]
+			public void Given_objects_where_only_a_boolean_property_is_different()
+			{
+				Test.Given(new MappingTester<OutputClass>())
+					.When(Verify_is_called)
+					.With(A_boolean_property_difference)
+					.Should(Detect_the_difference)
+					.Should(Give_the_name_of_the_property_that_has_the_value_difference)
+					.Verify();
+			}
+
+			[Test]
+			public void Given_objects_where_only_a_decimal_property_is_different()
+			{
+				Test.Given(new MappingTester<OutputClass>())
+					.When(Verify_is_called)
+					.With(A_decimal_property_difference)
+					.Should(Detect_the_difference)
+					.Should(Give_the_name_of_the_property_that_has_the_value_difference)
+					.Verify();
+			}
+
+			[Test]
+			public void Given_objects_where_only_a_string_property_is_different()
+			{
+				Test.Given(new MappingTester<OutputClass>())
+					.When(Verify_is_called)
+					.With(A_string_property_difference)
+					.Should(Detect_the_difference)
+					.Should(Give_the_name_of_the_property_that_has_the_value_difference)
+					.Verify();
+			}
+
+			[Test]
+			public void Given_objects_where_only_an_int_property_is_different()
+			{
+				Test.Given(new MappingTester<OutputClass>())
+					.When(Verify_is_called)
+					.With(An_int_property_difference)
+					.Should(Detect_the_difference)
+					.Should(Give_the_name_of_the_property_that_has_the_value_difference)
+					.Verify();
+			}
+
+			private void A_DateTime_property_difference(MappingTester<OutputClass> obj)
+			{
+				var source = new ClassFiller<InputClass>().Source;
+				_context.Expected = new OutputClass
+					{
+						BooleanProperty = source.BooleanProperty,
+						IntegerProperty = source.IntegerProperty,
+						StringProperty = source.StringProperty,
+						DecimalProperty = source.DecimalProperty,
+						DateTimeProperty = source.DateTimeProperty
+					};
+				_context.Destination = new OutputClass
+					{
+						BooleanProperty = _context.Expected.BooleanProperty,
+						StringProperty = _context.Expected.StringProperty,
+						DecimalProperty = _context.Expected.DecimalProperty,
+						DateTimeProperty = _context.Expected.DateTimeProperty.AddDays(1),
+						IntegerProperty = _context.Expected.IntegerProperty
+					};
+				_expectedDifferenceMessage = "DateTimeProperty";
+			}
+
+			private void A_boolean_property_difference(MappingTester<OutputClass> obj)
+			{
+				var source = new ClassFiller<InputClass>().Source;
+				_context.Expected = new OutputClass
+					{
+						BooleanProperty = source.BooleanProperty,
+						IntegerProperty = source.IntegerProperty,
+						StringProperty = source.StringProperty,
+						DecimalProperty = source.DecimalProperty,
+						DateTimeProperty = source.DateTimeProperty
+					};
+
+				_context.Destination = new OutputClass
+					{
+						BooleanProperty = !_context.Expected.BooleanProperty,
+						StringProperty = _context.Expected.StringProperty,
+						DecimalProperty = _context.Expected.DecimalProperty,
+						DateTimeProperty = _context.Expected.DateTimeProperty,
+						IntegerProperty = _context.Expected.IntegerProperty
+					};
+
+				_expectedDifferenceMessage = "BooleanProperty";
+			}
+
+			private void A_decimal_property_difference(MappingTester<OutputClass> obj)
+			{
+				var source = new ClassFiller<InputClass>().Source;
+				_context.Expected = new OutputClass
+					{
+						BooleanProperty = source.BooleanProperty,
+						IntegerProperty = source.IntegerProperty,
+						StringProperty = source.StringProperty,
+						DecimalProperty = source.DecimalProperty,
+						DateTimeProperty = source.DateTimeProperty
+					};
+				_context.Destination = new OutputClass
+					{
+						BooleanProperty = _context.Expected.BooleanProperty,
+						StringProperty = _context.Expected.StringProperty,
+						DecimalProperty = _context.Expected.DecimalProperty - 1,
+						DateTimeProperty = _context.Expected.DateTimeProperty,
+						IntegerProperty = _context.Expected.IntegerProperty
+					};
+				_expectedDifferenceMessage = "DecimalProperty";
+			}
+
+			private void A_string_property_difference(MappingTester<OutputClass> obj)
+			{
+				var source = new ClassFiller<InputClass>().Source;
+				_context.Expected = new OutputClass
+					{
+						BooleanProperty = source.BooleanProperty,
+						IntegerProperty = source.IntegerProperty,
+						StringProperty = source.StringProperty,
+						DecimalProperty = source.DecimalProperty,
+						DateTimeProperty = source.DateTimeProperty
+					};
+				_context.Destination = new OutputClass
+					{
+						BooleanProperty = _context.Expected.BooleanProperty,
+						StringProperty = _context.Expected.StringProperty.ToUpper(),
+						DecimalProperty = _context.Expected.DecimalProperty,
+						DateTimeProperty = _context.Expected.DateTimeProperty,
+						IntegerProperty = _context.Expected.IntegerProperty
 					};
 				_expectedDifferenceMessage = "StringProperty";
 			}

-			private void An_int_property_difference(MappingTester<OutputClass> obj, OutputClassContext context)
-			{
-				var source = new ClassFiller<InputClass>().Source;
-				context.Expected = new OutputClass
-					{
-						BooleanProperty = source.BooleanProperty,
-						IntegerProperty = source.IntegerProperty,
-						StringProperty = source.StringProperty,
-						DecimalProperty = source.DecimalProperty,
-						DateTimeProperty = source.DateTimeProperty
-					};
-				context.Destination = new OutputClass
-					{
-						BooleanProperty = context.Expected.BooleanProperty,
-						StringProperty = context.Expected.StringProperty,
-						DecimalProperty = context.Expected.DecimalProperty,
-						DateTimeProperty = context.Expected.DateTimeProperty,
-						IntegerProperty = context.Expected.IntegerProperty - 1
+			private void An_int_property_difference(MappingTester<OutputClass> obj)
+			{
+				var source = new ClassFiller<InputClass>().Source;
+				_context.Expected = new OutputClass
+					{
+						BooleanProperty = source.BooleanProperty,
+						IntegerProperty = source.IntegerProperty,
+						StringProperty = source.StringProperty,
+						DecimalProperty = source.DecimalProperty,
+						DateTimeProperty = source.DateTimeProperty
+					};
+				_context.Destination = new OutputClass
+					{
+						BooleanProperty = _context.Expected.BooleanProperty,
+						StringProperty = _context.Expected.StringProperty,
+						DecimalProperty = _context.Expected.DecimalProperty,
+						DateTimeProperty = _context.Expected.DateTimeProperty,
+						IntegerProperty = _context.Expected.IntegerProperty - 1
 					};

 				_expectedDifferenceMessage = "IntegerProperty";
@@ -239,14 +269,9 @@
 				_notification.ToString().ShouldBeEqualTo(_expectedDifferenceMessage);
 			}

-			private void Verify_is_called(MappingTester<OutputClass> obj, OutputClassContext context)
-			{
-				_notification = obj.Verify(context.Destination, context.Expected);
-			}
-
-			private void Verify_is_called(MappingTester<OutputListClass> obj, OutputListClassContext context)
-			{
-				_notification = obj.Verify(context.Destination, context.Expected);
+			private void Verify_is_called(MappingTester<OutputClass> obj)
+			{
+				_notification = obj.Verify(_context.Destination, _context.Expected);
 			}
 		}
 	}


Fix Playback application logging - if cmd-reply == error, ChannelData is null

--- src/NEventSocket/ApplicationExtensions.cs
+++ src/NEventSocket/ApplicationExtensions.cs
@@ -51,7 +51,7 @@
                         eventSocket.ExecuteApplication(uuid, "playback", file, loops: options.Loops)
                                    .ConfigureAwait(false));

-                if (!result.Success && result.ChannelData.AnswerState == AnswerState.Answered)
+                if (!result.Success && (result.ChannelData == null || result.ChannelData.AnswerState == AnswerState.Answered))
                 {
                     LogFailedApplicationResult(eventSocket, result);
                 }


Channels: dispose after calling hangup callback

--- src/NEventSocket/Channels/BasicChannel.cs
+++ src/NEventSocket/Channels/BasicChannel.cs
@@ -71,7 +71,7 @@
                                        if (e.EventName == EventName.ChannelHangup)
                                        {
                                            Log.Info(() => "Channel [{0}] Hangup Detected [{1}]".Fmt(UUID, e.HangupCause));
-                                           Dispose();
+
                                            try
                                            {
                                                HangupCallBack(e);
@@ -80,6 +80,8 @@
                                            {
                                                Log.ErrorException("Channel [{0}] error calling hangup callback".Fmt(UUID), ex);
                                            }
+
+                                           Dispose();
                                        }
                                    }));
         }


Add MapLazy extension method

Add MapLazy extension method

--- src/Nine.Injection/ContainerExtensions.cs
+++ src/Nine.Injection/ContainerExtensions.cs
@@ -140,6 +140,19 @@
         }

         /// <summary>
+        /// Map a lazy initialized instance of a concrete implementation for an interface or class
+        /// </summary>
+        /// <param name="container">The container</param>
+        /// <typeparam name="T">The type of interface or class to be registered</typeparam>
+        /// <param name="factory">The instance to register in the container</param>
+        /// <returns>The container, complete with new registration</returns>
+        public static IContainer MapLazy<T>(this IContainer container, Func<T> factory)
+        {
+            container.Map(typeof(Lazy<T>), new Lazy<T>(factory));
+            return container;
+        }
+
+        /// <summary>
         /// Map a specific instance of a concrete implementation for an interface or class
         /// </summary>
         /// <param name="container">The container</param>


Update Dewey Index View's bootstrap for the table.

--- src/Open-School-Library/Views/Deweys/Index.cshtml
+++ src/Open-School-Library/Views/Deweys/Index.cshtml
@@ -9,7 +9,7 @@

     Create New Dewey

-

+


#18740: Preventing link collision on "current" class

Work Item: 18740

--HG--
branch : 1.x

--- src/Orchard.Web/Core/Shapes/Views/MenuItem.cshtml
+++ src/Orchard.Web/Core/Shapes/Views/MenuItem.cshtml
@@ -8,7 +8,7 @@
 } else {
     string requestUrl = Request.Path.Replace(Request.ApplicationPath, string.Empty).TrimEnd('/').ToUpperInvariant();
     string modelUrl = Model.Href.Replace(Request.ApplicationPath, string.Empty).TrimEnd('/').ToUpperInvariant();
-    if ((!string.IsNullOrEmpty(modelUrl) && requestUrl.StartsWith(modelUrl)) || requestUrl == modelUrl) {
+    if (requestUrl == modelUrl) {
 	    Model.Classes.Add("current");
     }
     if(items.Any()) {


ObservableObject 클래스의 SuppressMessage 특성 줄바꿈을 제거합니다.

--- src/ReactiveMvvm/ReactiveMvvm/ObservableObject.cs
+++ src/ReactiveMvvm/ReactiveMvvm/ObservableObject.cs
@@ -22,11 +22,7 @@
         protected virtual bool Equals<T>(T left, T right) =>
             EqualityComparer<T>.Default.Equals(left, right);

-        [System.Diagnostics.CodeAnalysis.SuppressMessage(
-            "Microsoft.Design",
-            "CA1045:DoNotPassTypesByReference",
-            MessageId = "0#",
-            Justification = "This form is generally used to implement observable properties")]
+        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference", MessageId = "0#", Justification = "This form is generally used to implement observable properties")]
         protected bool SetValue<T>(
             ref T store, T value, [CallerMemberName]string propertyName = null)
         {


refact(PopupPlatformIos): Fixed code style

--- src/Rg.Plugins.Popup.IOS/Impl/PopupPlatformIos.cs
+++ src/Rg.Plugins.Popup.IOS/Impl/PopupPlatformIos.cs
@@ -19,10 +19,10 @@
     [Preserve(AllMembers = true)]
     internal class PopupPlatformIos : IPopupPlatform
     {
-        private readonly List<UIWindow> _windows = new List<UIWindow>();
+        readonly List<UIWindow> _windows = new List<UIWindow>();

-        private bool IsiOS9OrNewer => UIDevice.CurrentDevice.CheckSystemVersion(9, 0);
-        private bool IsiOS13OrNewer => UIDevice.CurrentDevice.CheckSystemVersion(13, 0);
+        bool IsiOS9OrNewer => UIDevice.CurrentDevice.CheckSystemVersion(9, 0);
+        bool IsiOS13OrNewer => UIDevice.CurrentDevice.CheckSystemVersion(13, 0);

         public event EventHandler OnInitialized
         {
@@ -48,9 +48,7 @@
             var window = new PopupWindow();

             if (IsiOS13OrNewer)
-            {
                 _windows.Add(window);
-            }

             window.BackgroundColor = Color.Transparent.ToUIColor();
             window.RootViewController = new PopupPlatformRenderer(renderer);
@@ -59,9 +57,7 @@
             window.MakeKeyAndVisible();

             if (!IsiOS9OrNewer)
-            {
                 window.Frame = new CGRect(0, 0, UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height);
-            }

             await window.RootViewController.PresentViewControllerAsync(renderer.ViewController, false);
         }
@@ -86,9 +82,7 @@
                 window.Hidden = true;

                 if (IsiOS13OrNewer && _windows.Contains(window))
-                {
                     _windows.Remove(window);
-                }

                 window.Dispose();
                 window = null;
@@ -98,7 +92,7 @@
             }
         }

-        private void DisposeModelAndChildrenRenderers(VisualElement view)
+        void DisposeModelAndChildrenRenderers(VisualElement view)
         {
             IVisualElementRenderer renderer;
             foreach (VisualElement child in view.Descendants())
@@ -122,7 +116,7 @@
             XFPlatform.SetRenderer(view, null);
         }

-        private void HandleChildRemoved(object sender, ElementEventArgs e)
+        void HandleChildRemoved(object sender, ElementEventArgs e)
         {
             var view = e.Element;
             DisposeModelAndChildrenRenderers((VisualElement)view);


add comment for subtracting

add comment for subtracting

--- src/SharpCompress/Common/Tar/Headers/TarHeader.cs
+++ src/SharpCompress/Common/Tar/Headers/TarHeader.cs
@@ -73,6 +73,13 @@
             if (nameByteCount > 100)
             {
                 WriteLongFilenameHeader(output);
+                // update to short name lower than 100 - [max bytes of one character].
+                // subtracting bytes is needed because preventing infinite loop(example code is here).
+                //
+                // var bytes = Encoding.UTF8.GetBytes(new string(0x3042, 100));
+                // var truncated = Encoding.UTF8.GetBytes(Encoding.UTF8.GetString(bytes, 0, 100));
+                //
+                // and then truncated.Length is 102.
                 Name = ArchiveEncoding.Decode(ArchiveEncoding.Encode(Name), 0, 100 - ArchiveEncoding.GetEncoding().GetMaxByteCount(1));
                 Write(output);
             }


fix #87 subscribeasync

fix #87 subscribeasync

--- src/SoCreate.ServiceFabric.PubSub/BrokerClient.cs
+++ src/SoCreate.ServiceFabric.PubSub/BrokerClient.cs
@@ -53,7 +53,7 @@
         public async Task SubscribeAsync<T>(ReferenceWrapper referenceWrapper, Type messageType, Func<T, Task> handler, bool isOrdered = true) where T : class
         {
             Handlers[messageType] = message => handler((T)message);
-            var brokerService = await _brokerServiceLocator.GetBrokerServiceForMessageAsync(messageType);
+            var brokerService = await _brokerServiceLocator.GetBrokerServiceForMessageAsync(messageType.FullName);
             await brokerService.SubscribeAsync(referenceWrapper, messageType.FullName, isOrdered);
         }


Support for Kick command

Support for Kick command

--- src/Procon.Core/Connections/Connection.cs
+++ src/Procon.Core/Connections/Connection.cs
@@ -162,6 +162,17 @@
                         }
                     },
                     new CommandDispatchHandler(this.NetworkProtocolActionMove)
+                }, {
+                    new CommandAttribute() {
+                        CommandType = CommandType.NetworkProtocolActionKick,
+                        ParameterTypes = new List<CommandParameterType>() {
+                            new CommandParameterType() {
+                                Name = "kick",
+                                Type = typeof(Kick)
+                            }
+                        }
+                    },
+                    new CommandDispatchHandler(this.NetworkProtocolActionKick)
                 }
             });
         }
@@ -467,6 +478,31 @@
                     Now = new CommandData() {
                         Moves = new List<Move>() {
                             move
+                        }
+                    }
+                };
+            }
+            else {
+                result = CommandResultArgs.InsufficientPermissions;
+            }
+
+            return result;
+        }
+
+        public CommandResultArgs NetworkProtocolActionKick(Command command, Dictionary<String, CommandParameter> parameters) {
+            CommandResultArgs result = null;
+
+            Kick kick = parameters["kick"].First<Kick>();
+
+            if (this.Security.DispatchPermissionsCheck(command, command.Name).Success == true) {
+                this.Game.Action(kick);
+
+                result = new CommandResultArgs() {
+                    Success = true,
+                    Status = CommandResultType.Success,
+                    Now = new CommandData() {
+                        Kicks = new List<Kick>() {
+                            kick
                         }
                     }
                 };


561.1

--- src/Tests/Test_CpuBlitCoreRasterizer/PORT/Main.cs
+++ src/Tests/Test_CpuBlitCoreRasterizer/PORT/Main.cs
@@ -49,6 +49,8 @@
             //8. the content inside membitmap is just color image buffer
             //   you can copy it to other image object (eg SkImage, Gdi+ image etc)

+
+            //... example ...
             using (System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(membitmap.Width, membitmap.Height))
             {
                 IntPtr mem_ptr = membitmap.GetRawBufferHead();
@@ -60,7 +62,6 @@
                 }
                 bmp.UnlockBits(bmpdata);
                 bmp.Save("test01.png");
-
             }
         }


Added comments to ElementIndexer, and some shorter implementation.

--- src/Spark.Engine/Search/ElementIndexer.cs
+++ src/Spark.Engine/Search/ElementIndexer.cs
@@ -53,6 +53,12 @@
             return ListOf(new NumberValue(element.Value.Value));
         }

+        /// <summary>
+        /// { start : lowerbound-of-fhirdatetime, end : upperbound-of-fhirdatetime }
+        /// <seealso cref="ToExpressions(Period)"/>, with lower and upper bounds of FhirDateTime as bounds of the Period.
+        /// </summary>
+        /// <param name="element"></param>
+        /// <returns></returns>
         public List<Expression> ToExpressions(FhirDateTime element)
         {
             if (element == null)
@@ -65,6 +71,12 @@

             return ListOf(new CompositeValue(bounds));
         }
+
+        /// <summary>
+        /// { start : lowerbound-of-period-start, end : upperbound-of-period-end }
+        /// </summary>
+        /// <param name="element"></param>
+        /// <returns></returns>

         public List<Expression> ToExpressions(Period element)
         {
@@ -81,6 +93,11 @@
             return ListOf(new CompositeValue(bounds));
         }

+        /// <summary>
+        /// { system : system1, code: code1, text: display1 },
+        /// </summary>
+        /// <param name="element"></param>
+        /// <returns></returns>
         public List<Expression> ToExpressions(Coding element)
         {
             if (element == null)
@@ -97,6 +114,11 @@
             return ListOf(new CompositeValue(values));
         }

+        /// <summary>
+        /// { code : identifier-value, system : identifier-system, text : identifier-type }
+        /// </summary>
+        /// <param name="element"></param>
+        /// <returns></returns>
         public List<Expression> ToExpressions(Identifier element)
         {
             if (element == null)
@@ -113,14 +135,26 @@
             return ListOf(new CompositeValue(values));
         }

+        /// <summary>
+        /// { coding :
+        ///     [
+        ///         { system : system1, code: code1, text: display1 },
+        ///         { system : system2, code: code2, text: display2 },
+        ///     ],
+        ///  text : codeableconcept-text
+        /// }
+        /// </summary>
+        /// <param name="element"></param>
+        /// <returns></returns>
         public List<Expression> ToExpressions(CodeableConcept element)
         {
             if (element == null)
                 return null;

             var result = new List<Expression>();
-
-            result.AddRange(element.Coding.SelectMany(c => ToExpressions(c)));
+            var codingResult = new IndexValue("coding");
+
+            codingResult.Values.AddRange(element.Coding.SelectMany(c => ToExpressions(c)));

             if (element.Text != null)
                 result.Add(new IndexValue("text", new StringValue(element.Text)));
@@ -128,6 +162,11 @@
             return result;
         }

+        /// <summary>
+        /// { code : contactpoint-value, system : contactpoint-use }
+        /// </summary>
+        /// <param name="element"></param>
+        /// <returns></returns>
         public List<Expression> ToExpressions(ContactPoint element)
         {
             if (element == null)
@@ -142,6 +181,11 @@
             return ListOf(new CompositeValue(values));
         }

+        /// <summary>
+        /// { code : true/false }, system is absent
+        /// </summary>
+        /// <param name="element"></param>
+        /// <returns></returns>
         public List<Expression> ToExpressions(FhirBoolean element)
         {
             if (element == null || !element.Value.HasValue)
@@ -182,6 +226,11 @@

         }

+        /// <summary>
+        /// Returns list of all Address elements
+        /// </summary>
+        /// <param name="element"></param>
+        /// <returns></returns>
         public List<Expression> ToExpressions(Address element)
         {
             if (element == null)
@@ -199,6 +248,11 @@
             return values.Where(v => v != null).ToList();
         }

+        /// <summary>
+        /// Returns list of Given and Family parts of the name
+        /// </summary>
+        /// <param name="element"></param>
+        /// <returns></returns>
         public List<Expression> ToExpressions(HumanName element)
         {
             if (element == null)
@@ -231,24 +285,8 @@
             if (elements == null)
                 return null;

-            var result = new List<Expression>();
-
-            foreach (var element in elements)
-            {
-                result.AddRange(Map(element));
-            }
-
-            return result;
-//            return elements.SelectMany(el => ToExpressions(el)).ToList();
-        }
-
-        //public List<Expression> ToExpressions<T>(IEnumerable<T> elements) where T is Element
-        //{
-        //    if (elements == null)
-        //        return null;
-
-        //    return elements.SelectMany(el => ToExpressions(el)).ToList();
-        //}
+            return elements.SelectMany(el => Map(el)).ToList();
+        }

         public List<Expression> ToExpressions<T>(Code<T> element) where T : struct
         {


little whitespace cleanup, merged in tax percent, closes #251, closes #256

--- src/Stripe/Entities/StripeSubscription.cs
+++ src/Stripe/Entities/StripeSubscription.cs
@@ -40,7 +40,7 @@

         [JsonProperty("status")]
         public string Status { get; set; }
-
+
         [JsonProperty("application_fee_percent")]
         public decimal? ApplicationFeePercent { get; set; }


respawnevt fix

respawnevt fix

--- Pluton.Patcher/Program.cs
+++ Pluton.Patcher/Program.cs
@@ -333,7 +333,9 @@
             respawn.Body.Instructions.Clear();
             respawn.Body.Instructions.Add(Instruction.Create(OpCodes.Ldarg_0));
             respawn.Body.Instructions.Add(Instruction.Create(OpCodes.Ldarg_1));
+            respawn.Body.Instructions.Add(Instruction.Create(OpCodes.Ldarg_2));
             respawn.Body.Instructions.Add(Instruction.Create(OpCodes.Call, rustAssembly.MainModule.Import(spawnEvent)));
+            respawn.Body.Instructions.Add(Instruction.Create(OpCodes.Ret));
         }

         private static void ServerConsoleCommandPatch()


add additional test for no-solution-folders

--- test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs
+++ test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs
@@ -320,6 +320,56 @@
 EndGlobal
 ";

+    private const string ExpectedSlnFileAfterAddingProjectWithNoSolutionFoldersOption = @"
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26006.2
+MinimumVisualStudioVersion = 10.0.40219.1
+Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""App"", ""App.csproj"", ""{7072A694-548F-4CAE-A58F-12D257D5F486}""
+EndProject
+Project(""{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"") = ""Lib"", ""src\Lib\Lib.csproj"", ""{84A45D44-B677-492D-A6DA-B3A71135AB8E}""
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Debug|x64 = Debug|x64
+		Debug|x86 = Debug|x86
+		Release|Any CPU = Release|Any CPU
+		Release|x64 = Release|x64
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64
+		{7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64
+		{7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86
+		{7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86
+		{7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64
+		{7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64
+		{7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86
+		{7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86
+		{84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|x64.Build.0 = Debug|Any CPU
+		{84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{84A45D44-B677-492D-A6DA-B3A71135AB8E}.Debug|x86.Build.0 = Debug|Any CPU
+		{84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|Any CPU.Build.0 = Release|Any CPU
+		{84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|x64.ActiveCfg = Release|Any CPU
+		{84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|x64.Build.0 = Release|Any CPU
+		{84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|x86.ActiveCfg = Release|Any CPU
+		{84A45D44-B677-492D-A6DA-B3A71135AB8E}.Release|x86.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
+";
+
         [Theory]
         [InlineData("--help")]
         [InlineData("-h")]
@@ -1074,6 +1124,28 @@
                 .HaveStdOutContaining(string.Format(CommonLocalizableStrings.ProjectAddedToTheSolution, projectToAdd));
         }

+        [Fact]
+        public void WhenNestedProjectIsAddedAndNoSolutionFoldersOptionIsPassedNoSolutionFoldersAreCreated()
+        {
+            var projectDirectory = TestAssets
+                .Get("TestAppWithSlnAndCsprojInSubDir")
+                .CreateInstance()
+                .WithSourceFiles()
+                .Root
+                .FullName;
+
+            var projectToAdd = Path.Combine("src", "Lib", "Lib.csproj");
+            var cmd = new DotnetCommand()
+                .WithWorkingDirectory(projectDirectory)
+                .ExecuteWithCapturedOutput($"sln App.sln add --no-solution-folders {projectToAdd}");
+            cmd.Should().Pass();
+
+            var slnPath = Path.Combine(projectDirectory, "App.sln");
+            var expectedSlnContents = GetExpectedSlnContents(slnPath, ExpectedSlnFileAfterAddingProjectWithNoSolutionFoldersOption);
+            File.ReadAllText(slnPath)
+                .Should().BeVisuallyEquivalentTo(expectedSlnContents);
+        }
+
         private string GetExpectedSlnContents(
             string slnPath,
             string slnTemplate,


format that

format that

--- src/Tugberk.Web/MediaStorage/LocalImageStorage.cs
+++ src/Tugberk.Web/MediaStorage/LocalImageStorage.cs
@@ -19,10 +19,10 @@
             var imagePath = LocalImagesPathProvider.GetRandomImagePath(nameWithExtension);
             var fileName = Path.GetFileName(imagePath);

-            _logger.LogInformation("Saving {baseFileName} under {imagePath}",
+            _logger.LogInformation("Saving {baseFileName} under {imagePath}",
                 nameWithExtension, imagePath);

-            using(var fileStream = File.Open(imagePath, FileMode.CreateNew))
+            using (var fileStream = File.Open(imagePath, FileMode.CreateNew))
             {
                 await content.CopyToAsync(fileStream);
             }


Switched assembly references to use a file and type binding seems to work now (#493)

--- src/extensions/Wyam.CodeAnalysis/AnalyzeCSharp.cs
+++ src/extensions/Wyam.CodeAnalysis/AnalyzeCSharp.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
+using System.Collections.Immutable;
 using System.IO;
 using System.Linq;
 using System.Text;
@@ -458,9 +459,9 @@
             // Add the input source and references
             List<ISymbol> symbols = new List<ISymbol>();
             compilation = AddSourceFiles(inputs, context, compilation);
-            compilation = AddAssemblyReferences(context, symbols, compilation);
             compilation = AddProjectReferences(context, symbols, compilation);
             compilation = AddSolutionReferences(context, symbols, compilation);
+            compilation = AddAssemblyReferences(context, symbols, compilation);

             // Get and return the document tree
             symbols.Add(compilation.Assembly.GlobalNamespace);
@@ -510,20 +511,13 @@
                 IFile xmlFile = context.FileSystem.GetFile(assemblyFile.Path.ChangeExtension("xml"));
                 if (xmlFile.Exists)
                 {
-                    Trace.Verbose($"Creating metadata reference for assembly {assemblyFile.Path.FullPath} with XML documentation file");
-                    using (Stream xmlStream = xmlFile.OpenRead())
-                    {
-                        using (MemoryStream xmlBytes = new MemoryStream())
-                        {
-                            xmlStream.CopyTo(xmlBytes);
-                            return MetadataReference.CreateFromStream(
-                                assemblyFile.OpenRead(),
-                                documentation: XmlDocumentationProvider.CreateFromBytes(xmlBytes.ToArray()));
-                        }
-                    }
+                    Trace.Verbose($"Creating metadata reference for assembly {assemblyFile.Path.FullPath} with XML documentation file at {xmlFile.Path.FullPath}");
+                    return MetadataReference.CreateFromFile(
+                        assemblyFile.Path.FullPath,
+                        documentation: XmlDocumentationProvider.CreateFromFile(xmlFile.Path.FullPath));
                 }
                 Trace.Verbose($"Creating metadata reference for assembly {assemblyFile.Path.FullPath} without XML documentation file");
-                return (MetadataReference)MetadataReference.CreateFromStream(assemblyFile.OpenRead());
+                return (MetadataReference)MetadataReference.CreateFromFile(assemblyFile.Path.FullPath);
             }).ToArray();
             if (assemblyReferences.Length > 0)
             {
@@ -589,7 +583,7 @@
                 .Select(x =>
                 {
                     Trace.Verbose($"Creating compilation reference for project {x.Name}");
-                    return (MetadataReference)x.GetCompilationAsync().Result.ToMetadataReference();
+                    return (MetadataReference)x.GetCompilationAsync().Result.ToMetadataReference(new[] { x.AssemblyName }.ToImmutableArray());
                 })
                 .ToArray();
             if (compilationReferences.Length > 0)


Check PlatformParameters in BrokerHelper.CanInvokeBroker

--- src/ADAL.PCL.iOS/BrokerHelper.cs
+++ src/ADAL.PCL.iOS/BrokerHelper.cs
@@ -49,6 +49,10 @@
             get
             {
                 PlatformParameters pp = PlatformParameters as PlatformParameters;
+				if (pp == null)
+				{
+					return false;
+				}
                 return pp.UseBroker && UIApplication.SharedApplication.CanOpenUrl(new NSUrl("msauth://"));
             }
         }


remove extra nulls

remove extra nulls

--- src/AutoMapper/ConstructorMap.cs
+++ src/AutoMapper/ConstructorMap.cs
@@ -43,7 +43,7 @@
                     ExpressionResultConverters.FirstOrDefault(c => c.CanGetExpressionResolutionResult(result, map));

                 result = matchingExpressionConverter?.GetExpressionResolutionResult(result, map)
-                    ?? throw new AutoMapperMappingException($"Unable to generate the instantiation expression for the constructor {Ctor}: no expression could be mapped for constructor parameter '{map.Parameter}'.", null, TypeMap.Types, null, null);
+                    ?? throw new AutoMapperMappingException($"Unable to generate the instantiation expression for the constructor {Ctor}: no expression could be mapped for constructor parameter '{map.Parameter}'.", null, TypeMap.Types);

                 return result;
             });
@@ -55,4 +55,4 @@
             _ctorParams.Add(new ConstructorParameterMap(parameter, resolvers, canResolve));
         }
     }
-}+}


mapping engine cleanup

mapping engine cleanup

--- src/AutoMapper/IMappingEngine.cs
+++ src/AutoMapper/IMappingEngine.cs
@@ -1,7 +1,7 @@
-using System;
-
 namespace AutoMapper
 {
+    using System;
+
     /// <summary>
     /// Performs mapping based on configuration
     /// </summary>
@@ -46,8 +46,9 @@
         /// <typeparam name="TDestination">Destination type to create</typeparam>
         /// <param name="source">Source object to map from</param>
         /// <param name="opts">Mapping options</param>
-        /// <returns>Mapped destination object</returns>
-        TDestination Map<TSource, TDestination>(TSource source, Action<IMappingOperationOptions<TSource, TDestination>> opts);
+        /// <returns>Mapped destination object</returns>
+        TDestination Map<TSource, TDestination>(TSource source,
+            Action<IMappingOperationOptions<TSource, TDestination>> opts);

         /// <summary>
         /// Execute a mapping from the source object to the existing destination object.
@@ -67,8 +68,9 @@
         /// <param name="source">Source object to map from</param>
         /// <param name="destination">Destination object to map into</param>
         /// <param name="opts">Mapping options</param>
-        /// <returns>The mapped destination object, same instance as the <paramref name="destination"/> object</returns>
-        TDestination Map<TSource, TDestination>(TSource source, TDestination destination, Action<IMappingOperationOptions<TSource, TDestination>> opts);
+        /// <returns>The mapped destination object, same instance as the <paramref name="destination"/> object</returns>
+        TDestination Map<TSource, TDestination>(TSource source, TDestination destination,
+            Action<IMappingOperationOptions<TSource, TDestination>> opts);

         /// <summary>
         /// Execute a mapping from the source object to a new destination object with explicit <see cref="System.Type"/> objects
@@ -108,7 +110,8 @@
         /// <param name="destinationType">Destination type to use</param>
         /// <param name="opts">Mapping options</param>
         /// <returns>Mapped destination object, same instance as the <paramref name="destination"/> object</returns>
-        object Map(object source, object destination, Type sourceType, Type destinationType, Action<IMappingOperationOptions> opts);
+        object Map(object source, object destination, Type sourceType, Type destinationType,
+            Action<IMappingOperationOptions> opts);

         /// <summary>
         /// Create a map between the <typeparamref name="TSource"/> and <typeparamref name="TDestination"/> types and execute the map
@@ -117,7 +120,7 @@
         /// <typeparam name="TDestination">Destination type to use</typeparam>
         /// <param name="source">Source object to map from</param>
         /// <returns>Mapped destination object</returns>
-    	TDestination DynamicMap<TSource, TDestination>(TSource source);
+        TDestination DynamicMap<TSource, TDestination>(TSource source);

         /// <summary>
         /// Create a map between the <paramref name="source"/> object and <typeparamref name="TDestination"/> types and execute the map.
@@ -126,7 +129,7 @@
         /// <typeparam name="TDestination">Destination type to use</typeparam>
         /// <param name="source">Source object to map from</param>
         /// <returns>Mapped destination object</returns>
-    	TDestination DynamicMap<TDestination>(object source);
+        TDestination DynamicMap<TDestination>(object source);

         /// <summary>
         /// Create a map between the <paramref name="sourceType"/> and <paramref name="destinationType"/> types and execute the map.
@@ -136,7 +139,7 @@
         /// <param name="sourceType">Source type to use</param>
         /// <param name="destinationType">Destination type to use</param>
         /// <returns>Mapped destination object</returns>
-    	object DynamicMap(object source, Type sourceType, Type destinationType);
+        object DynamicMap(object source, Type sourceType, Type destinationType);

         /// <summary>
         /// Create a map between the <typeparamref name="TSource"/> and <typeparamref name="TDestination"/> types and execute the map to the existing destination object
@@ -145,7 +148,7 @@
         /// <typeparam name="TDestination">Destination type to use</typeparam>
         /// <param name="source">Source object to map from</param>
         /// <param name="destination">Destination object to map into</param>
-		void DynamicMap<TSource, TDestination>(TSource source, TDestination destination);
+        void DynamicMap<TSource, TDestination>(TSource source, TDestination destination);

         /// <summary>
         /// Create a map between the <paramref name="sourceType"/> and <paramref name="destinationType"/> types and execute the map to the existing destination object.
@@ -155,7 +158,6 @@
         /// <param name="destination"></param>
         /// <param name="sourceType">Source type to use</param>
         /// <param name="destinationType">Destination type to use</param>
-    	void DynamicMap(object source, object destination, Type sourceType, Type destinationType);
+        void DynamicMap(object source, object destination, Type sourceType, Type destinationType);
     }
-}
-
+}


Added information message about debug logging

--- src/AutoTest.WinForms/Program.cs
+++ src/AutoTest.WinForms/Program.cs
@@ -6,6 +6,7 @@
 using System.Reflection;
 using Castle.MicroKernel.Registration;
 using System.IO;
+using AutoTest.Core.Messaging;

 namespace AutoTest.WinForms
 {
@@ -26,6 +27,7 @@
 			{
 			ConfigureApplication();
         	var overviewForm = BootStrapper.Services.Locate<IOverviewForm>();
+			notifyOnLoggingSetup();
         	Application.Run(overviewForm.Form);
         	BootStrapper.ShutDown();
 			}
@@ -71,5 +73,11 @@
                 .Register(Component.For<IOverviewForm>().ImplementedBy<FeedbackForm>())
                 .Register(Component.For<IInformationForm>().ImplementedBy<InformationForm>());
         }
+
+		private static void notifyOnLoggingSetup()
+		{
+			var bus = BootStrapper.Services.Locate<IMessageBus>();
+			bus.Publish<InformationMessage>(new InformationMessage("Debugging enabled"));
+		}
     }
 }


Copy meta.json correctly when duplicating a book (BL-9956)

--- src/BloomExe/Book/BookStorage.cs
+++ src/BloomExe/Book/BookStorage.cs
@@ -2415,7 +2415,7 @@
 			{
 				var meta = DynamicJson.Parse(File.ReadAllText(metaPath));
 				meta.bookInstanceId = Guid.NewGuid().ToString();
-				RobustFile.WriteAllText(metaPath, JsonConvert.SerializeObject(meta));
+				RobustFile.WriteAllText(metaPath, meta.ToString());
 			}

 			// rename the book htm file


Use station ID property.

Use station ID property.

--- src/Challonge/MainWindow.xaml.cs
+++ src/Challonge/MainWindow.xaml.cs
@@ -31,7 +31,7 @@
 			m_timer.Start();

 			m_stations = Enumerable.Range(0, Settings.Default.Stations)
-				.Select(x => new Station())
+				.Select((x, i) => new Station { Id = i + 1 })
 				.ToList();
 		}

@@ -71,12 +71,12 @@
 			foreach (var station in m_stations.Where(x => x.Match == null).TakeWhile(x => waitingMatches.Count != 0))
 				station.Match = waitingMatches.Dequeue();

-			List<string> matchStrings = m_stations.Select((station, i) =>
+			List<string> matchStrings = m_stations.Select(station =>
 				{
 					if (station.Match == null)
-						return string.Format("Station {0}: Not scheduled.", i + 1);
+						return string.Format("Station {0}: Not scheduled.", station.Id);

-					return string.Format("Station {0} - Round {1}: {2} vs {3}", i + 1,
+					return string.Format("Station {0} - Round {1}: {2} vs {3}", station.Id,
 						station.Match.round < 0 ? "L" + Math.Abs(station.Match.round) : "W" + station.Match.round,
 						m_client.GetParticipant(station.Match.player1_id).name,
 						m_client.GetParticipant(station.Match.player2_id).name


fix: 修复通道基类构造函数中未将host参数保存的错误。 :imp:

fix: 修复通道基类构造函数中未将host参数保存的错误。 :imp:

--- src/Communication/ChannelBase.cs
+++ src/Communication/ChannelBase.cs
@@ -53,7 +53,7 @@
 		#region 构造函数
 		protected ChannelBase(int channelId, object host)
 		{
-			_host = null;
+			_host = host;
 			_channelId = channelId;
 			_lastSendTime = new DateTime(1900, 1, 1);
 			_lastReceivedTime = new DateTime(1900, 1, 1);


Fix CGColorSpace CreateWithName

Fix CGColorSpace CreateWithName

--- src/CoreGraphics/CGColorSpace.cs
+++ src/CoreGraphics/CGColorSpace.cs
@@ -165,13 +165,13 @@
 		}

 		[DllImport (Constants.CoreGraphicsLibrary)]
-		extern static IntPtr CGColorSpaceCreateWithName (string name);
+		extern static IntPtr CGColorSpaceCreateWithName (IntPtr name);

 		public static CGColorSpace CreateWithName (string name)
 		{
 			if (name == null)
 				throw new ArgumentNullException ("name");
-			return new CGColorSpace (CGColorSpaceCreateWithName (name), true);
+			return new CGColorSpace (CGColorSpaceCreateWithName (new NSString(name).Handle), true);
 		}

 		[DllImport (Constants.CoreGraphicsLibrary)]


wp8: better WebView.refresh impl

wp8: better WebView.refresh impl

--- platform/wp8/rhodes/MainPage.xaml.cs
+++ platform/wp8/rhodes/MainPage.xaml.cs
@@ -103,7 +103,8 @@
 		public void Refresh(int index)
         {
             if (!isUIThread) { Dispatcher.BeginInvoke(delegate() { Refresh(index); }); return; }
-            RhodesWebBrowser.InvokeScript("eval", "history.go()");
+            //RhodesWebBrowser.InvokeScript("eval", "history.go()");
+            RhodesWebBrowser.Navigate(new Uri(RhodesWebBrowser.Source.AbsoluteUri, UriKind.Absolute));
         }

 		public bool isStarted()


wp8: menu appearance fixed

wp8: menu appearance fixed

--- platform/wp8/rhodes/MainPage.xaml.cs
+++ platform/wp8/rhodes/MainPage.xaml.cs
@@ -67,6 +67,7 @@

             InitializeComponent();
             ApplicationBar.IsVisible = false;
+            ApplicationBar.Opacity = 0.75;
             try
             {
                 // create rhodes runtime object
@@ -198,6 +199,27 @@
             // TODO: webview size changed event handler ?
         }

+        private void updateAppBarModeAndVisibility(bool autoToolbarVisibility = true)
+        {
+            if (autoToolbarVisibility && (ApplicationBar.Buttons.Count > 0))
+            {
+                ApplicationBar.Mode = ApplicationBarMode.Default;
+                ApplicationBar.IsVisible = true;
+                ApplicationBar.IsMenuEnabled = ApplicationBar.MenuItems.Count > 0;
+            }
+            else if (ApplicationBar.MenuItems.Count > 0)
+            {
+                ApplicationBar.Mode = ApplicationBarMode.Minimized;
+                ApplicationBar.IsVisible = true;
+                ApplicationBar.IsMenuEnabled = true;
+            }
+            else
+            {
+                ApplicationBar.Mode = ApplicationBarMode.Default;
+                ApplicationBar.IsVisible = false;
+                ApplicationBar.IsMenuEnabled = false;
+            }
+        }

         // *** TOOLBAR ***

@@ -206,25 +228,24 @@
             if (!isUIThread) { Dispatcher.BeginInvoke(delegate() { toolbarRemoveAllButtons(); }); return; }
             ApplicationBar.Buttons.Clear();
             toolbarItems.Clear();
-            ApplicationBar.IsVisible = ApplicationBar.MenuItems.Count > 0;
+            updateAppBarModeAndVisibility();
         }

 		public void toolbarShow()
         {
             if (!isUIThread) { Dispatcher.BeginInvoke(delegate() { toolbarShow(); }); return; }
-            ApplicationBar.IsVisible = true;
+            updateAppBarModeAndVisibility();
         }

 		public void toolbarHide()
         {
             if (!isUIThread) { Dispatcher.BeginInvoke(delegate() { toolbarHide(); }); return; }
-            ApplicationBar.IsVisible = false; // ?? ApplicationBar.MenuItems.Count > 0
+            updateAppBarModeAndVisibility(false);
         }

 		public int toolbarGetHeight()
         {
-            // TODO: implement toolbarGetHeight
-            return ApplicationBar.IsVisible ? 30 : 0;
+            return ApplicationBar.IsVisible ? (ApplicationBar.Mode == ApplicationBarMode.Default ? 72 : 30) : 0;
         }

         public void toolbarAddAction(string text)
@@ -237,7 +258,7 @@
             toolbarItems.Add(text, text);
             ApplicationBar.Buttons.Add(toolbarButton);
             toolbarButton.Click += new EventHandler(toolbarButton_Click);
-            ApplicationBar.IsVisible = true;
+            updateAppBarModeAndVisibility();
         }

 		public void toolbarAddAction(Icon icon, string text, string action, bool rightAlign)
@@ -272,9 +293,7 @@
             if (!isUIThread) { Dispatcher.BeginInvoke(delegate() { menuClear(); }); return; }
             ApplicationBar.MenuItems.Clear();
             menuItems.Clear();
-            ApplicationBar.IsVisible = ApplicationBar.Buttons.Count > 0;
-            ApplicationBar.IsMenuEnabled = false;
-
+            updateAppBarModeAndVisibility();
         }

 		public void menuAddAction(string text, int item)
@@ -284,8 +303,7 @@
             ApplicationBar.MenuItems.Add(menuItem);
             menuItems.Add(text, item);
             menuItem.Click += new EventHandler(menuItem_Click);
-            ApplicationBar.IsVisible = true;
-            ApplicationBar.IsMenuEnabled = true;
+            updateAppBarModeAndVisibility();
         }

 		public void menuAddSeparator()


added unit tests for all loglevels and for static log fluent builder

--- tests/NLog.UnitTests/Fluent/LogBuilderTests.cs
+++ tests/NLog.UnitTests/Fluent/LogBuilderTests.cs
@@ -64,7 +64,18 @@
         [Fact]
         public void TraceWrite()
         {
-            _logger.Trace()
+            TraceWrite(_logger.Trace());
+        }
+
+        [Fact]
+        public void TraceWrite_static_builder()
+        {
+            TraceWrite(Log.Trace());
+        }
+
+        private void TraceWrite(LogBuilder logBuilder)
+        {
+            logBuilder
                 .Message("This is a test fluent message.")
                 .Property("Test", "TraceWrite")
                 .Write();
@@ -76,7 +87,7 @@
             }

             var ticks = DateTime.Now.Ticks;
-            _logger.Trace()
+            logBuilder
                 .Message("This is a test fluent message '{0}'.", ticks)
                 .Property("Test", "TraceWrite")
                 .Write();
@@ -89,7 +100,6 @@
                 AssertDebugLastMessage("t2", rendered);
             }
         }
-

         [Fact]
         public void TraceWriteProperties()
@@ -174,7 +184,18 @@
         [Fact]
         public void InfoWrite()
         {
-            _logger.Info()
+            InfoWrite(_logger.Info());
+        }
+
+        [Fact]
+        public void InfoWrite_static_builder()
+        {
+            InfoWrite(Log.Info());
+        }
+
+        private void InfoWrite(LogBuilder logBuilder)
+        {
+            logBuilder
                 .Message("This is a test fluent message.")
                 .Property("Test", "InfoWrite")
                 .Write();
@@ -186,11 +207,10 @@
                 AssertLastLogEventTarget(expectedEvent);
             }

-            _logger.Info()
+            logBuilder
                 .Message("This is a test fluent message '{0}'.", DateTime.Now.Ticks)
                 .Property("Test", "InfoWrite")
                 .Write();
-

             {
                 //previous
@@ -202,10 +222,46 @@
         }

         [Fact]
+        public void DebugWrite()
+        {
+            ErrorWrite(_logger.Debug(), LogLevel.Debug);
+        }
+
+        [Fact]
+        public void DebugWrite_static_builder()
+        {
+            ErrorWrite(Log.Debug(), LogLevel.Debug);
+        }
+
+        [Fact]
+        public void FatalWrite()
+        {
+            ErrorWrite(_logger.Fatal(), LogLevel.Fatal);
+        }
+
+        [Fact]
+        public void FatalWrite_static_builder()
+        {
+            ErrorWrite(Log.Fatal(), LogLevel.Fatal);
+        }
+
+        [Fact]
         public void ErrorWrite()
+        {
+            ErrorWrite(_logger.Error(), LogLevel.Error);
+        }
+
+        [Fact]
+        public void ErrorWrite_static_builder()
+        {
+            ErrorWrite(Log.Error(), LogLevel.Error);
+        }
+
+        private void ErrorWrite(LogBuilder logBuilder, LogLevel logLevel)
         {
             Exception catchedException = null;
             string path = "blah.txt";
+
             try
             {
                 string text = File.ReadAllText(path);
@@ -213,46 +269,43 @@
             catch (Exception ex)
             {
                 catchedException = ex;
-                _logger.Error()
+                logBuilder
                     .Message("Error reading file '{0}'.", path)
                     .Exception(ex)
                     .Property("Test", "ErrorWrite")
                     .Write();
             }

-
-
-            {
-                var expectedEvent = new LogEventInfo(LogLevel.Error, "logger1", "Error reading file '{0}'.");
+            {
+                var expectedEvent = new LogEventInfo(logLevel, "logger1", "Error reading file '{0}'.");
                 expectedEvent.Properties["Test"] = "ErrorWrite";
                 expectedEvent.Exception = catchedException;
                 AssertLastLogEventTarget(expectedEvent);
                 AssertDebugLastMessageContains("t2", "Error reading file '");
             }
-            _logger.Error()
+            logBuilder
                 .Message("This is a test fluent message.")
                 .Property("Test", "ErrorWrite")
                 .Write();

             {
-                var expectedEvent = new LogEventInfo(LogLevel.Error, "logger1", "This is a test fluent message.");
+                var expectedEvent = new LogEventInfo(logLevel, "logger1", "This is a test fluent message.");
                 expectedEvent.Properties["Test"] = "ErrorWrite";
                 AssertLastLogEventTarget(expectedEvent);
             }

-            _logger.Error()
+            logBuilder
                 .Message("This is a test fluent message '{0}'.", DateTime.Now.Ticks)
                 .Property("Test", "ErrorWrite")
                 .Write();

             {
-                var expectedEvent = new LogEventInfo(LogLevel.Error, "logger1", "This is a test fluent message '{0}'.");
+                var expectedEvent = new LogEventInfo(logLevel, "logger1", "This is a test fluent message '{0}'.");
                 expectedEvent.Properties["Test"] = "ErrorWrite";
                 AssertLastLogEventTarget(expectedEvent);
                 AssertDebugLastMessageContains("t2", "This is a test fluent message '");
             }
         }
-

         /// <summary>
         /// Test the written logevent


added static methods to Result that mirror the extension methods.

--- DotNetFunctional/Primitives/Result.cs
+++ DotNetFunctional/Primitives/Result.cs
@@ -1,4 +1,5 @@
-using System.Diagnostics;
+using System.Collections.Generic;
+using System.Diagnostics;

 namespace System
 {
@@ -301,5 +302,76 @@
             => this.IsFailure
             ? Result.Fail<T>(this.Error)
             : Result.Ok(item);
+
+        #region Static versions of extension methods
+
+        /// <summary>
+        /// Combines all the Results in the <paramref name="results" /> list.
+        /// If there are no failure results, a Success Result is returned.
+        /// If there are any failure results, a Failure Result is returned that contains all the
+        /// error messages (separated separated by <paramref name="errorMessagesSeparator" />.)
+        /// </summary>
+        /// <param name="errorMessagesSeparator">Separator for error messages. Defaults to a comma.</param>
+        /// <param name="results">The results to combine.</param>
+        /// <returns></returns>
+        [DebuggerStepThrough]
+        public static Result CombineAll(IEnumerable<Result> results, string errorMessagesSeparator = ResultExtensions.DEFAULT_SEPARATOR)
+            => results.CombineAll(errorMessagesSeparator);
+
+        /// <summary>
+        /// Combines the results into a single result.
+        /// Returns all the errors in a single result if there are any.
+        /// Returns all the items as a success if there aren't any errors.
+        /// </summary>
+        /// <typeparam name="T"></typeparam>
+        /// <param name="errorMessagesSeparator">The error messages separator.</param>
+        /// <param name="results">The results to combine.</param>
+        /// <returns></returns>
+        [DebuggerStepThrough]
+        public static Result<IEnumerable<T>> CombineAll<T>(IEnumerable<Result<T>> results, string errorMessagesSeparator = ResultExtensions.DEFAULT_SEPARATOR)
+            => results.CombineAll(errorMessagesSeparator);
+
+        /// <summary>
+        /// Combines the Results, one at a time.
+        /// Returns the first failure encountered, or a Success Result if there are no failures.
+        /// </summary>
+        /// <param name="results">The results to combine.</param>
+        /// <returns></returns>
+        [DebuggerStepThrough]
+        public static Result CombineSequential(IEnumerable<Result> results)
+            => results.CombineSequential();
+
+        /// <summary>
+        /// Combines the Results, one at a time.
+        /// Returns the first failure encountered, or a Success Result if there are no failures.
+        /// </summary>
+        /// <typeparam name="T"></typeparam>
+        /// <param name="results">The results to combine.</param>
+        /// <returns></returns>
+        [DebuggerStepThrough]
+        public static Result CombineSequential<T>(IEnumerable<Result<T>> results)
+            => results.CombineSequential();
+
+        /// <summary>
+        /// Combines the Results, one at a time.
+        /// Returns the first failure encountered, or a Success Result if there are no failures.
+        /// </summary>
+        /// <param name="results">The results to combine.</param>
+        /// <returns></returns>
+        [DebuggerStepThrough]
+        public static Result CombineSequential(IEnumerable<Func<Result>> functions)
+            => functions.CombineSequential();
+
+        /// <summary>
+        /// Combines the Results of each function, one at a time.
+        /// Returns the first failure encountered, or all the results if there are no failures.
+        /// </summary>
+        /// <param name="results">The results to combine.</param>
+        /// <returns></returns>
+        [DebuggerStepThrough]
+        public static IEnumerable<Result<T>> CombineSequential<T>(IEnumerable<Func<Result<T>>> functions)
+            => functions.CombineSequential();
+
+        #endregion Static versions of extension methods
     }
 }


更改Get_Program_Version變數名稱

更改Get_Program_Version變數名稱

更改Get_Program_Version變數名稱為GetProgramVersion

--- UartOscilloscope/CSharpFiles/VersionInfo.cs
+++ UartOscilloscope/CSharpFiles/VersionInfo.cs
@@ -17,9 +17,9 @@
 	class VersionInfo                                                           //	VersionInfo類別
 	{                                                                           //	進入VersionInfo類別
 		private const float Program_Version = 39;								//	宣告Program_Version靜態全域變數，記錄程式版本
-		public float Get_Program_Version()                                      //	Get_Program_Version方法
-		{                                                                       //	進入Get_Program_Version方法
+		public float GetProgramVersion()										//	GetProgramVersion方法
+		{                                                                       //	進入GetProgramVersion方法
 			return Program_Version;                                             //	回傳Program_Version變數值
-		}                                                                       //	結束Get_Program_Version方法
+		}                                                                       //	結束GetProgramVersion方法
 	}                                                                           //	結束VersionInfo類別
 }                                                                               //	結束UartOscilloscope命名空間


S-54454: Use the new 15.0 SDK to access meta via IServices

--- VersionOne.ServerConnector/EntityFactory.cs
+++ VersionOne.ServerConnector/EntityFactory.cs
@@ -6,18 +6,16 @@
 namespace VersionOne.ServerConnector {
     // TODO extract interface and inject into VersionOneProcessor
     internal class EntityFactory {
-        private readonly IMetaModel metaModel;
         private readonly IServices services;
         private readonly IEnumerable<AttributeInfo> attributesToQuery;

-        internal EntityFactory(IMetaModel metaModel, IServices services, IEnumerable<AttributeInfo> attributesToQuery) {
-            this.metaModel = metaModel;
+        internal EntityFactory(IServices services, IEnumerable<AttributeInfo> attributesToQuery) {
             this.services = services;
             this.attributesToQuery = attributesToQuery;
         }

         internal Asset Create(string assetTypeName, IEnumerable<AttributeValue> attributeValues) {
-            var assetType = metaModel.GetAssetType(assetTypeName);
+            var assetType = services.Meta.GetAssetType(assetTypeName);
             var asset = services.New(assetType, Oid.Null);

             foreach (var attributeValue in attributeValues) {


Minor change in GenerateEmptyBlocksAsync method

--- WalletWasabi.Tests/NodeBuilding/CoreNode.cs
+++ WalletWasabi.Tests/NodeBuilding/CoreNode.cs
@@ -294,11 +294,12 @@
 			var bestBlock = await rpc.GetBlockAsync(height);
 			ConcurrentChain chain = null;
 			var blocks = new List<Block>();
-			var now = MockTime == null ? DateTimeOffset.UtcNow : MockTime.Value;
+			var now = MockTime ?? DateTimeOffset.UtcNow;
 			using(var node = CreateNodeClient())
 			{
 				node.VersionHandshake();
-				chain = node.GetChain();
+				chain = node.GetChain(bestBlock.Header.GetHash());
+
 				for(var i = 0; i < blockCount; i++)
 				{
 					uint nonce = 0;


Simplify code (fix codescene?)

Simplify code (fix codescene?)

--- WalletWasabi/TorSocks5/TorProcessManager.cs
+++ WalletWasabi/TorSocks5/TorProcessManager.cs
@@ -81,14 +81,9 @@
 						var torPath = "";
 						var geoIpPath = "";
 						var geoIp6Path = "";
-						var fullBaseDirectory = Path.GetFullPath(AppContext.BaseDirectory);
+						var fullBaseDirectory = EnvironmentHelpers.GetFullBaseDirectory();
 						if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
 						{
-							if (!fullBaseDirectory.StartsWith('/'))
-							{
-								fullBaseDirectory = fullBaseDirectory.Insert(0, "/");
-							}
-
 							torPath = $@"{torDir}/Tor/tor";
 							geoIpPath = $@"{torDir}/Data/Tor/geoip";
 							geoIp6Path = $@"{torDir}/Data/Tor/geoip6";


changed scope to 'openid nnin'

changed scope to 'openid nnin'

--- WebApp-B2C-DotNet/App_Start/Startup.Auth.cs
+++ WebApp-B2C-DotNet/App_Start/Startup.Auth.cs
@@ -57,7 +57,7 @@
                     SecurityTokenValidated = OnSecurityTokenValidated,

                 },
-                Scope = "openid",
+                Scope = "openid nnin", // Added nnin
                 ResponseType = "id_token",

                 // The PolicyConfigurationManager takes care of getting the correct Azure AD authentication


Unit 2 Lesson 5 done.

Unit 2 Lesson 5 done.

--- src/Unit-2/DoThis/Actors/ChartingActor.cs
+++ src/Unit-2/DoThis/Actors/ChartingActor.cs
@@ -7,7 +7,7 @@

 namespace ChartApp.Actors
 {
-    public class ChartingActor : ReceiveActor
+    public class ChartingActor : ReceiveActor, IWithUnboundedStash
     {
         /// <summary>
         /// Maximum number of points we will allow in a series
@@ -71,6 +71,8 @@
         private Dictionary<string, Series> _seriesIndex;
         private readonly Button _pauseButton;

+        public IStash Stash { get; set; }
+
         public ChartingActor(Chart chart, Button pauseButton) :
             this(chart, new Dictionary<string, Series>(), pauseButton)
         {
@@ -102,11 +104,17 @@

         private void Paused()
         {
+            Receive<AddSeries>(addSeries => Stash.Stash());
+            Receive<RemoveSeries>(removeSeries => Stash.Stash());
             Receive<Metric>(metric => HandleMetricsPaused(metric));
             Receive<TogglePause>(pause =>
             {
                 SetPauseButtonText(false);
                 UnbecomeStacked();
+
+                // ChartingActor is leaving the Paused state, put messages back
+                // into mailbox for processing under new behavior
+                Stash.UnstashAll();
             });
         }


Fixed AsyncResult not constructed correctly when AsyncCreationOptions are specified

--- src/UnityFx.Async/Api/Core/AsyncResult.cs
+++ src/UnityFx.Async/Api/Core/AsyncResult.cs
@@ -1107,7 +1107,7 @@
 				_exception = new OperationCanceledException();
 			}

-			if (flags > StatusRunning)
+			if ((flags & _statusMask) > StatusRunning)
 			{
 				_callback = _callbackCompletionSentinel;
 				_flags = flags | _flagCompletedSynchronously;


Fixed build failure

Fixed build failure

--- src/VsConsole/Console/VSScriptExecutor.cs
+++ src/VsConsole/Console/VSScriptExecutor.cs
@@ -88,7 +88,7 @@
                 if (fullScriptPath.EndsWith(PowerShellScripts.Init, StringComparison.OrdinalIgnoreCase))
                 {
                     _skipPSScriptExecution = await NuGetPackageManager.PackageExistsInAnotherNuGetProject(nuGetProject, packageIdentity,
-                        _solutionManager, nuGetProjectContext, CancellationToken.None);
+                        _solutionManager, CancellationToken.None);
                 }
                 else
                 {


update command property of entity editor

--- Wodsoft.ComBoost.Wpf/Editor/EntityEditor.cs
+++ Wodsoft.ComBoost.Wpf/Editor/EntityEditor.cs
@@ -47,9 +47,12 @@
             CurrentValue = null;
             IsChanged = OriginValue == null;
         }
+        public ICommand SelectCommand { get { return (ICommand)GetValue(SelectCommandProperty); } protected set { SetValue(SelectCommandPropertyKey, value); } }
+        protected static readonly DependencyPropertyKey SelectCommandPropertyKey = DependencyProperty.RegisterReadOnly("SelectCommand", typeof(ICommand), typeof(EntityEditor), new PropertyMetadata());
+        public static readonly DependencyProperty SelectCommandProperty = SelectCommandPropertyKey.DependencyProperty;

-        public ICommand SelectCommand { get; private set; }
-
-        public ICommand ClearCommand { get; private set; }
+        public ICommand ClearCommand { get { return (ICommand)GetValue(ClearCommandProperty); } protected set { SetValue(ClearCommandPropertyKey, value); } }
+        protected static readonly DependencyPropertyKey ClearCommandPropertyKey = DependencyProperty.RegisterReadOnly("ClearCommand", typeof(ICommand), typeof(EntityEditor), new PropertyMetadata());
+        public static readonly DependencyProperty ClearCommandProperty = ClearCommandPropertyKey.DependencyProperty;
     }
 }


Attempt to the server's OAuth login bits working again

The OAuth flow stopped working, seemingly because our redirect_uris are
now being rejected. This change may not entirely solve the problem, but
hopefully it will get the server's OAuth bits to work. We replace WWT
redirect URIs with the special "desktop" one, which is actually more
correct since the server-side OAuth flow is app-like rather than running
in a web browser.

--- src/WWTMVC5/WebServices/LiveIdAuth.svc.cs
+++ src/WWTMVC5/WebServices/LiveIdAuth.svc.cs
@@ -62,7 +62,9 @@

         public async Task<string> GetTokens(string authCode)
         {
-            var redir = GetRedirectUrl();
+            // This call is purely internal, so use the "desktop" redirect_uri. Our WWT ones
+            // are currently (2020 Nov) disabled, possibly because they are HTTP not HTTPS.
+            var redir = "https://login.live.com/oauth20_desktop.srf";
             var tokenUri = new Uri(string.Format("https://login.live.com/oauth20_token.srf?client_id={0}&redirect_uri={1}&client_secret={2}&code={3}&grant_type=authorization_code",
                 _clientId, HttpUtility.UrlEncode(redir), _clientSecret, authCode));

@@ -98,7 +100,9 @@
             {
                 return string.Empty;
             }
-            var redir = GetRedirectUrl();
+            // This call is purely internal, so use the "desktop" redirect_uri. Our WWT ones
+            // are currently (2020 Nov) disabled, possibly because they are HTTP not HTTPS.
+            var redir = "https://login.live.com/oauth20_desktop.srf";

             var tokenUri = string.Format("https://login.live.com/oauth20_token.srf?client_id={0}&redirect_uri={1}&client_secret={2}&refresh_token={3}&grant_type=refresh_token",
                 _clientId, HttpUtility.UrlEncode(redir), _clientSecret, token);


Added SendAsync templates for cleaner method calls.

--- src/WebSocketManager.Client/Connection.cs
+++ src/WebSocketManager.Client/Connection.cs
@@ -17,10 +17,12 @@
         public string ConnectionId { get; set; }

         private ClientWebSocket _clientWebSocket { get; set; }
+
         private JsonSerializerSettings _jsonSerializerSettings = new JsonSerializerSettings()
         {
             ContractResolver = new CamelCasePropertyNamesContractResolver()
         };
+
         private Dictionary<string, InvocationHandler> _handlers = new Dictionary<string, InvocationHandler>();

         public Connection()
@@ -38,14 +40,12 @@
                 {
                     this.ConnectionId = message.Data;
                 }
-
                 else if (message.MessageType == MessageType.ClientMethodInvocation)
                 {
                     var invocationDescriptor = JsonConvert.DeserializeObject<InvocationDescriptor>(message.Data, _jsonSerializerSettings);
                     Invoke(invocationDescriptor);
                 }
             });
-
         }

         public void On(string methodName, Action<object[]> handler)
@@ -53,17 +53,51 @@
             var invocationHandler = new InvocationHandler(handler, new Type[] { });
             _handlers.Add(methodName, invocationHandler);
         }
-    /// <summary>
-    /// Send a message to the server
-    /// </summary>
-    /// <param name="invocationDescriptor">Example usage: set the MethodName to SendMessage and set the arguments to the connectionID with a text message</param>
-    /// <returns></returns>
-    public async Task SendAsync(InvocationDescriptor invocationDescriptor)
-    {
-      var bytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(invocationDescriptor));
-      await _clientWebSocket.SendAsync(new ArraySegment<byte>(bytes), WebSocketMessageType.Text, true, CancellationToken.None);
-    }
-    private void Invoke(InvocationDescriptor invocationDescriptor)
+
+        /// <summary>
+        /// Send a message to the server
+        /// </summary>
+        /// <param name="invocationDescriptor">Example usage: set the MethodName to SendMessage and set the arguments to the connectionID with a text message</param>
+        /// <returns></returns>
+        public async Task SendAsync(InvocationDescriptor invocationDescriptor)
+        {
+            var bytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(invocationDescriptor));
+            await _clientWebSocket.SendAsync(new ArraySegment<byte>(bytes), WebSocketMessageType.Text, true, CancellationToken.None);
+        }
+
+        public async Task SendAsync<T1>(string method, T1 arg1) => await SendAsync(new InvocationDescriptor { MethodName = method, Arguments = new object[] { arg1 } });
+
+        public async Task SendAsync<T1, T2>(string method, T1 arg1, T2 arg2) => await SendAsync(new InvocationDescriptor { MethodName = method, Arguments = new object[] { arg1, arg2 } });
+
+        public async Task SendAsync<T1, T2, T3>(string method, T1 arg1, T2 arg2, T3 arg3) => await SendAsync(new InvocationDescriptor { MethodName = method, Arguments = new object[] { arg1, arg2, arg3 } });
+
+        public async Task SendAsync<T1, T2, T3, T4>(string method, T1 arg1, T2 arg2, T3 arg3, T4 arg4) => await SendAsync(new InvocationDescriptor { MethodName = method, Arguments = new object[] { arg1, arg2, arg3, arg4 } });
+
+        public async Task SendAsync<T1, T2, T3, T4, T5>(string method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) => await SendAsync(new InvocationDescriptor { MethodName = method, Arguments = new object[] { arg1, arg2, arg3, arg4, arg5 } });
+
+        public async Task SendAsync<T1, T2, T3, T4, T5, T6>(string method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) => await SendAsync(new InvocationDescriptor { MethodName = method, Arguments = new object[] { arg1, arg2, arg3, arg4, arg5, arg6 } });
+
+        public async Task SendAsync<T1, T2, T3, T4, T5, T6, T7>(string method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) => await SendAsync(new InvocationDescriptor { MethodName = method, Arguments = new object[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7 } });
+
+        public async Task SendAsync<T1, T2, T3, T4, T5, T6, T7, T8>(string method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8) => await SendAsync(new InvocationDescriptor { MethodName = method, Arguments = new object[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 } });
+
+        public async Task SendAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9>(string method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9) => await SendAsync(new InvocationDescriptor { MethodName = method, Arguments = new object[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 } });
+
+        public async Task SendAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(string method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10) => await SendAsync(new InvocationDescriptor { MethodName = method, Arguments = new object[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10 } });
+
+        public async Task SendAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(string method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11) => await SendAsync(new InvocationDescriptor { MethodName = method, Arguments = new object[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11 } });
+
+        public async Task SendAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(string method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12) => await SendAsync(new InvocationDescriptor { MethodName = method, Arguments = new object[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12 } });
+
+        public async Task SendAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(string method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13) => await SendAsync(new InvocationDescriptor { MethodName = method, Arguments = new object[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13 } });
+
+        public async Task SendAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(string method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14) => await SendAsync(new InvocationDescriptor { MethodName = method, Arguments = new object[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14 } });
+
+        public async Task SendAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(string method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15) => await SendAsync(new InvocationDescriptor { MethodName = method, Arguments = new object[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15 } });
+
+        public async Task SendAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(string method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16) => await SendAsync(new InvocationDescriptor { MethodName = method, Arguments = new object[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16 } });
+
+        private void Invoke(InvocationDescriptor invocationDescriptor)
         {
             var invocationHandler = _handlers[invocationDescriptor.MethodName];
             if (invocationHandler != null)
@@ -77,7 +111,6 @@

         private async Task Receive(ClientWebSocket clientWebSocket, Action<Message> handleMessage)
         {
-
             while (_clientWebSocket.State == WebSocketState.Open)
             {
                 ArraySegment<Byte> buffer = new ArraySegment<byte>(new Byte[1024 * 4]);
@@ -98,7 +131,6 @@
                     {
                         serializedMessage = await reader.ReadToEndAsync().ConfigureAwait(false);
                     }
-
                 }

                 if (result.MessageType == WebSocketMessageType.Text)
@@ -106,7 +138,6 @@
                     var message = JsonConvert.DeserializeObject<Message>(serializedMessage);
                     handleMessage(message);
                 }
-
                 else if (result.MessageType == WebSocketMessageType.Close)
                 {
                     await _clientWebSocket.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "", CancellationToken.None).ConfigureAwait(false);


Automated dotnet-format update from commit b432875d9a9fb9d0d5b96d67e49036686a43ff96 on refs/heads/dev

--- src/WeihanLi.Common/Services/Validator.cs
+++ src/WeihanLi.Common/Services/Validator.cs
@@ -17,7 +17,7 @@

 public sealed class DataAnnotationValidator : IValidator
 {
-    public static IValidator Instance {get;}
+    public static IValidator Instance { get; }

     static DataAnnotationValidator()
     {


[tests] Disable failing MSBuildTask_Tests.PropertyOverridesContainSemicolon

.. on mono/osx.

- Fix the path issues in test
- the remaining problem is that is it trying to invoke `csc.exe` from
  mono's framework directory. The correct fix would be the mono specific
  targets file which overrides `CscTool*` properties.

--- src/XMakeTasks/UnitTests/MSBuild_Tests.cs
+++ src/XMakeTasks/UnitTests/MSBuild_Tests.cs
@@ -329,6 +329,7 @@
 #else
         [Fact]
 #endif
+        [Trait("Category", "mono-osx-failing")]
         public void PropertyOverridesContainSemicolon()
         {
             ObjectModelHelpers.DeleteTempProjectDirectory();
@@ -339,7 +340,7 @@

             // Just a normal console application project.
             ObjectModelHelpers.CreateFileInTempProjectDirectory(
-                @"bug'533'369\Sub;Dir\ConsoleApplication1\ConsoleApplication1.csproj", @"
+                Path.Combine("bug'533'369", "Sub;Dir", "ConsoleApplication1", "ConsoleApplication1.csproj"), @"

                 <Project DefaultTargets=`Build` ToolsVersion=`msbuilddefaulttoolsversion` xmlns=`msbuildnamespace`>
                   <PropertyGroup>
@@ -377,7 +378,7 @@

             // Just a normal console application project.
             ObjectModelHelpers.CreateFileInTempProjectDirectory(
-                @"bug'533'369\Sub;Dir\ConsoleApplication1\Program.cs", @"
+                Path.Combine("bug'533'369", "Sub;Dir", "ConsoleApplication1", "Program.cs"), @"
                 using System;

                 namespace ConsoleApplication32
@@ -401,7 +402,7 @@
             // is coming from another property which is produced by CreateProperty and has
             // some special characters in it.
             ObjectModelHelpers.CreateFileInTempProjectDirectory(
-                @"bug'533'369\Sub;Dir\TeamBuild.proj", @"
+                Path.Combine("bug'533'369", "Sub;Dir", "TeamBuild.proj"), @"
                 <Project ToolsVersion=`msbuilddefaulttoolsversion` xmlns=`msbuildnamespace`>

                     <Target Name=`Build`>
@@ -418,9 +419,9 @@
                 </Project>
                 ");

-            ObjectModelHelpers.BuildTempProjectFileExpectSuccess(@"bug'533'369\Sub;Dir\TeamBuild.proj");
-
-            ObjectModelHelpers.AssertFileExistsInTempProjectDirectory(@"bug'533'369\Sub;Dir\binaries\ConsoleApplication1.exe");
+            ObjectModelHelpers.BuildTempProjectFileExpectSuccess(Path.Combine("bug'533'369", "Sub;Dir", "TeamBuild.proj"));
+
+            ObjectModelHelpers.AssertFileExistsInTempProjectDirectory(Path.Combine("bug'533'369", "Sub;Dir", "binaries", "ConsoleApplication1.exe"));
         }

         /// <summary>


Fix DelegateFileSystem.ReplaceFileImpl invalid destBackupPath

--- src/Zio/FileSystems/DelegateFileSystem.cs
+++ src/Zio/FileSystems/DelegateFileSystem.cs
@@ -69,7 +69,7 @@
         protected override void ReplaceFileImpl(PathInfo srcPath, PathInfo destPath, PathInfo destBackupPath,
             bool ignoreMetadataErrors)
         {
-            NextFileSystem.ReplaceFile(ConvertPathToDelegate(srcPath), ConvertPathToDelegate(destPath), destBackupPath.IsNull ? destBackupPath : ConvertPathToDelegate(destPath), ignoreMetadataErrors);
+            NextFileSystem.ReplaceFile(ConvertPathToDelegate(srcPath), ConvertPathToDelegate(destPath), destBackupPath.IsNull ? destBackupPath : ConvertPathToDelegate(destBackupPath), ignoreMetadataErrors);
         }

         /// <inheritdoc />


FileSystemSample - ShouldGetExistingFileAndReadContents

--- projects/FileSystemSample/test/FileSystemContract.Directory.cs
+++ projects/FileSystemSample/test/FileSystemContract.Directory.cs
@@ -170,6 +170,19 @@
             ShouldGetTwoMatchingFiles("A?.*", dir, @"*\Dir1\ab.txt", @"*\Dir1\ag.txt");
         }

+        [TestMethod]
+        public void ShouldGetExistingFileAndReadContents()
+        {
+            IFileSystem fs = this.Create();
+            IDirectory dir = this.CreateDir(fs, "Parent");
+            IFile file1 = CreateFile(dir, "a.txt");
+            this.WriteAll(file1, "remember me");
+
+            IFile file2 = GetOneFile(dir);
+
+            this.ReadToEnd(file2).Should().Be("remember me");
+        }
+
         private static void ShouldGetNoFiles(IDirectory dir)
         {
             IFile[] files = dir.GetFiles("*");
@@ -177,11 +190,16 @@
             files.Should().BeEmpty();
         }

+        private static IFile GetOneFile(IDirectory dir)
+        {
+            IFile[] files = dir.GetFiles("*");
+
+            return files.Should().ContainSingle().Which;
+        }
+
         private static void ShouldGetOneFile(IDirectory dir, string expectedMatch)
         {
-            IFile[] files = dir.GetFiles("*");
-
-            files.Should().ContainSingle().Which.Path.ToString().Should().Match(expectedMatch);
+            GetOneFile(dir).Path.ToString().Should().Match(expectedMatch);
         }

         private static void ShouldGetTwoFiles(IDirectory dir, string expectedMatch0, string expectedMatch1)


[WIN-7036] macOS - Save dialogs should correctly display the default file name instead of "untitled"

--- Xwt.XamMac/Xwt.Mac/SaveFileDialogBackend.cs
+++ Xwt.XamMac/Xwt.Mac/SaveFileDialogBackend.cs
@@ -39,8 +39,10 @@
 		#region IFileDialogBackend implementation
 		public void Initialize (System.Collections.Generic.IEnumerable<FileDialogFilter> filters, bool multiselect, string initialFileName)
 		{
-			if (!string.IsNullOrEmpty (initialFileName))
-				this.DirectoryUrl = new NSUrl (initialFileName,true);
+			if(!string.IsNullOrEmpty(initialFileName)) {
+				this.NameFieldStringValue = initialFileName;
+				this.DirectoryUrl = new NSUrl(initialFileName, true);
+			}

 			this.Prompt = Application.TranslationCatalog.GetString("Select File");
 		}


Added attribute argument serialized type name tests

--- src/ApiContractGenerator.Tests/Integration/AttributeTests.cs
+++ src/ApiContractGenerator.Tests/Integration/AttributeTests.cs
@@ -28,5 +28,93 @@
                 "    }",
                 "}"));
         }
+
+        [Test]
+        public static void Attribute_argument_with_serialized_generic_enum_type_name()
+        {
+            Assert.That("[Test(A.B.C<int, object>.D<A.B.C<int, object>.D<int>.E>.E.F)] public class TestAttribute : System.Attribute { public TestAttribute(object obj) { } }" +
+                        "namespace A.B { public static class C<T1, T2> { public static class D<T3> { public enum E { F } } } }", HasContract(
+                "[Test(A.B.C<int, object>.D<A.B.C<int, object>.D<int>.E>.E.F)]",
+                "public class TestAttribute : System.Attribute",
+                "{",
+                "    public TestAttribute(object obj);",
+                "}",
+                "namespace A.B",
+                "{",
+                "    public static class C<T1, T2>",
+                "    {",
+                "        public static class D<T3>",
+                "        {",
+                "            public enum E : int",
+                "            {",
+                "                F = 0",
+                "            }",
+                "        }",
+                "    }",
+                "}"));
+        }
+
+        [Test]
+        public static void Attribute_argument_with_serialized_type_name()
+        {
+            Assert.That("[Test(typeof(A.B.C.D))] public class TestAttribute : System.Attribute { public TestAttribute(object obj) { } }" +
+                        "namespace A.B { public static class C { public static class D { } } }", HasContract(
+                "[Test(typeof(A.B.C.D))]",
+                "public class TestAttribute : System.Attribute",
+                "{",
+                "    public TestAttribute(object obj);",
+                "}",
+                "namespace A.B",
+                "{",
+                "    public static class C",
+                "    {",
+                "        public static class D",
+                "        {",
+                "        }",
+                "    }",
+                "}"));
+        }
+
+        [Test]
+        public static void Attribute_argument_with_serialized_open_generic_type_name()
+        {
+            Assert.That("[Test(typeof(A.B.C<,>.D<>))] public class TestAttribute : System.Attribute { public TestAttribute(object obj) { } }" +
+                        "namespace A.B { public static class C<T1, T2> { public static class D<T3> { } } }", HasContract(
+                "[Test(typeof(A.B.C<,>.D<>))]",
+                "public class TestAttribute : System.Attribute",
+                "{",
+                "    public TestAttribute(object obj);",
+                "}",
+                "namespace A.B",
+                "{",
+                "    public static class C<T1, T2>",
+                "    {",
+                "        public static class D<T3>",
+                "        {",
+                "        }",
+                "    }",
+                "}"));
+        }
+
+        [Test]
+        public static void Attribute_argument_with_serialized_closed_generic_type_name()
+        {
+            Assert.That("[Test(typeof(A.B.C<int, object>.D<A.B.C<int, object>.D<int>>))] public class TestAttribute : System.Attribute { public TestAttribute(object obj) { } }" +
+                        "namespace A.B { public static class C<T1, T2> { public class D<T3> { private D() { } } } }", HasContract(
+                "[Test(typeof(A.B.C<int, object>.D<A.B.C<int, object>.D<int>>))]",
+                "public class TestAttribute : System.Attribute",
+                "{",
+                "    public TestAttribute(object obj);",
+                "}",
+                "namespace A.B",
+                "{",
+                "    public static class C<T1, T2>",
+                "    {",
+                "        public class D<T3>",
+                "        {",
+                "        }",
+                "    }",
+                "}"));
+        }
     }
 }


Fix persistent login

Fix persistent login

--- src/ChessVariantsTraining/Services/PersistentLoginHandler.cs
+++ src/ChessVariantsTraining/Services/PersistentLoginHandler.cs
@@ -69,7 +69,8 @@
                 login = new SavedLogin(user, context.Connection.RemoteIpAddress.ToString());
             } while (savedLoginRepository.ContainsID(login.ID));
             savedLoginRepository.Add(login);
-            context.Response.Cookies.Append("login", login.ID + ":" + login.UnhashedToken);
+            context.Response.Cookies.Append("login", login.ID + ":" + login.UnhashedToken, new CookieOptions() { HttpOnly = true, Secure = true,
+                Expires = new DateTimeOffset(DateTime.UtcNow.AddDays(30), new TimeSpan(0)) });
         }

         public void Logout(HttpContext context)
@@ -89,7 +90,7 @@
             }

             savedLoginRepository.Delete(identifier);
-            context.Response.Cookies.Delete("login", new CookieOptions() { HttpOnly = true, Secure = true });
+            context.Response.Cookies.Delete("login");
         }

         public void LogoutEverywhereExceptHere(HttpContext context)


Fixed obsolete message.

Fixed obsolete message.

--- src/Core/Managed/Shared/DataContracts/DependencyTelemetry.cs
+++ src/Core/Managed/Shared/DataContracts/DependencyTelemetry.cs
@@ -207,7 +207,7 @@
         /// Gets or sets the dependency kind, like SQL, HTTP, Azure, etc.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        [Obsolete("Use DependencyTypeName")]
+        [Obsolete("Use Type")]
         public string DependencyKind
         {
             get