config

config

--- Web/WebBaseSystem.Web/App_Start/IdentityConfig.cs
+++ Web/WebBaseSystem.Web/App_Start/IdentityConfig.cs
@@ -1,45 +1,45 @@
-using System.Threading.Tasks;
-using Microsoft.AspNet.Identity;
-using Microsoft.AspNet.Identity.EntityFramework;
-using Microsoft.AspNet.Identity.Owin;
-using Microsoft.Owin;
-using WebBaseSystem.Web.Models;
-
-namespace WebBaseSystem.Web
-{
-    // Configure the application user manager used in this application. UserManager is defined in ASP.NET Identity and is used by the application.
-
-    public class ApplicationUserManager : UserManager<ApplicationUser>
-    {
-        public ApplicationUserManager(IUserStore<ApplicationUser> store)
-            : base(store)
-        {
-        }
-
-        public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options, IOwinContext context)
-        {
-            var manager = new ApplicationUserManager(new UserStore<ApplicationUser>(context.Get<ApplicationDbContext>()));
-            // Configure validation logic for usernames
-            manager.UserValidator = new UserValidator<ApplicationUser>(manager)
-            {
-                AllowOnlyAlphanumericUserNames = false,
-                RequireUniqueEmail = true
-            };
-            // Configure validation logic for passwords
-            manager.PasswordValidator = new PasswordValidator
-            {
-                RequiredLength = 6,
-                RequireNonLetterOrDigit = true,
-                RequireDigit = true,
-                RequireLowercase = true,
-                RequireUppercase = true,
-            };
-            var dataProtectionProvider = options.DataProtectionProvider;
-            if (dataProtectionProvider != null)
-            {
-                manager.UserTokenProvider = new DataProtectorTokenProvider<ApplicationUser>(dataProtectionProvider.Create("ASP.NET Identity"));
-            }
-            return manager;
-        }
-    }
-}
+using System.Threading.Tasks;
+using Microsoft.AspNet.Identity;
+using Microsoft.AspNet.Identity.EntityFramework;
+using Microsoft.AspNet.Identity.Owin;
+using Microsoft.Owin;
+using WebBaseSystem.Web.Models;
+
+namespace WebBaseSystem.Web
+{
+    // Configure the application user manager used in this application. UserManager is defined in ASP.NET Identity and is used by the application.
+
+    public class ApplicationUserManager : UserManager<ApplicationUser>
+    {
+        public ApplicationUserManager(IUserStore<ApplicationUser> store)
+            : base(store)
+        {
+        }
+
+        public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options, IOwinContext context)
+        {
+            var manager = new ApplicationUserManager(new UserStore<ApplicationUser>(context.Get<ApplicationDbContext>()));
+            // Configure validation logic for usernames
+            manager.UserValidator = new UserValidator<ApplicationUser>(manager)
+            {
+                AllowOnlyAlphanumericUserNames = false,
+                RequireUniqueEmail = true
+            };
+            // Configure validation logic for passwords
+            manager.PasswordValidator = new PasswordValidator
+            {
+                RequiredLength = 6,
+                RequireNonLetterOrDigit = false,
+                RequireDigit = false,
+                RequireLowercase = false,
+                RequireUppercase = false,
+            };
+            var dataProtectionProvider = options.DataProtectionProvider;
+            if (dataProtectionProvider != null)
+            {
+                manager.UserTokenProvider = new DataProtectorTokenProvider<ApplicationUser>(dataProtectionProvider.Create("ASP.NET Identity"));
+            }
+            return manager;
+        }
+    }
+}


fix: review chagnes

fix: review chagnes

--- pubsub/api/Pubsub.Samples/PullMessagesWithFlowControlAsync.cs
+++ pubsub/api/Pubsub.Samples/PullMessagesWithFlowControlAsync.cs
@@ -14,6 +14,7 @@

 // [START pubsub_subscriber_flow_settings]

+using Google.Api.Gax;
 using Google.Cloud.PubSub.V1;
 using System;
 using System.Linq;
@@ -32,7 +33,7 @@
             {
                 AckExtensionWindow = TimeSpan.FromSeconds(4),
                 AckDeadline = TimeSpan.FromSeconds(10),
-                FlowControlSettings = new Google.Api.Gax.FlowControlSettings(maxOutstandingElementCount: 100, maxOutstandingByteCount: 10240)
+                FlowControlSettings = new FlowControlSettings(maxOutstandingElementCount: 100, maxOutstandingByteCount: 10240)
             });
         // SubscriberClient runs your message handle function on multiple
         // threads to maximize throughput.


Left aligning the RGB + Hex labels because I think it looks a little better.

--- windows/ColorInspector/InspectorForm.Designer.cs
+++ windows/ColorInspector/InspectorForm.Designer.cs
@@ -62,7 +62,7 @@
             //
             this.lblHex.AutoSize = true;
             this.lblHex.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.lblHex.Location = new System.Drawing.Point(309, 56);
+            this.lblHex.Location = new System.Drawing.Point(305, 56);
             this.lblHex.Name = "lblHex";
             this.lblHex.Size = new System.Drawing.Size(34, 13);
             this.lblHex.TabIndex = 3;


Fix another failing test in VirtualEnvTests.

--- Python/Tests/Core.UI/VirtualEnvTests.cs
+++ Python/Tests/Core.UI/VirtualEnvTests.cs
@@ -359,21 +359,21 @@
                 var project = app.OpenProject(@"TestData\Environments.sln");

                 app.OpenSolutionExplorer().SelectProject(project);
-                app.Dte.ExecuteCommand("Python.ActivateEnvironment", "/env:\"Python 32-bit 2.7\"");
+                app.Dte.ExecuteCommand("Python.ActivateEnvironment", "/env:\"Python 2.7 (32-bit)\"");

                 using (var createVenv = AutomationDialog.FromDte(app, "Python.AddVirtualEnvironment")) {
                     var baseInterp = new ComboBox(createVenv.FindByAutomationId("BaseInterpreter")).GetSelectedItemName();

-                    Assert.AreEqual("Python 32-bit 2.7", baseInterp);
+                    Assert.AreEqual("Python 2.7 (32-bit)", baseInterp);
                     createVenv.Cancel();
                 }

-                app.Dte.ExecuteCommand("Python.ActivateEnvironment", "/env:\"Python 32-bit 3.3\"");
+                app.Dte.ExecuteCommand("Python.ActivateEnvironment", "/env:\"Python 3.3 (32-bit)\"");

                 using (var createVenv = AutomationDialog.FromDte(app, "Python.AddVirtualEnvironment")) {
                     var baseInterp = new ComboBox(createVenv.FindByAutomationId("BaseInterpreter")).GetSelectedItemName();

-                    Assert.AreEqual("Python 32-bit 3.3", baseInterp);
+                    Assert.AreEqual("Python 3.3 (32-bit)", baseInterp);
                     createVenv.Cancel();
                 }
             }


Skip broken test

Skip broken test

--- test/dotnet-watch.FunctionalTests/NoDepsAppTests.cs
+++ test/dotnet-watch.FunctionalTests/NoDepsAppTests.cs
@@ -41,7 +41,7 @@
             Assert.Throws<ArgumentException>(() => Process.GetProcessById(pid));
         }

-        [Fact]
+        [Fact(Skip="https://github.com/aspnet/DotNetTools/issues/407")]
         public async Task RestartProcessThatTerminatesAfterFileChange()
         {
             await _app.StartWatcherAsync();


Add test showing handling of creating twice

If consumers are supposed to be able to run EnsureIndexes when their app starts, it should not crash if the indexes have not changed.

--- test/functional/MongoManager_EnsureIndexes_Tests.cs
+++ test/functional/MongoManager_EnsureIndexes_Tests.cs
@@ -109,6 +109,17 @@
             Assert.Equal(new BsonDocument().Add("CompoundnessOfTheLong", 1).Add("StringOfCompoundness", 1), secondSetOfIndexes["compound_index"].GetElement("key").Value);
         }

+        [Fact]
+        public void DoNothingIfTheIndexAlreadyExists_andIsTheSame()
+        {
+            CreateAndGetIndexes<SimpleIndexes>(); // should drop and create
+            var afterSecondRun = CreateAndGetIndexes<SimpleIndexes>(false); // should _NOT_ drop
+
+            Assert.Equal(3, afterSecondRun.Count); // the auto-generated "_id_" and our own
+            Assert.Equal(new BsonDocument().Add("String", 1), afterSecondRun["string_index"].GetElement("key").Value);
+            Assert.Equal(new BsonDocument().Add("Int", 1), afterSecondRun["Int_1"].GetElement("key").Value);
+        }
+
         #region Create and get indexes
         private IDictionary<string, BsonDocument> CreateAndGetIndexes<TDocument>(bool doDrop = true)
         {


close #314

close #314

--- src/core/Akka.Remote.Tests/RemoteWatcherSpec.cs
+++ src/core/Akka.Remote.Tests/RemoteWatcherSpec.cs
@@ -381,8 +381,45 @@

             //assume that connection comes up again, or remote system is restarted
             var c = CreateRemoteActor(Props.Create<MyActor>(), "c6");
-
-            //TODO: Finish test
+            monitorA.Tell(new RemoteWatcher.WatchRemote(c,a));
+
+            monitorA.Tell(RemoteWatcher.HeartbeatTick.Instance, TestActor);
+            ExpectMsg<RemoteWatcher.Heartbeat>();
+            monitorA.Tell(_heartbeatRspB, monitorB);
+            ExpectNoMsg(TimeSpan.FromSeconds(1));
+            monitorA.Tell(RemoteWatcher.HeartbeatTick.Instance, TestActor);
+            ExpectMsg<RemoteWatcher.Heartbeat>();
+            monitorA.Tell(_heartbeatRspB, monitorB);
+            monitorA.Tell(RemoteWatcher.HeartbeatTick.Instance, TestActor);
+            ExpectMsg<RemoteWatcher.Heartbeat>();
+            monitorA.Tell(RemoteWatcher.ReapUnreachableTick.Instance, TestActor);
+            p.ExpectNoMsg(TimeSpan.FromSeconds(1));
+            monitorA.Tell(RemoteWatcher.HeartbeatTick.Instance, TestActor);
+            ExpectMsg<RemoteWatcher.Heartbeat>();
+            monitorA.Tell(_heartbeatRspB, monitorB);
+            monitorA.Tell(RemoteWatcher.HeartbeatTick.Instance, TestActor);
+            ExpectMsg<RemoteWatcher.Heartbeat>();
+            monitorA.Tell(RemoteWatcher.ReapUnreachableTick.Instance, TestActor);
+            p.ExpectNoMsg(TimeSpan.FromSeconds(1));
+            q.ExpectNoMsg(TimeSpan.FromSeconds(1));
+
+            //then stop heartbeating again; should generate a new AddressTerminated
+            Within(TimeSpan.FromSeconds(10), () =>
+            {
+                AwaitAssert(() =>
+                {
+                    monitorA.Tell(RemoteWatcher.HeartbeatTick.Instance, TestActor);
+                    ExpectMsg<RemoteWatcher.Heartbeat>();
+                    //but no HeartbeatRsp
+                    monitorA.Tell(RemoteWatcher.ReapUnreachableTick.Instance);
+                    p.ExpectMsg(new TestRemoteWatcher.AddressTerm(b.Path.Address), TimeSpan.FromSeconds(1));
+                    q.ExpectMsg(new TestRemoteWatcher.Quarantined(b.Path.Address, RemoteAddressUid), TimeSpan.FromSeconds(1));
+                });
+                return true;
+            });
+
+            //make sure nothing floods over to next test
+            ExpectNoMsg(TimeSpan.FromSeconds(2));
         }

     }


Added linq-to-BsonExpression conversion for Equals method

--- LiteDB.Tests/Mapper/LinqBsonExpression_Tests.cs
+++ LiteDB.Tests/Mapper/LinqBsonExpression_Tests.cs
@@ -84,7 +84,24 @@
             public List<User> Users { get; set; }
         }

-        private static Address StaticProp { get; set; } = new Address {Number = 99};
+        public class Account
+        {
+            [BsonId]
+            public Guid Id { get; set; }
+
+            [BsonRef("customers")]
+            public Customer Customer { get; set; }
+        }
+
+        public class Product
+        {
+            [BsonId]
+            public ObjectId Id { get; set; }
+
+            public string Name { get; set; }
+        }
+
+        private static Address StaticProp { get; set; } = new Address { Number = 99 };
         private const int CONST_INT = 100;
         private string MyMethod() => "ok";
         private int MyIndex() => 5;
@@ -109,7 +126,7 @@
             // only constants
             var today = DateTime.Today;
             var john = "JOHN";
-            var a = new {b = new {c = "JOHN"}};
+            var a = new { b = new { c = "JOHN" } };

             // only constants
             TestExpr(x => 0, "@p0", 0);
