Update osu!.db reading for 20191107 update

--- osu-database-reader/BinaryFiles/OsuDb.cs
+++ osu-database-reader/BinaryFiles/OsuDb.cs
@@ -34,17 +34,27 @@
             AccountName = r.ReadString();

             Beatmaps = new List<BeatmapEntry>();
+
             int length = r.ReadInt32();
+
             for (int i = 0; i < length; i++) {
                 int currentIndex = (int)r.BaseStream.Position;
-                int entryLength = r.ReadInt32();
+                int entryLength = 0;
+
+                // After version 20191107, the size of the beatmap entry is no longer present
+                // https://github.com/ppy/osu-wiki/commit/7ce3b8988d9945fe5867029a65750b40d66a3820
+                const int lengthOsuVersion = 20191107;
+
+                if (OsuVersion < lengthOsuVersion)
+                    entryLength = r.ReadInt32();

                 Beatmaps.Add(BeatmapEntry.ReadFromReader(r, false, OsuVersion));

-                if (r.BaseStream.Position != currentIndex + entryLength + 4) {
+                if (OsuVersion < lengthOsuVersion && r.BaseStream.Position != currentIndex + entryLength + 4) {
                     Debug.Fail($"Length doesn't match, {r.BaseStream.Position} instead of expected {currentIndex + entryLength + 4}");
                 }
             }
+
             AccountRank = (PlayerRank)r.ReadByte();
         }


Use ruleset.ShortName instead of hardcoded names.

--- osu.Desktop/DiscordRichPresenceClient.cs
+++ osu.Desktop/DiscordRichPresenceClient.cs
@@ -80,19 +80,19 @@
             switch (ruleset.ID)
             {
                 case 0:
-                    presence.Assets.SmallImageKey = "osu";
+                    presence.Assets.SmallImageKey = ruleset.ShortName;
                     break;

                 case 1:
-                    presence.Assets.SmallImageKey = "taiko";
+                    presence.Assets.SmallImageKey = ruleset.ShortName;
                     break;

                 case 2:
-                    presence.Assets.SmallImageKey = "fruits";
+                    presence.Assets.SmallImageKey = ruleset.ShortName;
                     break;

                 case 3:
-                    presence.Assets.SmallImageKey = "mania";
+                    presence.Assets.SmallImageKey = ruleset.ShortName;
                     break;

                 default:


Use the `View` width and height instead of the osuTK ones

This allows us to update earlier, as we have a valid layout.

--- osu.Framework.Android/AndroidGameView.cs
+++ osu.Framework.Android/AndroidGameView.cs
@@ -162,14 +162,12 @@
         public void RenderGame()
         {
             LayoutChange += (_, __) => updateSafeArea();
+            updateSafeArea();

             Host = new AndroidGameHost(this);
             Host.ExceptionThrown += handleException;
             Host.Run(game);
             HostStarted?.Invoke(Host);
-
-            // if this is run immediately, we'll have an invalid layout (Width == Height == 0).
-            Host.InputThread.Scheduler.Add(updateSafeArea);
         }

         private bool handleException(Exception ex)
@@ -220,7 +218,7 @@

             int[] location = new int[2];
             GetLocationOnScreen(location);
-            var viewArea = new RectangleI(location[0], location[1], Width, Height);
+            var viewArea = new RectangleI(location[0], location[1], (this as View).Width, (this as View).Height);

             // intersect with the usable area and treat the the difference as unsafe.


Fix typo in `ArchiveModelManager`

Fix typo in `ArchiveModelManager`

--- osu.Game/Database/ArchiveModelManager.cs
+++ osu.Game/Database/ArchiveModelManager.cs
@@ -806,7 +806,7 @@
         protected TModel CheckForExisting(TModel model) => model.Hash == null ? null : ModelStore.ConsumableItems.FirstOrDefault(b => b.Hash == model.Hash);

         /// <summary>
-        /// Whether inport can be skipped after finding an existing import early in the process.
+        /// Whether import can be skipped after finding an existing import early in the process.
         /// Only valid when <see cref="ComputeHash"/> is not overridden.
         /// </summary>
         /// <param name="existing">The existing model.</param>


Make QueryAndPopulate's filter non-optional (you basically *never* want this missing)

--- osu.Game/Database/DatabaseBackedStore.cs
+++ osu.Game/Database/DatabaseBackedStore.cs
@@ -83,9 +83,9 @@
         /// <summary>
         /// Query and populate results.
         /// </summary>
-        /// <param name="filter">An optional filter to refine results.</param>
+        /// <param name="filter">An filter to refine results.</param>
         /// <returns></returns>
-        public List<T> QueryAndPopulate<T>(Expression<Func<T, bool>> filter = null)
+        public List<T> QueryAndPopulate<T>(Expression<Func<T, bool>> filter)
             where T : class
         {
             checkType(typeof(T));


Remove `user` from `SubmittableScore`

Remove `user` from `SubmittableScore`

This wasn't being used by osu-web, and included far too much unnecessary
data. Of note, `pp` and `ruleset_id` are also not strictly required, but
there's no harm in sending them so I've left them be for now.

--- osu.Game/Online/Solo/SubmittableScore.cs
+++ osu.Game/Online/Solo/SubmittableScore.cs
@@ -46,9 +46,6 @@
         [JsonProperty("mods")]
         public APIMod[] Mods { get; set; }

-        [JsonProperty("user")]
-        public APIUser User { get; set; }
-
         [JsonProperty("statistics")]
         public Dictionary<HitResult, int> Statistics { get; set; }

@@ -67,7 +64,6 @@
             RulesetID = score.RulesetID;
             Passed = score.Passed;
             Mods = score.APIMods;
-            User = score.User;
             Statistics = score.Statistics;
         }
     }


clang-format vs plugin: use Alp's suggestion for getting the path

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@196124 91177308-0d34-0410-b5e6-96231b3b80d8

--- tools/clang-format-vs/ClangFormat/ClangFormatPackage.cs
+++ tools/clang-format-vs/ClangFormat/ClangFormatPackage.cs
@@ -129,8 +129,8 @@
         /// </summary>
         private string RunClangFormat(string text, int offset, int length, string path)
         {
-            string vsixPath = Path.GetDirectoryName(Uri.UnescapeDataString(
-                new UriBuilder(Assembly.GetExecutingAssembly().CodeBase).Path));
+            string vsixPath = Path.GetDirectoryName(
+                typeof(ClangFormatPackage).Assembly.Location);

             System.Diagnostics.Process process = new System.Diagnostics.Process();
             process.StartInfo.UseShellExecute = false;


Fixing unit test failure in FacebookAuthorizeFilterTest.

--- test/Microsoft.AspNet.Mvc.Facebook.Test/FacebookAuthorizeFilterTest.cs
+++ test/Microsoft.AspNet.Mvc.Facebook.Test/FacebookAuthorizeFilterTest.cs
@@ -43,7 +43,7 @@

             ContentResult result = Assert.IsType<ContentResult>(authorizeFilter.CreateRedirectResult(uri));
             Assert.Equal("text/html", result.ContentType);
-            Assert.Contains("http://example.com/?query=4';%20alert('hello%20world')", result.Content);
+            Assert.Equal(@"<script>window.top.location = 'http://example.com/?query=4\u0027;%20alert(\u0027hello%20world\u0027)';</script>", result.Content);
         }

         [Fact]


Bring additional tests for binding hooks

--- tests/Avalonia.ReactiveUI.UnitTests/AutoDataTemplateBindingHookTest.cs
+++ tests/Avalonia.ReactiveUI.UnitTests/AutoDataTemplateBindingHookTest.cs
@@ -28,11 +28,36 @@

         public class ExampleView : ReactiveUserControl<ExampleViewModel>
         {
-            public ItemsControl List { get; } = new ItemsControl();
+            public ItemsControl List { get; } = new ItemsControl
+            {
+                Template = GetTemplate()
+            };

             public ExampleView()
             {
+                List.ApplyTemplate();
+                List.Presenter.ApplyTemplate();
                 Content = List;
+
+                ViewModel = new ExampleViewModel();
+                this.OneWayBind(ViewModel, x => x.Items, x => x.List.Items);
+            }
+        }
+
+        public class ExampleViewWithItemTemplate : ReactiveUserControl<ExampleViewModel>
+        {
+            public ItemsControl List { get; } = new ItemsControl
+            {
+                Template = GetTemplate()
+            };
+
+            public ExampleViewWithItemTemplate()
+            {
+                List.ApplyTemplate();
+                List.Presenter.ApplyTemplate();
+                List.ItemTemplate = GetItemTemplate();
+                Content = List;
+
                 ViewModel = new ExampleViewModel();
                 this.OneWayBind(ViewModel, x => x.Items, x => x.List.Items);
             }
@@ -50,6 +75,15 @@
         {
             var view = new ExampleView();
             Assert.NotNull(view.List.ItemTemplate);
+            Assert.IsType<FuncDataTemplate<object>>(view.List.ItemTemplate);
+        }
+
+        [Fact]
+        public void Should_Not_Override_Data_Template_Binding_When_Item_Template_Is_Set()
+        {
+            var view = new ExampleViewWithItemTemplate();
+            Assert.NotNull(view.List.ItemTemplate);
+            Assert.IsType<FuncDataTemplate<TextBlock>>(view.List.ItemTemplate);
         }

         [Fact]
@@ -57,10 +91,6 @@
         {
             var view = new ExampleView();
             view.ViewModel.Items.Add(new NestedViewModel());
-
-            view.List.Template = GetTemplate();
-            view.List.ApplyTemplate();
-            view.List.Presenter.ApplyTemplate();

             var child = view.List.Presenter.Panel.Children[0];
             var container = (ContentPresenter) child;
@@ -70,15 +100,24 @@
         }

         [Fact]
+        public void Should_Not_Use_View_Model_View_Host_When_Item_Template_Is_Set()
+        {
+            var view = new ExampleViewWithItemTemplate();
+            view.ViewModel.Items.Add(new NestedViewModel());
+
+            var child = view.List.Presenter.Panel.Children[0];
+            var container = (ContentPresenter) child;
+            container.UpdateChild();
+
+            Assert.IsType<TextBlock>(container.Child);
+        }
+
+        [Fact]
         public void Should_Resolve_And_Embedd_Appropriate_View_Model()
         {
             var view = new ExampleView();
             var root = new TestRoot { Child = view };
             view.ViewModel.Items.Add(new NestedViewModel());
-
-            view.List.Template = GetTemplate();
-            view.List.ApplyTemplate();
-            view.List.Presenter.ApplyTemplate();

             var child = view.List.Presenter.Panel.Children[0];
             var container = (ContentPresenter) child;
@@ -93,7 +132,12 @@
             Assert.IsType<string>(host.DataContext);
         }

-        private FuncControlTemplate GetTemplate()
+        private static FuncDataTemplate GetItemTemplate()
+        {
+            return new FuncDataTemplate<TextBlock>((parent, scope) => new TextBlock());
+        }
+
+        private static FuncControlTemplate GetTemplate()
         {
             return new FuncControlTemplate<ItemsControl>((parent, scope) =>
             {


Added extra unit tests and restructured the class.

--- tests/Magick.NET.Tests/MagickNETTests/TheGetFormatInformationMethod.cs
+++ tests/Magick.NET.Tests/MagickNETTests/TheGetFormatInformationMethod.cs
@@ -15,132 +15,189 @@
     {
         public class TheGetFormatInformationMethod
         {
-            [Fact]
-            public void ShouldReturnTheCorrectInfoForTheGradientFormat()
+            public class WithFileInfo
             {
-                var formatInfo = MagickNET.GetFormatInformation(MagickFormat.Gradient);
-                Assert.NotNull(formatInfo);
-                Assert.Equal(MagickFormat.Gradient, formatInfo.Format);
-                Assert.True(formatInfo.CanReadMultithreaded);
-                Assert.True(formatInfo.CanWriteMultithreaded);
-                Assert.Equal("Gradual linear passing from one shade to another", formatInfo.Description);
-                Assert.False(formatInfo.IsMultiFrame);
-                Assert.True(formatInfo.IsReadable);
-                Assert.False(formatInfo.IsWritable);
-                Assert.Null(formatInfo.MimeType);
+                [Fact]
+                public void ShouldThrowExceptionWhenFileInfoIsNull()
+                {
+                    var exception = Assert.Throws<ArgumentNullException>(() => MagickNET.GetFormatInformation((FileInfo)null));
+
+                    Assert.Equal("file", exception.ParamName);
+                }
+
+                [Fact]
+                public void ShouldReturnTheCorrectInfoForThePngFormat()
+                {
+                    var fileInfo = new FileInfo(Files.MagickNETIconPNG);
+                    var formatInfo = MagickNET.GetFormatInformation(fileInfo);
+
+                    Assert.NotNull(formatInfo);
+                    Assert.True(formatInfo.CanReadMultithreaded);
+                    Assert.True(formatInfo.CanWriteMultithreaded);
+                    Assert.Equal("Portable Network Graphics", formatInfo.Description);
+                    Assert.Equal(MagickFormat.Png, formatInfo.Format);
+                    Assert.False(formatInfo.IsMultiFrame);
+                    Assert.True(formatInfo.IsReadable);
+                    Assert.True(formatInfo.IsWritable);
+                    Assert.Equal("image/png", formatInfo.MimeType);
+                    Assert.Equal(MagickFormat.Png, formatInfo.ModuleFormat);
+                }
             }

-            [Fact]
-            public void ShouldReturnTheCorrectInfoForTheJp2Format()
+            public class WithFilename
             {
-                var formatInfo = MagickNET.GetFormatInformation(MagickFormat.Jp2);
-                Assert.NotNull(formatInfo);
-                Assert.Equal(MagickFormat.Jp2, formatInfo.Format);
-                Assert.True(formatInfo.CanReadMultithreaded);
-                Assert.True(formatInfo.CanWriteMultithreaded);
-                Assert.Equal("JPEG-2000 File Format Syntax", formatInfo.Description);
-                Assert.False(formatInfo.IsMultiFrame);
-                Assert.True(formatInfo.IsReadable);
-                Assert.True(formatInfo.IsWritable);
-                Assert.Equal("image/jp2", formatInfo.MimeType);
+                [Fact]
+                public void ShouldThrowExceptionWhenFileMameIsNull()
+                {
+                    var exception = Assert.Throws<ArgumentNullException>(() => MagickNET.GetFormatInformation((string)null));
+
+                    Assert.Equal("fileName", exception.ParamName);
+                }
+
+                [Fact]
+                public void ShouldThrowExceptionWhenFilenameIsEmpty()
+                {
+                    var exception = Assert.Throws<ArgumentException>(() => MagickNET.GetFormatInformation(string.Empty));
+
+                    Assert.Equal("fileName", exception.ParamName);
+                }
+
+                [Fact]
+                public void ShouldReturnNullForUnknownExtension()
+                {
+                    using (var temporaryFile = new TemporaryFile("foo.bar"))
+                    {
+                        var formatInfo = MagickNET.GetFormatInformation(temporaryFile.FullName);
+
+                        Assert.Null(formatInfo);
+                    }
+                }
+
+                [Fact]
+                public void ShouldReturnTheCorrectInfoForTheJpgFormat()
+                {
+                    var formatInfo = MagickNET.GetFormatInformation(Files.ImageMagickJPG);
+
+                    Assert.NotNull(formatInfo);
+                    Assert.True(formatInfo.CanReadMultithreaded);
+                    Assert.True(formatInfo.CanWriteMultithreaded);
+                    Assert.Equal("Joint Photographic Experts Group JFIF format", formatInfo.Description);
+                    Assert.Equal(MagickFormat.Jpg, formatInfo.Format);
+                    Assert.False(formatInfo.IsMultiFrame);
+                    Assert.True(formatInfo.IsReadable);
+                    Assert.True(formatInfo.IsWritable);
+                    Assert.Equal("image/jpeg", formatInfo.MimeType);
+                    Assert.Equal(MagickFormat.Jpeg, formatInfo.ModuleFormat);
+                }
             }

-            [Fact]
-            public void ShouldReturnTheCorrectInfoForThePangoFormat()
+            public class WithMagickFormat
             {
-                var formatInfo = MagickNET.GetFormatInformation(MagickFormat.Pango);
-                Assert.NotNull(formatInfo);
-                Assert.False(formatInfo.CanReadMultithreaded);
-                Assert.False(formatInfo.CanWriteMultithreaded);
-                Assert.Equal("Pango Markup Language", formatInfo.Description);
-                Assert.Equal(MagickFormat.Pango, formatInfo.Format);
-                Assert.False(formatInfo.IsMultiFrame);
-                Assert.True(formatInfo.IsReadable);
-                Assert.False(formatInfo.IsWritable);
-                Assert.Null(formatInfo.MimeType);
-                Assert.Equal(MagickFormat.Pango, formatInfo.ModuleFormat);
+                [Fact]
+                public void ShouldReturnNullForUnknownFormat()
+                {
+                    var formatInfo = MagickNET.GetFormatInformation((MagickFormat)12345);
+
+                    Assert.Null(formatInfo);
+                }
+
+                [Fact]
+                public void ShouldReturnTheCorrectInfoForTheGradientFormat()
+                {
+                    var formatInfo = MagickNET.GetFormatInformation(MagickFormat.Gradient);
+
+                    Assert.NotNull(formatInfo);
+                    Assert.Equal(MagickFormat.Gradient, formatInfo.Format);
+                    Assert.True(formatInfo.CanReadMultithreaded);
+                    Assert.True(formatInfo.CanWriteMultithreaded);
+                    Assert.Equal("Gradual linear passing from one shade to another", formatInfo.Description);
+                    Assert.False(formatInfo.IsMultiFrame);
+                    Assert.True(formatInfo.IsReadable);
+                    Assert.False(formatInfo.IsWritable);
+                    Assert.Null(formatInfo.MimeType);
+                }
+
+                [Fact]
+                public void ShouldReturnTheCorrectInfoForTheJp2Format()
+                {
+                    var formatInfo = MagickNET.GetFormatInformation(MagickFormat.Jp2);
+
+                    Assert.NotNull(formatInfo);
+                    Assert.Equal(MagickFormat.Jp2, formatInfo.Format);
+                    Assert.True(formatInfo.CanReadMultithreaded);
+                    Assert.True(formatInfo.CanWriteMultithreaded);
+                    Assert.Equal("JPEG-2000 File Format Syntax", formatInfo.Description);
+                    Assert.False(formatInfo.IsMultiFrame);
+                    Assert.True(formatInfo.IsReadable);
+                    Assert.True(formatInfo.IsWritable);
+                    Assert.Equal("image/jp2", formatInfo.MimeType);
+                }
+
+                [Fact]
+                public void ShouldReturnTheCorrectInfoForThePangoFormat()
+                {
+                    var formatInfo = MagickNET.GetFormatInformation(MagickFormat.Pango);
+
+                    Assert.NotNull(formatInfo);
+                    Assert.False(formatInfo.CanReadMultithreaded);
+                    Assert.False(formatInfo.CanWriteMultithreaded);
+                    Assert.Equal("Pango Markup Language", formatInfo.Description);
+                    Assert.Equal(MagickFormat.Pango, formatInfo.Format);
+                    Assert.False(formatInfo.IsMultiFrame);
+                    Assert.True(formatInfo.IsReadable);
+                    Assert.False(formatInfo.IsWritable);
+                    Assert.Null(formatInfo.MimeType);
+                    Assert.Equal(MagickFormat.Pango, formatInfo.ModuleFormat);
+                }
+
+                [Fact]
+                public void ShouldReturnFormatInfoForAllFormats()
+                {
+                    var missingFormats = new List<string>();
+
+                    foreach (MagickFormat format in Enum.GetValues(typeof(MagickFormat)))
+                    {
+                        if (format == MagickFormat.Unknown)
+                            continue;
+
+                        var formatInfo = MagickNET.GetFormatInformation(format);
+                        if (formatInfo == null)
+                        {
+                            if (ShouldReport(format))
+                                missingFormats.Add(format.ToString());
+                        }
+                    }
+
+                    if (missingFormats.Count > 0)
+                        throw new XunitException("Cannot find MagickFormatInfo for: " + string.Join(", ", missingFormats.ToArray()));
+                }
+
+                private static bool ShouldReport(MagickFormat format)
+                {
+                    if (IsDisabledThroughPolicy(format))
+                        return false;
+
+                    if (!OperatingSystem.IsWindows)
+                    {
+                        if (format == MagickFormat.Clipboard || format == MagickFormat.Emf || format == MagickFormat.Wmf)
+                            return false;
+                    }
+
+                    if (OperatingSystem.IsMacOS)
+                    {
+                        if (format == MagickFormat.Jxl)
+                            return false;
+                    }
+
+                    return true;
+                }
+
+                /// <summary>
+                /// Disabled with <see cref="TestCollectionOrderer.ModifyPolicy(string)"/>.
+                /// </summary>
+                private static bool IsDisabledThroughPolicy(MagickFormat format)
+                    => format == MagickFormat.Sun || format == MagickFormat.Ras;
             }
-
-            [Fact]
-            public void ShouldReturnTheCorrectInfoForTheJpgFormat()
-            {
-                var formatInfo = MagickNET.GetFormatInformation(Files.ImageMagickJPG);
-                Assert.NotNull(formatInfo);
-                Assert.True(formatInfo.CanReadMultithreaded);
-                Assert.True(formatInfo.CanWriteMultithreaded);
-                Assert.Equal("Joint Photographic Experts Group JFIF format", formatInfo.Description);
-                Assert.Equal(MagickFormat.Jpg, formatInfo.Format);
-                Assert.False(formatInfo.IsMultiFrame);
-                Assert.True(formatInfo.IsReadable);
-                Assert.True(formatInfo.IsWritable);
-                Assert.Equal("image/jpeg", formatInfo.MimeType);
-                Assert.Equal(MagickFormat.Jpeg, formatInfo.ModuleFormat);
-            }
-
-            [Fact]
-            public void ShouldReturnTheCorrectInfoForThePngFormat()
-            {
-                var fileInfo = new FileInfo(Files.MagickNETIconPNG);
-                var formatInfo = MagickNET.GetFormatInformation(fileInfo);
-                Assert.NotNull(formatInfo);
-                Assert.True(formatInfo.CanReadMultithreaded);
-                Assert.True(formatInfo.CanWriteMultithreaded);
-                Assert.Equal("Portable Network Graphics", formatInfo.Description);
-                Assert.Equal(MagickFormat.Png, formatInfo.Format);
-                Assert.False(formatInfo.IsMultiFrame);
-                Assert.True(formatInfo.IsReadable);
-                Assert.True(formatInfo.IsWritable);
-                Assert.Equal("image/png", formatInfo.MimeType);
-                Assert.Equal(MagickFormat.Png, formatInfo.ModuleFormat);
-            }
-
-            [Fact]
-            public void ShouldReturnFormatInfoForAllFormats()
-            {
-                var missingFormats = new List<string>();
-
-                foreach (MagickFormat format in Enum.GetValues(typeof(MagickFormat)))
-                {
-                    if (format == MagickFormat.Unknown)
-                        continue;
-
-                    var formatInfo = MagickNET.GetFormatInformation(format);
-                    if (formatInfo == null)
-                    {
-                        if (ShouldReport(format))
-                            missingFormats.Add(format.ToString());
-                    }
-                }
-
-                if (missingFormats.Count > 0)
-                    throw new XunitException("Cannot find MagickFormatInfo for: " + string.Join(", ", missingFormats.ToArray()));
-            }
-
-            private static bool ShouldReport(MagickFormat format)
-            {
-                if (IsDisabledThroughPolicy(format))
-                    return false;
-
-                if (!OperatingSystem.IsWindows)
-                {
-                    if (format == MagickFormat.Clipboard || format == MagickFormat.Emf || format == MagickFormat.Wmf)
-                        return false;
-                }
-
-                if (OperatingSystem.IsMacOS)
-                {
-                    if (format == MagickFormat.Jxl)
-                        return false;
-                }
-
-                return true;
-            }
-
-            /// <summary>
-            /// Disabled with <see cref="TestCollectionOrderer.ModifyPolicy(string)"/>.
-            /// </summary>
-            private static bool IsDisabledThroughPolicy(MagickFormat format)
-                => format == MagickFormat.Sun || format == MagickFormat.Ras;
         }
     }
 }


FrameRateUtilityでnullオブジェクトに対して関数が呼べてしまうので修正

--- trunk/STG/Assets/Scripts/Utility/FrameRateUtility.cs
+++ trunk/STG/Assets/Scripts/Utility/FrameRateUtility.cs
@@ -43,7 +43,10 @@
 				i--;
 			}
 		}
-
-		func();
+
+		if( func.Target.ToString() != "null" )
+		{
+			func();
+		}
 	}
 }