@@ -181,7 +198,7 @@
             TestExpr<User>(x => x.Phones.ElementAt(1), "$.Phones[@p0]", 1);

             // call external method/props/const inside parameter expression
-            var a = new {b = new {c = 123}};
+            var a = new { b = new { c = 123 } };

             // Items(int) generate eval value index
             TestExpr<User>(x => x.Phones[a.b.c].Number, "$.Phones[123].Number");
@@ -262,9 +279,9 @@
             // cast only fromType Double/Decimal to Int32/64

             // int cast/convert/parse
-            TestExpr<User>(x => (int) x.Salary, "INT32(Salary)");
-            TestExpr<User>(x => (int) x.Salary, "INT32(Salary)");
-            TestExpr<User>(x => (double) x.Id, "_id");
+            TestExpr<User>(x => (int)x.Salary, "INT32(Salary)");
+            TestExpr<User>(x => (int)x.Salary, "INT32(Salary)");
+            TestExpr<User>(x => (double)x.Id, "_id");
             TestExpr(x => Convert.ToInt32("123"), "INT32(@p0)", "123");
             TestExpr(x => Int32.Parse("123"), "INT32(@p0)", "123");
         }
@@ -288,6 +305,13 @@
             TestExpr<User>(x => x.Name.EndsWith("David"), "Name LIKE ('%' + @p0)", "David");
             TestExpr<User>(x => x.Name.StartsWith(x.Address.Street), "Name LIKE (Address.Street + '%')");

+            // Equals
+            TestExpr<User>(x => x.Name.Equals("John"), "Name = @p0", "John");
+            TestExpr<User>(x => x.CreatedOn.Equals(new DateTime(2019, 1, 1)), "CreatedOn = DATETIME(@p0, @p1, @p2)", 2019, 1, 1);
+            TestExpr<Account>(x => x.Id.Equals(Guid.Empty), $"_id = GUID(\"{Guid.Empty.ToString()}\")");
+            TestExpr<Product>(x => x.Id.Equals(ObjectId.Empty), $"_id = OBJECTID(\"{ObjectId.Empty.ToString()}\")");
+            TestExpr<User>(x => x.Salary.Equals(2000.0D), "Salary = @p0", 2000.0D);
+
             // string members
             TestExpr<User>(x => x.Address.Street.Length, "LENGTH(Address.Street)");
             TestExpr(x => string.Empty, "''");
@@ -345,11 +369,11 @@
         public void Linq_New_Instance()
         {
             // new class
-            TestExpr<User>(x => new {x.Name, x.Address}, "{ Name, Address }");
-            TestExpr<User>(x => new {N = x.Name, A = x.Address}, "{ N: $.Name, A: $.Address }");
+            TestExpr<User>(x => new { x.Name, x.Address }, "{ Name, Address }");
+            TestExpr<User>(x => new { N = x.Name, A = x.Address }, "{ N: $.Name, A: $.Address }");

             // new array
-            TestExpr<User>(x => new int[] {x.Id, 6, 7}, "[_id, @p0, @p1]", 6, 7);
+            TestExpr<User>(x => new int[] { x.Id, 6, 7 }, "[_id, @p0, @p1]", 6, 7);

             // new fixed types
             TestExpr(x => new DateTime(2018, 5, 28), "DATETIME(@p0, @p1, @p2)", 2018, 5, 28);
@@ -357,20 +381,20 @@
             TestExpr(x => new Guid("1A3B944E-3632-467B-A53A-206305310BAC"), "GUID(@p0)", "1A3B944E-3632-467B-A53A-206305310BAC");

             // new instances with initializers
-            TestExpr<User>(x => new User {Id = 1, Active = false}, "{ _id: @p0, Active: @p1 }", 1, false);
+            TestExpr<User>(x => new User { Id = 1, Active = false }, "{ _id: @p0, Active: @p1 }", 1, false);

             // used in UpdateMany extend document
-            TestExpr<User>(x => new User {Name = x.Name.ToUpper(), Salary = x.Salary * 2}, "{ Name: UPPER($.Name), Salary: ($.Salary * @p0) }", 2);
+            TestExpr<User>(x => new User { Name = x.Name.ToUpper(), Salary = x.Salary * 2 }, "{ Name: UPPER($.Name), Salary: ($.Salary * @p0) }", 2);
         }

         [Fact]
         public void Linq_Composite_Key()
         {
             // using composite key new class initializer
-            TestExpr<User>(x => x.Address == new Address {Number = 555}, "(Address = { Number: @p0 })", 555);
+            TestExpr<User>(x => x.Address == new Address { Number = 555 }, "(Address = { Number: @p0 })", 555);

             // using 2 levels
-            TestExpr<User>(x => x.Address == new Address {Number = 1, City = new City {Country = "BR", CityName = "POA"}},
+            TestExpr<User>(x => x.Address == new Address { Number = 1, City = new City { Country = "BR", CityName = "POA" } },
                 "(Address = { Number: @p0, City: { Country: @p1, CityName: @p2 } })", 1, "BR", "POA");
         }

@@ -397,18 +421,18 @@
         public void Linq_Complex_Expressions()
         {
             TestExpr<User>(x => new
-                {
-                    CityName = x.Address.City.CityName,
-                    Count = x.Phones.Where(p => p.Type == PhoneType.Landline).Count(),
-                    List = x.Phones.Where(p => p.Number > x.Salary).Select(p => p.Number).ToArray()
-                },
+            {
+                CityName = x.Address.City.CityName,
+                Count = x.Phones.Where(p => p.Type == PhoneType.Landline).Count(),
+                List = x.Phones.Where(p => p.Number > x.Salary).Select(p => p.Number).ToArray()
+            },
                 @"
             {
                 CityName: $.Address.City.CityName,
                 Count: COUNT(FILTER($.Phones=>(@.Type=@p0))),
                 List: ARRAY(MAP(FILTER($.Phones=>(@.Number>$.Salary))=>@.Number))
             }",
-                (int) PhoneType.Landline);
+                (int)PhoneType.Landline);
         }

         [Fact]
@@ -433,7 +457,7 @@
             TestExpr<User>(x => x.DomainName, "$.USER_DOMAIN_NAME");

             // in creation new class
-            TestExpr<User>(x => new {x.DomainName}, "{ DomainName: $.USER_DOMAIN_NAME }");
+            TestExpr<User>(x => new { x.DomainName }, "{ DomainName: $.USER_DOMAIN_NAME }");
         }

         [Fact]


cleaned up Utils.cs (win)

cleaned up Utils.cs (win)

--- src/ui/windows/TogglDesktop/TogglDesktop/Utils.cs
+++ src/ui/windows/TogglDesktop/TogglDesktop/Utils.cs
@@ -3,6 +3,7 @@
 using System.Linq;
 using System.Windows.Forms;
 using System.Windows;
+using TogglDesktop.Properties;
 using TogglDesktop.WPF;
 using Size = System.Drawing.Size;

@@ -10,21 +11,23 @@
 {
 public static class Utils
 {
+    #region window position loading and saving
+
     public static void LoadWindowLocation(Window mainWindow, EditViewPopup editPopup)
     {
         try
         {
             if (editPopup != null)
             {
-                var size = Properties.Settings.Default.EditSize;
+                var size = Settings.Default.EditSize;
                 editPopup.Width = size.Width;
                 editPopup.Height = size.Height;
             }
-            if (Properties.Settings.Default.Maximized)
+            if (Settings.Default.Maximized)
             {
                 mainWindow.WindowState = WindowState.Maximized;
             }
-            else if (Properties.Settings.Default.Minimized)
+            else if (Settings.Default.Minimized)
             {
                 mainWindow.WindowState = WindowState.Minimized;
             }
@@ -51,7 +54,7 @@
         }
         catch (Exception ex)
         {
-            Console.WriteLine("Could not load window location: ", ex);
+            Toggl.Debug("Could not load window location: " + ex);
         }
     }

@@ -65,37 +68,37 @@
             .Any(s => s.WorkingArea.IntersectsWith(windowBounds));
     }

-    public static TogglDesktop.ModifierKeys GetModifiers(KeyEventArgs e)
+    public static void SaveWindowLocation(Window mainWindow, EditViewPopup edit)
     {
-        TogglDesktop.ModifierKeys modifiers = 0;
-        if (e != null)
+        try
         {
-            if (e.Alt)
+            Toggl.SetWindowSettings(
+                (long)mainWindow.Left,
+                (long)mainWindow.Top,
+                (long)mainWindow.Height,
+                (long)mainWindow.Width);
+
+            var state = mainWindow.WindowState;
+            Settings.Default.Maximized = state == WindowState.Maximized;
+            Settings.Default.Minimized = state == WindowState.Minimized;
+
+            if (edit != null)
             {
-                modifiers = modifiers | TogglDesktop.ModifierKeys.Alt;
+                Settings.Default.EditSize = new Size((int)edit.Width, (int)edit.Height);
             }
-            if (e.Control)
-            {
-                modifiers = modifiers | TogglDesktop.ModifierKeys.Control;
-            }
-            if (e.Shift)
-            {
-                modifiers = modifiers | TogglDesktop.ModifierKeys.Shift;
-            }
+
+            Settings.Default.Save();
         }
-        return modifiers;
+        catch (Exception ex)
+        {
+            Toggl.Debug("Could not save window location: " + ex);
+        }
     }

-    public static string GetKeyCode(KeyEventArgs e)
-    {
-        if (e != null)
-        {
-            return e.KeyCode.ToString();
-        }
-        return null;
-    }
+    #endregion

-
+    #region keyboard shortcuts
+
     public struct KeyCombination
     {
         private readonly ModifierKeys modifiers;
@@ -107,100 +110,50 @@
             this.keyCode = keyCode;
         }

-        public ModifierKeys Modifiers {
-            get {
-                return this.modifiers;
-            }
-        }
-        public string KeyCode {
-            get {
-                return this.keyCode;
-            }
-        }
+        public ModifierKeys Modifiers { get { return this.modifiers; } }
+        public string KeyCode { get { return this.keyCode; } }
     }

     public static void SetShortcutForShow(KeyCombination? e)
+    {
+        setShortcut(e, "show",
+            (s, m) => s.ShowModifiers = m,
+            (s, k) => s.ShowKey = k
+            );
+    }
+
+    public static void SetShortcutForStart(KeyCombination? e)
+    {
+        setShortcut(e, "start",
+            (s, m) => s.StartModifiers = m,
+            (s, k) => s.StartKey = k
+            );
+    }
+
+    private static void setShortcut(KeyCombination? e, string shortcutName,
+        Action<Settings, ModifierKeys> setModifier, Action<Settings, string> setKey)
     {
         try
         {
             if (e.HasValue)
             {
-                Properties.Settings.Default.ShowModifiers = e.Value.Modifiers;
-                Properties.Settings.Default.ShowKey = e.Value.KeyCode;
+                setModifier(Settings.Default, e.Value.Modifiers);
+                setKey(Settings.Default, e.Value.KeyCode);
             }
             else
             {
-                Properties.Settings.Default.ShowModifiers = 0;
-                Properties.Settings.Default.ShowKey = null;
+                setModifier(Settings.Default, 0);
+                setKey(Settings.Default, null);
             }

-            Properties.Settings.Default.Save();
+            Settings.Default.Save();
         }
         catch (Exception ex)
         {
-            Console.WriteLine("Could not set shortcut for show: {0}", ex);
+            Toggl.Debug(string.Format("Could not set shortcut for {0}: {1}", shortcutName, ex));
         }
     }

-    public static void SetShortcutForStart(KeyCombination? e)
-    {
-        try
-        {
-            if (e.HasValue)
-            {
-                Properties.Settings.Default.StartModifiers = e.Value.Modifiers;
-                Properties.Settings.Default.StartKey = e.Value.KeyCode;
-            }
-            else
-            {
-                Properties.Settings.Default.StartModifiers = 0;
-                Properties.Settings.Default.StartKey = null;
-            }
-
-            Properties.Settings.Default.Save();
-        }
-        catch (Exception ex)
-        {
-            Console.WriteLine("Could not set shortcut for start: {0}", ex);
-        }
-    }
-
-    public static void SaveWindowLocation(Window f, EditViewPopup edit)
-    {
-        try
-        {
-            Toggl.SetWindowSettings(
-                (long)f.Left,
-                (long)f.Top,
-                (long)f.Height,
-                (long)f.Width);
-
-            if (f.WindowState == WindowState.Maximized)
-            {
-                Properties.Settings.Default.Maximized = true;
-                Properties.Settings.Default.Minimized = false;
-            }
-            else if (f.WindowState == WindowState.Normal)
-            {
-                Properties.Settings.Default.Maximized = false;
-                Properties.Settings.Default.Minimized = false;
-            }
-            else
-            {
-                Properties.Settings.Default.Maximized = false;
-                Properties.Settings.Default.Minimized = true;
-            }
-
-            if (edit != null) {
-                Properties.Settings.Default.EditSize = new Size((int)edit.Width, (int)edit.Height);
-            }
-
-            Properties.Settings.Default.Save();
-        }
-        catch (Exception ex)
-        {
-            Console.WriteLine("Could not save window location: ", ex);
-        }
-    }
+    #endregion
 }
 }