Fixed test.

Fixed test.

--- tests/Avalonia.Input.UnitTests/GesturesTests.cs
+++ tests/Avalonia.Input.UnitTests/GesturesTests.cs
@@ -1,10 +1,9 @@
 using System.Collections.Generic;
 using Avalonia.Controls;
-using Avalonia.Input;
 using Avalonia.UnitTests;
 using Xunit;

-namespace Avalonia.Interactivity.UnitTests
+namespace Avalonia.Input.UnitTests
 {
     public class GesturesTests
     {
@@ -45,7 +44,7 @@
         }

         [Fact]
-        public void Tapped_Should_Be_Raised_For_Middle_Button()
+        public void Tapped_Should_Not_Be_Raised_For_Middle_Button()
         {
             Border border = new Border();
             var decorator = new Decorator
@@ -58,7 +57,7 @@

             _mouse.Click(border, MouseButton.Middle);

-            Assert.True(raised);
+            Assert.False(raised);
         }

         [Fact]


added IoC for LanguageRepo

added IoC for LanguageRepo

--- Web/Startup.cs
+++ Web/Startup.cs
@@ -37,6 +37,7 @@
             services.AddScoped<IJobRepository, JobRepository>();
             services.AddScoped<IJobProjectRepository, JobProjectRepository>();
             services.AddScoped<ISchoolRepository, SchoolRepository>();
+            services.AddScoped<ILanguageRepository, LanguageRepository>();
         }

         public void Configure(IApplicationBuilder app, IHostingEnvironment env)


add failing test for autoscroll to selected item in listbox #4855

--- tests/Avalonia.Controls.UnitTests/ListBoxTests.cs
+++ tests/Avalonia.Controls.UnitTests/ListBoxTests.cs
@@ -405,6 +405,53 @@
             _mouse.Click(item);

             Assert.Equal(1, raised);
+        }
+
+        [Fact]
+        public void Adding_And_Selecting_Item_With_AutoScrollToSelectedItem_Should_NotHide_FirstItem()
+        {
+            using (UnitTestApplication.Start(TestServices.StyledWindow))
+            {
+                var items = new AvaloniaList<string>();
+
+                var wnd = new Window() { Width = 100, Height = 100, IsVisible = true };
+
+                var target = new ListBox()
+                {
+                    VerticalAlignment = Layout.VerticalAlignment.Top,
+                    AutoScrollToSelectedItem = true,
+                    Width = 50,
+                    VirtualizationMode = ItemVirtualizationMode.Simple,
+                    ItemTemplate = new FuncDataTemplate<object>((c, _) => new Border() { Height = 10 }),
+                    Items = items,
+                };
+                wnd.Content = target;
+
+                var lm = wnd.LayoutManager;
+
+                lm.ExecuteInitialLayoutPass();
+
+                var panel = target.Presenter.Panel;
+
+                items.Add("Item 1");
+                target.Selection.Select(0);
+                lm.ExecuteLayoutPass();
+
+                Assert.Equal(1, panel.Children.Count);
+
+                items.Add("Item 2");
+                target.Selection.Select(1);
+                lm.ExecuteLayoutPass();
+
+                Assert.Equal(2, panel.Children.Count);
+
+                //make sure we have enough space to show all items
+                Assert.True(panel.Bounds.Height >= panel.Children.Sum(c => c.Bounds.Height));
+
+                //make sure we show items and they completelly visible, not only partially
+                Assert.True(panel.Children[0].Bounds.Top >= 0 && panel.Children[0].Bounds.Bottom <= panel.Bounds.Height, "first item is not completelly visible!");
+                Assert.True(panel.Children[1].Bounds.Top >= 0 && panel.Children[1].Bounds.Bottom <= panel.Bounds.Height, "second item is not completelly visible!");
+            }
         }

         private FuncControlTemplate ListBoxTemplate()


Update LessonBook.CreateSampleLesson to be callable

CreateSampleLesson is no longer called automatically by the constructor.
It can be manually called when needed.  This has been done so multiple
copies of the sample lesson are not saved.

--- Assets/Classes/GGProductions/LetterStorm/Data/Collections/LessonBook.cs
+++ Assets/Classes/GGProductions/LetterStorm/Data/Collections/LessonBook.cs
@@ -34,8 +34,6 @@
         public LessonBook()
         {
             _lessons = new LessonCollection();
-
-            CreateSampleLesson();
         }
         #endregion Constructors -----------------------------------------------

@@ -43,7 +41,7 @@
         /// <summary>
         /// Create a sample Lesson with a few basic words and hints
         /// </summary>