Use custom binary search in ValueStore.

Use custom binary search in ValueStore.

--- src/Avalonia.Base/PropertyStore/ValueStore.cs
+++ src/Avalonia.Base/PropertyStore/ValueStore.cs
@@ -528,9 +528,8 @@
         private void InsertFrame(IValueFrame frame)
         {
             Debug.Assert(!_frames.Contains(frame));
-            var index = _frames.BinarySearch(frame, FrameInsertionComparer.Instance);
-            if (index < 0)
-                index = ~index;
+
+            var index = BinarySearchFrame(frame.Priority);
             _frames.Insert(index, frame);
             ++_frameGeneration;
             frame.SetOwner(this);
@@ -569,15 +568,12 @@
         {
             Debug.Assert(priority != BindingPriority.LocalValue);

-            // TODO: Binary search?
-            for (var i = _frames.Count - 1; i >= 0;  --i)
-            {
-                var frame = _frames[i];
-                if (frame is ImmediateValueFrame immediate &&  !immediate.Contains(property))
-                    return immediate;
-                if (frame.Priority > priority)
-                    break;
-            }
+            var index = BinarySearchFrame(priority);
+
+            if (index > 0 && _frames[index - 1] is ImmediateValueFrame f &&
+                f.Priority == priority &&
+                !f.Contains(property))
+                return f;

             var result = new ImmediateValueFrame(priority);
             InsertFrame(result);
@@ -915,14 +911,28 @@
             }
         }

-        private class FrameInsertionComparer : IComparer<IValueFrame>
-        {
-            public static readonly FrameInsertionComparer Instance = new FrameInsertionComparer();
-            public int Compare(IValueFrame? x, IValueFrame? y)
-            {
-                var result = y!.Priority - x!.Priority;
-                return result != 0 ? result : -1;
-            }
+        private int BinarySearchFrame(BindingPriority priority)
+        {
+            var lo = 0;
+            var hi = _frames.Count - 1;
+
+            // Binary search insertion point.
+            while (lo <= hi)
+            {
+                var i = lo + ((hi - lo) >> 1);
+                var order = priority - _frames[i].Priority;
+
+                if (order <= 0)
+                {
+                    lo = i + 1;
+                }
+                else
+                {
+                    hi = i - 1;
+                }
+            }
+
+            return lo;
         }

         private readonly struct OldNewValue


Added async QuerySegment methods as part of refactoring for more DRY code

--- src/AzureCloudTable.Api/TableAccessContext.cs
+++ src/AzureCloudTable.Api/TableAccessContext.cs
@@ -8,6 +8,7 @@
     using System.Threading.Tasks;
     using Microsoft.WindowsAzure.Storage;
     using Microsoft.WindowsAzure.Storage.Table;
+    using Microsoft.WindowsAzure.Storage.Table.Queryable;
     using ServiceStack.Text;

     /// <summary>
@@ -328,7 +329,7 @@
         /// <returns>TableQuery object</returns>
         public TableQuery<TAzureTableEntity> Query()
         {
-            return new TableQuery<TAzureTableEntity>();
+            return _table.CreateQuery<TAzureTableEntity>();
         }

         /// <summary>
@@ -338,20 +339,74 @@
         /// <returns></returns>
         public IEnumerable<TAzureTableEntity> GetByPartitionKey(string partitionKey)
         {
-            var pkFilter = TableQuery.GenerateFilterCondition(CtConstants.PropNamePartitionKey, QueryComparisons.Equal, partitionKey);
-            var query = new TableQuery<TAzureTableEntity>().Where(pkFilter);
-            TableQuerySegment<TAzureTableEntity> currentQuerySegment = null;
-            while(currentQuerySegment == null || currentQuerySegment.ContinuationToken != null)
-            {
-                currentQuerySegment = _table.ExecuteQuerySegmented(query,
-                    currentQuerySegment != null
-                        ? currentQuerySegment.ContinuationToken
-                        : null);
-                foreach(var entity in currentQuerySegment)
-                {
-                    yield return entity;
-                }
-            }
+            return Query().Where(tEnt => tEnt.PartitionKey == partitionKey);
+        }
+
+        public async Task<List<TAzureTableEntity>> GetByPartitionKeyAsync(string partitionKey)
+        {
+            var theQuery = Query().Where(tEnt => tEnt.PartitionKey == partitionKey);
+            return await RunQuerySegmentAsync(theQuery.AsTableQuery()).ConfigureAwait(false);
+        }
+
+        private IEnumerable<TAzureTableEntity> RunQuerySegment(TableQuery<TAzureTableEntity> theQuery)
+        {
+            TableQuerySegment<TAzureTableEntity> currentQuerySegment = null;
+            while (currentQuerySegment == null || currentQuerySegment.ContinuationToken != null)
+            {
+                currentQuerySegment = theQuery.ExecuteSegmented(currentQuerySegment != null ? currentQuerySegment.ContinuationToken : null);
+                foreach (var entity in currentQuerySegment)
+                {
+                    yield return entity;
+                }
+            }
+        }
+
+        private async Task<List<TAzureTableEntity>> RunQuerySegmentAsync(TableQuery<TAzureTableEntity> tableQuery)
+        {
+            TableQuerySegment<TAzureTableEntity> querySegment = null;
+            var returnList = new List<TAzureTableEntity>();
+            while(querySegment == null || querySegment.ContinuationToken != null)
+            {
+                querySegment = await _table.ExecuteQuerySegmentedAsync(tableQuery, querySegment != null ? querySegment.ContinuationToken : null);
+                returnList.AddRange(querySegment);
+            }
+            return returnList;
+        }
+
+        private IEnumerable<TAzureTableEntity> RunQuerySegmentWithFilter(TableQuery<TAzureTableEntity> theQuery,
+                                                                         Func<TAzureTableEntity, bool> customFilter)
+        {
+            TableQuerySegment<TAzureTableEntity> currentQuerySegment = null;
+            while (currentQuerySegment == null || currentQuerySegment.ContinuationToken != null)
+            {
+                currentQuerySegment = theQuery.ExecuteSegmented(currentQuerySegment != null ? currentQuerySegment.ContinuationToken : null);
+                foreach (var entity in currentQuerySegment)
+                {
+                    if(customFilter(entity))
+                    {
+                        yield return entity;
+                    }
+                }
+            }
+        }
+
+        private async Task<List<TAzureTableEntity>> RunQuerySegmentWithFilterAsync(TableQuery<TAzureTableEntity> tableQuery,
+                                                                                Func<TAzureTableEntity, bool> customFilter)
+        {
+            TableQuerySegment<TAzureTableEntity> querySegment = null;
+            var returnList = new List<TAzureTableEntity>();
+            while(querySegment == null || querySegment.ContinuationToken != null)
+            {
+                querySegment = await _table.ExecuteQuerySegmentedAsync(tableQuery, querySegment != null ? querySegment.ContinuationToken : null);
+                foreach(var entity in querySegment)
+                {
+                    if(customFilter(entity))
+                    {
+                        returnList.Add(entity);
+                    }
+                }
+            }
+            return returnList;
         }

         /// <summary>


Add missing NoInlining to new DetourExtTest struct-related additions

--- MonoMod.UnitTest/RuntimeDetour/DetourExtTest.cs
+++ MonoMod.UnitTest/RuntimeDetour/DetourExtTest.cs
@@ -257,8 +257,8 @@
                 // It should be preferably tested on x86, as it's where the struct size caused problems.
 #if true
                 Assert.Equal(new TwoInts() {
-                    A = 0x11111111,
-                    B = 0x22222222
+                    A = 11111111,
+                    B = 22222222
                 }, DummyTwoInts());

                 using (Hook h = new Hook(
@@ -271,14 +271,14 @@
                     })
                 )) {
                     Assert.Equal(new TwoInts() {
-                        A = 0x11111111 * 2,
-                        B = 0x22222222 * 3
+                        A = 11111111 * 2,
+                        B = 22222222 * 3
                     }, DummyTwoInts());
                 }

                 Assert.Equal(new TwoInts() {
-                    A = 0x11111111,
-                    B = 0x22222222
+                    A = 11111111,
+                    B = 22222222
                 }, DummyTwoInts());
 #endif

@@ -331,10 +331,10 @@
                 // It should be preferably tested on x86, as it's where the edge case with this certain return size occurred.
 #if true
                 Assert.Equal(
-                    0x11111111,
+                    11111111,
                     new TwoInts() {
-                        A = 0x11111111,
-                        B = 0x22222222
+                        A = 11111111,
+                        B = 22222222
                     }.Magic
                 );

@@ -347,19 +347,19 @@
                     })
                 )) {
                     Assert.Equal(
-                        0x11111111 * 2 + 0x22222222,
+                        11111111 * 2 + 22222222,
                         new TwoInts() {
-                            A = 0x11111111,
-                            B = 0x22222222
+                            A = 11111111,
+                            B = 22222222
                         }.Magic
                     );
                 }

                 Assert.Equal(
-                    0x11111111,
+                    11111111,
                     new TwoInts() {
-                        A = 0x11111111,
-                        B = 0x22222222
+                        A = 11111111,
+                        B = 22222222
                     }.Magic
                 );
 #endif
@@ -399,10 +399,12 @@
             public int A;
             public int B;
             public int Magic {
+                [MethodImpl(MethodImplOptions.NoInlining)]
                 get {
                     return A;
                 }
             }
+            [MethodImpl(MethodImplOptions.NoInlining)]
             public override string ToString()
                 => $"({A}, {B})";
         }
@@ -410,8 +412,8 @@
         [MethodImpl(MethodImplOptions.NoInlining)]
         private TwoInts DummyTwoInts() {
             return new TwoInts() {
-                A = 0x11111111,
-                B = 0x22222222
+                A = 11111111,
+                B = 22222222
             };
         }


Asm4GCN would fail if there was more than one AMD GCN GPU. It will now work but Asm4GCN will not work with both GPUs without adjustment.

--- NOpenCL/NOpenCL/UnsafeNativeMethods.Programs.cs
+++ NOpenCL/NOpenCL/UnsafeNativeMethods.Programs.cs
@@ -108,14 +108,17 @@
                 gh = Array.ConvertAll(bins, b => GCHandle.Alloc(b, GCHandleType.Pinned));
                 IntPtr[] binaries = Array.ConvertAll(gh, h => h.AddrOfPinnedObject());

-                handle = clCreateProgramWithBinary(context, devCt, devices, lengths, binaries, binaryStatus, out errorCode);
+                //todo: had to put in a 1 for devCt. On systems with more then 1 device using
+                //anything larger then 1 here fails so forcing 1 for now because at least it works.
+                //was: handle = clCreateProgramWithBinary(context, devCt, devices, lengths, binaries, binaryStatus, out errorCode);
+                handle = clCreateProgramWithBinary(context, 1, devices, lengths, binaries, binaryStatus, out errorCode);
             }
             finally
             {
                 for (int i = 0; i < gh.Length; i++)
                     gh[i].Free();
             }
-
+
             ErrorHandler.ThrowOnFailure(errorCode);

             return handle;
@@ -330,9 +333,10 @@
             UIntPtr actualSize;
             try
             {
-                memory = Marshal.AllocHGlobal(IntPtr.Size);
-                ErrorHandler.ThrowOnFailure(clGetProgramInfo(program, 0x1165, (UIntPtr)UIntPtr.Size, memory, out actualSize));
-                IntPtr[] array = new IntPtr[1];
+                // Allicate space for up to 8 GPUs - I cannot see going over that in one system.
+                memory = Marshal.AllocHGlobal(IntPtr.Size * 8);
+                ErrorHandler.ThrowOnFailure(clGetProgramInfo(program, 0x1165/*BinarySizes*/, (UIntPtr)(UIntPtr.Size * 8), memory, out actualSize));
+                IntPtr[] array = new IntPtr[(int)actualSize / IntPtr.Size];
                 Marshal.Copy(memory, array, 0, array.Length);
                 return Array.ConvertAll(array, p => (int)p);
             }


use lazy instead of double-checked locking to encapsulate singleton pattern

--- Nodejs/Product/Nodejs/Options/TypingsInfoBar.cs
+++ Nodejs/Product/Nodejs/Options/TypingsInfoBar.cs
@@ -43,20 +43,14 @@
                 true);

         private IServiceProvider _provider;
-        private static volatile TypingsInfoBar _instance;
-        private static object _infoBarLock = new object();
         private bool _isVisible = false;
+
+        private static readonly Lazy<TypingsInfoBar> _instance =
+            new Lazy<TypingsInfoBar>(() => new TypingsInfoBar(NodejsPackage.Instance));

         public static TypingsInfoBar Instance {
             get {
-                if (_instance == null) {
-                    lock (_infoBarLock) {
-                        if (_instance == null) {
-                            _instance = new TypingsInfoBar(NodejsPackage.Instance);
-                        }
-                    }
-                }
-                return _instance;
+                return _instance.Value;
             }
         }


update  Debug.Assert

update  Debug.Assert

--- my_aspnetmvc_learning/Controllers/ImageController.cs
+++ my_aspnetmvc_learning/Controllers/ImageController.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Web;
 using System.Web.Mvc;
@@ -32,13 +33,12 @@
             for (var i = 0; i < Request.Files.Count; i++)
             {
                 var file = Request.Files[i];
-                if (file.IsNotNull())
-                {
-                    logger.Info(string.Format("FileName : {0}", file.FileName));
-                    file.SaveAs(filename: AppDomain.CurrentDomain.BaseDirectory + "upload/" + file.FileName);
-                }
+                if (!file.IsNotNull()) continue;
+                Debug.Assert(file != null, "file != null");
+                logger.Info(string.Format("FileName : {0}", file.FileName));
+                file.SaveAs(filename: AppDomain.CurrentDomain.BaseDirectory + "upload/" + file.FileName);
             }
-            return Json(new { success = true }, JsonRequestBehavior.AllowGet);
+            return Json(new { success = true, msg = "上传成功！" }, JsonRequestBehavior.AllowGet);
         }
     }
 }


Data: Matlab: roundtrip test

Data: Matlab: roundtrip test

--- src/DataUnitTests/Matlab/MatlabWriterTests.cs
+++ src/DataUnitTests/Matlab/MatlabWriterTests.cs
@@ -29,6 +29,7 @@
 using System.Numerics;
 using MathNet.Numerics.Data.Matlab;
 using MathNet.Numerics.LinearAlgebra;
+using MathNet.Numerics.LinearAlgebra.Storage;
 using NUnit.Framework;

 namespace MathNet.Numerics.Data.UnitTests.Matlab
@@ -98,6 +99,8 @@
                 Assert.AreEqual(w.ColumnCount, r.ColumnCount);
                 Assert.IsTrue(w.Equals(r));
             }
+
+            File.Delete("testd.mat");
         }

         [Test]
@@ -146,6 +149,8 @@
                 Assert.AreEqual(w.ColumnCount, r.ColumnCount);
                 Assert.IsTrue(w.Equals(r));
             }
+
+            File.Delete("tests.mat");
         }

         /// <summary>
@@ -197,6 +202,8 @@
                 Assert.AreEqual(w.ColumnCount, r.ColumnCount);
                 Assert.IsTrue(w.Equals(r));
             }
+
+            File.Delete("testc.mat");
         }

         /// <summary>
@@ -248,6 +255,8 @@
                 Assert.AreEqual(w.ColumnCount, r.ColumnCount);
                 Assert.IsTrue(w.Equals(r));
             }
+
+            File.Delete("testz.mat");
         }

         /// <summary>
@@ -269,5 +278,48 @@
         {
             Assert.Throws<ArgumentNullException>(() => MatlabWriter.Write<double>("somefile2", null, "matrix"));
         }
+
+        [Test]
+        public void MatlabMatrixRoundtrip()
+        {
+            var denseDouble = Matrix<double>.Build.Random(20, 20);
+            var denseComplex = Matrix<Complex>.Build.Random(10, 10);
+            var diagonalDouble = Matrix<double>.Build.DiagonalOfDiagonalArray(new[] { 1.0, 2.0, 3.0 });
+            var sparseDouble = Matrix<double>.Build.Sparse(20, 20, (i, j) => i%(j+1) == 2 ? i + 10*j : 0);
+
+            var denseDoubleP = MatlabWriter.Pack(denseDouble, "denseDouble");
+            var denseComplexP = MatlabWriter.Pack(denseComplex, "denseComplex");
+            var diagonalDoubleP = MatlabWriter.Pack(diagonalDouble, "diagonalDouble");
+            var sparseDoubleP = MatlabWriter.Pack(sparseDouble, "sparseDouble");
+
+            Assert.That(MatlabReader.Unpack<double>(denseDoubleP).Equals(denseDouble));
+            Assert.That(MatlabReader.Unpack<Complex>(denseComplexP).Equals(denseComplex));
+            Assert.That(MatlabReader.Unpack<double>(diagonalDoubleP).Equals(diagonalDouble));
+            Assert.That(MatlabReader.Unpack<double>(sparseDoubleP).Equals(sparseDouble));
+
+            Assert.That(MatlabReader.Unpack<double>(denseDoubleP).Storage, Is.TypeOf<DenseColumnMajorMatrixStorage<double>>());
+            Assert.That(MatlabReader.Unpack<Complex>(denseComplexP).Storage, Is.TypeOf<DenseColumnMajorMatrixStorage<Complex>>());
+            Assert.That(MatlabReader.Unpack<double>(diagonalDoubleP).Storage, Is.TypeOf<SparseCompressedRowMatrixStorage<double>>());
+            Assert.That(MatlabReader.Unpack<double>(sparseDoubleP).Storage, Is.TypeOf<SparseCompressedRowMatrixStorage<double>>());
+
+            if (File.Exists("testrt.mat"))
+            {
+                File.Delete("testrt.mat");
+            }
+
+            MatlabWriter.Store("testrt.mat", new[] { denseDoubleP, denseComplexP, diagonalDoubleP, sparseDoubleP });
+
+            Assert.That(MatlabReader.Read<double>("testrt.mat", "denseDouble").Equals(denseDouble));
+            Assert.That(MatlabReader.Read<Complex>("testrt.mat", "denseComplex").Equals(denseComplex));
+            Assert.That(MatlabReader.Read<double>("testrt.mat", "diagonalDouble").Equals(diagonalDouble));
+            Assert.That(MatlabReader.Read<double>("testrt.mat", "sparseDouble").Equals(sparseDouble));
+
+            Assert.That(MatlabReader.Read<double>("testrt.mat", "denseDouble").Storage, Is.TypeOf<DenseColumnMajorMatrixStorage<double>>());
+            Assert.That(MatlabReader.Read<Complex>("testrt.mat", "denseComplex").Storage, Is.TypeOf<DenseColumnMajorMatrixStorage<Complex>>());
+            Assert.That(MatlabReader.Read<double>("testrt.mat", "diagonalDouble").Storage, Is.TypeOf<SparseCompressedRowMatrixStorage<double>>());
+            Assert.That(MatlabReader.Read<double>("testrt.mat", "sparseDouble").Storage, Is.TypeOf<SparseCompressedRowMatrixStorage<double>>());
+
+            File.Delete("testrt.mat");
+        }
     }
 }


Update Index.cshtml

Update Index.cshtml

--- Omnilex/Omnilex-Website/Views/Home/Index.cshtml
+++ Omnilex/Omnilex-Website/Views/Home/Index.cshtml
@@ -11,12 +11,12 @@

-        <form class="form-search">
+

                 <input type="text" class="span2 search-query">
                 <button type="submit" class="btn"></button>

-        </form>
+


*feature test* ubitode, let convex hull shape type work for prims other than uploaded meshs, making it change the mesh level of detail from high to low. This will work on all prims that get a internal mesh or sculpts. Mesh size reduction will depend on particular shape. This is not as SL. There prims do also get concave areas. Uploaded meshs work as before. A normal 10x10x10 torus gets 152 vertices in place of 900, and 198 faces in place of 1198.

--- OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
+++ OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
@@ -1092,17 +1092,20 @@
             CalcPrimBodyData();

             m_mesh = null;
-            if (_parent_scene.needsMeshing(pbs))
+            if (_parent_scene.needsMeshing(pbs) && (pbs.SculptData.Length > 0))
             {
                 bool convex;
+                int clod = (int)LevelOfDetail.High;
                 if (m_shapetype == 0)
                     convex = false;
                 else
+                {
                     convex = true;
-
-                m_mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, (int)LevelOfDetail.High, true, convex);
-            }
-
+                    if (_pbs.SculptType != (byte)SculptType.Mesh)
+                        clod = (int)LevelOfDetail.Low;
+                }
+                m_mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, clod, true, convex);
+            }

             m_building = true; // control must set this to false when done

@@ -1360,12 +1363,18 @@
                 if (m_mesh == null)
                 {
                     bool convex;
+                    int clod = (int)LevelOfDetail.High;
+
                     if (m_shapetype == 0)
                         convex = false;
                     else
+                    {
                         convex = true;
-
-                    mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, (int)LevelOfDetail.High, true, convex);
+                        if (_pbs.SculptType != (byte)SculptType.Mesh)
+                            clod = (int)LevelOfDetail.Low;
+                    }
+
+                    mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, clod, true, convex);
                 }
                 else
                 {
@@ -1373,7 +1382,7 @@
                 }

                 if (mesh == null)
-                {
+                {
                     m_log.WarnFormat("[PHYSICS]: CreateMesh Failed on prim {0} at <{1},{2},{3}>.", Name, _position.X, _position.Y, _position.Z);
                     return false;
                 }


fix 'system.exception: unknown type in list.size: system.uint32'

--- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -459,6 +459,8 @@
                             size += 64;
                         else if (o is int)
                             size += 4;
+                        else if (o is uint)
+                            size += 4;
                         else if (o is string)
                             size += ((string)o).Length;
                         else if (o is float)


accounting for Emu inconsistency

accounting for Emu inconsistency

--- src/DescribeMe.Core/Factories/ImageFactory.cs
+++ src/DescribeMe.Core/Factories/ImageFactory.cs
@@ -61,7 +61,7 @@
             if ((type != "Image" ||
                 (type == "Image" &&
                 string.IsNullOrWhiteSpace((string)map["Con1Description"]) &&
-                map.GetMaps("images").Any(x => string.IsNullOrWhiteSpace(x.GetString("MulDescription")) && x.GetString("AdmPublishWebNoPassword") == "Yes"))) &&
+                map.GetMaps("images").Any(x => string.IsNullOrWhiteSpace(x.GetString("MulDescription")) && string.Equals(x.GetString("AdmPublishWebNoPassword"), "yes", StringComparison.OrdinalIgnoreCase)))) &&
                 discipline != "Numismatics")
             {
                 // Determine what images we are adding.
@@ -73,7 +73,7 @@
                                  x.GetString("MulIdentifier").EndsWith(".tif", StringComparison.OrdinalIgnoreCase) ||
                                  x.GetString("MulIdentifier").EndsWith(".tiff", StringComparison.OrdinalIgnoreCase))
                                 && !x.GetString("MulIdentifier").Contains("Graphic Warning.tiff")