-        private void CreateSampleLesson()
+        public void CreateSampleLesson()
         {
             // Create a sample Lesson with a few words and hints
             Lesson sampleLesson = new Lesson("Sample Lesson");


Simplify: strip nodes unnecessary for classification.

--- A-vs-An/WikipediaAvsAnTrieExtractor/SimplifyExtension.cs
+++ A-vs-An/WikipediaAvsAnTrieExtractor/SimplifyExtension.cs
@@ -4,28 +4,43 @@

 namespace WikipediaAvsAnTrieExtractor {
     public static class SimplifyExtension {
-        public static MutableNode Simplify(this MutableNode node, int scaleFactor) {
-            Dictionary<char, MutableNode> simpleKids = null;
-            if (node.Kids != null)
-                foreach (var kidEntry in node.Kids) {
-                    var kid = kidEntry.Value;
-                    var diff = kid.ratio.anCount - kid.ratio.aCount;
-                    var occurence = kid.ratio.anCount + kid.ratio.aCount;
-                    if (Math.Abs(occurence) < scaleFactor)
-                        continue;
-                    var simpleKid = kid.Simplify(scaleFactor);
-                    if (simpleKid.Kids != null ||
-                        diff*(long) diff >= scaleFactor*(long) occurence
-                        //&& simpleKid.Annotation() != node.Annotation()
-                        ) {
-                        simpleKids = simpleKids ?? new Dictionary<char, MutableNode>();
-                        simpleKids.Add(kidEntry.Key, simpleKid);
-                    }
+        public static Node Simplify(this Node node, int scaleFactor) {
+            if (node.SortedKids == null)
+                return new Node {
+                    c = node.c,
+                    ratio = node.ratio,
+                };
+
+            Node[] simpleKids = null;
+            int kidCount = 0;
+            foreach (var kidEntry in node.SortedKids) {
+                var kid = kidEntry;
+                var diff = kid.ratio.anCount - kid.ratio.aCount;
+                var occurence = kid.ratio.anCount + kid.ratio.aCount;
+                if (Math.Abs(occurence) < scaleFactor)
+                    continue;
+                var simpleKid = kid.Simplify(scaleFactor);
+                if (simpleKid.SortedKids != null ||
+                    diff * (long)diff >= scaleFactor * (long)occurence
+                    && Annotation(simpleKid) != Annotation(node)
+                    ) {
+                    if (simpleKids == null)
+                        simpleKids = new Node[node.SortedKids.Length];
+                    simpleKids[kidCount++] = simpleKid;
                 }
-            return new MutableNode {
+            }
+            if (simpleKids != null)
+                Array.Resize(ref simpleKids, kidCount);
+
+            return new Node {
+                c = node.c,
                 ratio = node.ratio,
-                Kids = simpleKids
+                SortedKids = simpleKids
             };
+        }
+
+        static bool Annotation(Node node) {
+            return node.ratio.anCount > node.ratio.aCount;
         }
     }
 }


calcul average visite

calcul average visite

--- Ada/AdaWebApp/Models/DAL/Repositories/VisitRepository.cs
+++ Ada/AdaWebApp/Models/DAL/Repositories/VisitRepository.cs
@@ -3,6 +3,7 @@
 using System;
 using System.Collections.Generic;
 using System.Data.Entity;
+using System.Data.Entity.Core.Objects;
 using System.Linq;

 namespace AdaWebApp.Models.DAL.Repositories
@@ -37,7 +38,7 @@
                                                             //et ne prend donc pas l'année de la dernière visite.
                                                             //&& v.Person.DateOfBirth.Year == v.Date.Year)
                                                             .ToList();
-        }
+        }

         public List<Visit> GetVisitForAPersonById(int id,int nbVisit)
         {
@@ -47,14 +48,17 @@
         public int GetNbVisits(GenderValues? gender ,int? age1, int? age2)
         {
             DateTime dateAverage = DateTime.Today.AddDays(-120);
+            int date = DateTime.Now.Day;
+            int nbDayVisits = Table.Where(v => v.Date > dateAverage).GroupBy(x => DbFunctions.TruncateTime(x.Date)).Count();
+            int nbVisits;

             if(age1 == null && gender == null)
             {
-                return Table.Count(v => v.Date > dateAverage);
+                nbVisits = Table.Count(v => v.Date > dateAverage);
             }
             else if(age1 == null)
             {
-                return Table.Where(v => v.Person.Gender == gender).Count(v => v.Date > dateAverage);
+                nbVisits = Table.Where(v => v.Person.Gender == gender).Count(v => v.Date > dateAverage);
             }
             else if(gender == null)
             {
@@ -62,13 +66,13 @@

                 if (age2 == null)
                 {
-                    return Table.Where(v => v.Person.DateOfBirth.Year == age1).Count(v => v.Date > dateAverage);
+                    nbVisits = Table.Where(v => v.Person.DateOfBirth.Year == age1).Count(v => v.Date > dateAverage);
                 }
                 else
                 {
                     age2 = DateTime.Today.Year - age2;

-                    return Table.Where(v => v.Person.DateOfBirth.Year <= age1 && v.Person.DateOfBirth.Year >= age2).Count(v => v.Date > dateAverage);
+                    nbVisits = Table.Where(v => v.Person.DateOfBirth.Year <= age1 && v.Person.DateOfBirth.Year >= age2).Count(v => v.Date > dateAverage);
                 }
             }
             else
@@ -77,14 +81,18 @@

                 if (age2 == null)
                 {
-                    return Table.Where(v => v.Person.DateOfBirth.Year == age1 && v.Person.Gender == gender).Count(v => v.Date > dateAverage);
+                    nbVisits = Table.Where(v => v.Person.DateOfBirth.Year == age1 && v.Person.Gender == gender).Count(v => v.Date > dateAverage);
                 }
                 else
                 {
                     age2 = DateTime.Today.Year - age2;
-                    return Table.Where(v => v.Person.DateOfBirth.Year <= age1 && v.Person.DateOfBirth.Year >= age2 && v.Person.Gender == gender).Count(v => v.Date > dateAverage);
+                    nbVisits = Table.Where(v => v.Person.DateOfBirth.Year <= age1 && v.Person.DateOfBirth.Year >= age2 && v.Person.Gender == gender).Count(v => v.Date > dateAverage);
                 }
             }
+
+            float result = nbVisits / nbDayVisits;
+
+            return Math.Floor((int)result);
         }

         public bool CheckVisitExist(int id)


Ignore casing for _colorByCategoryName dictionary.

--- CalDavSynchronizer/Implementation/Events/EventSynchronizationContext.cs
+++ CalDavSynchronizer/Implementation/Events/EventSynchronizationContext.cs
@@ -38,7 +38,7 @@
         {
           using (var categoriesWrapper = GenericComObjectWrapper.Create(outlookSession.Categories))
           {
-            return categoriesWrapper.Inner.ToSafeEnumerable<Category>().ToDictionary(c => c.Name, c => c.Color);
+            return categoriesWrapper.Inner.ToSafeEnumerable<Category>().ToDictionary(c => c.Name, c => c.Color, StringComparer.InvariantCultureIgnoreCase);
           }
         },
         false);


Adjust regression algorithm (#4714)

Adjust regression algorithm (#4714)

* Adjust test to show how to legitimately change an order

* Address review

* fix comparator; check Order Time

--- Algorithm.CSharp/OrderImmutabilityRegressionAlgorithm.cs
+++ Algorithm.CSharp/OrderImmutabilityRegressionAlgorithm.cs
@@ -15,6 +15,7 @@

 using System;
 using System.Collections.Generic;
+using System.Linq;
 using QuantConnect.Data;
 using QuantConnect.Interfaces;
 using QuantConnect.Orders;
@@ -31,6 +32,8 @@
     public class OrderImmutabilityRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition
     {
         private readonly Symbol _spy = QuantConnect.Symbol.Create("SPY", SecurityType.Equity, Market.USA);
+        private OrderTicket _ticket;
+        private Order _originalOrder;

         /// <summary>
         /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.
@@ -38,7 +41,7 @@
         public override void Initialize()
         {
             SetStartDate(2013, 10, 08);  //Set Start Date
-            SetEndDate(2013, 10, 17);    //Set End Date
+            SetEndDate(2013, 10, 09);    //Set End Date
             SetCash(100000);             //Set Strategy Cash
             AddEquity("SPY", Resolution.Daily);
         }
@@ -51,17 +54,35 @@
         {
             if (!Portfolio.Invested)
             {
-                SetHoldings(_spy, 1);
+                _ticket = LimitOrder(_spy, 10, 100);
                 Debug("Purchased Stock");
+
+                // Here we will show how to correctly change an order, we will then verify at End of Algorithm!
+                // First get the order as it is now, should be a copy, so it wont be updated!
+                _originalOrder = Transactions.GetOrderById(_ticket.OrderId);
+
+                // Create an UpdateOrderRequest and send it to the ticket
+                var updateFields = new UpdateOrderFields { Quantity = 20, Tag = "Pepe", LimitPrice = data[_spy].Low};
+                var response = _ticket.Update(updateFields);
+
+                // Test order time
+                if (_originalOrder.Time != UtcTime)
+                {
+                    Error("Order Time should be UtcTime!");
+                    throw new Exception("Order Time should be UtcTime!");
+                }
             }
         }

         /// <summary>
         /// All order events get pushed through this function
+        /// This function will test that what we get from Transactions is indeed a clone
+        /// The only authentic way to change the order is to change through the order ticket!
         /// </summary>
         /// <param name="orderEvent">OrderEvent object that contains all the information about the event</param>
         public override void OnOrderEvent(OrderEvent orderEvent)
         {
+
             // Get the order twice, since they are clones they should NOT be the same
             var orderV1 = Transactions.GetOrderById(orderEvent.OrderId);
             var orderV2 = Transactions.GetOrderById(orderEvent.OrderId);
@@ -72,37 +93,56 @@
                 throw new Exception("Orders should be clones, hence not equal!");
             }

+            // Try and manipulate orderV2 using the only external accessor BrokerID, since we
+            // are changing a clone the BrokerIDs should not be the same
+            orderV2.BrokerId.Add("FAKE BROKER ID");
+            var orderV3 = Transactions.GetOrderById(orderEvent.OrderId);
+
+            if (orderV2.BrokerId.SequenceEqual(orderV3.BrokerId))
+            {
+                Error("Broker IDs should not be the same!");
+                throw new Exception("Broker IDs should not be the same!");
+            }
+
             //Try and manipulate the orderV1 using UpdateOrderRequest
             //NOTICE: Orders should only be updated through their tickets!
-            var updateFields = new UpdateOrderFields { Quantity = 99, Tag = "Pepe" };
+            var updateFields = new UpdateOrderFields { Quantity = 99, Tag = "Pepe2!" };
             var updateRequest = new UpdateOrderRequest(DateTime.Now, orderEvent.OrderId, updateFields);
             orderV1.ApplyUpdateOrderRequest(updateRequest);
+            var orderV4 = Transactions.GetOrderById(orderEvent.OrderId);

-            //Get another copy of the order and compare
-            var orderV3 = Transactions.GetOrderById(orderEvent.OrderId);
-
-            if (orderV1.Quantity == orderV3.Quantity)
+            if (orderV4.Quantity == orderV1.Quantity)
             {
-                Error("Quantities should not be changed!");
-                throw new Exception("Quantities should not be changed!");
-            }
-
-            if (orderV1.Tag == orderV3.Tag)
-            {
-                Error("Tag should not be changed!");
-                throw new Exception("Tag should not be changed!");
+                Error("Order quantity should not be the same!");
+                throw new Exception("Order quantity should not be the same!");
             }

-            //Try and manipulate orderV2 using the only external accessor BrokerID
-            orderV2.BrokerId.Add("FAKE BROKER ID");
+            if (orderV4.Tag == orderV1.Tag)
+            {
+                Error("Order tag should not be the same!");
+                throw new Exception("Order tag should not be the same!");
+            }
+        }

-            //Get another copy of the order and compare
-            var orderV4 = Transactions.GetOrderById(orderEvent.OrderId);
+        /// <summary>
+        /// Will run at End of Algorithm
+        /// We will be using this to check our order was updated!
+        /// </summary>
+        public override void OnEndOfAlgorithm()
+        {
+            //Get an updated copy of the order and compare to our original
+            var updatedOrder = Transactions.GetOrderById(_ticket.OrderId);

-            if (orderV2.BrokerId == orderV4.BrokerId)
+            if (updatedOrder.Quantity == _originalOrder.Quantity)
             {
-                Error("BrokerIDs should not be the same!");
-                throw new Exception("BrokerIDs should not be the same!");
+                Error("Quantities should have been updated!");
+                throw new Exception("Quantities should have been updated!");
+            }
+
+            if (updatedOrder.Tag == _originalOrder.Tag)
+            {
+                Error("Tag should have been updated!");
+                throw new Exception("Tag should have been updated!");
             }
         }

@@ -124,25 +164,25 @@
             {"Total Trades", "1"},
             {"Average Win", "0%"},
             {"Average Loss", "0%"},
-            {"Compounding Annual Return", "246.000%"},
-            {"Drawdown", "1.100%"},
+            {"Compounding Annual Return", "-5.591%"},
+            {"Drawdown", "0.000%"},
             {"Expectancy", "0"},
-            {"Net Profit", "3.459%"},
-            {"Sharpe Ratio", "10.11"},
-            {"Probabilistic Sharpe Ratio", "83.150%"},
+            {"Net Profit", "-0.032%"},
+            {"Sharpe Ratio", "-9.862"},
+            {"Probabilistic Sharpe Ratio", "0%"},
             {"Loss Rate", "0%"},
             {"Win Rate", "0%"},
             {"Profit-Loss Ratio", "0"},
-            {"Alpha", "1.935"},
-            {"Beta", "-0.119"},
-            {"Annual Standard Deviation", "0.16"},
-            {"Annual Variance", "0.026"},
-            {"Information Ratio", "-4.556"},
-            {"Tracking Error", "0.221"},
-            {"Treynor Ratio", "-13.568"},
-            {"Total Fees", "$3.26"},
-            {"Fitness Score", "0.111"},
-            {"OrderListHash", "1268340653"}
+            {"Alpha", "0.007"},
+            {"Beta", "-0.582"},
+            {"Annual Standard Deviation", "0.004"},
+            {"Annual Variance", "0"},
+            {"Information Ratio", "-10.999"},
+            {"Tracking Error", "0.011"},
+            {"Treynor Ratio", "0.067"},
+            {"Total Fees", "$1.00"},
+            {"Fitness Score", "0.007"},
+            {"OrderListHash", "1715759777"}
         };
     }
 }


Removing search control from campaign page

Marked div tag to remove, ok to remove this or do we just want to hide
for later use? Issue #422

--- AllReadyApp/Web-App/AllReady/Views/Campaign/Index.cshtml
+++ AllReadyApp/Web-App/AllReady/Views/Campaign/Index.cshtml
@@ -10,7 +10,7 @@
     <link rel="stylesheet" href="~/css/campaignStyle.css" asp-file-version="true" />
 </environment>

-

+

         <input type="search"
                class="campaign-search "


Changing the order fixes #107

Changing the order fixes #107

--- AngleSharp/Css/ValueConverters/PeriodicValueConverter.cs
+++ AngleSharp/Css/ValueConverters/PeriodicValueConverter.cs
@@ -115,11 +115,11 @@
                 if (name == _labels[0])
                     return _top.Original;
                 else if (name == _labels[1])
+                    return _right.Original;
+                else if (name == _labels[2])
+                    return _bottom.Original;
+                else if (name == _labels[3])
                     return _left.Original;
-                else if (name == _labels[2])
-                    return _right.Original;
-                else if (name == _labels[3])
-                    return _bottom.Original;

                 return null;
             }


Minor cleanup for InvariantActionExecutor.

--- ContractExtensions/ContextActions/Invariants/InvariantActionExecutor.cs
+++ ContractExtensions/ContextActions/Invariants/InvariantActionExecutor.cs
@@ -69,17 +69,19 @@
             method.Body.AddStatementAfter(statement, addAfter);
         }

+        /// <summary>
+        /// Returns statement after which current invariant should be added.
+        /// </summary>
+        /// <remarks>
+        /// Order of the invariants:
+        /// Invariants that check fields
+        /// Invariants that check properties
+        /// All of them would be in the order of the declaration.
+        /// </remarks>
         [CanBeNull]
         private ICSharpStatement GetPreviousInvariantStatement()
         {
-
             var declaration = _invariantAvailability.FieldOrPropertyDeclaration;
-            //if (declaration.IsField)
-            //{
-            //    return GetPreviousInvariantForField(declaration);
-            //}
-
-            //return GetPreviousInvariantForProperty(declaration);

             IEnumerable<IDeclaration> fields = _classDeclaration.MemberDeclarations.OfType<IFieldDeclaration>();
             IEnumerable<IDeclaration> properties = Enumerable.Empty<IDeclaration>();
@@ -106,80 +108,6 @@
             }

             return null;