-                                && x.GetString("AdmPublishWebNoPassword") != "No")
+                                && !string.Equals(x.GetString("AdmPublishWebNoPassword"), "no", StringComparison.OrdinalIgnoreCase))
                     .Select(x => new Image(
                                      x.GetString("irn"),
                                      catalogueIrn,


Add detection for which account to look at since the search returns both track bot accounts

--- src/DiscordBot/Modules/Border/BorderModule.cs
+++ src/DiscordBot/Modules/Border/BorderModule.cs
@@ -71,13 +71,13 @@
                     .Description("Returns the current School Idol Festival EN tier borders.")
                     .Do(e =>
                     {
-                        GetLastBorderTweet(e, "sifen_trackbot");
+                        GetLastBorderTweet(e, "LLSIF EN Tracker Bot");
                     });
                 group.CreateCommand("sifjp")
                     .Description("Returns the current School Idol Festival JP tier borders.")
                     .Do(e =>
                     {
-                        GetLastBorderTweet(e, "sifjp_trackbot");
+                        GetLastBorderTweet(e, "LLSIF JP Tracker Bot");
                     });
             });
             manager.CreateCommands("", group =>
@@ -86,7 +86,7 @@
                     .Description("Returns the current School Idol Festival EN tier borders.")
                     .Do(e =>
                     {
-                        GetLastBorderTweet(e, "sifen_trackbot");
+                        GetLastBorderTweet(e, "LLSIF EN Tracker Bot");
                     });
                 group.CreateCommand("ss")
                     .Description("Returns the current Starlight Stage tier borders.")
@@ -98,15 +98,23 @@
                     .Description("Returns the current School Idol Festival JP tier borders.")
                     .Do(e =>
                     {
-                        GetLastBorderTweet(e, "sifjp_trackbot");
+                        GetLastBorderTweet(e, "LLSIF JP Tracker Bot");
                     });
             });
         }

         private async void GetLastBorderTweet(CommandEventArgs e, string account)
         {
-            var accts = Search.SearchUsers(account);
+            var accts = Search.SearchUsers("sifen_trackbot");
             var acct = accts.First();
+            foreach (var a in accts)
+            {
+                acct = a;
+                if (a.Name == account)
+                {
+                    break;
+                }
+            }
             var lastTweets = acct.GetUserTimeline(20);
             var lastTweet = "";
             foreach (var tweet in lastTweets)


Fox for WinForms where ComboBox does not support the SelectionPattern

--- src/FlaUI.Core/AutomationElements/ComboBox.cs
+++ src/FlaUI.Core/AutomationElements/ComboBox.cs
@@ -19,7 +19,7 @@

         protected IValuePattern ValuePattern => Patterns.Value.Pattern;

-        protected ISelectionPattern SelectionPattern => Patterns.Selection.Pattern;
+        protected ISelectionPattern SelectionPattern => Patterns.Selection.PatternOrDefault;

         /// <summary>
         /// The text of the editable element inside the combobox.
@@ -64,7 +64,18 @@
         /// <summary>
         /// Gets all selected items.
         /// </summary>
-        public ComboBoxItem[] SelectedItems => SelectionPattern.Selection.Value.Select(x => new ComboBoxItem(x.BasicAutomationElement)).ToArray();
+        public ComboBoxItem[] SelectedItems
+        {
+            get
+            {
+                // In WinForms, there is no selection pattern, so search the items which are selected.
+                if (SelectionPattern == null)
+                {
+                    return Items.Where(x => x.IsSelected).ToArray();
+                }
+                return SelectionPattern.Selection.Value.Select(x => new ComboBoxItem(x.BasicAutomationElement)).ToArray();
+            }
+        }

         /// <summary>
         /// Gets the first selected item or null otherwise.


Update LinkItemExtensions.cs

Update LinkItemExtensions.cs

code optimization

--- src/Geta.EPi.Extensions/LinkItemExtensions.cs
+++ src/Geta.EPi.Extensions/LinkItemExtensions.cs
@@ -45,7 +45,7 @@
         /// <returns>Returns friendly URL if item is EPiServer content, otherwise returns the original Href property value.</returns>
         public static string GetFriendlyUrl(this LinkItem linkItem, bool includeHost = false)
         {
-            if (linkItem.Href == null)
+            if (string.IsNullOrWhiteSpace(linkItem.Href))
             {
                 return string.Empty;
             }
@@ -60,7 +60,7 @@
                 ? url.ToString()
                 : UrlResolver.Current.GetUrl(url.ToString()) ?? url.ToString();

-            return includeHost && !friendlyUrl.IsEmpty() ? friendlyUrl.AddHost() : friendlyUrl;
+            return includeHost && !string.IsNullOrWhiteSpace(friendlyUrl) ? friendlyUrl.AddHost() : friendlyUrl;
         }
     }
 }


Slot copy plots on create.

Slot copy plots on create.

--- src/JoinRpg.Services.Impl/ClaimServiceImpl.cs
+++ src/JoinRpg.Services.Impl/ClaimServiceImpl.cs
@@ -312,7 +312,7 @@

         if (claim.Character?.CharacterType == CharacterType.Slot)
         {
-            var character = CreateCharacterFromSlot(claim.Character, claim.Player);
+            var character = await CreateCharacterFromSlot(claim.Character, claim.Player);
             claim.Character = character;
             claim.CharacterId = character.CharacterId;
         }
@@ -366,7 +366,7 @@
                     CommentExtraAction.ApproveByMaster));
     }

-    private static Character CreateCharacterFromSlot(Character slot, User player)
+    private async Task<Character> CreateCharacterFromSlot(Character slot, User player)
     {

         switch (slot.CharacterSlotLimit)
@@ -418,6 +418,16 @@
             UpdatedById = player.UserId,
         };

+        var plots = await PlotRepository.GetPlotsForCharacter(slot);
+
+        foreach (var plot in plots)
+        {
+            if (plot.TargetCharacters.Contains(slot))
+            {
+                plot.TargetCharacters.Add(newCharacter);
+            }
+        }
+
         return newCharacter;
     }

@@ -934,12 +944,19 @@
     }

     private readonly IAccommodationInviteService _accommodationInviteService;
+    private readonly IPlotService plotService;
+
     public ClaimServiceImpl(IUnitOfWork unitOfWork, IEmailService emailService,
       IFieldDefaultValueGenerator fieldDefaultValueGenerator,
         IAccommodationInviteService accommodationInviteService,
-        ICurrentUserAccessor currentUserAccessor
+        ICurrentUserAccessor currentUserAccessor,
+        IPlotService plotService
         ) : base(unitOfWork, emailService,
-      fieldDefaultValueGenerator, currentUserAccessor) => _accommodationInviteService = accommodationInviteService;
+      fieldDefaultValueGenerator, currentUserAccessor)
+    {
+        _accommodationInviteService = accommodationInviteService;
+        this.plotService = plotService;
+    }

     private void SetDiscussed(Claim claim, bool isVisibleToPlayer)
     {


Skip tone/duration on beep on LINUX

Skip tone/duration on beep on LINUX

--- src/Microsoft.PowerShell.PSReadLine/Render.cs
+++ src/Microsoft.PowerShell.PSReadLine/Render.cs
@@ -656,7 +656,11 @@
             case BellStyle.None:
                 break;
             case BellStyle.Audible:
+#if LINUX
+                Console.Beep();
+#else
                 Console.Beep(Options.DingTone, Options.DingDuration);
+#endif
                 break;
             case BellStyle.Visual:
                 // TODO: flash prompt? command line?


open Plex manager when double-clicking the tray icon

--- PlexServiceTray/NotifyIconApplicationContext.cs
+++ PlexServiceTray/NotifyIconApplicationContext.cs
@@ -62,6 +62,7 @@
             _notifyIcon.Text = "Manage Plex Media Server Service";
             _notifyIcon.Visible = true;
             _notifyIcon.Click += new EventHandler(notifyIcon_Click);
+            _notifyIcon.DoubleClick += new EventHandler(openManager_Click);
             _notifyIcon.ContextMenuStrip.Opening += ContextMenuStrip_Opening;
         }


it's ensure not finally

it's ensure not finally

git-svn-id: fcce7d6ce0ac15bf24f68871b5145d46fc068279@2466 2c1201b4-01cd-e047-a400-b836ae1fbc61

--- src/Boo.Lang.Compiler/Steps/StricterErrorChecking.cs
+++ src/Boo.Lang.Compiler/Steps/StricterErrorChecking.cs
@@ -38,7 +38,7 @@
 	{
 		Hashtable _types = new Hashtable();

-		int _finallyBlock;
+		int _ensureBlock;

 		override public void Run()
 		{
@@ -121,16 +121,26 @@

 		bool InsideEnsure
 		{
-			get { return _finallyBlock > 0; }
+			get { return _ensureBlock > 0; }
 		}

 		public override void OnTryStatement(TryStatement node)
 		{
 			Visit(node.ProtectedBlock);
 			Visit(node.ExceptionHandlers);
-			++_finallyBlock;
+			EnterEnsureBlock();
 			Visit(node.EnsureBlock);
-			--_finallyBlock;
+			LeaveEnsureBlock();
+		}
+
+		private void EnterEnsureBlock()
+		{
+			++_ensureBlock;
+		}
+
+		private void LeaveEnsureBlock()
+		{
+			--_ensureBlock;
 		}

 		public override void LeaveReturnStatement(ReturnStatement node)


Remove chart.js references, need to remove the pkg

--- src/Cash-Flow-Projection/Views/Shared/_Layout.cshtml
+++ src/Cash-Flow-Projection/Views/Shared/_Layout.cshtml
@@ -57,7 +57,6 @@
     <environment names="Development">
         <script src="~/lib/jquery/dist/jquery.js"></script>
         <script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
-        <script src="~/lib/Chart.js/src/chart.js"></script>
         <script src="~/js/site.js" asp-append-version="true"></script>
     </environment>
     <environment names="Staging,Production">
@@ -69,7 +68,6 @@
                 asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.min.js"
                 asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal">
         </script>
-        <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.bundle.js"></script>
         <script src="~/js/site.min.js" asp-append-version="true"></script>
     </environment>


Limit the size of BlendedNode arrays that are returned to the pool

--- src/Compilers/CSharp/Portable/Parser/SyntaxParser.cs
+++ src/Compilers/CSharp/Portable/Parser/SyntaxParser.cs
@@ -73,12 +73,18 @@

         public void Dispose()
         {
-            var blendedTokens = _blendedTokens;
-            if (blendedTokens != null)
-            {
-                Array.Clear(_blendedTokens, 0, _blendedTokens.Length);
-                s_blendedNodesPool.Free(_blendedTokens);
-                _blendedTokens = null;
+            if (_blendedTokens != null)
+            {
+                if (_blendedTokens.Length < 4096)
+                {
+                    Array.Clear(_blendedTokens, 0, _blendedTokens.Length);
+                    s_blendedNodesPool.Free(_blendedTokens);
+                    _blendedTokens = null;
+                }
+                else
+                {
+                    s_blendedNodesPool.ForgetTrackedObject(_blendedTokens);
+                }
             }
         }


Also fixed SingleMathProvider. Need some unification

--- Retia/Mathematics/SingleMathProvider.cs
+++ Retia/Mathematics/SingleMathProvider.cs
@@ -165,7 +165,7 @@

         protected override Matrix<float> PropagateSingleError(Matrix<float> y, Matrix<float> target, int batchSize)
         {
-            return target.Map2((targetVal, yVal) => float.IsNaN(targetVal) ? 0.0f : yVal, y).Divide(batchSize);
+            return target.Map2((targetVal, yVal) => float.IsNaN(targetVal) ? 0.0f : yVal - targetVal, y).Divide(batchSize);
         }

         protected override bool AlmostEqual(float a, float b)


Changed ForService to For in fluent interface registration.

git-svn-id: 6eea8ec865c4fa60105bc56808c028bdcf72a817@1153 079b0acf-d9fa-0310-9935-e5ade295c882

--- Rhino.Security/RhinoSecurityFacility.cs
+++ Rhino.Security/RhinoSecurityFacility.cs
@@ -18,17 +18,17 @@
         protected override void Init()
         {
 			Kernel.Register(
-				Component.ForService<AddCachingInterceptor>(),
-                Component.ForService<IAuthorizationService>()
+				Component.For<AddCachingInterceptor>(),
+                Component.For<IAuthorizationService>()
                     .ImplementedBy<AuthorizationService>()
                     .Interceptors(new InterceptorReference(typeof(AddCachingInterceptor))).Anywhere,
-                Component.ForService<IAuthorizationRepository>()
+                Component.For<IAuthorizationRepository>()
                     .ImplementedBy<AuthorizationRepository>()
                     .Interceptors(new InterceptorReference(typeof(AddCachingInterceptor))).Anywhere,
-                Component.ForService<IPermissionsBuilderService>()
+                Component.For<IPermissionsBuilderService>()
                     .ImplementedBy<PermissionsBuilderService>()
                     .Interceptors(new InterceptorReference(typeof(AddCachingInterceptor))).Anywhere,
-                Component.ForService<IPermissionsService>()
+                Component.For<IPermissionsService>()
                     .ImplementedBy<PermissionsService>()
                     .Interceptors(new InterceptorReference(typeof(AddCachingInterceptor))).Anywhere
 				);
@@ -36,7 +36,7 @@
             if (Kernel.HasComponent(typeof(IValidatorRegistry)) == false)
             {
             	Kernel.Register(
-            		Component.ForService<IValidatorRegistry>()
+            		Component.For<IValidatorRegistry>()
             			.ImplementedBy<CachedValidationRegistry>()
             		);
             }
@@ -44,7 +44,7 @@
             if (Kernel.HasComponent(typeof(ValidatorRunner)) == false)
             {
             	Kernel.Register(
-            		Component.ForService<ValidatorRunner>()
+            		Component.For<ValidatorRunner>()
             		);
             }
         }


Update WpfProjectEditorPlatform.cs

Update WpfProjectEditorPlatform.cs

--- src/Core2D.UI.Wpf/Editor/WpfProjectEditorPlatform.cs
+++ src/Core2D.UI.Wpf/Editor/WpfProjectEditorPlatform.cs
@@ -477,7 +477,7 @@
             }
             catch (Exception ex)
             {
-                _serviceProvider.GetService<ILog>()?.LogException(ex)
+                _serviceProvider.GetService<ILog>()?.LogException(ex);
             }
         }

@@ -544,7 +544,7 @@
             }
             catch (Exception ex)
             {
-                _serviceProvider.GetService<ILog>()?.LogException(ex)
+                _serviceProvider.GetService<ILog>()?.LogException(ex);
             }
         }

@@ -557,7 +557,7 @@
             }
             catch (Exception ex)
             {
-                _serviceProvider.GetService<ILog>()?.LogException(ex)
+                _serviceProvider.GetService<ILog>()?.LogException(ex);
             }
         }

@@ -570,7 +570,7 @@
             }
             catch (Exception ex)
             {
-                _serviceProvider.GetService<ILog>()?.LogException(ex)
+                _serviceProvider.GetService<ILog>()?.LogException(ex);
             }
         }

@@ -583,7 +583,7 @@
             }
             catch (Exception ex)
             {
-                _serviceProvider.GetService<ILog>()?.LogException(ex)
+                _serviceProvider.GetService<ILog>()?.LogException(ex);
             }
         }


Implement permissions for flags

Implement permissions for flags

--- Rocket_Safezone/Commands/FlagCommand.cs
+++ Rocket_Safezone/Commands/FlagCommand.cs
@@ -31,6 +31,13 @@
             }

             String flagName = command.GetStringParameter(1);
+
+            if (!PermissionUtil.HasPermission(caller, "flag." + flagName))
+            {
+                RocketChat.Say(caller.CSteamID, "You don't have access to this flag!", Color.red);
+                return;
+            }
+
             Type t = Flag.GetFlagType(flagName);
             if (t == null)
             {


hooked up the add line items button to actually do just that

--- Purchasing.Web/Views/OrderMockup/Request.cshtml
+++ Purchasing.Web/Views/OrderMockup/Request.cshtml
@@ -31,7 +31,7 @@
         td {text-align: left;}

     </style>
-
+

@@ -161,7 +167,7 @@
                         <input type="text" placeholder="Unit" class="unit" value="each"/>
                         <input type="text" placeholder="Catalog #" class="catalog-num" />
                         <input type="text" placeholder="Description" class="description"/>
-                        <input type="text" placeholder="Unit Price" class="price" />
+                        <input type="text" placeholder="Price" class="price" />
                         More

@@ -336,6 +342,17 @@

 }

+
+

     <form>


[managed] useragent test ignores minor version

Since minor version is changed during build, keep the check only on
major version which changes less frequently

--- sdk/Managed/test/Microsoft.WindowsAzure.MobileServices.Test/UnitTests/MobileServiceClient.Test.cs
+++ sdk/Managed/test/Microsoft.WindowsAzure.MobileServices.Test/UnitTests/MobileServiceClient.Test.cs
@@ -156,7 +156,7 @@
             // string userAgent = hijack.Request.Headers.UserAgent.ToString();

             string userAgent = string.Join(" ", hijack.Request.Headers.GetValues("user-agent"));
-            Assert.IsTrue(userAgent.Contains("ZUMO/1.0"));
+            Assert.IsTrue(userAgent.Contains("ZUMO/1."));
             Assert.IsTrue(userAgent.Contains("version=1."));
         }


Fixed Level Editor Bug

Fixed Level Editor Bug

--- RTSGame/Defiant/Defiant/LevelEditor/LEScreen.cs
+++ RTSGame/Defiant/Defiant/LevelEditor/LEScreen.cs
@@ -19,6 +19,7 @@
 using RTSEngine.Data.Parsers;
 using RTSEngine.Controllers;
 using RTSEngine.Interfaces;