-
-            //var fields = _classDeclaration.MemberDeclarations.OfType<IFieldDeclaration>().ToList();
-
-            //if (declaration.IsField)
-            //{
-            //    var index = fields.FindIndex(x => x.DeclaredName == declaration.Name);
-            //    return index > 0 ? fields[index - 1] : null;
-
-            //}
-            //else
-            //{
-            //    var properties = _classDeclaration.MemberDeclarations.OfType<IPropertyDeclaration>().ToList();
-
-            //    // If we're adding prop
-            //    if (properties.Count == 0)
-            //    {
-            //        return fields.LastOrDefault();
-            //    }
-
-            //    var index = properties.FindIndex(x => x.DeclaredName == declaration.Name);
-            //    return index > 0 ? properties[index - 1] : null;
-        }
-
-        private ICSharpStatement GetPreviousInvariantForProperty(FieldOrPropertyDeclaration declaration)
-        {
-            throw new System.NotImplementedException();
-        }
-
-        private ICSharpStatement GetPreviousInvariantForField(FieldOrPropertyDeclaration declaration)
-        {
-            var fields = _classDeclaration.MemberDeclarations.OfType<IFieldDeclaration>().ToList();
-
-            var fieldInvariantStatements =
-                _classDeclaration.GetInvariants()
-                .Where(i => fields.Any(f => i.ArgumentName == f.DeclaredName))
-                .ToDictionary(x => x.ArgumentName, x => x);
-
-            // Looking for "previous" fields backwards
-            foreach (var previousField in fields.SkipWhile(fd => fd.DeclaredName != declaration.Name).Reverse())
-            {
-                if (fieldInvariantStatements.ContainsKey(previousField.DeclaredName))
-                {
-                    return fieldInvariantStatements[previousField.DeclaredName].Statement;
-                }
-            }
-
-            return null;
-        }
-
-
-        [CanBeNull]
-        private IDeclaration GetPreviousFieldOrProperty(FieldOrPropertyDeclaration declaration)
-        {
-            var fields = _classDeclaration.MemberDeclarations.OfType<IFieldDeclaration>().ToList();
-
-            if (declaration.IsField)
-            {
-                var index = fields.FindIndex(x => x.DeclaredName == declaration.Name);
-                return index > 0 ? fields[index - 1] : null;
-
-            }
-            else
-            {
-                var properties = _classDeclaration.MemberDeclarations.OfType<IPropertyDeclaration>().ToList();
-
-                // If we're adding prop
-                if (properties.Count == 0)
-                {
-                    return fields.LastOrDefault();
-                }
-
-                var index = properties.FindIndex(x => x.DeclaredName == declaration.Name);
-                return index > 0 ? properties[index - 1] : null;
-            }
         }

         private IMethodDeclaration AddObjectInvariantMethodIfNecessary()


Fix- input events should be blocked while transitioning between rooms

--- AGS.Engine/Input/GLInput.cs
+++ AGS.Engine/Input/GLInput.cs
@@ -11,12 +11,14 @@
 		private GameWindow _game;
 		private int _virtualWidth, _virtualHeight;
 		private IGameState _state;
+		private IAGSRoomTransitions _roomTransitions;

 		private IAnimationContainer _mouseCursor;
 		private MouseCursor _originalOSCursor;

-		public GLInput (GameWindow game, AGS.API.Size virtualResolution, IGameState state)
+		public GLInput (GameWindow game, AGS.API.Size virtualResolution, IGameState state, IAGSRoomTransitions roomTransitions)
 		{
+			this._roomTransitions = roomTransitions;
 			this._virtualWidth = virtualResolution.Width;
 			this._virtualHeight = virtualResolution.Height;
 			this._state = state;
@@ -32,6 +34,7 @@

 			game.MouseDown += async (sender, e) =>
 			{
+				if (isInputBlocked()) return;
 				var button = convert(e.Button);
 				if (button == AGS.API.MouseButton.Left) LeftMouseButtonDown = true;
 				else if (button == AGS.API.MouseButton.Right) RightMouseButtonDown = true;
@@ -39,14 +42,27 @@
 			};
 			game.MouseUp += async (sender, e) =>
 			{
+				if (isInputBlocked()) return;
 				var button = convert(e.Button);
 				if (button == AGS.API.MouseButton.Left) LeftMouseButtonDown = false;
 				else if (button == AGS.API.MouseButton.Right) RightMouseButtonDown = false;
 				await MouseUp.InvokeAsync(sender, new AGS.API.MouseButtonEventArgs(button, convertX(e.X), convertY(e.Y)));
 			};
-			game.MouseMove += async (sender, e) => await MouseMove.InvokeAsync(sender, new MousePositionEventArgs(convertX(e.X), convertY(e.Y)));
-			game.KeyDown += async (sender, e) => await KeyDown.InvokeAsync(sender, new KeyboardEventArgs(convert(e.Key)));
-			game.KeyUp += async (sender, e) => await KeyUp.InvokeAsync(sender, new KeyboardEventArgs(convert(e.Key)));
+			game.MouseMove += async (sender, e) =>
+			{
+				if (isInputBlocked()) return;
+				await MouseMove.InvokeAsync(sender, new MousePositionEventArgs (convertX(e.X), convertY(e.Y)));
+			};
+			game.KeyDown += async (sender, e) =>
+			{
+				if (isInputBlocked()) return;
+				await KeyDown.InvokeAsync(sender, new KeyboardEventArgs (convert(e.Key)));
+			};
+			game.KeyUp += async (sender, e) =>
+			{
+				if (isInputBlocked()) return;
+				await KeyUp.InvokeAsync(sender, new KeyboardEventArgs (convert(e.Key)));
+			};
 		}

 		#region IInputEvents implementation
@@ -94,6 +110,12 @@
 		  	}
 		}

+		private bool isInputBlocked()
+		{
+			if (_roomTransitions.State != RoomTransitionState.NotInTransition) return true;
+			return false;
+		}
+
 		private AGS.API.MouseButton convert(OpenTK.Input.MouseButton button)
 		{
 			switch (button) {


for uwp.

for uwp.

--- Jasily.Core.CSShared/Windows/VisibilityExtensions.cs
+++ Jasily.Core.CSShared/Windows/VisibilityExtensions.cs
@@ -1,28 +1,25 @@
-
+#if WINDOWS_UWP
+using Windows.UI.Xaml;
+#endif
+
 namespace System.Windows
 {
     public static class VisibilityExtensions
     {
-#if DESKTOP
+#if DESKTOP || WINDOWS_UWP
         /// <summary>
         /// 如果 True，返回 Visible，否则返回 Collapsed
         /// </summary>
         /// <param name="value"></param>
         /// <returns>value ? Visibility.Visible : Visibility.Collapsed;</returns>
-        public static Visibility VisibleIfTrue(this bool value)
-        {
-            return value ? Visibility.Visible : Visibility.Collapsed;
-        }
+        public static Visibility VisibleIfTrue(this bool value) => value ? Visibility.Visible : Visibility.Collapsed;

         /// <summary>
         /// 如果 True，返回 Collapsed，否则返回 Visible
         /// </summary>
         /// <param name="value"></param>
         /// <returns></returns>
-        public static Visibility CollapsedIfTrue(this bool value)
-        {
-            return (!value) ? Visibility.Visible : Visibility.Collapsed;
-        }
+        public static Visibility CollapsedIfTrue(this bool value) => value ? Visibility.Collapsed : Visibility.Visible;
 #endif
     }
 }


Fix dictionary sort order #78

Fix dictionary sort order #78

Fix the sort order, and prep for guid (but we can't set it yet)

--- Jumoo.uSync.Core/Serializers/DictionarySerializer.cs
+++ Jumoo.uSync.Core/Serializers/DictionarySerializer.cs
@@ -50,54 +50,74 @@

         private IDictionaryItem UpdateDictionaryValues(XElement node, Guid? parent, List<ILanguage> languages)
         {
+            var itemKeyNode = node.Attribute("Key");
+            if (itemKeyNode == null)
+                return null;
+
+            var itemKey = itemKeyNode.Value;

-            var itemKeyNode = node.Attribute("Key");
-            if (itemKeyNode != null)
-            {
-                var itemKey = itemKeyNode.Value;
-                LogHelper.Debug<DictionarySerializer>("Deserialize: < {0}", () => itemKey);
-
-                IDictionaryItem item = default(IDictionaryItem);
-
-                if (_localizationService.DictionaryItemExists(itemKey))
+
+            IDictionaryItem item = default(IDictionaryItem);
+
+            /*
+
+            // currently (v7.5.3) you can't set the key value of a dictionary item
+            // so we dont put it in the export file. and don't look up on it
+
+            Guid guid = Guid.Empty;
+
+            var itemGuid = node.Attribute("Guid");
+            if (itemGuid != null && Guid.TryParse(itemGuid.Value, out guid))
+            {
+                item = _localizationService.GetDictionaryItemById(guid);
+            }
+            */
+
+            if (item == null && _localizationService.DictionaryItemExists(itemKey))
+            {
+                item = _localizationService.GetDictionaryItemByKey(itemKey);
+            }
+
+
+            // both create by guid or key haven't found the value
+            if (item == null)
+            {
+                if (parent.HasValue)
+                    item = new DictionaryItem(parent.Value, itemKey);
+                else
+                    item = new DictionaryItem(itemKey);
+            }
+
+            if (item == null)
+                return null;
+
+            /*
+            if (guid != Guid.Empty)
+                item.Key = guid;
+            */
+
+            foreach (var valueNode in node.Elements("Value"))
+            {
+                var languageId = valueNode.Attribute("LanguageCultureAlias").ValueOrDefault("");
+                if (!string.IsNullOrEmpty(languageId))
                 {
-                    // existing
-                    item = _localizationService.GetDictionaryItemByKey(itemKey);
-                }
-                else
-                {
-                    if (parent.HasValue)
-                        item = new DictionaryItem(parent.Value, itemKey);
-                    else
-                        item = new DictionaryItem(itemKey);
-                }
-
-                foreach (var valueNode in node.Elements("Value"))
-                {
-                    var languageId = valueNode.Attribute("LanguageCultureAlias").ValueOrDefault("");
-                    if (!string.IsNullOrEmpty(languageId))
+                    var language = languages.FirstOrDefault(x => x.IsoCode == languageId);
+                    if (language != null)
                     {
-                        var language = languages.FirstOrDefault(x => x.IsoCode == languageId);
-                        if (language != null)
-                        {
-                            _localizationService.AddOrUpdateDictionaryValue(item, language, valueNode.Value);
-                        }
+                        _localizationService.AddOrUpdateDictionaryValue(item, language, valueNode.Value);
                     }
                 }
-
-                _localizationService.Save(item);
-
-
-                // children
-                foreach (var child in node.Elements("DictionaryItem"))
-                {
-                    UpdateDictionaryValues(child, item.Key, languages);
-                }
-
-                return item;
-            }
-
-            return null;
+            }
+
+            _localizationService.Save(item);
+
+            // children
+            foreach (var child in node.Elements("DictionaryItem"))
+            {
+                UpdateDictionaryValues(child, item.Key, languages);
+            }
+
+            return item;
         }

         internal override SyncAttempt<XElement> SerializeCore(IDictionaryItem item)
@@ -119,6 +139,7 @@
         {
             var node = new XElement(Constants.Packaging.DictionaryItemNodeName,
                 new XAttribute("Key", item.ItemKey));
+                // new XAttribute("Guid", item.Key));

             foreach (var translation in item.Translations.OrderBy(x => x.Language.IsoCode))
             {
@@ -128,8 +149,11 @@
                     new XCData(translation.Value)));
             }

-            var children = _localizationService.GetDictionaryItemChildren(item.Key);
-            foreach (var child in children.OrderBy(x => x.Key))
+            var children = _localizationService
+                .GetDictionaryItemChildren(item.Key)
+                .ToList();
+
+            foreach (var child in children.OrderBy(x => x.ItemKey))
             {
                 node.Add(GetDictionaryElement(child));
             }


Fix a couple issues with zipimport

Fix a couple issues with zipimport

- Add correct separator after prefix and remove before
- Fix creation of __path__
(cherry picked from commit f975d2f68412fd761939d19f0bfbb44fffea0fcc)

--- Languages/IronPython/IronPython.Modules/zipimport.cs
+++ Languages/IronPython/IronPython.Modules/zipimport.cs
@@ -140,6 +140,11 @@
                 }

                 _prefix = input.Replace(path, string.Empty);
+                // add trailing SEP
+                if (!string.IsNullOrEmpty(_prefix) && !_prefix.EndsWith (Path.DirectorySeparatorChar.ToString())) {
+                    _prefix = _prefix.Substring (1);
+                    _prefix += Path.DirectorySeparatorChar;
+                }
                 _archive = path;
             }