+using Microsoft.Xna.Framework.Content;

 namespace RTS {
     public struct LEVT {
@@ -61,6 +62,7 @@
         WorldManager vManager;
         VoxState state;
         VoxelRenderer renderer;
+        ContentManager voxContent;

         // Voxel Modifying Data
         Dictionary<string, VoxData> dVox;
@@ -110,7 +112,10 @@
             state.World.worldMin.X = 0;
             state.World.worldMin.Y = 0;
             CreateVoxTypes();
-            renderer = new VoxelRenderer(game.Graphics, game.Content);
+
+            voxContent = new ContentManager(game.Services);
+            voxContent.RootDirectory = @"Content";
+            renderer = new VoxelRenderer(game.Graphics, voxContent);
             renderer.Hook(state);
             renderer.LoadEffect(@"FX\VoxelLE");
             renderer.LoadVMap(@"LevelEditor\VoxMap.png");
@@ -307,6 +312,9 @@
         private void DestroyVoxWorld() {
             state.VWorkPool.Dispose();
             renderer.Dispose();
+            voxContent.Unload();
+            voxContent.Dispose();
+            voxContent = null;
         }
         private void DestroyWidgets() {
             voxMenu.Unhook();


Groups

Groups

--- ReadingTool.Site/Controllers/TextsController.cs
+++ ReadingTool.Site/Controllers/TextsController.cs
@@ -27,6 +27,7 @@
 using AutoMapper;
 using Ionic.Zip;
 using Newtonsoft.Json;
+using ReadingTool.Common;
 using ReadingTool.Common.Search;
 using ReadingTool.Entities;
 using ReadingTool.Repository;
@@ -80,7 +81,7 @@
         public ActionResult Index()
         {
             var groups = _groupMembershipRepository
-                .FindAll(x => x.User == _userRepository.LoadOne(UserId))
+                .FindAll(x => x.User == _userRepository.LoadOne(UserId) && new[] { MembershipType.Member, MembershipType.Owner, MembershipType.Moderator }.Contains(x.MembershipType))
                 .Select(x => x.Group)
                 .ToDictionary(x => x.GroupId, x => x.Name);


cleanup and small optimizations

cleanup and small optimizations

--- src/FastExpressionCompiler/FastExpressionCompiler.cs
+++ src/FastExpressionCompiler/FastExpressionCompiler.cs
@@ -42,7 +42,7 @@
         public static Func<T> Compile<T>(Expression<Func<T>> lambdaExpr)
         {
             return TryCompile<Func<T>>(lambdaExpr.Body, lambdaExpr.Parameters, Empty<Type>(), typeof(T))
-                ?? lambdaExpr.Compile();
+                   ?? lambdaExpr.Compile();
         }

         /// <summary>Compiles lambda expression to <typeparamref name="TDelegate"/>.</summary>
@@ -335,7 +335,7 @@

                 ClosedItemCount = totalItemCount;

-                var typedClosureCreateMethods = Closure.TypedClosureCreateMethods;
+                var typedClosureCreateMethods = Closure.CreateMethods;

                 // Construct the array base closure when number of values is bigger than
                 // number of fields in biggest Closure class
@@ -419,8 +419,11 @@

         internal static class Closure
         {
-            public static readonly MethodInfo[] TypedClosureCreateMethods =
-                typeof(Closure).GetTypeInfo().DeclaredMethods.ToArray();
+            private static readonly IEnumerable<MethodInfo> _methods =
+                typeof(Closure).GetTypeInfo().DeclaredMethods;
+
+            public static readonly MethodInfo[] CreateMethods =
+                _methods as MethodInfo[] ?? _methods.ToArray();

             public static Closure<T1> CreateClosure<T1>(T1 v1)
             {
@@ -684,7 +687,7 @@

         #endregion

-        #region Nested Lambda Expressions
+        #region Nested Lambdas

         private struct NestedLambdaInfo
         {
@@ -703,31 +706,37 @@
             }
         }

-        internal static readonly MethodInfo[] CurryClosureFuncMethods =
-            typeof(ExpressionCompiler).GetTypeInfo().DeclaredMethods.Where(m => m.Name == "CurryFunc").ToArray();
-
-        internal static Func<R> CurryFunc<C, R>(Func<C, R> f, C c) { return () => f(c); }
-        internal static Func<T1, R> CurryFunc<C, T1, R>(Func<C, T1, R> f, C c) { return t1 => f(c, t1); }
-        internal static Func<T1, T2, R> CurryFunc<C, T1, T2, R>(Func<C, T1, T2, R> f, C c) { return (t1, t2) => f(c, t1, t2); }
-        internal static Func<T1, T2, T3, R> CurryFunc<C, T1, T2, T3, R>(Func<C, T1, T2, T3, R> f, C c) { return (t1, t2, t3) => f(c, t1, t2, t3); }
-        internal static Func<T1, T2, T3, T4, R> CurryFunc<C, T1, T2, T3, T4, R>(Func<C, T1, T2, T3, T4, R> f, C c) { return (t1, t2, t3, t4) => f(c, t1, t2, t3, t4); }
-        internal static Func<T1, T2, T3, T4, T5, R> CurryFunc<C, T1, T2, T3, T4, T5, R>(Func<C, T1, T2, T3, T4, T5, R> f, C c) { return (t1, t2, t3, t4, t5) => f(c, t1, t2, t3, t4, t5); }
-        internal static Func<T1, T2, T3, T4, T5, T6, R> CurryFunc<C, T1, T2, T3, T4, T5, T6, R>(Func<C, T1, T2, T3, T4, T5, T6, R> f, C c) { return (t1, t2, t3, t4, t5, t6) => f(c, t1, t2, t3, t4, t5, t6); }
-        internal static Func<T1, T2, T3, T4, T5, T6, T7, R> CurryFunc<C, T1, T2, T3, T4, T5, T6, T7, R>(Func<C, T1, T2, T3, T4, T5, T6, T7, R> f, C c) { return (t1, t2, t3, t4, t5, t6, t7) => f(c, t1, t2, t3, t4, t5, t6, t7); }
-        internal static Func<T1, T2, T3, T4, T5, T6, T7, T8, R> CurryFunc<C, T1, T2, T3, T4, T5, T6, T7, T8, R>(Func<C, T1, T2, T3, T4, T5, T6, T7, T8, R> f, C c) { return (t1, t2, t3, t4, t5, t6, t7, t8) => f(c, t1, t2, t3, t4, t5, t6, t7, t8); }
-
-        internal static readonly MethodInfo[] CurryClosureActionMethods =
-            typeof(ExpressionCompiler).GetTypeInfo().DeclaredMethods.Where(m => m.Name == "CurryAction").ToArray();
-
-        internal static Action CurryAction<C>(Action<C> a, C c) { return () => a(c); }
-        internal static Action<T1> CurryAction<C, T1>(Action<C, T1> f, C c) { return t1 => f(c, t1); }
-        internal static Action<T1, T2> CurryAction<C, T1, T2>(Action<C, T1, T2> f, C c) { return (t1, t2) => f(c, t1, t2); }
-        internal static Action<T1, T2, T3> CurryAction<C, T1, T2, T3>(Action<C, T1, T2, T3> f, C c) { return (t1, t2, t3) => f(c, t1, t2, t3); }
-        internal static Action<T1, T2, T3, T4> CurryAction<C, T1, T2, T3, T4>(Action<C, T1, T2, T3, T4> f, C c) { return (t1, t2, t3, t4) => f(c, t1, t2, t3, t4); }
-        internal static Action<T1, T2, T3, T4, T5> CurryAction<C, T1, T2, T3, T4, T5>(Action<C, T1, T2, T3, T4, T5> f, C c) { return (t1, t2, t3, t4, t5) => f(c, t1, t2, t3, t4, t5); }
-        internal static Action<T1, T2, T3, T4, T5, T6> CurryAction<C, T1, T2, T3, T4, T5, T6>(Action<C, T1, T2, T3, T4, T5, T6> f, C c) { return (t1, t2, t3, t4, t5, t6) => f(c, t1, t2, t3, t4, t5, t6); }
-        internal static Action<T1, T2, T3, T4, T5, T6, T7> CurryAction<C, T1, T2, T3, T4, T5, T6, T7>(Action<C, T1, T2, T3, T4, T5, T6, T7> f, C c) { return (t1, t2, t3, t4, t5, t6, t7) => f(c, t1, t2, t3, t4, t5, t6, t7); }
-        internal static Action<T1, T2, T3, T4, T5, T6, T7, T8> CurryAction<C, T1, T2, T3, T4, T5, T6, T7, T8>(Action<C, T1, T2, T3, T4, T5, T6, T7, T8> f, C c) { return (t1, t2, t3, t4, t5, t6, t7, t8) => f(c, t1, t2, t3, t4, t5, t6, t7, t8); }
+        internal static class CurryClosureFuncs
+        {
+            private static readonly IEnumerable<MethodInfo> _methods =
+                typeof(CurryClosureFuncs).GetTypeInfo().DeclaredMethods;
+
+            public static readonly MethodInfo[] Methods = _methods as MethodInfo[] ?? _methods.ToArray();
+
+            public static Func<R> Curry<C, R>(Func<C, R> f, C c) { return () => f(c); }
+            public static Func<T1, R> Curry<C, T1, R>(Func<C, T1, R> f, C c) { return t1 => f(c, t1); }
+            public static Func<T1, T2, R> Curry<C, T1, T2, R>(Func<C, T1, T2, R> f, C c) { return (t1, t2) => f(c, t1, t2); }
+            public static Func<T1, T2, T3, R> Curry<C, T1, T2, T3, R>(Func<C, T1, T2, T3, R> f, C c) { return (t1, t2, t3) => f(c, t1, t2, t3); }
+            public static Func<T1, T2, T3, T4, R> Curry<C, T1, T2, T3, T4, R>(Func<C, T1, T2, T3, T4, R> f, C c) { return (t1, t2, t3, t4) => f(c, t1, t2, t3, t4); }
+            public static Func<T1, T2, T3, T4, T5, R> Curry<C, T1, T2, T3, T4, T5, R>(Func<C, T1, T2, T3, T4, T5, R> f, C c) { return (t1, t2, t3, t4, t5) => f(c, t1, t2, t3, t4, t5); }
+            public static Func<T1, T2, T3, T4, T5, T6, R> Curry<C, T1, T2, T3, T4, T5, T6, R>(Func<C, T1, T2, T3, T4, T5, T6, R> f, C c) { return (t1, t2, t3, t4, t5, t6) => f(c, t1, t2, t3, t4, t5, t6); }
+        }
+
+        internal static class CurryClosureActions
+        {
+            private static readonly IEnumerable<MethodInfo> _methods =
+                typeof(CurryClosureActions).GetTypeInfo().DeclaredMethods;
+
+            public static readonly MethodInfo[] Methods = _methods as MethodInfo[] ?? _methods.ToArray();
+
+            internal static Action Curry<C>(Action<C> a, C c) { return () => a(c); }
+            internal static Action<T1> Curry<C, T1>(Action<C, T1> f, C c) { return t1 => f(c, t1); }
+            internal static Action<T1, T2> Curry<C, T1, T2>(Action<C, T1, T2> f, C c) { return (t1, t2) => f(c, t1, t2); }
+            internal static Action<T1, T2, T3> Curry<C, T1, T2, T3>(Action<C, T1, T2, T3> f, C c) { return (t1, t2, t3) => f(c, t1, t2, t3); }
+            internal static Action<T1, T2, T3, T4> Curry<C, T1, T2, T3, T4>(Action<C, T1, T2, T3, T4> f, C c) { return (t1, t2, t3, t4) => f(c, t1, t2, t3, t4); }
+            internal static Action<T1, T2, T3, T4, T5> Curry<C, T1, T2, T3, T4, T5>(Action<C, T1, T2, T3, T4, T5> f, C c) { return (t1, t2, t3, t4, t5) => f(c, t1, t2, t3, t4, t5); }
+            internal static Action<T1, T2, T3, T4, T5, T6> Curry<C, T1, T2, T3, T4, T5, T6>(Action<C, T1, T2, T3, T4, T5, T6> f, C c) { return (t1, t2, t3, t4, t5, t6) => f(c, t1, t2, t3, t4, t5, t6); }
+        }

         #endregion

@@ -740,9 +749,9 @@

             var typeInfo = value.GetType().GetTypeInfo();
             return !typeInfo.IsPrimitive
-                && !(value is string)
-                && !(value is Type)
-                && !typeInfo.IsEnum;
+                   && !(value is string)
+                   && !(value is Type)
+                   && !typeInfo.IsEnum;
         }

         // @paramExprs is required for nested lambda compilation
@@ -775,23 +784,23 @@
                     var callExprInfo = expr as MethodCallExpressionInfo;
                     if (callExprInfo != null)
                         return (callExprInfo.Object == null ||
-                            TryCollectBoundConstants(ref closure, callExprInfo.Object, paramExprs)) &&
-                            TryCollectBoundConstants(ref closure, callExprInfo.Arguments, paramExprs);
+                                TryCollectBoundConstants(ref closure, callExprInfo.Object, paramExprs)) &&
+                               TryCollectBoundConstants(ref closure, callExprInfo.Arguments, paramExprs);

                     var callExpr = (MethodCallExpression)expr;
                     return (callExpr.Object == null ||
-                        TryCollectBoundConstants(ref closure, callExpr.Object, paramExprs)) &&
-                        TryCollectBoundConstants(ref closure, callExpr.Arguments, paramExprs);
+                            TryCollectBoundConstants(ref closure, callExpr.Object, paramExprs)) &&
+                           TryCollectBoundConstants(ref closure, callExpr.Arguments, paramExprs);

                 case ExpressionType.MemberAccess:
                     var memberExprInfo = expr as MemberExpressionInfo;
                     if (memberExprInfo != null)
                         return memberExprInfo.Expression == null
-                            || TryCollectBoundConstants(ref closure, memberExprInfo.Expression, paramExprs);
+                               || TryCollectBoundConstants(ref closure, memberExprInfo.Expression, paramExprs);

                     var memberExpr = ((MemberExpression)expr).Expression;
                     return memberExpr == null ||
-                        TryCollectBoundConstants(ref closure, memberExpr, paramExprs);
+                           TryCollectBoundConstants(ref closure, memberExpr, paramExprs);

                 case ExpressionType.New:
                     var newExprInfo = expr as NewExpressionInfo;
@@ -887,13 +896,13 @@
                 case ExpressionType.Invoke:
                     var invocationExpr = (InvocationExpression)expr;
                     return TryCollectBoundConstants(ref closure, invocationExpr.Expression, paramExprs)
-                        && TryCollectBoundConstants(ref closure, invocationExpr.Arguments, paramExprs);
+                           && TryCollectBoundConstants(ref closure, invocationExpr.Arguments, paramExprs);

                 case ExpressionType.Conditional:
                     var conditionalExpr = (ConditionalExpression)expr;
                     return TryCollectBoundConstants(ref closure, conditionalExpr.Test, paramExprs)
-                        && TryCollectBoundConstants(ref closure, conditionalExpr.IfTrue, paramExprs)
-                        && TryCollectBoundConstants(ref closure, conditionalExpr.IfFalse, paramExprs);
+                           && TryCollectBoundConstants(ref closure, conditionalExpr.IfTrue, paramExprs)
+                           && TryCollectBoundConstants(ref closure, conditionalExpr.IfFalse, paramExprs);

                 default:
                     var unaryExpr = expr as UnaryExpression;
@@ -903,7 +912,7 @@
                     var binaryExpr = expr as BinaryExpression;
                     if (binaryExpr != null)
                         return TryCollectBoundConstants(ref closure, binaryExpr.Left, paramExprs)
-                            && TryCollectBoundConstants(ref closure, binaryExpr.Right, paramExprs);
+                               && TryCollectBoundConstants(ref closure, binaryExpr.Right, paramExprs);
                     break;
             }

@@ -941,7 +950,6 @@
                     case 5: return typeof(Action<,,,,>).MakeGenericType(paramTypes);
                     case 6: return typeof(Action<,,,,,>).MakeGenericType(paramTypes);
                     case 7: return typeof(Action<,,,,,,>).MakeGenericType(paramTypes);
-                    case 8: return typeof(Action<,,,,,,,>).MakeGenericType(paramTypes);
                     default:
                         throw new NotSupportedException(
                             string.Format("Action with so many ({0}) parameters is not supported!", paramTypes.Length));
@@ -982,7 +990,7 @@
                 switch (e.NodeType)
                 {
                     case ExpressionType.Parameter:
-                        var pInfo = expr as ParameterExpressionInfo;
+                        var pInfo = expr as ParameterExpressionInfo;
                         return EmitParameter(pInfo != null ? pInfo.ParamExpr : (ParameterExpression)expr, paramExprs, il, closure);
                     case ExpressionType.Convert:
                         return EmitConvert((UnaryExpression)expr, paramExprs, il, closure);
@@ -1082,7 +1090,7 @@
             private static bool EmitBinary(BinaryExpression e, IList<ParameterExpression> ps, ILGenerator il, ClosureInfo closure)
             {
                 return TryEmit(e.Left, ps, il, closure)
-                    && TryEmit(e.Right, ps, il, closure);
+                       && TryEmit(e.Right, ps, il, closure);
             }

             private static bool EmitMany(IList<Expression> es, IList<ParameterExpression> ps, ILGenerator il, ClosureInfo closure)
@@ -1459,7 +1467,7 @@
                 return true;
             }

-            private static bool EmitNestedLambda(object lambdaExpr,
+            private static bool EmitNestedLambda(object lambdaExpr,
                 IList<ParameterExpression> paramExprs, ILGenerator il, ClosureInfo closure)
             {
                 // First, find in closed compiled lambdas the one corresponding to the current lambda expression.
@@ -1586,16 +1594,12 @@
                     }
                 }

+                // Create nested closure object composed of all constants, params, lambdas loaded on stack
                 if (isNestedArrayClosure)
-                {
                     il.Emit(OpCodes.Newobj, ArrayClosure.Constructor);
-                }
                 else
-                {
-                    // Create nested closure object composed of all constants, params, lambdas loaded on stack
-                    var closureCtor = nestedClosureInfo.ClosureType.GetTypeInfo().DeclaredConstructors.First();
-                    il.Emit(OpCodes.Newobj, closureCtor);
-                }
+                    il.Emit(OpCodes.Newobj,
+                        nestedClosureInfo.ClosureType.GetTypeInfo().DeclaredConstructors.First());

                 EmitMethodCall(il, GetCurryClosureMethod(nestedLambda, nestedLambdaInfo.IsAction));
                 return true;
@@ -1604,9 +1608,9 @@
             private static MethodInfo GetCurryClosureMethod(object lambda, bool isAction)
             {
                 var lambdaTypeArgs = lambda.GetType().GetTypeInfo().GenericTypeArguments;
-                return isAction
-                    ? CurryClosureActionMethods[lambdaTypeArgs.Length - 1].MakeGenericMethod(lambdaTypeArgs)
-                    : CurryClosureFuncMethods[lambdaTypeArgs.Length - 2].MakeGenericMethod(lambdaTypeArgs);
+                return isAction
+                    ? CurryClosureActions.Methods[lambdaTypeArgs.Length - 1].MakeGenericMethod(lambdaTypeArgs)
+                    : CurryClosureFuncs.Methods[lambdaTypeArgs.Length - 2].MakeGenericMethod(lambdaTypeArgs);
             }

             private static bool EmitInvokeLambda(InvocationExpression e, IList<ParameterExpression> paramExprs, ILGenerator il, ClosureInfo closure)


fixed: #218

fixed: #218

--- src/FastExpressionCompiler/FastExpressionCompiler.cs
+++ src/FastExpressionCompiler/FastExpressionCompiler.cs
@@ -2184,14 +2184,14 @@
                         il.Emit(OpCodes.Call, sourceType.FindNullableHasValueGetterMethod());

                         var labelSourceHasValue = il.DefineLabel();
-                        il.Emit(OpCodes.Brtrue_S, labelSourceHasValue); // jump where source has a value
+                        il.Emit(OpCodes.Brtrue, labelSourceHasValue); // jump where source has a value

                         // otherwise, emit and load a `new Nullable<TTarget>()` struct (that's why a Init instead of New)
                         EmitLoadLocalVariable(il, InitValueTypeVariable(il, targetType));

                         // jump to completion
                         var labelDone = il.DefineLabel();
-                        il.Emit(OpCodes.Br_S, labelDone);
+                        il.Emit(OpCodes.Br, labelDone);

                         // if source nullable has a value:
                         il.MarkLabel(labelSourceHasValue);
@@ -3539,7 +3539,7 @@

                         il.Emit(OpCodes.Ldc_I4_0);
                         var doneLabel = il.DefineLabel();
-                        il.Emit(OpCodes.Br_S, doneLabel);
+                        il.Emit(OpCodes.Br, doneLabel);

                         il.MarkLabel(ifTrueLabel);
                         il.Emit(OpCodes.Ldc_I4_1);
@@ -3681,7 +3681,7 @@
                         var endL = il.DefineLabel();
                         var locIndex = InitValueTypeVariable(il, exprType);
                         EmitLoadLocalVariable(il, locIndex);
-                        il.Emit(OpCodes.Br_S, endL);
+                        il.Emit(OpCodes.Br, endL);
                         il.MarkLabel(valueLabel);
                         il.Emit(OpCodes.Newobj, exprType.GetTypeInfo().DeclaredConstructors.GetFirst());
                         il.MarkLabel(endL);


port tests to new framework

port tests to new framework

--- src/Analyzers/CSharp/Tests/UseConditionalExpression/UseConditionalExpressionForAssignmentTests.cs
+++ src/Analyzers/CSharp/Tests/UseConditionalExpression/UseConditionalExpressionForAssignmentTests.cs
@@ -326,28 +326,45 @@
     {
         [|if|] (true)
         {
+            this.{|CS1061:i|} = 0;
+        }
+        else
+        {
+            throw new System.Exception();
+        }
+    }
+}",
+@"
+class C
+{
+    void M()
+    {
+        this.{|CS1061:i|} = true ? 0 : throw new System.Exception();
+    }
+}");
+        }
+
+        [Fact]
+        public async Task TestOnNonUniformTargetSyntax()
+        {
+            await TestInRegularAndScript1Async(
+@"
+class C
+{
+    private int i;
+
+    void M()
+    {
+        [|if|] (true)
+        {
             this.i = 0;
         }
         else
         {
-            throw new System.Exception();
-        }
-    }
-}",
-@"
-class C
-{
-    void M()
-    {
-        this.i = true ? 0 : throw new System.Exception();
-    }
-}");
-        }
-
-        [Fact]
-        public async Task TestOnNonUniformTargetSyntax()
-        {
-            await TestInRegularAndScript1Async(
+            this . i = 1;
+        }
+    }
+}",
 @"
 class C
 {
@@ -355,19 +372,37 @@

     void M()
     {
+        this.i = true ? 0 : 1;
+    }
+}");
+        }
+
+        [Fact]
+        public async Task TestOnAssignmentToDefinedField()
+        {
+            await TestInRegularAndScript1Async(
+@"
+class C
+{
+    int i;
+
+    void M()
+    {
         [|if|] (true)
         {
             this.i = 0;
         }
         else
         {
-            this . i = 1;
-        }
-    }
-}",
-@"
-class C
-{
+            this.i = 1;
+        }
+    }
+}",
+@"
+class C
+{
+    int i;
+
     void M()
     {
         this.i = true ? 0 : 1;
@@ -376,39 +411,6 @@
         }

         [Fact]
-        public async Task TestOnAssignmentToDefinedField()
-        {
-            await TestInRegularAndScript1Async(
-@"
-class C
-{
-    int i;
-
-    void M()
-    {
-        [|if|] (true)
-        {
-            this.i = 0;
-        }
-        else
-        {
-            this.i = 1;
-        }
-    }
-}",
-@"
-class C
-{
-    int i;
-
-    void M()
-    {
-        this.i = true ? 0 : 1;
-    }
-}");
-        }
-
-        [Fact]
         public async Task TestOnAssignmentToAboveLocalNoInitializer()
         {
             await TestInRegularAndScript1Async(
@@ -607,6 +609,8 @@
             i = 1;
         }
     }
+
+    int Foo() => 0;
 }",
 @"
 class C
@@ -616,6 +620,8 @@
         int i = Foo();
         i = true ? 0 : 1;
     }
+
+    int Foo() => 0;
 }");
         }

@@ -624,6 +630,8 @@
         {
             await TestInRegularAndScript1Async(
 @"
+using System;
+
 class C
 {
     void M()
@@ -641,6 +649,8 @@
     }
 }",
 @"
+using System;
+
 class C
 {
     void M()
@@ -671,6 +681,8 @@
             i = 1;
         }
     }
+
+    bool Bar(int i) => true;
 }",
 @"
 class C
@@ -680,6 +692,8 @@
         int i = 0;
         i = Bar(i) ? 0 : 1;
     }
+
+    bool Bar(int i) => true;
 }");
         }

@@ -1171,7 +1185,7 @@
 {
     void M(int i)
     {
-        {|FixAllInDocument:if|} (true)
+        [|if|] (true)
         {
             i = 0;
         }
@@ -1181,7 +1195,7 @@
         }

         string s;
-        if (true)
+        [|if|] (true)
         {
             s = ""a"";
         }
@@ -1223,7 +1237,7 @@
         }
     }

-    void Foo(int x, int y, int z) { }
+    int Foo(int x, int y, int z) => 0;
 }",
 @"
 class C
@@ -1236,7 +1250,7 @@
             : 1;
     }

-    void Foo(int x, int y, int z) { }
+    int Foo(int x, int y, int z) => 0;
 }");
         }

@@ -1259,6 +1273,8 @@
                 1, 2, 3);
         }
     }
+
+    int Foo(int x, int y, int z) => 0;
 }",
 @"
 class C
@@ -1270,6 +1286,8 @@
             : Foo(
                 1, 2, 3);
     }
+
+    int Foo(int x, int y, int z) => 0;
 }");
         }

@@ -1293,6 +1311,8 @@
                 4, 5, 6);
         }
     }
+
+    int Foo(int x, int y, int z) => 0;
 }",
 @"
 class C
@@ -1305,6 +1325,8 @@
             : Foo(
                 4, 5, 6);
     }
+
+    int Foo(int x, int y, int z) => 0;
 }");
         }

@@ -1425,8 +1447,9 @@
         [Fact]
         public async Task TestElseIfWithoutBlock()
         {
-            await TestInRegularAndScript1Async(
-@"
+            await new VerifyCS.Test
+            {
+                TestCode = @"
 class C
 {
     void M(int i)
@@ -1436,14 +1459,17 @@
         else i = 0;
     }
 }",
-@"
-class C
-{
-    void M(int i)
-    {
-        i = true ? 2 : false : 1 : 0;
-    }
-}");
+                FixedCode = @"
+class C
+{
+    void M(int i)
+    {
+        if (true) i = 2;
+        else i = false ? 1 : 0;
+    }
+}",
+                CodeFixTestBehaviors = Testing.CodeFixTestBehaviors.FixOne,
+            }.RunAsync();
         }

         [Fact]


fix build error in 16f918616b8ccaacfd3a798982105a194dfa0525

--- src/FilterLists.Services/Snapshot/SnapshotService.cs
+++ src/FilterLists.Services/Snapshot/SnapshotService.cs
@@ -39,8 +39,7 @@
         private async Task<IEnumerable<FilterListViewUrlDto>> GetListsToCapture(int batchSize) =>
             await DbContext
                   .FilterLists
-                  .Where(l => !l.CantSnapshot &&
-                              !(l.ViewUrl.StartsWith(WaybackService.WaybackMachineUrlPrefix) &&
+                  .Where(l => !(l.ViewUrl.StartsWith(WaybackService.WaybackMachineUrlPrefix) &&
                                 l.Snapshots.Any(s => s.WasSuccessful)))
                   .OrderBy(l => l.Snapshots.Any())
                   .ThenBy(l => l.Snapshots


Removing use of lambda syntax in script blocks emitted by AureliaEnhanceTagHelper - fixes issue in IE11.

--- src/FooBar.Web/TagHelpers/AureliaEnhanceTagHelper.cs
+++ src/FooBar.Web/TagHelpers/AureliaEnhanceTagHelper.cs
@@ -52,8 +52,8 @@
 				}
 				output.PostElement.AppendHtml($@"
                 <script>
-                    SystemJS.import('app/core/aurelia-enhancer').then(enhancer => {{
-						SystemJS.import('{Module}').then(module => {{
+                    SystemJS.import('app/core/aurelia-enhancer').then(function(enhancer) {{
+						SystemJS.import('{Module}').then(function(module) {{
 							var data = {jsonData};
 							var clientModel = module.create(data);
 							enhancer.enhance(clientModel, document.getElementById('{elementId}'));
@@ -65,7 +65,7 @@
 			{
 				output.PostElement.AppendHtml($@"
                 <script>
-                    SystemJS.import('app/core/aurelia-enhancer').then(enhancer => {{
+                    SystemJS.import('app/core/aurelia-enhancer').then(function(enhancer) {{
 						enhancer.enhance({{}}, document.getElementById('{elementId}'));
                     }});
                 </script>");


Made OnConnectionRedirection event based in SharedConnectionRedirectionPayloadHandler

--- src/Booma.Proxy.Client.Unity.SharedHandlers/Handlers/SharedConnectionRedirectionPayloadHandler.cs
+++ src/Booma.Proxy.Client.Unity.SharedHandlers/Handlers/SharedConnectionRedirectionPayloadHandler.cs
@@ -12,7 +12,7 @@
 namespace Booma.Proxy
 {
 	[SceneTypeCreate(GameSceneType.ServerSelectionScreen)]
-	public class SharedConnectionRedirectionPayloadHandler : GameMessageHandler<SharedConnectionRedirectPayload>
+	public sealed class SharedConnectionRedirectionPayloadHandler : GameMessageHandler<SharedConnectionRedirectPayload>, IConnectionRedirectionEventSubscribable
 	{
 		private IFullCryptoInitializationService<byte[]> CryptoInitializer { get; }

@@ -20,6 +20,9 @@
 		/// Data model for connection details.
 		/// </summary>
 		private IGameConnectionEndpointDetails ConnectionEndpoint { get; }
+
+		/// <inheritdoc />
+		public event EventHandler OnConnectionRedirection;

 		/// <inheritdoc />
 		public SharedConnectionRedirectionPayloadHandler([NotNull] IGameConnectionEndpointDetails connectionEndpoint, [NotNull] IFullCryptoInitializationService<byte[]> cryptoInitializer, ILog logger)
@@ -45,18 +48,13 @@
 			ConnectionEndpoint.IpAddress = payload.EndpointAddress.ToString();
 			ConnectionEndpoint.Port = payload.EndpointerPort;

-			await OnConnectionRedirected();
+			//Dispatch the redirection event.
+			OnConnectionRedirection?.Invoke(this, EventArgs.Empty);
 		}

 		private string BuildLoginDebugString(SharedConnectionRedirectPayload payload)
 		{
 			return $"Ip: {payload.EndpointAddress} Port: {payload.EndpointerPort}";
 		}
-
-		//Default version we don't do anything.
-		protected virtual Task OnConnectionRedirected()
-		{
-			return Task.CompletedTask;
-		}
 	}
 }


fix tests

fix tests

--- src/EditorFeatures/CSharpTest/Completion/CompletionProviders/ConversionCompletionProviderTests.cs
+++ src/EditorFeatures/CSharpTest/Completion/CompletionProviders/ConversionCompletionProviderTests.cs
@@ -937,7 +937,6 @@

             var assertShouldBeNullable =
                 fromClassOrStruct == "struct" &&
-                toClassOrStruct == "struct" &&
                 (propertyIsNullable || conditionalAccess);

             var propertyNullableQuestionMark = propertyIsNullable ? "?" : "";


Fixed C# type printer to go through visit method when printing declarations.

--- src/Generator/Generators/CSharp/CSharpTypePrinter.cs
+++ src/Generator/Generators/CSharp/CSharpTypePrinter.cs
@@ -586,9 +586,9 @@
         public override TypePrinterResult VisitClassDecl(Class @class)
         {
             if (ContextKind == TypePrinterContextKind.Native)
-                return $"{GetName(@class.OriginalClass ?? @class)}.{Helpers.InternalStruct}";
-
-            return $@"{GetName(@class)}{(@class.IsDependent ? $@"<{
+                return $"{VisitDeclaration(@class.OriginalClass ?? @class)}.{Helpers.InternalStruct}";
+
+            return $@"{VisitDeclaration(@class)}{(@class.IsDependent ? $@"<{
                 string.Join(", ", @class.TemplateParameters.Select(p => p.Name))}>" : string.Empty)}";
         }

@@ -617,17 +617,17 @@

         public override TypePrinterResult VisitTypedefDecl(TypedefDecl typedef)
         {
-            return GetName(typedef);
+            return VisitDeclaration(typedef);
         }

         public override TypePrinterResult VisitTypeAliasDecl(TypeAlias typeAlias)
         {
-            return GetName(typeAlias);
+            return VisitDeclaration(typeAlias);
         }

         public override TypePrinterResult VisitEnumDecl(Enumeration @enum)
         {
-            return GetName(@enum);
+            return VisitDeclaration(@enum);
         }

         public override TypePrinterResult VisitEnumItemDecl(Enumeration.Item item)
@@ -635,7 +635,7 @@
             return VisitDeclaration(item);
         }

-        public string GetName(Declaration decl)
+        string GetName(Declaration decl)
         {
             var names = new Stack<string>();

@@ -682,7 +682,7 @@

         public override TypePrinterResult VisitVariableDecl(Variable variable)
         {
-            return GetName(variable);
+            return VisitDeclaration(variable);
         }

         public override TypePrinterResult VisitParameters(IEnumerable<Parameter> @params,


delivery_date can be null

delivery_date can be null

--- src/MyParcelApi.Net/Models/ShipmentOptions.cs
+++ src/MyParcelApi.Net/Models/ShipmentOptions.cs
@@ -13,7 +13,7 @@
         public DeliveryType DeliveryType { get; set; }

         [DataMember(Name = "delivery_date", EmitDefaultValue = false, IsRequired = false)]
-        public DateTime DeliveryDate { get; set; }
+        public DateTime? DeliveryDate { get; set; }

         [DataMember(Name = "only_recipient", EmitDefaultValue = false, IsRequired = false)]
         private int? _onlyRecipientRaw;


Fix formatting.

Fix formatting.

--- src/Features/CSharp/Portable/UseExpressionBody/Helpers/UseExpressionBodyForLocalFunctionHelper.cs
+++ src/Features/CSharp/Portable/UseExpressionBody/Helpers/UseExpressionBodyForLocalFunctionHelper.cs
@@ -8,7 +8,7 @@

 namespace Microsoft.CodeAnalysis.CSharp.UseExpressionBody
 {
-    internal class UseExpressionBodyForLocalFunctionHelper :
+    internal class UseExpressionBodyForLocalFunctionHelper :
         UseExpressionBodyHelper<LocalFunctionStatementSyntax>
     {
         public static readonly UseExpressionBodyForLocalFunctionHelper Instance = new UseExpressionBodyForLocalFunctionHelper();