@@ -230,7 +235,7 @@
                     string fullpath = string.Format("{0}{1}{2}{3}",
                         _archive,
                         Path.DirectorySeparatorChar,
-                        _prefix.Length > 0 ? _prefix[0].ToString() : "",
+                        _prefix.Length > 0 ? _prefix : string.Empty,
                         subname);

                     List pkgpath = PythonOps.MakeList(fullpath);


Added code to .NET and SL that results in an exception being thrown if an attempt is made to register a property against a type that has already been instantiated.

bugid: 325

--- cslatest/Csla.Test/PropertyGetSet/PropertyGetSetTests.cs
+++ cslatest/Csla.Test/PropertyGetSet/PropertyGetSetTests.cs
@@ -540,8 +540,16 @@
     [ExpectedException(typeof(InvalidOperationException))]
     public void PropertyNotRegistered()
     {
-      var root = new BadGetSet();
-      var tmp = root.Id;
+      var first = new EditableGetSet();
+      try
+      {
+        var root = new BadGetSet();
+        var tmp = root.Id;
+      }
+      catch (TypeInitializationException ex)
+      {
+        throw ex.InnerException;
+      }
     }

     #region Event Bubbling


try fix disappeared taskbar item

try fix disappeared taskbar item

--- MahApps.Metro/Behaviours/BorderlessWindowBehavior.cs
+++ MahApps.Metro/Behaviours/BorderlessWindowBehavior.cs
@@ -190,6 +190,11 @@
             return returnval;
         }

+        private bool IsGreaterOrEqualWin8()
+        {
+            return Environment.OSVersion.Version >= new Version(6, 0);
+        }
+
         private void AssociatedObject_Activated(object sender, EventArgs e)
         {
             if (savedBorderBrush != null)
@@ -197,6 +202,28 @@
                 AssociatedObject.BorderBrush = savedBorderBrush;
             }
             HandleMaximize();
+
+            HandleTaskbarItem();
+        }
+
+        private void HandleTaskbarItem()
+        {
+            if (IsGreaterOrEqualWin8())
+            {
+                // nasty hack for >= win 8
+                // the taskbar item disappears after this steps
+                // - Set IgnoreTaskbarOnMaximize="True"
+                // - Maximize the application
+                // - Minimize and focus another application OR click somewhere on a second monitor
+                // - Focus the original application again
+                // - The taskbar item disappeared
+                var showInTaskbar = AssociatedObject.ShowInTaskbar;
+                if (showInTaskbar && AssociatedObject.WindowState == WindowState.Minimized)
+                {
+                    AssociatedObject.ShowInTaskbar = false;
+                    AssociatedObject.ShowInTaskbar = showInTaskbar;
+                }
+            }
         }

         private void AssociatedObject_Deactivated(object sender, EventArgs e)
@@ -206,6 +233,8 @@
                 savedBorderBrush = AssociatedObject.BorderBrush;
                 AssociatedObject.BorderBrush = this.nonActiveBorderColor;
             }
+
+            HandleTaskbarItem();
         }

         private void AssociatedObject_StateChanged(object sender, EventArgs e)


Put the upgrade indicator dot back on

Put the upgrade indicator dot back on

--- MatterControlLib/PartPreviewWindow/MainViewWidget.cs
+++ MatterControlLib/PartPreviewWindow/MainViewWidget.cs
@@ -276,6 +276,14 @@
 						Name = "Upgrade",
 						Padding = new BorderDouble(15, 0),
 					});
+
+				tab.AfterDraw += (s, e) =>
+				{
+					e.Graphics2D.Circle(tab.LocalBounds.Right - 25 * DeviceScale,
+						tab.LocalBounds.Bottom + tab.Height / 2 - 1 * DeviceScale,
+						5 * DeviceScale,
+						theme.PrimaryAccentColor);
+				};
 			}
 			else
 			{
@@ -288,6 +296,7 @@
 						Padding = new BorderDouble(15, 0),
 					});
 			}
+
 			EnableReduceWidth(tab, theme);

 			// Library tab
@@ -521,7 +530,7 @@
 			flashBackground.Start();
 		}

-		private void SetLinkButtonsVisibility (object s, StringEventArgs e)
+		private void SetLinkButtonsVisibility(object s, StringEventArgs e)
 		{
 			if (UpdateControlData.Instance.UpdateStatus == UpdateControlData.UpdateStatusStates.UpdateAvailable)
 			{


Fix cycle detected message

Fix cycle detected message

We can re-evaluate the same assembly when following typeforwards, depending on order
of evaluation.  Fix the cycle detection to actually check if the same node is in the dependency
stack.

--- Microsoft.Packaging.Tools.Trimming/tasks/FileNode.cs
+++ Microsoft.Packaging.Tools.Trimming/tasks/FileNode.cs
@@ -58,6 +58,11 @@
         public NuGetPackageNode Package { get; }
         public IEnumerable<FileNode> Dependencies { get { return dependencies; } }

+        public override string ToString()
+        {
+            return Name;
+        }
+
         public void PopulateDependencies(IDictionary<string, FileNode> allFiles, bool preferNativeImage, ILog log)
         {
             if (dependencies == null)
@@ -73,15 +78,17 @@
                 stack = new Stack<FileNode>();
             }

+            if (stack.Contains(this))
+            {
+                log.LogMessage($"Cycle detected: {String.Join(" -> ", stack)} -> {this}");
+            }
+
+            if (dependencies != null)
+            {
+                return;
+            }
+
             stack.Push(this);
-
-            if (dependencies != null)
-            {
-                // re-entrant call indicates a cycle, bail
-                log.LogMessage($"Cycle detected: {String.Join(" -> ", stack)}");
-                stack.Pop();
-                return;
-            }

             dependencies = new HashSet<FileNode>();


Modified protected void DoNavigate() to put

else if (navigateTo == null || navigateTo == String.Empty || navigateTo == "next")

before

else if (navigateTo.StartsWith(uriPrefix))

to avoid a null ref exception

git-svn-id: bab0c2de90ee11a20376049c2cdee62584491f34@1533 73e77b4c-caa6-f847-a29a-24ab75ae54b6

--- MonoRail/Castle.MonoRail.Framework/WizardStepPage.cs
+++ MonoRail/Castle.MonoRail.Framework/WizardStepPage.cs
@@ -139,6 +139,10 @@
 			{
 				RedirectToPreviousStep();
 			}
+			else if (navigateTo == null || navigateTo == String.Empty || navigateTo == "next")
+			{
+				RedirectToNextStep();
+			}
 			else if (navigateTo.StartsWith(uriPrefix))
 			{
 				Redirect(navigateTo.Substring(uriPrefix.Length));
@@ -146,10 +150,6 @@
 			else if (navigateTo == "first")
 			{
 				RedirectToFirstStep();
-			}
-			else if (navigateTo == null || navigateTo == String.Empty || navigateTo == "next")
-			{
-				RedirectToNextStep();
 			}
 			else
 			{


add IsPayable for Contract

add IsPayable for Contract

--- Neo.SmartContract.Framework/Services/Neo/Contract.cs
+++ Neo.SmartContract.Framework/Services/Neo/Contract.cs
@@ -5,6 +5,12 @@
         public extern byte[] Script
         {
             [Syscall("Neo.Contract.GetScript")]
+            get;
+        }
+
+        public extern bool IsPayable
+        {
+            [Syscall("Neo.Contract.IsPayable")]
             get;
         }


Fixed bug on ExistingLocalListenEndPoints for bluetooth

--- NetworkCommsDotNet/Connection/ConnectionListeners.cs
+++ NetworkCommsDotNet/Connection/ConnectionListeners.cs
@@ -25,6 +25,7 @@

 #if NET35 || NET4
 using InTheHand.Net;
+using InTheHand.Net.Bluetooth;
 #endif

 #if NETFX_CORE
@@ -376,8 +377,12 @@
         {
             if (connectionType == ConnectionType.TCP || connectionType == ConnectionType.UDP)
                 return ExistingLocalListenEndPoints(connectionType, new IPEndPoint(IPAddress.Any, 0));
+#if NET35 || NET4
+            else if (connectionType == ConnectionType.Bluetooth)
+                return ExistingLocalListenEndPoints(connectionType, new BluetoothEndPoint(BluetoothAddress.None, BluetoothService.Empty));
+#endif
             else
-                return ExistingLocalListenEndPoints(connectionType, null);
+                throw new ArgumentException("Method ExistingLocalListenEndPoints is not defined for the conneciton type: " + connectionType.ToString(), "connectionType");
         }

         /// <summary>
@@ -392,11 +397,15 @@
         public static List<EndPoint> ExistingLocalListenEndPoints(ConnectionType connectionType, EndPoint localEndPointToMatch)
         {
             if (connectionType == ConnectionType.Undefined) throw new ArgumentException("ConnectionType.Undefined may not be used with this override. Please see others.", "connectionType");
+            if (localEndPointToMatch == null) throw new ArgumentNullException("localEndPointToMatch");

 #if NET4 || NET35
             if (connectionType == ConnectionType.Bluetooth)
             {
                 InTheHand.Net.BluetoothEndPoint btEndPointToMatch = localEndPointToMatch as InTheHand.Net.BluetoothEndPoint;
+
+                if (btEndPointToMatch == null)
+                    throw new ArgumentException("Local endpoint must be a BluetoothEndPoint for Bluetooth connection type", "localEndPointToMatch");

                 List<EndPoint> btResult = new List<EndPoint>();
                 lock (staticConnectionLocker)
@@ -405,16 +414,26 @@
                     {
                         foreach (EndPoint endPoint in listenersDict[connectionType].Keys)
                         {
-                            var btEndPoint = endPoint as InTheHand.Net.BluetoothEndPoint;
-                            if (btEndPointToMatch != null && !btEndPointToMatch.HasPort)
+                            var btEndPoint = endPoint as InTheHand.Net.BluetoothEndPoint;
+                            if (btEndPointToMatch.Address == BluetoothAddress.None && btEndPointToMatch.Service == BluetoothService.Empty)
                             {
-                                //Match the IP Address
+                                btResult.Add(btEndPoint);
+                            }
+                            else if (btEndPointToMatch.Address != BluetoothAddress.None && btEndPointToMatch.Service == BluetoothService.Empty)
+                            {
+                                //Match the address
                                 if (btEndPoint.Address.Equals(btEndPointToMatch.Address) &&
                                     listenersDict[connectionType][btEndPoint].IsListening)
                                     btResult.Add(btEndPoint);
-                            }
-                            else if ((endPoint.Equals(localEndPointToMatch) || localEndPointToMatch == null) &&
-                                    listenersDict[connectionType][endPoint].IsListening)
+                            }
+                            else if (btEndPointToMatch.Address == BluetoothAddress.None && btEndPointToMatch.Service != BluetoothService.Empty)
+                            {
+                                //Match the service
+                                if (btEndPoint.Service.Equals(btEndPointToMatch.Service) &&
+                                    listenersDict[connectionType][btEndPoint].IsListening)
+                                    btResult.Add(btEndPoint);
+                            }
+                            else if (endPoint.Equals(localEndPointToMatch) && listenersDict[connectionType][endPoint].IsListening)
                             {
                                 btResult.Add(endPoint);
                                 break;
@@ -457,8 +476,7 @@
                                 listenersDict[connectionType][ipEndPoint].IsListening)
                                 result.Add(ipEndPoint);
                         }
-                        else if ((endPoint.Equals(localEndPointToMatch) || localEndPointToMatch == null) &&
-                                listenersDict[connectionType][endPoint].IsListening)
+                        else if (endPoint.Equals(localEndPointToMatch) && listenersDict[connectionType][endPoint].IsListening)
                         {
                             result.Add(endPoint);
                             break;


Moved OverrideSizeRatio logic to the SetSizeRatio method so we do not duplicate code, but keep the same protection against a DivideByZero error.

--- Assets/HoloToolkit/Utilities/Scripts/FixedAngularSize.cs
+++ Assets/HoloToolkit/Utilities/Scripts/FixedAngularSize.cs
@@ -12,36 +12,63 @@
     /// </summary>
     public class FixedAngularSize : MonoBehaviour
     {
+        [Tooltip("Off sets the scale ratio so that text does not scale down too much. (Set to zero for linear scaling)")]
+        public float OverrideSizeRatio = 0;
+
         // The ratio between the transform's local scale and its starting
         // distance from the camera.
         private Vector3 defaultSizeRatios;
+        private float startingDistance;
+        private Vector3 startingScale;

-        void Start()
+        private void Start()
         {
             // Calculate the XYZ ratios for the transform's localScale over its
             // initial distance from the camera.
-            float startingDistance = Vector3.Distance(Camera.main.transform.position, transform.position);
-            if (startingDistance > 0.0f)
+            startingDistance = Vector3.Distance(Camera.main.transform.position, transform.position);
+            startingScale = transform.localScale;
+
+            SetSizeRatio(OverrideSizeRatio);
+        }
+
+        /// <summary>
+        /// Manually update the OverrideSizeRatio during runtime or through UnityEvents in the editor
+        /// </summary>
+        /// <param name="ratio"> 0 - 1 : Use 0 for linear scaling</param>
+        public void SetSizeRatio(float ratio)
+        {
+            if (ratio == 0)
             {
-                defaultSizeRatios = transform.localScale / startingDistance;
+                if (startingDistance > 0.0f)
+                {
+                    // set to a linear scale ratio
+                    OverrideSizeRatio = 1 / startingDistance;
+                }
+                else
+                {
+                    // If the transform and the camera are both in the same
+                    // position (that is, the distance between them is zero),
+                    // disable this Behaviour so we don't get a DivideByZero
+                    // error later on.
+                    enabled = false;
+#if UNITY_EDITOR
+                    Debug.LogWarning("The object and the camera are in the same position at Start(). The attached FixedAngularSize Behaviour is now disabled.");
+#endif // UNITY_EDITOR
+                }
             }
             else
             {
-                // If the transform and the camera are both in the same
-                // position (that is, the distance between them is zero),
-                // disable this Behaviour so we don't get a DivideByZero
-                // error later on.
-                enabled = false;
-#if UNITY_EDITOR
-                Debug.LogWarning("The object and the camera are in the same position at Start(). The attached FixedAngularSize Behaviour is now disabled.");
-#endif // UNITY_EDITOR
+                OverrideSizeRatio = ratio;
             }
         }

-        void Update()
+        private void Update()
         {
             float distanceToHologram = Vector3.Distance(Camera.main.transform.position, transform.position);
-            transform.localScale = defaultSizeRatios * distanceToHologram;
+            // create an offset ratio based on the starting position. This value creates a new angle that pivots
+            // on the starting position that is more or less drastic than the normal scale ratio.
+            float curvedRatio = 1 - startingDistance * OverrideSizeRatio;
+            transform.localScale = startingScale * (distanceToHologram * OverrideSizeRatio + curvedRatio);
         }
     }
 }


AzureMobileAppRequestHelper refactoring not used header

--- Assets/Scripts/CloudBread/AzureMobileAppRequestHelper.cs
+++ Assets/Scripts/CloudBread/AzureMobileAppRequestHelper.cs
@@ -1,16 +1,11 @@
 using UnityEngine;
 using System;
-using System.Text;
-using System.Collections;
 using System.Collections.Generic;

 namespace AssemblyCSharp
 {
 	public class AzureMobileAppRequestHelper
 	{
-
-		// Header Default
-
 		// ZUMO-API-VERSION
 		private static string _api_version = "2.0.0";

@@ -29,15 +24,6 @@
 			cbAuth = new CBAuthentication ();
 		}

-//		public string setServerAdd(string address){
-//			char lastChar = address [address.Length];
-//			if (lastChar.CompareTo ("/") == 0) {
-//				return address.Substring (0, address.Length - 1);
-//			};
-//
-//			return address;
-//		}
-
 		public void setTokenJson(string result){
 			Debug.Log ("[AzureMobileAppRequest] " + result);
 			var resultDic = (Dictionary<string, object>) JsonParser.Read2Object(result);
@@ -46,23 +32,6 @@
 			var crypt = CBAuthentication.AES_decrypt (cbAuth.token, "1234567890123456", "1234567890123456");

 			Debug.Log ("[token decrypt] " + crypt);
-		}
-
-		public Dictionary<string, string> getDefaultHeader(){
-			var header = new Dictionary<string, string> ();
-			header["ZUMO-API-VERSION"] = _api_version;
-			header ["Accept"] = "application/json";
-
-			header["X-ZUMO-VERSION"] = "ZUMO/2.0 (lang=Managed; os=Windows Store; os_version=--; arch=X86; version=2.0.31217.0)";
-			header ["X-ZUMO-FEATURES"] = "AJ";
-			header ["X-ZUMO-INSTALLATION-ID"] = "fe52b710-0312-4cad-8d53-dfd28d4c6f9b";
-			header ["Content-Type"] = "application/json";
-
-			if (AuthToken != null) {
-				header ["X-ZUMO-AUTH"] = AuthToken;
-			}
-
-			return header;
 		}

 		public static Dictionary<string, string> getHeader(){


Updated PassOrFailto return result from Pass or Fail methods

--- Enyim.Caching/Memcached/Results/Extensions/OperationResultExtensions.cs
+++ Enyim.Caching/Memcached/Results/Extensions/OperationResultExtensions.cs
@@ -53,16 +53,9 @@
 		/// Ony LCD properties are copied
 		/// </summary>
 		/// <param name="target"></param>
-		public static void PassOrFail(this IOperationResult source, bool success, string message = "", Exception ex = null)
+		public static IOperationResult PassOrFail(this IOperationResult source, bool success, string message = "", Exception ex = null)
 		{
-			if (success)
-			{
-				Pass(source);
-			}
-			else
-			{
-				Fail(source, message, ex);
-			}
+			return success ? Pass(source) : Fail(source, message, ex);
 		}
 	}
 }


Strategies. Reduced Connector usage.

Strategies. Reduced Connector usage.


Ensure root app mapping works (#2415)

Ensure root app mapping works (#2415)

close #2414

--- BTCPayServer/Filters/DomainMappingConstraintAttribute.cs
+++ BTCPayServer/Filters/DomainMappingConstraintAttribute.cs
@@ -41,6 +41,13 @@
                     context.RouteContext.RouteData.Values.Add("appId", matchedDomainMapping.AppId);
                     return true;
                 }
+
+                if (AppType == css.RootAppType) {
+                    context.RouteContext.RouteData.Values.Add("appId", css.RootAppId);
+
+                    return true;
+                }
+
                 return AppType is null;
             }
             else


uijhuhuh

uijhuhuh

--- BaselineSolution.Facade/Security/ISecurityMgntService.cs
+++ BaselineSolution.Facade/Security/ISecurityMgntService.cs
@@ -11,6 +11,6 @@

         Response<UserBo> GetUserList();
-        Response<bool> SetUserPassword();
+        Response<bool> SetUserPassword(UserSetPasswordBo bo);
     }
 }


Update LoggingOptions.cs

Update LoggingOptions.cs

--- RoboSharp/LoggingOptions.cs
+++ RoboSharp/LoggingOptions.cs
@@ -68,7 +68,7 @@
         /// <summary>
         /// Do not log file names.
         /// [/NFL]
-        /// WARNING: If this is set to TRUE then GUI then cannot handle showing progress correctly as it can't get information it requires from the log
+        /// WARNING: If this is set to TRUE then GUI cannot handle showing progress correctly as it can't get information it requires from the log
         /// </summary>
         public bool NoFileList { get; set; }
         /// <summary>


Fix for issue #40

Fix for issue #40

--- websocket-sharp/Net/HttpConnection.cs
+++ websocket-sharp/Net/HttpConnection.cs
@@ -178,6 +178,24 @@
       removeConnection ();
     }

+    private void disposeTimer ()
+    {
+      if (_timer == null)
+        return;
+
+      var timer = _timer;
+      _timer = null;
+
+      try {
+        timer.Change (Timeout.Infinite, Timeout.Infinite);
+      }
+      catch {
+      }
+
+      if (timer != null)
+        timer.Dispose ();
+    }
+
     private void init ()
     {
       _chunked = false;
@@ -194,10 +212,10 @@
     private static void onRead (IAsyncResult asyncResult)
     {
       var conn = (HttpConnection) asyncResult.AsyncState;
-      conn._timer.Change (Timeout.Infinite, Timeout.Infinite);

       var read = -1;
       try {
+        conn._timer.Change (Timeout.Infinite, Timeout.Infinite);
         read = conn._stream.EndRead (asyncResult);
         conn._requestBuffer.Write (conn._buffer, 0, read);
         if (conn._requestBuffer.Length > 32768) {
@@ -212,6 +230,7 @@
           conn.SendError ();

         if (conn._socket != null) {
+          conn.disposeTimer ();
           conn.closeSocket ();
           conn.unbind ();
         }
@@ -220,6 +239,7 @@
       }

       if (read <= 0) {
+        conn.disposeTimer ();
         conn.closeSocket ();
         conn.unbind ();

@@ -263,6 +283,7 @@
     private static void onTimeout (object state)
     {
       var conn = (HttpConnection) state;
+      conn.disposeTimer ();
       conn.closeSocket ();
       conn.unbind ();
     }
@@ -369,6 +390,7 @@

         var req = _context.Request;
         var res = _context.Response;
+
         force |= !req.KeepAlive;
         if (!force)
           force = res.Headers ["Connection"] == "close";
@@ -387,15 +409,17 @@

         var socket = _socket;
         _socket = null;
+
+        disposeTimer ();
+
         try {
           socket.Shutdown (SocketShutdown.Both);
         }
         catch {
         }
-        finally {
-          if (socket != null)
-            socket.Close ();
-        }
+
+        if (socket != null)
+          socket.Close ();

         unbind ();
         removeConnection ();
@@ -421,7 +445,7 @@
         _stream.BeginRead (_buffer, 0, _bufferSize, onRead, this);
       }
       catch {
-        _timer.Change (Timeout.Infinite, Timeout.Infinite);
+        disposeTimer ();
         closeSocket ();
         unbind ();
       }


Fix a badly named test method

Fix a badly named test method

--- NetgearRouter.Tests/Devices/EndToEndTests/AttachedDevicesParserTests.cs
+++ NetgearRouter.Tests/Devices/EndToEndTests/AttachedDevicesParserTests.cs
@@ -8,7 +8,7 @@
     [TestFixture]
     public sealed class AttachedDevicesParserTests
     {
-        public void Foo()
+        public void TheSoapResponseIsParsedCorrectly()
         {
             var parser = new AttachedDevicesParser(new DevicesParser(new DeviceParser()), new DeviceInformationExtractor());
             var devices = parser.Parse(ExampleSoapResponse).ToArray();


Update Assert call and mute the test

Update Assert call and mute the test

--- Octokit.Tests.Integration/Reactive/ObservableRepositoriesClientTests.cs
+++ Octokit.Tests.Integration/Reactive/ObservableRepositoriesClientTests.cs
@@ -31,7 +31,7 @@

         public class TheGetAllPublicSinceMethod
         {
-            [IntegrationTest]
+            [IntegrationTest(Skip = "This will take a very long time to return, so will skip it for now.")]
             public async Task ReturnsAllPublicReposSinceLastSeen()
             {
                 var github = Helper.GetAuthenticatedClient();
@@ -42,8 +42,7 @@
                     Since = 32732250
                 };
                 var repositories = await client.GetAllPublic(request).ToArray();
-                Assert.NotNull(repositories);
-                Assert.True(repositories.Any());
+                Assert.NotEmpty(repositories);
                 Assert.Equal(32732252, repositories[0].Id);
                 Assert.False(repositories[0].Private);
                 Assert.Equal("zad19", repositories[0].Name);


Allow SmtpClients and other SSL users to work with our cert handler installed

--- OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
+++ OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
@@ -29,6 +29,7 @@
 using System.Collections.Generic;
 using System.IO;
 using System.Net;
+using System.Net.Mail;
 using System.Net.Security;
 using System.Text;
 using System.Threading;
@@ -111,21 +112,36 @@
             X509Chain  chain,
             SslPolicyErrors  sslPolicyErrors)
         {
-            HttpWebRequest Request = (HttpWebRequest)sender;
-
-            if (Request.Headers.Get("NoVerifyCert") != null)
-            {
+            // If this is a web request we need to check the headers first
+            // We may want to ignore SSL
+            if (sender is HttpWebRequest)
+            {
+                HttpWebRequest Request = (HttpWebRequest)sender;
+                ServicePoint sp = Request.ServicePoint;
+
+                // We don't case about encryption, get out of here
+                if (Request.Headers.Get("NoVerifyCert") != null)
+                {
+                    return true;
+                }
+
+                // If there was an upstream cert verification error, bail
+                if ((((int)sslPolicyErrors) & ~4) != 0)
+                    return false;
+
+                // Check for policy and execute it if defined
+                if (ServicePointManager.CertificatePolicy != null)
+                {
+                    return ServicePointManager.CertificatePolicy.CheckValidationResult (sp, certificate, Request, 0);
+                }
+
                 return true;
             }
-
+
+            // If it's not HTTP, trust .NET to check it
             if ((((int)sslPolicyErrors) & ~4) != 0)
                 return false;

-            if (ServicePointManager.CertificatePolicy != null)
-            {
-                ServicePoint sp = Request.ServicePoint;
-                return ServicePointManager.CertificatePolicy.CheckValidationResult (sp, certificate, Request, 0);
-            }
             return true;
         }
         #region IHttpRequestModule Members


Upgraded CprBrokerWixInstallers to 2.2.3.2 to reflect latest changes

--- PART/Source/CprBroker/CprBrokerWixInstallers/Properties/AssemblyInfo.cs
+++ PART/Source/CprBroker/CprBrokerWixInstallers/Properties/AssemblyInfo.cs
@@ -75,5 +75,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2.2.3.1")]
-[assembly: AssemblyFileVersion("2.2.3.1")]
+[assembly: AssemblyVersion("2.2.3.2")]
+[assembly: AssemblyFileVersion("2.2.3.2")]


删除冗余的方法。

删除冗余的方法。

--- Rabbit.Kernel/Environment/Configuration/Impl/ShellSettingsSerializer.cs
+++ Rabbit.Kernel/Environment/Configuration/Impl/ShellSettingsSerializer.cs
@@ -62,35 +62,6 @@
             }
         }

-        public static ShellSettings ParseSettings2(string text)
-        {
-            using (var settings = new StringReader(text))
-            {
-                var shellSettings = new ShellSettings();
-                string setting;
-                while ((setting = settings.ReadLine()) != null)
-                {
-                    if (string.IsNullOrWhiteSpace(setting))
-                        continue;
-
-                    var separatorIndex = setting.IndexOf(Separator);
-                    if (separatorIndex == -1)
-                        continue;
-
-                    var key = setting.Substring(0, separatorIndex).Trim();
-                    var value = setting.Substring(separatorIndex + 1).Trim();
-
-                    //值等于空值则跳过。
-                    if (value.Equals(EmptyValue, StringComparison.OrdinalIgnoreCase))
-                        continue;
-
-                    shellSettings[key] = value;
-                }
-
-                return shellSettings;
-            }
-        }
-
         /// <summary>
         /// 将外壳设置信息组成文本。
         /// </summary>


Cleanup of documentation in PackageManagerTests

--- OpenIIoT.Core.Tests/Packaging/PackageManagerTests.cs
+++ OpenIIoT.Core.Tests/Packaging/PackageManagerTests.cs
@@ -62,9 +62,9 @@
     using OpenIIoT.SDK.Common;
     using OpenIIoT.SDK.Common.OperationResult;
     using OpenIIoT.SDK.Packaging;
+    using OpenIIoT.SDK.Packaging.Manifest;
     using OpenIIoT.SDK.Platform;
     using Xunit;
-    using OpenIIoT.SDK.Packaging.Manifest;

     /// <summary>
     ///     Unit tests for the <see cref="PackageManager"/> class.
@@ -128,10 +128,29 @@
         /// </summary>
         private Mock<IApplicationManager> ManagerMock { get; set; }

+        /// <summary>
+        ///     Gets or sets the IPackageArchive mockup for testing.
+        /// </summary>
         private Mock<IPackageArchive> PackageArchiveMock { get; set; }
+
+        /// <summary>
+        ///     Gets or sets the IPackageFactory mockup for testing.
+        /// </summary>
         private Mock<IPackageFactory> PackageFactoryMock { get; set; }
+
+        /// <summary>
+        ///     Gets or sets the IPackageManifest mockup for testing.
+        /// </summary>
         private Mock<IPackageManifest> PackageManifestMock { get; set; }
+
+        /// <summary>
+        ///     Gets or sets the IPackage mockup for testing.
+        /// </summary>
         private Mock<IPackage> PackageMock { get; set; }
+
+        /// <summary>
+        ///     Gets or sets the IPackageScanner mockup for testing.
+        /// </summary>
         private Mock<IPackageScanner> PackageScannerMock { get; set; }

         /// <summary>
@@ -1262,6 +1281,9 @@

         #region Private Methods

+        /// <summary>
+        ///     Configures the mockups for the unit tests.
+        /// </summary>
         private void SetupMocks()
         {
             DirectoryMock.Setup(d => d.Packages).Returns(Temp);


removed loop to create 0000 default wearables

--- OpenSim/Grid/AgentDomain.Modules/UserLoginService.cs
+++ OpenSim/Grid/AgentDomain.Modules/UserLoginService.cs
@@ -537,46 +537,37 @@
         private static AvatarWearable[] GetDefaultWearables()
         {
                 AvatarWearable[] defaultWearables = new AvatarWearable[13]; //should be 13 of these
-                for (int i = 0; i < 13; i++)
-                {
-                    defaultWearables[i] = new AvatarWearable();
-                }
+                //for (int i = 0; i < 13; i++)
+                //{
+                    //defaultWearables[i] = new AvatarWearable();
+                //}

                 // Body
+                defaultWearables[0] = new AvatarWearable();
                 defaultWearables[0].ItemID  = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9");
                 defaultWearables[0].AssetID = new UUID("66c41e39-38f9-f75a-024e-585989bfab73");

                 // Skin
+                defaultWearables[1] = new AvatarWearable();
                 defaultWearables[1].ItemID  = new UUID("77c41e39-38f9-f75a-024e-585989bfabc9");
                 defaultWearables[1].AssetID = new UUID("77c41e39-38f9-f75a-024e-585989bbabbb");
+
+                // Hair
+                defaultWearables[2] = new AvatarWearable();
+                defaultWearables[2].ItemID  = new UUID("d342e6c1-b9d2-11dc-95ff-0800200c9a66");
+                defaultWearables[2].AssetID = new UUID("d342e6c0-b9d2-11dc-95ff-0800200c9a66");

                 // Shirt
+                defaultWearables[4] = new AvatarWearable();
                 defaultWearables[4].ItemID  = new UUID("77c41e39-38f9-f75a-0000-585989bf0000");
                 defaultWearables[4].AssetID = new UUID("00000000-38f9-1111-024e-222222111110");

                 // Pants
+                defaultWearables[5] = new AvatarWearable();
                 defaultWearables[5].ItemID  = new UUID("77c41e39-38f9-f75a-0000-5859892f1111");
                 defaultWearables[5].AssetID = new UUID("00000000-38f9-1111-024e-222222111120");

-                // rob added these to have > 4 items
-                defaultWearables[2].ItemID  = new UUID("d342e6c1-b9d2-11dc-95ff-0800200c9a66");
-                defaultWearables[2].AssetID = new UUID("d342e6c0-b9d2-11dc-95ff-0800200c9a66");
-                 //defaultWearables[3].ItemID  = new UUID("00000000-0000-0000-0000-000000000000");
-                //defaultWearables[3].AssetID = new UUID("00000000-0000-0000-0000-000000000000");
-                 //defaultWearables[6].ItemID  = new UUID("00000000-0000-0000-0000-000000000000");
-                //defaultWearables[6].AssetID = new UUID("00000000-0000-0000-0000-000000000000");
-                 //defaultWearables[7].ItemID  = new UUID("00000000-0000-0000-0000-000000000000");
-                //defaultWearables[7].AssetID = new UUID("00000000-0000-0000-0000-000000000000");
-                 //defaultWearables[8].ItemID  = new UUID("00000000-0000-0000-0000-000000000000");
-                //defaultWearables[8].AssetID = new UUID("00000000-0000-0000-0000-000000000000");
-                 //defaultWearables[9].ItemID  = new UUID("00000000-0000-0000-0000-000000000000");
-                //defaultWearables[9].AssetID = new UUID("00000000-0000-0000-0000-000000000000");
-                 //defaultWearables[10].ItemID  = new UUID("00000000-0000-0000-0000-000000000000");
-                //defaultWearables[10].AssetID = new UUID("00000000-0000-0000-0000-000000000000");
-                 //defaultWearables[11].ItemID  = new UUID("00000000-0000-0000-0000-000000000000");
-                //defaultWearables[11].AssetID = new UUID("00000000-0000-0000-0000-000000000000");
-                 //defaultWearables[12].ItemID  = new UUID("00000000-0000-0000-0000-000000000000");
-                //defaultWearables[12].AssetID = new UUID("00000000-0000-0000-0000-000000000000");
+


Removed unstable test.

Removed unstable test.

--- Ryder.Tests/HelpersTests.cs
+++ Ryder.Tests/HelpersTests.cs
@@ -76,17 +76,8 @@

             LikelyInlined().ShouldBe(UnlikelyInlined());

-            inlinedStart = inlinedMethod.GetRuntimeMethodHandle().GetMethodStart();
-            nonInlinedStart = nonInlinedMethod.GetRuntimeMethodHandle().GetMethodStart();
-
-            inlinedStart.HasBeenCompiled().ShouldBeTrue();
-            nonInlinedStart.HasBeenCompiled().ShouldBeTrue();
-
-            byte[] inlinedBytes = new byte[12];
-            byte[] nonInlinedBytes = new byte[12];
-
-            Marshal.Copy(inlinedStart, inlinedBytes, 0, 12);
-            Marshal.Copy(nonInlinedStart, nonInlinedBytes, 0, 12);
+            // I tried testing inlining after some operations, but
+            // the results all change depending on the configuration, and i don't wanna mess with this.
         }

         [MethodImpl(MethodImplOptions.AggressiveInlining)]