Improved PropertyHelper so it throws less first chance exceptions when using Try[x]PropertyValue

--- src/Catel.Core/Catel.Core.Shared/Reflection/Helpers/PropertyHelper.cs
+++ src/Catel.Core/Catel.Core.Shared/Reflection/Helpers/PropertyHelper.cs
@@ -25,7 +25,7 @@
         /// </summary>
         private static readonly ILog Log = LogManager.GetCurrentClassLogger();

-        private static readonly ICacheStorage<string, PropertyInfo> _availableProperties = new CacheStorage<string, PropertyInfo>();
+        private static readonly ICacheStorage<string, PropertyInfo> _availableProperties = new CacheStorage<string, PropertyInfo>();
         #endregion

         #region Methods
@@ -111,31 +111,7 @@
             Argument.IsNotNull("obj", obj);
             Argument.IsNotNullOrWhitespace("property", property);

-            TValue defaultValue = default(TValue);
-
-            var propertyInfo = GetPropertyInfo(obj, property);
-            if (propertyInfo == null)
-            {
-                value = defaultValue;
-                return false;
-            }
-
-            if (!propertyInfo.CanRead)
-            {
-                value = defaultValue;
-                return false;
-            }
-
-            try
-            {
-                value = (TValue) propertyInfo.GetValue(obj, null);
-                return true;
-            }
-            catch (Exception)
-            {
-                value = defaultValue;
-                return false;
-            }
+            return TryGetPropertyValue(obj, property, false, out value);
         }

         /// <summary>
@@ -150,21 +126,60 @@
         /// <exception cref="ArgumentException">The <paramref name="property" /> is <c>null</c> or whitespace.</exception>
         public static object GetPropertyValue(object obj, string property)
         {
-            Argument.IsNotNull("obj", obj);
-            Argument.IsNotNullOrWhitespace("property", property);
+            return GetPropertyValue<object>(obj, property);
+        }
+
+        /// <summary>
+        /// Gets the property value of a specific object.
+        /// </summary>
+        /// <typeparam name="TValue">The type of the value.</typeparam>
+        /// <param name="obj">The object.</param>
+        /// <param name="property">The property.</param>
+        /// <returns>The property value or <c>null</c> if no property can be found.</returns>
+        /// <exception cref="ArgumentNullException">The <paramref name="obj" /> is <c>null</c>.</exception>
+        /// <exception cref="ArgumentException">The <paramref name="property" /> is <c>null</c> or whitespace.</exception>
+        /// <exception cref="PropertyNotFoundException">The <paramref name="obj" /> is not found or not publicly available.</exception>
+        /// <exception cref="CannotGetPropertyValueException">The property value cannot be read.</exception>
+        public static TValue GetPropertyValue<TValue>(object obj, string property)
+        {
+            TValue returnValue;
+
+            TryGetPropertyValue(obj, property, true, out returnValue);
+
+            return returnValue;
+        }
+
+        private static bool TryGetPropertyValue<TValue>(object obj, string property, bool throwOnException, out TValue value)
+        {
+            Argument.IsNotNull("obj", obj);
+            Argument.IsNotNullOrWhitespace("property", property);
+
+            value = default(TValue);

             var propertyInfo = GetPropertyInfo(obj, property);
             if (propertyInfo == null)
             {
                 Log.Error("Property '{0}' is not found on the object '{1}', probably the wrong field is being mapped", property, obj.GetType().Name);
-                throw new PropertyNotFoundException(property);
+
+                if (throwOnException)
+                {
+                    throw new PropertyNotFoundException(property);
+                }
+
+                return false;
             }

             // Return property value if available
             if (!propertyInfo.CanRead)
             {
                 Log.Error("Cannot read property {0}.'{1}'", obj.GetType().Name, property);
-                throw new CannotGetPropertyValueException(property);
+
+                if (throwOnException)
+                {
+                    throw new CannotGetPropertyValueException(property);
+                }
+
+                return false;
             }

 #if NETFX_CORE || PCL
@@ -172,31 +187,21 @@
 #else
             try
             {
-                return propertyInfo.GetValue(obj, null);
+                value = (TValue)propertyInfo.GetValue(obj, null);
+                return true;
             }
             catch (MethodAccessException)
             {
                 Log.Error("Cannot read property {0}.'{1}'", obj.GetType().Name, property);
-                throw new CannotGetPropertyValueException(property);
-            }
-
-#endif
-        }
-
-        /// <summary>
-        /// Gets the property value of a specific object.
-        /// </summary>
-        /// <typeparam name="TValue">The type of the value.</typeparam>
-        /// <param name="obj">The object.</param>
-        /// <param name="property">The property.</param>
-        /// <returns>The property value or <c>null</c> if no property can be found.</returns>
-        /// <exception cref="ArgumentNullException">The <paramref name="obj" /> is <c>null</c>.</exception>
-        /// <exception cref="ArgumentException">The <paramref name="property" /> is <c>null</c> or whitespace.</exception>
-        /// <exception cref="PropertyNotFoundException">The <paramref name="obj" /> is not found or not publicly available.</exception>
-        /// <exception cref="CannotGetPropertyValueException">The property value cannot be read.</exception>
-        public static TValue GetPropertyValue<TValue>(object obj, string property)
-        {
-            return (TValue) GetPropertyValue(obj, property);
+
+                if (throwOnException)
+                {
+                    throw new CannotGetPropertyValueException(property);
+                }
+
+                return false;
+            }
+#endif
         }

         /// <summary>
@@ -211,29 +216,7 @@
         /// <exception cref="ArgumentException">The <paramref name="property" /> is <c>null</c> or whitespace.</exception>
         public static bool TrySetPropertyValue(object obj, string property, object value)
         {
-            Argument.IsNotNull("obj", obj);
-            Argument.IsNotNullOrWhitespace("property", property);
-
-            var propertyInfo = GetPropertyInfo(obj, property);
-            if (propertyInfo == null)
-            {
-                return false;
-            }
-
-            if (!propertyInfo.CanWrite)
-            {
-                return false;
-            }
-
-            try
-            {
-                SetPropertyValue(obj, property, value);
-                return true;
-            }
-            catch (Exception)
-            {
-                return false;
-            }
+            return TrySetPropertyValue(obj, property, value, false);
         }

         /// <summary>
@@ -248,6 +231,11 @@
         /// <exception cref="ArgumentException">The <paramref name="property" /> is <c>null</c> or whitespace.</exception>
         public static void SetPropertyValue(object obj, string property, object value)
         {
+            TrySetPropertyValue(obj, property, value, true);
+        }
+
+        private static bool TrySetPropertyValue(object obj, string property, object value, bool throwOnError)
+        {
             Argument.IsNotNull("obj", obj);
             Argument.IsNotNullOrWhitespace("property", property);

@@ -255,18 +243,29 @@
             if (propertyInfo == null)
             {
                 Log.Error("Property '{0}' is not found on the object '{1}', probably the wrong field is being mapped", property, obj.GetType().Name);
-                throw new PropertyNotFoundException(property);
+
+                if (throwOnError)
+                {
+                    throw new PropertyNotFoundException(property);
+                }
+
+                return false;
             }

             if (!propertyInfo.CanWrite)
             {
                 Log.Error("Cannot write property {0}.'{1}'", obj.GetType().Name, property);
-                throw new CannotSetPropertyValueException(property);
+
+                if (throwOnError)
+                {
+                    throw new CannotSetPropertyValueException(property);
+                }
+
+                return false;
             }

 #if NETFX_CORE
             propertyInfo.SetValue(obj, value, null);
-            return;
 #else

 #if NET
@@ -277,11 +276,19 @@
             if (setMethod == null)
             {
                 Log.Error("Cannot write property {0}.'{1}', SetMethod is null", obj.GetType().Name, property);
-                throw new CannotSetPropertyValueException(property);
-            }
-
-            setMethod.Invoke(obj, new[] {value});
-#endif
+
+                if (throwOnError)
+                {
+                    throw new CannotSetPropertyValueException(property);
+                }
+
+                return false;
+            }
+
+            setMethod.Invoke(obj, new[] { value });
+#endif
+
+            return true;
         }

 #if !NETFX_CORE && !PCL
@@ -313,7 +320,7 @@
                 throw new PropertyNotFoundException(property);
             }

-            return (TValue) propertyInfo.GetValue(obj, BindingFlags, null, new object[] {}, CultureInfo.InvariantCulture);
+            return (TValue)propertyInfo.GetValue(obj, BindingFlags, null, new object[] { }, CultureInfo.InvariantCulture);
         }

 #endif


Make Handle.ToString override debug-only

This is a debugging convenience. There's no customer value in this override to a private type

[tfs-changeset: 1681980]

--- src/Common/src/Internal/Metadata/NativeFormat/NativeMetadataReader.cs
+++ src/Common/src/Internal/Metadata/NativeFormat/NativeMetadataReader.cs
@@ -144,10 +144,12 @@

         internal int _value;

+#if DEBUG
         public override string ToString()
         {
             return String.Format("{1} : {0,8:X8}", _value, Enum.GetName(typeof(HandleType), this.HandleType));
         }
+#endif
     }

     public static class NativeFormatReaderExtensions


Add full testing flow for `BeatmapOffsetControl`

--- osu.Game.Tests/Visual/Gameplay/TestSceneBeatmapOffsetControl.cs
+++ osu.Game.Tests/Visual/Gameplay/TestSceneBeatmapOffsetControl.cs
@@ -1,8 +1,12 @@
 // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
 // See the LICENCE file in the repository root for full licence text.

+using System.Linq;
 using NUnit.Framework;
 using osu.Framework.Graphics;
+using osu.Framework.Testing;
+using osu.Game.Overlays.Settings;
+using osu.Game.Scoring;
 using osu.Game.Screens.Play.PlayerSettings;
 using osu.Game.Tests.Visual.Ranking;

@@ -10,18 +14,46 @@
 {
     public class TestSceneBeatmapOffsetControl : OsuTestScene
     {
+        private BeatmapOffsetControl offsetControl;
+
+        [SetUpSteps]
+        public void SetUpSteps()
+        {
+            AddStep("Create control", () =>
+            {
+                Child = new PlayerSettingsGroup("Some settings")
+                {
+                    Anchor = Anchor.Centre,
+                    Origin = Anchor.Centre,
+                    Children = new Drawable[]
+                    {
+                        offsetControl = new BeatmapOffsetControl()
+                    }
+                };
+            });
+        }
+
         [Test]
         public void TestDisplay()
         {
-            Child = new PlayerSettingsGroup("Some settings")
+            const double average_error = -4.5;
+
+            AddAssert("Offset is neutral", () => offsetControl.Current.Value == 0);
+            AddAssert("No calibration button", () => !offsetControl.ChildrenOfType<SettingsButton>().Any());
+            AddStep("Set reference score", () =>
             {
-                Anchor = Anchor.Centre,
-                Origin = Anchor.Centre,
-                Children = new Drawable[]
+                offsetControl.ReferenceScore.Value = new ScoreInfo
                 {
-                    new BeatmapOffsetControl(TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents(-4.5))
-                }
-            };
+                    HitEvents = TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents(average_error)
+                };
+            });
+
+            AddAssert("Has calibration button", () => offsetControl.ChildrenOfType<SettingsButton>().Any());
+            AddStep("Press button", () => offsetControl.ChildrenOfType<SettingsButton>().Single().TriggerClick());
+            AddAssert("Offset is adjusted", () => offsetControl.Current.Value == average_error);
+
+            AddStep("Remove reference score", () => offsetControl.ReferenceScore.Value = null);
+            AddAssert("No calibration button", () => !offsetControl.ChildrenOfType<SettingsButton>().Any());
         }
     }
 }


Allow the PackageUpgradeSerializationBinder to be ComVisible (#169)

--- src/DurableTask.Core/Serializing/PackageUpgradeSerializationBinder.cs
+++ src/DurableTask.Core/Serializing/PackageUpgradeSerializationBinder.cs
@@ -16,12 +16,17 @@
     using System;
     using System.Collections.Generic;
     using System.Linq;
+    using System.Runtime.Serialization;
     using Newtonsoft.Json.Serialization;

     /// <summary>
-    /// SerializationBinder to be used for deserializing DurableTask types that are pre v-2.0, this allows upgrade compaibility. This is not sufficient to deserialize objects from 1.0 which had the Tags Property set.
+    /// SerializationBinder to be used for deserializing DurableTask types that are pre v-2.0, this allows upgrade compaibility.
+    /// This is not sufficient to deserialize objects from 1.0 which had the Tags Property set.
     /// </summary>
-    public class PackageUpgradeSerializationBinder : DefaultSerializationBinder
+    public class PackageUpgradeSerializationBinder : SerializationBinder
+#if NETSTANDARD2_0
+        ,ISerializationBinder
+#endif
     {
         static Lazy<IDictionary<string, Type>> KnownTypes = new Lazy<IDictionary<string, Type>>(() =>
         {
@@ -33,6 +38,7 @@

         static readonly string CurrentAssemblyName = typeof(PackageUpgradeSerializationBinder).Assembly.GetName().Name;
         static readonly ISet<string> _upgradeableAssemblyNames = new HashSet<string>{ "DurableTask", "DurableTaskFx" };
+        readonly DefaultSerializationBinder defaultBinder = new DefaultSerializationBinder();

         /// <inheritdoc />
         public override Type BindToType(string assemblyName, string typeName)
@@ -53,10 +59,16 @@

             if (resolvedType == null)
             {
-                resolvedType = base.BindToType(assemblyName, typeName);
+                resolvedType = defaultBinder.BindToType(assemblyName, typeName);
             }

             return resolvedType;
         }
+
+        /// <inheritdoc />
+        public override void BindToName(Type serializedType, out string assemblyName, out string typeName)
+        {
+            defaultBinder.BindToName(serializedType, out assemblyName, out typeName);
+        }
     };
 }


Finish transforms on controls load complete

--- osu.Game/Screens/Edit/Compose/Components/SelectionBoxControl.cs
+++ osu.Game/Screens/Edit/Compose/Components/SelectionBoxControl.cs
@@ -54,7 +54,9 @@
         protected override void LoadComplete()
         {
             base.LoadComplete();
+
             UpdateHoverState();
+            FinishTransforms(true);
         }

         protected override bool OnHover(HoverEvent e)


Add more tests

Add more tests

--- src/EditorFeatures/CSharpTest/UseAutoProperty/UseAutoPropertyTests.cs
+++ src/EditorFeatures/CSharpTest/UseAutoProperty/UseAutoPropertyTests.cs
@@ -1520,6 +1520,58 @@
         }

         [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseAutoProperty)]
+        public async Task TestMultipleFieldsAbove3()
+        {
+            await TestInRegularAndScriptAsync(
+@"class Class
+{
+    [|int i|];
+
+    int j;
+
+    int P
+    {
+        get
+        {
+            return i;
+        }
+    }
+}",
+@"class Class
+{
+    int j;
+
+    int P { get; }
+}");
+        }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseAutoProperty)]
+        public async Task TestMultipleFieldsAbove4()
+        {
+            await TestInRegularAndScriptAsync(
+@"class Class
+{
+    int j;
+
+    [|int i|];
+
+    int P
+    {
+        get
+        {
+            return i;
+        }
+    }
+}",
+@"class Class
+{
+    int j;
+
+    int P { get; }
+}");
+        }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseAutoProperty)]
         public async Task TestMultipleFieldsBelow1()
         {
             await TestInRegularAndScriptAsync(
@@ -1568,5 +1620,57 @@
     int j;
 }");
         }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseAutoProperty)]
+        public async Task TestMultipleFieldsBelow3()
+        {
+            await TestInRegularAndScriptAsync(
+@"class Class
+{
+    int P
+    {
+        get
+        {
+            return i;
+        }
+    }
+
+    [|int i|];
+
+    int j;
+}",
+@"class Class
+{
+    int P { get; }
+
+    int j;
+}");
+        }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseAutoProperty)]
+        public async Task TestMultipleFieldsBelow4()
+        {
+            await TestInRegularAndScriptAsync(
+@"class Class
+{
+    int P
+    {
+        get
+        {
+            return i;
+        }
+    }
+
+    int j;
+
+    [|int i|];
+}",
+@"class Class
+{
+    int P { get; }
+
+    int j;
+}");
+        }
     }
 }


Ensure flowing animation starts correctly from zero

--- osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs
+++ osu.Game/Screens/Play/HUD/HitErrorMeters/ColourHitErrorMeter.cs
@@ -169,7 +169,9 @@

                 IsRemoved = false;

-                this.FadeIn();
+                this.FadeIn()
+                    // On pool re-use, start flow animation from (0,0).
+                    .MoveTo(Vector2.Zero);

                 content.FadeInFromZero(animation_duration, Easing.OutQuint)
                        .MoveToY(-DrawSize.Y)


Quarantine flagged tests (#21723)

Quarantine flagged tests (#21723)

--- src/Identity/Specification.Tests/src/UserManagerSpecificationTests.cs
+++ src/Identity/Specification.Tests/src/UserManagerSpecificationTests.cs
@@ -1450,6 +1450,7 @@
         /// </summary>
         /// <returns>Task</returns>
         [Fact]
+        [QuarantinedTest]
         public async Task ChangePhoneNumberFailsWithWrongPhoneNumber()
         {
             var manager = CreateManager();
@@ -1518,6 +1519,7 @@
         /// </summary>
         /// <returns>Task</returns>
         [Fact]
+        [QuarantinedTest]
         public async Task CanChangeEmailOnlyIfEmailSame()
         {
             var manager = CreateManager();


[ListView] Fix a visual artifact (bgo#605736)

--- src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
+++ src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Rendering.cs
@@ -103,14 +103,16 @@
                 PaintHeader (damage);
             }

+            if (Model != null) {
+                PaintRows (damage);
+            }
+
+            // Focused frame border is bolder than BorderWidth,
+            // draw it after the rows to avoid visual artifacts.
             if (HasFocus)
                 Theme.DrawFrameBorderFocused (cairo_context, Allocation);
             else
                 Theme.DrawFrameBorder (cairo_context, Allocation);
-
-            if (Model != null) {
-                PaintRows (damage);
-            }

             PaintDraggingColumn (damage);


xml doc fix

xml doc fix

--- src/Microsoft.AspNet.Mvc.Core/ApplicationModelConventionExtensions.cs
+++ src/Microsoft.AspNet.Mvc.Core/ApplicationModelConventionExtensions.cs
@@ -14,7 +14,7 @@
         /// <summary>
         /// Adds a <see cref="IControllerModelConvention"/> to all the controllers in the application.
         /// </summary>
-        /// <param name="conventions">The list of <see cref="IApplicationModelConvention">
+        /// <param name="conventions">The list of <see cref="IApplicationModelConvention"/>
         /// in <see cref="MvcOptions"/>.</param>
         /// <param name="controllerModelConvention">The <see cref="IControllerModelConvention"/> which needs to be
         /// added.</param>


Don't allow ucd emails to auth against google.

Note, ErrorMessage is not working.

--- Anlab.Mvc/Controllers/AccountController.cs
+++ Anlab.Mvc/Controllers/AccountController.cs
@@ -290,6 +290,16 @@
                 return RedirectToAction(nameof(Login));
             }

+            if (info.LoginProvider.Equals("Google", StringComparison.OrdinalIgnoreCase))
+            {
+                var emailClaim = info.Principal.FindFirstValue(ClaimTypes.Email);
+                if (emailClaim.Contains("@ucdavis"))
+                {
+                    ErrorMessage = "Do not use Google to log in to a UC Davis account";
+                    return RedirectToAction("Login");
+                }
+            }
+
             // setup claims properly to deal with how CAS represents things
             if (info.LoginProvider.Equals("UCDavis", StringComparison.OrdinalIgnoreCase))
             {


Updating orcharde to see System Administrator.

--- src/Orchard.Web/Modules/NGM.CasClient/Client/Security/CasPrincipal.cs
+++ src/Orchard.Web/Modules/NGM.CasClient/Client/Security/CasPrincipal.cs
@@ -154,7 +154,7 @@
             {
                 var username = MaxAttributes.EmailAddress.ToLowerInvariant();

-                IsAdmin = db.aspnet_Users.Where(u => u.LoweredUserName == username).SelectMany(x => x.aspnet_Roles.Select(y => y.RoleName)).Any(x => x == "Administrator");
+                IsAdmin = db.aspnet_Users.Where(u => u.LoweredUserName == username).SelectMany(x => x.aspnet_Roles.Select(y => y.RoleName)).Any(x => x == "System Administrator");
                 IsCmsAdmin = db.aspnet_Users.Where(u => u.LoweredUserName == username).SelectMany(x => x.aspnet_Roles.Select(y => y.RoleName)).Any(x => x == "CMS Manager");
             }


size right pane. ugly i know. sorry.

size right pane. ugly i know. sorry.

--- source/CBA/Views/Home/Results.cshtml
+++ source/CBA/Views/Home/Results.cshtml
@@ -29,18 +29,18 @@

ViewBag.Error

     }

-

+

             @if (!String.IsNullOrEmpty(Model.ScoreGraphic))
             {
-
+
             }
             else
             {
-
+
             }

-

+

                 Issues


2320.10: edgeColoring, reverseClockDir

2320.10: edgeColoring, reverseClockDir

--- src/PixelFarm/PixelFarm.Drawing/7_CpuBlitPainter/Msdf/EdgeColoring.cs
+++ src/PixelFarm/PixelFarm.Drawing/7_CpuBlitPainter/Msdf/EdgeColoring.cs
@@ -57,6 +57,8 @@
             double crossThreshold = Math.Sin(angleThreshold);
             List<int> corners = new List<int>(); //TODO: review reusable list

+            bool reverseClockDir = false;
+
             // for (std::vector<Contour>::iterator contour = shape.contours.begin(); contour != shape.contours.end(); ++contour)
             foreach (Contour contour in shape.contours)
             {
@@ -66,17 +68,36 @@
                 int edgeCount = edges.Count;
                 if (edgeCount != 0)
                 {
-                    Vector2 prevDirection = edges[edgeCount - 1].direction(1);// (*(contour->edges.end() - 1))->direction(1);
-                    for (int i = 0; i < edgeCount; ++i)
-                    {
-                        EdgeSegment edge = edges[i];
-                        if (isCorner(prevDirection.normalize(),
-                            edge.direction(0).normalize(), crossThreshold))
-                        {
-                            corners.Add(i);
-                        }
-                        prevDirection = edge.direction(1);
-                    }
+                    if (reverseClockDir)
+                    {
+                        Vector2 prevDirection = edges[edgeCount - 1].direction(1);// (*(contour->edges.end() - 1))->direction(1);
+                        for (int i = 0; i < edgeCount; ++i)
+                        {
+                            EdgeSegment edge = edges[i];
+                            if (isCorner(prevDirection.normalize(),
+                                edge.direction(0).normalize(), crossThreshold))
+                            {
+                                corners.Add(i);
+                            }
+                            prevDirection = edge.direction(1);
+                        }
+                    }
+                    else
+                    {
+                        //original
+                        Vector2 prevDirection = edges[edgeCount - 1].direction(1);// (*(contour->edges.end() - 1))->direction(1);
+                        for (int i = 0; i < edgeCount; ++i)
+                        {
+                            EdgeSegment edge = edges[i];
+                            if (isCorner(prevDirection.normalize(),
+                                edge.direction(0).normalize(), crossThreshold))
+                            {
+                                corners.Add(i);
+                            }
+                            prevDirection = edge.direction(1);
+                        }
+                    }
+
                 }

                 // Smooth contour
@@ -143,23 +164,48 @@
                 // Multiple corners
                 else
                 {
-                    int cornerCount = corners.Count;
-                    int spline = 0;
-                    int start = corners[0];
-
-                    EdgeColor color = EdgeColor.WHITE;
-                    switchColor(ref color, ref seed);
-                    EdgeColor initialColor = color;
-                    for (int i = 0; i < edgeCount; ++i)
-                    {
-                        int index = (start + i) % edgeCount;
-                        if (spline + 1 < cornerCount && corners[spline + 1] == index)
-                        {
-                            ++spline;
-                            switchColor(ref color, ref seed, (EdgeColor)(((spline == cornerCount - 1) ? 1 : 0) * (int)initialColor));
-                        }
-                        edges[index].color = color;
-                    }
+                    if (reverseClockDir)
+                    {
+                        int cornerCount = corners.Count;
+                        int spline = 0;
+                        int start = corners[0];
+
+                        EdgeColor color = EdgeColor.WHITE;
+                        switchColor(ref color, ref seed);
+                        EdgeColor initialColor = color;
+                        for (int i = 0; i < edgeCount; ++i)
+                        {
+                            int index = (start + i) % edgeCount;
+                            if (spline + 1 < cornerCount && corners[spline + 1] == index)
+                            {
+                                ++spline;
+                                switchColor(ref color, ref seed, (EdgeColor)(((spline == cornerCount - 1) ? 1 : 0) * (int)initialColor));
+                            }
+                            edges[index].color = color;
+                        }
+                    }
+                    else
+                    {
+                        //original
+                        int cornerCount = corners.Count;
+                        int spline = 0;
+                        int start = corners[0];
+
+                        EdgeColor color = EdgeColor.WHITE;
+                        switchColor(ref color, ref seed);
+                        EdgeColor initialColor = color;
+                        for (int i = 0; i < edgeCount; ++i)
+                        {
+                            int index = (start + i) % edgeCount;
+                            if (spline + 1 < cornerCount && corners[spline + 1] == index)
+                            {
+                                ++spline;
+                                switchColor(ref color, ref seed, (EdgeColor)(((spline == cornerCount - 1) ? 1 : 0) * (int)initialColor));
+                            }
+                            edges[index].color = color;
+                        }
+                    }
+
                 }
             }
         }


Cleanup too many repetitive strings

Cleanup too many repetitive strings

--- src/ServiceStack/WebHost.Endpoints/Support/Templates/HtmlTemplates.cs
+++ src/ServiceStack/WebHost.Endpoints/Support/Templates/HtmlTemplates.cs
@@ -13,21 +13,26 @@
         public static string OperationControlTemplate;
         public static string OperationsControlTemplate;

+        private const string IndexOperationsFileName = "IndexOperations.html";
+        private const string OperationControlFileName = "OperationControl.html";
+        private const string OperationsControlFileName = "OperationsControl.html";
+
+
         static HtmlTemplates()
         {
             var UseCustomPath = EndpointHost.Config.UseCustomMetadataTemplates;

             if (UseCustomPath)
             {
-                IndexOperationsTemplate = LoadExternal("IndexOperations.html");
-                OperationControlTemplate = LoadExternal("OperationControl.html");
-                OperationsControlTemplate = LoadExternal("OperationsControl.html");
+                IndexOperationsTemplate = LoadExternal(IndexOperationsFileName);
+                OperationControlTemplate = LoadExternal(OperationControlFileName);
+                OperationsControlTemplate = LoadExternal(OperationsControlFileName);
             }
             else
             {
-                IndexOperationsTemplate = LoadEmbeddedHtmlTemplate("IndexOperations.html");
-                OperationControlTemplate = LoadEmbeddedHtmlTemplate("OperationControl.html");
-                OperationsControlTemplate = LoadEmbeddedHtmlTemplate("OperationsControl.html");
+                IndexOperationsTemplate = LoadEmbeddedHtmlTemplate(IndexOperationsFileName);
+                OperationControlTemplate = LoadEmbeddedHtmlTemplate(OperationControlFileName);
+                OperationsControlTemplate = LoadEmbeddedHtmlTemplate(OperationsControlFileName);
             }
         }

@@ -47,16 +52,16 @@
         {
             string _resourceNamespace = typeof(HtmlTemplates).Namespace + ".Html.";
             var stream = typeof(HtmlTemplates).Assembly.GetManifestResourceStream(_resourceNamespace + templateName);
-			if (stream == null)
-			{
-				throw new FileNotFoundException(
+            if (stream == null)
+            {
+                throw new FileNotFoundException(
                     "Could not load HTML template embedded resource " + templateName,
                     templateName);
-			}
-			using (var streamReader = new StreamReader(stream))
-			{
-				return streamReader.ReadToEnd();
-			}
+            }
+            using (var streamReader = new StreamReader(stream))
+            {
+                return streamReader.ReadToEnd();
+            }
         }

     }


Only show check mark if the severities are the same

If the user selects a bunch of diagnostics with differing severities in
Solution Explorer, right-clicks,  and opens the "Set Rule Set Severity"
submenu they will see a check mark next to every applicable severity.
E.g., if one rule is an error and one is a warning, then both Error and
Warn will be checked.

The general feeling is that this will be confusing to users. Instead,
only show a check mark when all the selected rules share the same
severity.

--- src/VisualStudio/Core/SolutionExplorerShim/AnalyzersCommandHandler.cs
+++ src/VisualStudio/Core/SolutionExplorerShim/AnalyzersCommandHandler.cs
@@ -238,64 +238,70 @@

         private void UpdateSeverityMenuItemsChecked()
         {
-            bool errorMenuItemChecked = false;
-            bool warningMenuItemChecked = false;
-            bool infoMenuItemChecked = false;
-            bool hiddenMenuItemChecked = false;
-            bool noneMenuItemChecked = false;
+            _setSeverityErrorMenuItem.Checked = false;
+            _setSeverityWarningMenuItem.Checked = false;
+            _setSeverityInfoMenuItem.Checked = false;
+            _setSeverityHiddenMenuItem.Checked = false;
+            _setSeverityNoneMenuItem.Checked = false;

             var workspace = TryGetWorkspace() as VisualStudioWorkspaceImpl;
-            if (workspace != null)
-            {
-                var groups = _tracker.SelectedDiagnosticItems.GroupBy(item => item.AnalyzerItem.AnalyzersFolder.ProjectId);
-
-                foreach (var group in groups)
-                {
-                    var project = (AbstractProject)workspace.GetHostProject(group.Key);
-                    IRuleSetFile ruleSet = project.RuleSetFile;
-
-                    if (ruleSet != null)
+            if (workspace == null)
+            {
+                return;
+            }
+
+            HashSet<ReportDiagnostic> selectedItemSeverities = new HashSet<ReportDiagnostic>();
+
+            var groups = _tracker.SelectedDiagnosticItems.GroupBy(item => item.AnalyzerItem.AnalyzersFolder.ProjectId);
+
+            foreach (var group in groups)
+            {
+                var project = (AbstractProject)workspace.GetHostProject(group.Key);
+                IRuleSetFile ruleSet = project.RuleSetFile;
+
+                if (ruleSet != null)
+                {
+                    var specificOptions = ruleSet.GetSpecificDiagnosticOptions();
+
+                    foreach (var diagnosticItem in group)
                     {
-                        var specificOptions = ruleSet.GetSpecificDiagnosticOptions();
-
-                        foreach (var diagnosticItem in group)
+                        ReportDiagnostic ruleSetSeverity;
+                        if (specificOptions.TryGetValue(diagnosticItem.Descriptor.Id, out ruleSetSeverity) &&
+                            ruleSetSeverity != ReportDiagnostic.Default)
                         {
-                            ReportDiagnostic ruleSetSeverity;
-                            if (specificOptions.TryGetValue(diagnosticItem.Descriptor.Id, out ruleSetSeverity))
-                            {
-                                switch (ruleSetSeverity)
-                                {
-                                    case ReportDiagnostic.Default:
-                                        break;
-                                    case ReportDiagnostic.Error:
-                                        errorMenuItemChecked = true;
-                                        break;
-                                    case ReportDiagnostic.Warn:
-                                        warningMenuItemChecked = true;
-                                        break;
-                                    case ReportDiagnostic.Info:
-                                        infoMenuItemChecked = true;
-                                        break;
-                                    case ReportDiagnostic.Hidden:
-                                        hiddenMenuItemChecked = true;
-                                        break;
-                                    case ReportDiagnostic.Suppress:
-                                        noneMenuItemChecked = true;
-                                        break;
-                                    default:
-                                        break;
-                                }
-                            }
+                            selectedItemSeverities.Add(ruleSetSeverity);
                         }
                     }
                 }
             }
-
-            _setSeverityErrorMenuItem.Checked = errorMenuItemChecked;
-            _setSeverityWarningMenuItem.Checked = warningMenuItemChecked;
-            _setSeverityInfoMenuItem.Checked = infoMenuItemChecked;
-            _setSeverityHiddenMenuItem.Checked = hiddenMenuItemChecked;
-            _setSeverityNoneMenuItem.Checked = noneMenuItemChecked;
+
+            if (selectedItemSeverities.Count != 1)
+            {
+                return;
+            }
+
+            switch (selectedItemSeverities.Single())
+            {
+                case ReportDiagnostic.Default:
+                    break;
+                case ReportDiagnostic.Error:
+                    _setSeverityErrorMenuItem.Checked = true;
+                    break;
+                case ReportDiagnostic.Warn:
+                    _setSeverityWarningMenuItem.Checked = true;
+                    break;
+                case ReportDiagnostic.Info:
+                    _setSeverityInfoMenuItem.Checked = true;
+                    break;
+                case ReportDiagnostic.Hidden:
+                    _setSeverityHiddenMenuItem.Checked = true;
+                    break;
+                case ReportDiagnostic.Suppress:
+                    _setSeverityNoneMenuItem.Checked = true;
+                    break;
+                default:
+                    break;
+            }
         }

         private bool AnyDiagnosticsWithSeverity(ReportDiagnostic severity)


Add check obsolete function to avoid Unity "PlayerSettings Validation: Requested build target group (15) doesn't exist; #define symbols for scripting won't be added. " error when SaveAll

--- Assets/Editor/SymbolEditor/SymbolEditor.cs
+++ Assets/Editor/SymbolEditor/SymbolEditor.cs
@@ -219,16 +219,26 @@
 	/// <summary>
 	/// 全プラットフォームに同じシンボルを保存
 	/// </summary>
-	public static void SaveAll(){
-
-		//Symbolに対応した値をまとめたDefineValueを作成するかのフラグ
-		bool needToCreateDefineValue = true;
-
-		foreach (BuildTargetGroup buildTarget in Enum.GetValues(typeof(BuildTargetGroup))) {
-			Save (buildTarget, needToCreateDefineValue);
-
-			//一度書き出したら、DefineValueを再度書き出さないように
-			needToCreateDefineValue = false;
-		}
-	}
+    public static void SaveAll(){
+
+        //Symbolに対応した値をまとめたDefineValueを作成するかのフラグ
+        bool needToCreateDefineValue = true;
+
+        foreach (BuildTargetGroup buildTarget in Enum.GetValues(typeof(BuildTargetGroup))){
+
+            if (!IsObsolete(buildTarget)){
+                Save(buildTarget, needToCreateDefineValue);
+
+                //一度書き出したら、DefineValueを再度書き出さないように
+                needToCreateDefineValue = false;
+            }
+        }
+    }
+
+    public static bool IsObsolete(Enum value){
+        var fi = value.GetType().GetField(value.ToString());
+        var attributes = (ObsoleteAttribute[])
+            fi.GetCustomAttributes(typeof(ObsoleteAttribute), false);
+        return (attributes != null && attributes.Length > 0);
+    }
 }


using ridigbody2d for movement now

using ridigbody2d for movement now

--- Assets/Scripts/Character/PlayerMovement.cs
+++ Assets/Scripts/Character/PlayerMovement.cs
@@ -7,11 +7,17 @@
 public class PlayerMovement : MonoBehaviour
 {
     [SerializeField]private BlockManager manager;
+	private Rigidbody2D rigid;
     private float movement = 0.04f;

+	protected void Awake()
+	{
+		rigid = GetComponent<Rigidbody2D>();
+	}
     protected void Update()
     {
-        transform.Translate(Mathf.Clamp(Input.GetAxis("Horizontal"), -movement, movement), 0, 0);
+		rigid.AddRelativeForce(new Vector2(Input.GetAxis("Horizontal"), 0) * 25,ForceMode2D.Force);
+		rigid.velocity = Vector2.zero;
         if (Input.GetButtonDown("Jump"))
         {
             RaycastHit2D hit = Physics2D.Raycast(new Vector2(transform.position.x, transform.position.y + Vector2.down.y), Vector2.down, 0.1f);


[dsc] Throw compiler exceptions for syntax errors

--- DogeSharp/Program.cs
+++ DogeSharp/Program.cs
@@ -123,6 +123,8 @@

 						Log("much translation: {0}", actual);

+						parser.RemoveErrorListeners();
+						parser.AddErrorListener(new ErrorListener());
 						var visitor = new DogeToCSTranslator(actual);
 						var text = visitor.Visit(parser.prog());

@@ -229,4 +231,12 @@
 			}
 		}
 	}
+
+	internal class ErrorListener : IAntlrErrorListener<IToken>
+	{
+		public void SyntaxError(IRecognizer recognizer, IToken offendingSymbol, int line, int charPositionInLine, string msg, RecognitionException e)
+		{
+			throw new CompilerException(offendingSymbol, "wow, many syntax error: {0}", msg);
+		}
+	}
 }


Writing out some more error information on failed ot login message.

--- AutomationISE/AutomationISEControl.xaml.cs
+++ AutomationISE/AutomationISEControl.xaml.cs
@@ -304,17 +304,17 @@
                 else UpdateStatusBox(configurationStatusTextBox, Properties.Resources.NoSubscriptions);
                 refreshTimer.Start();
             }
-            catch (Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException)
-            {
-                UpdateStatusBox(configurationStatusTextBox, Properties.Resources.CancelSignIn);
-            }
-            catch (Microsoft.IdentityModel.Clients.ActiveDirectory.AdalException)
-            {
-                UpdateStatusBox(configurationStatusTextBox, Properties.Resources.CancelSignIn);
-            }
-            catch (Exception exception)
-            {
-                var detailsDialog = System.Windows.Forms.MessageBox.Show(exception.Message);
+            catch (Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException Ex)
+            {
+                UpdateStatusBox(configurationStatusTextBox, Properties.Resources.CancelSignIn +  " Error code: " + Ex.ErrorCode.ToString() + " Error Message: " + Ex.Message);
+            }
+            catch (Microsoft.IdentityModel.Clients.ActiveDirectory.AdalException Ex)
+            {
+                UpdateStatusBox(configurationStatusTextBox, Properties.Resources.CancelSignIn + " Error code: " + Ex.ErrorCode.ToString() + " Error Message: " + Ex.Message);
+            }
+            catch (Exception Ex)
+            {
+                var detailsDialog = System.Windows.Forms.MessageBox.Show(Ex.Message);
             }
         }


Refactoring SetForNet4 a wee bit to prevent compiler warnings.

--- Bieb.NHibernateProvider/Net4Collections.cs
+++ Bieb.NHibernateProvider/Net4Collections.cs
@@ -707,28 +707,28 @@
 		#region Nested type: SetSnapShot

 		[Serializable]
-		private class SetSnapShot<T> : ISetSnapshot<T>
-		{
-			private readonly List<T> elements;
+		private class SetSnapShot<TSnapshot> : ISetSnapshot<TSnapshot>
+		{
+			private readonly List<TSnapshot> elements;

 			private SetSnapShot()
 			{
-				elements = new List<T>();
+				elements = new List<TSnapshot>();
 			}

 			public SetSnapShot(int capacity)
 			{
-				elements = new List<T>(capacity);
-			}
-
-			public SetSnapShot(IEnumerable<T> collection)
-			{
-				elements = new List<T>(collection);
+				elements = new List<TSnapshot>(capacity);
+			}
+
+			public SetSnapShot(IEnumerable<TSnapshot> collection)
+			{
+				elements = new List<TSnapshot>(collection);
 			}

 			#region ISetSnapshot<T> Members

-			public IEnumerator<T> GetEnumerator()
+			public IEnumerator<TSnapshot> GetEnumerator()
 			{
 				return elements.GetEnumerator();
 			}
@@ -738,7 +738,7 @@
 				return GetEnumerator();
 			}

-			public void Add(T item)
+			public void Add(TSnapshot item)
 			{
 				elements.Add(item);
 			}
@@ -748,17 +748,17 @@
 				throw new InvalidOperationException();
 			}

-			public bool Contains(T item)
+			public bool Contains(TSnapshot item)
 			{
 				return elements.Contains(item);
 			}

-			public void CopyTo(T[] array, int arrayIndex)
+			public void CopyTo(TSnapshot[] array, int arrayIndex)
 			{
 				elements.CopyTo(array, arrayIndex);
 			}

-			public bool Remove(T item)
+			public bool Remove(TSnapshot item)
 			{
 				throw new InvalidOperationException();
 			}
@@ -783,17 +783,17 @@
 				get { return ((ICollection) elements).IsSynchronized; }
 			}

-			int ICollection<T>.Count
+			int ICollection<TSnapshot>.Count
 			{
 				get { return elements.Count; }
 			}

 			public bool IsReadOnly
 			{
-				get { return ((ICollection<T>) elements).IsReadOnly; }
-			}
-
-			public T this[T element]
+				get { return ((ICollection<TSnapshot>) elements).IsReadOnly; }
+			}
+
+			public TSnapshot this[TSnapshot element]
 			{
 				get
 				{
@@ -802,7 +802,7 @@
 					{
 						return elements[idx];
 					}
-					return default(T);
+					return default(TSnapshot);
 				}
 			}


ScheduledJobsManagerImpl

ScheduledJobsManagerImpl

* added support for continuation / paging on job retrieval

--- src/biz.dfch.CS.Appclusive.Scheduler.Core/ScheduledJobsManagerImpl.cs
+++ src/biz.dfch.CS.Appclusive.Scheduler.Core/ScheduledJobsManagerImpl.cs
@@ -16,6 +16,7 @@

 using System;
 using System.Collections.Generic;
+using System.Data.Services.Client;
 using System.Diagnostics.Contracts;
 using System.Linq;
 using System.Text;
@@ -34,10 +35,26 @@

             var scheduledJobs = new List<ScheduledJob>();

-            var result = endpoints.Core.ScheduledJobs;
-            Contract.Assert(null != result);
-            scheduledJobs = result.ToList();
+            var entities = endpoints.Core.ScheduledJobs.Execute() as QueryOperationResponse<ScheduledJob>;
+            while(null != entities)
+            {
+                foreach (var entity in entities)
+                {
+                    scheduledJobs.Add(entity);
+                    Contract.Assert(ScheduledJobsWorker.SCHEDULED_TASK_WORKER_JOBS_PER_INSTANCE_MAX >= scheduledJobs.Count);
+                }

+                var dataServiceQueryContinuation = entities.GetContinuation();
+                if (null != dataServiceQueryContinuation)
+                {
+                    entities = endpoints.Core.Execute(dataServiceQueryContinuation);
+                }
+                else
+                {
+                    entities = null;
+                }
+            }
+
             return scheduledJobs;
         }
     }


WorkItem annotations added to tests

WorkItem annotations added to tests

--- src/biz.dfch.CS.Entity.LifeCycleManager.Tests/LifeCycleManagerTest.cs
+++ src/biz.dfch.CS.Entity.LifeCycleManager.Tests/LifeCycleManagerTest.cs
@@ -38,6 +38,7 @@
         }

         [TestMethod]
+        [WorkItem(18)]
         public void LifeCycleManagerConstructorInitializesStateMachineWithDefaultConfigurationIfNoConfigurationDefinedExplicit()
         {
             var stateMachineConfigLoader = Mock.Create<IStateMachineConfigLoader>();
@@ -51,6 +52,7 @@
         }

         [TestMethod]
+        [WorkItem(11)]
         public void LifeCycleManagerConstructorCallsStateMachineConfigLoaderToLoadStateMachineConfigurationAccordingEntityType()
         {
             var stateMachineConfigLoader = Mock.Create<IStateMachineConfigLoader>();
@@ -61,6 +63,7 @@
         }

         [TestMethod]
+        [WorkItem(12)]
         public void LifeCycleManagerConstructorInitializesStateMachineWithLoadedConfigurationIfAvailable()
         {
             var stateMachineConfigLoader = Mock.Create<IStateMachineConfigLoader>();


missed a aot flag

missed a aot flag

--- E2Helpers/Advdupe.cs
+++ E2Helpers/Advdupe.cs
@@ -582,7 +582,7 @@
                     switch (b [ index - 1 ])
                     {
                         case 0:
-                        return null;
+                        return new AdvDupeObject("");

                         case 255:
                         return getTable(b, ref index, dupe);


added area so modules can also logout

added area so modules can also logout

--- CMSAdmin/Views/CmsAdmin/_LayoutMain.cshtml
+++ CMSAdmin/Views/CmsAdmin/_LayoutMain.cshtml
@@ -261,7 +261,7 @@
 			</form>

 			@if (Request.IsAuthenticated) {
-				using (Html.BeginForm("LogOff", RouteConfig.AdminCtrlr, FormMethod.Post, new { id = "logoutForm" })) {
+				using (Html.BeginForm("LogOff", RouteConfig.AdminCtrlr, new { area = "" }, FormMethod.Post, new { id = "logoutForm" })) {
 					@Html.AntiForgeryToken()

 					<input type="submit" name="btnLogout" value="Logout" id="btnLogout" />


--- CSharp/String/RemoveDuplicateinSequence.cs
+++ CSharp/String/RemoveDuplicateinSequence.cs
@@ -1,12 +1,12 @@
 using static System.Console;

 public class Program {
-    public static void Main() {
-        var texto = "Abcc111de12234";
-        var lista = new char[texto.Length];
-        for (int i = 0, j = 0; i < texto.Length; i++) if (!char.IsDigit(texto[i]) || (i != texto.Length - 1 && texto[i] != texto[i + 1])) lista[j++] = texto[i];
-        WriteLine(new string(lista));
-    }
+	public static void Main() {
+		var texto = "Abcc111de12234";
+		var lista = new char[texto.Length];
+		for (int i = 0, j = 0; i < texto.Length; i++) if (!char.IsDigit(texto[i]) || (i == 0 || texto[i] != texto[i - 1])) lista[j++] = texto[i];
+		WriteLine(new string(lista));
+	}
 }

 //https://pt.stackoverflow.com/q/291742/101


Automated dotnet-format update

Automated dotnet-format update

--- src/dotnetCampus.Ipc/IIpcObjectSerializer.cs
+++ src/dotnetCampus.Ipc/IIpcObjectSerializer.cs
@@ -6,4 +6,4 @@

         T Deserialize<T>(byte[] byteList);
     }
-}+}


Fix sendind admin msgs

Fix sendind admin msgs

--- Client/Systems/Admin/AdminMessageSender.cs
+++ Client/Systems/Admin/AdminMessageSender.cs
@@ -11,7 +11,7 @@
     {
         public void SendMessage(IMessageData msg)
         {
-            TaskFactory.StartNew(() => NetworkSender.QueueOutgoingMessage(MessageFactory.CreateNew<HandshakeCliMsg>(msg)));
+            TaskFactory.StartNew(() => NetworkSender.QueueOutgoingMessage(MessageFactory.CreateNew<AdminCliMsg>(msg)));
         }

         public void SendBanPlayerMsg(string playerName)


Fix summary

Fix summary

--- CommonMark/CommonMarkAdditionalFeatures.cs
+++ CommonMark/CommonMarkAdditionalFeatures.cs
@@ -35,6 +35,7 @@
         /// </summary>
         MathDollar = 8,

+        /// <summary>
         /// The parser will recognize emphasis in indented code.
         /// </summary>
         EmphasisInIndentedCode = 32,


Adjust spacing and line breaks a bit

Adjust spacing and line breaks a bit

--- osu.Framework/Graphics/MarginPadding.cs
+++ osu.Framework/Graphics/MarginPadding.cs
@@ -7,31 +7,42 @@
 namespace osu.Framework.Graphics
 {
     /// <summary>
-    /// Holds data about the margin or padding of a <see cref="Drawable"/>. The margin describes the size of an empty area around its <see cref="Drawable"/>, while the padding describes the size of an empty area inside its container.
+    /// Holds data about the margin or padding of a <see cref="Drawable"/>.
+    /// The margin describes the size of an empty area around its <see cref="Drawable"/>, while the padding describes the size of an empty area inside its container.
     /// </summary>
     public struct MarginPadding : IEquatable<MarginPadding>
     {
         /// <summary>
-        /// The absolute size of the space that should be left empty above the <see cref="Drawable"/> if used as margin or the absolute size of the space that should be left empty from the top of the container if used as padding.
+        /// The absolute size of the space that should be left empty above the <see cref="Drawable"/> if used as margin, or
+        /// the absolute size of the space that should be left empty from the top of the container if used as padding.
         /// </summary>
         public float Top;
+
         /// <summary>
-        /// The absolute size of the space that should be left empty to the left of the <see cref="Drawable"/> or the absolute size of the space that should be left empty from the left of the container if used as padding.
+        /// The absolute size of the space that should be left empty to the left of the <see cref="Drawable"/> if used as margin, or
+        /// the absolute size of the space that should be left empty from the left of the container if used as padding.
         /// </summary>
         public float Left;
+
         /// <summary>
-        /// The absolute size of the space that should be left empty below the <see cref="Drawable"/> or the absolute size of the space that should be left empty from the bottom of the container if used as padding.
+        /// The absolute size of the space that should be left empty below the <see cref="Drawable"/> if used as margin, or
+        /// the absolute size of the space that should be left empty from the bottom of the container if used as padding.
         /// </summary>
         public float Bottom;
+
         /// <summary>
-        /// The absolute size of the space that should be left empty to the right of the <see cref="Drawable"/> or the absolute size of the space that should be left empty from the right of the container if used as padding.
+        /// The absolute size of the space that should be left empty to the right of the <see cref="Drawable"/> if used as margin, or
+        /// the absolute size of the space that should be left empty from the right of the container if used as padding.
         /// </summary>
         public float Right;

         /// <summary>
-        /// Gets the total absolute size of the empty space horizontally around the <see cref="Drawable"/> or the absolute size of the space left empty from the right and left of the container if used as padding. Effectively <see cref="Right"/> + <see cref="Left"/>.
+        /// Gets the total absolute size of the empty space horizontally around the <see cref="Drawable"/> if used as margin, or
+        /// the absolute size of the space left empty from the right and left of the container if used as padding.
+        /// Effectively <see cref="Right"/> + <see cref="Left"/>.
         /// </summary>
         public float TotalHorizontal => Left + Right;
+
         /// <summary>
         /// Sets the values of both <see cref="Left"/> and <see cref="Right"/> to the assigned value.
         /// </summary>
@@ -41,9 +52,12 @@
         }

         /// <summary>
-        /// Gets the total absolute size of the empty space vertically around the <see cref="Drawable"/> or the absolute size of the space left empty from the top and bottom of the container if used as padding. Effectively <see cref="Top"/> + <see cref="Bottom"/>.
+        /// Gets the total absolute size of the empty space vertically around the <see cref="Drawable"/> or
+        /// the absolute size of the space left empty from the top and bottom of the container if used as padding.
+        /// Effectively <see cref="Top"/> + <see cref="Bottom"/>.
         /// </summary>
         public float TotalVertical => Top + Bottom;
+
         /// <summary>
         /// Sets the values of both <see cref="Top"/> and <see cref="Bottom"/> to the assigned value.
         /// </summary>


Ensure we default to primary display on first run

--- osu.Framework/Platform/DesktopWindow.cs
+++ osu.Framework/Platform/DesktopWindow.cs
@@ -70,7 +70,7 @@
             };

             config.BindWith(FrameworkSetting.LastDisplayDevice, windowDisplayIndex);
-            windowDisplayIndex.BindValueChanged(evt => CurrentDisplay.Value = Displays.ElementAtOrDefault((int)evt.NewValue), true);
+            windowDisplayIndex.BindValueChanged(evt => CurrentDisplay.Value = Displays.ElementAtOrDefault((int)evt.NewValue) ?? PrimaryDisplay, true);

             config.BindWith(FrameworkSetting.SizeFullscreen, sizeFullscreen);


Don't unnecessarily expose properties

Don't unnecessarily expose properties

--- osu.Game/Online/Chat/MessageNotifier.cs
+++ osu.Game/Online/Chat/MessageNotifier.cs
@@ -137,16 +137,14 @@
             public PrivateMessageNotification(string username, Channel channel)
             {
                 Icon = FontAwesome.Solid.Envelope;
-                Username = username;
-                Channel = channel;
-                Text = $"You received a private message from '{Username}'. Click to read it!";
+                this.username = username;
+                this.channel = channel;
+                Text = $"You received a private message from '{this.username}'. Click to read it!";
             }

-            public string Username { get; }
+            private readonly string username;

-            public Channel Channel { get; }
-
-            public Action<PrivateMessageNotification> OnRemove { get; set; }
+            private readonly Channel channel;

             public override bool IsImportant => false;

@@ -159,7 +157,7 @@
                 {
                     notificationOverlay.Hide();
                     chatOverlay.Show();
-                    channelManager.CurrentChannel.Value = Channel;
+                    channelManager.CurrentChannel.Value = channel;

                     return true;
                 };
@@ -172,10 +170,10 @@
             {
                 Icon = FontAwesome.Solid.At;
                 Text = $"Your name was mentioned in chat by '{username}'. Click to find out why!";
-                Channel = channel;
+                this.channel = channel;
             }

-            public Channel Channel { get; }
+            private readonly Channel channel;

             public override bool IsImportant => false;

@@ -188,7 +186,7 @@
                 {
                     notificationOverlay.Hide();
                     chatOverlay.Show();
-                    channelManager.CurrentChannel.Value = Channel;
+                    channelManager.CurrentChannel.Value = channel;

                     return true;
                 };


Don't serialise path version

Don't serialise path version

--- osu.Game/Rulesets/Objects/SliderPath.cs
+++ osu.Game/Rulesets/Objects/SliderPath.cs
@@ -18,6 +18,7 @@
         /// <summary>
         /// The current version of this <see cref="SliderPath"/>. Updated when any change to the path occurs.
         /// </summary>
+        [JsonIgnore]
         public IBindable<int> Version => version;

         private readonly Bindable<int> version = new Bindable<int>();


#1041 The 'difficulty stars' are showing higher.

--- unity/Assets/Scripts/UI/Screens/QuestSelectionScreen.cs
+++ unity/Assets/Scripts/UI/Screens/QuestSelectionScreen.cs
@@ -1089,14 +1089,14 @@

                     ui = new UIElement(scrollArea.GetScrollTransform());
                     difficulty_string_width = ui.GetStringWidth(difficulty_symbol + difficulty_symbol + difficulty_symbol + difficulty_symbol + difficulty_symbol, font_size);
-                    ui.SetLocation(UIScaler.GetHCenter() + (difficulty_text_offset - 5.5f), top_text_y + 0.1f, difficulty_string_width+1, 1);
+                    ui.SetLocation(UIScaler.GetHCenter() + (difficulty_text_offset - 5.5f), top_text_y + 0.1f, difficulty_string_width, 1);
                     ui.SetText(difficulty_symbol + difficulty_symbol + difficulty_symbol + difficulty_symbol + difficulty_symbol, grey_transparent_text);
                     ui.SetTextAlignment(TextAnchor.LowerLeft);
                     ui.SetBGColor(Color.clear);
                     ui.SetFontSize(font_size);

                     UIElementCropped uic = new UIElementCropped(scrollArea.GetScrollTransform());
-                    uic.SetLocation(UIScaler.GetHCenter() + (difficulty_text_offset - 5.5f), top_text_y + 0.1f, difficulty_string_width + 1, 1);
+                    uic.SetLocation(UIScaler.GetHCenter() + (difficulty_text_offset - 5.5f), top_text_y + 0.1f, difficulty_string_width, 1);
                     uic.SetText(difficulty_symbol + difficulty_symbol + difficulty_symbol + difficulty_symbol + difficulty_symbol, Color.black);
                     uic.SetTextAlignment(TextAnchor.LowerLeft);
                     uic.SetBGColor(Color.clear);


bug fix - ThreadLocalTransactionKeeper：在CallContext中残余的实例会导致后续事务不能正常运作。

--- cmstar.Data/ThreadLocalTransactionKeeper.cs
+++ cmstar.Data/ThreadLocalTransactionKeeper.cs
@@ -43,7 +43,12 @@
             lock (SyncBlock)
             {
                 keeper = (ThreadLocalTransactionKeeper)CallContext.LogicalGetData(CallContextName);
-                if (keeper == null)
+
+                // 同一个上下文（CallContext）的代码可能重复的开启关闭多次事务，每次提交或回滚后，再次开启新
+                // 事务时，应创建新的实例，避免拿到之前已经 Dispose 的实例。
+                // 虽然 Dispose 时会将 CallContext 里的引用清理掉，但每个方法的文档都说*可能会*抛出异常，为了
+                // 防止没有成功清理，这里也判断一下 _disposed 字段的值。
+                if (keeper == null || keeper._disposed)
                 {
                     keeper = new ThreadLocalTransactionKeeper(dbProviderFactory, connectionString);
                     CallContext.LogicalSetData(CallContextName, keeper);
@@ -178,11 +183,14 @@
                 //关闭数据库连接，若此时事务未完成，则会被数据库回滚
                 if (LocalConnectionInitialized())
                     _connection.Dispose();
-
+            }
+            finally
+            {
                 _disposed = true;
-            }
-            finally
-            {
+
+                // 用完后，需要从 CallContext 里清理掉当前对象的引用，否则引用会被一直保持着。
+                CallContext.LogicalSetData(CallContextName, null);
+
                 //显式释放资源时，阻止GC调用Finalize方法
                 if (disposing)
                     GC.SuppressFinalize(this);


Changes for releasing v4.9.3.4

Changes for releasing v4.9.3.4

git-svn-id: f6be4fc6801212b6461a9a76948e7afa54479b7a@75470 142e9c35-602f-4880-9f37-ec48a24daa6a

--- Demo/MWLite.GUI/Properties/AssemblyInfo.cs
+++ Demo/MWLite.GUI/Properties/AssemblyInfo.cs
@@ -5,13 +5,13 @@
 // General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
-[assembly: AssemblyTitle("MapWinGIS.Demo")]
-[assembly: AssemblyDescription("")]
+[assembly: AssemblyTitle("MapWindow GIS Lite")]
+[assembly: AssemblyDescription("Lite version of MapWindow GIS using the latest version of MapWinGIS")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("MapWinGIS.Demo")]
-[assembly: AssemblyCopyright("Copyright ©  2014")]
-[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCompany("MapWindow Open Source GIS Community")]
+[assembly: AssemblyProduct("MapWindow GIS Lite")]
+[assembly: AssemblyCopyright("Copyright © 2014-2015")]
+[assembly: AssemblyTrademark("MapWindow Open Source GIS Community")]
 [assembly: AssemblyCulture("")]

 // Setting ComVisible to false makes the types in this assembly not visible
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.0.4.*")]
+[assembly: AssemblyFileVersion("1.0.4.0")]


Add "Search" widget no base url warning

Add "Search" widget no base url warning

--- DesktopWidgets/Widgets/Search/ViewModel.cs
+++ DesktopWidgets/Widgets/Search/ViewModel.cs
@@ -1,4 +1,5 @@
 using System.Diagnostics;
+using System.Windows;
 using System.Windows.Input;
 using DesktopWidgets.Classes;
 using DesktopWidgets.Helpers;
@@ -40,6 +41,11 @@

         private void GoExecute()
         {
+            if (string.IsNullOrWhiteSpace(Settings.BaseUrl))
+            {
+                Popup.Show("You must setup a base url first.", MessageBoxButton.OK, MessageBoxImage.Exclamation);
+                return;
+            }
             var searchText = SearchText;
             SearchText = string.Empty;
             Process.Start($"{Settings.BaseUrl}{searchText}");


Remove some old code in OldArrowKeyListener

--- EndlessClient/Input/OldArrowKeyListener.cs
+++ EndlessClient/Input/OldArrowKeyListener.cs
@@ -9,8 +9,6 @@
 using EOLib.Domain.Character;
 using EOLib.IO.Map;
 using EOLib.Localization;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Input;
 using XNAControls;

 namespace EndlessClient.Input
@@ -26,75 +24,6 @@
             if (Game.Components.Any(x => x is OldArrowKeyListener))
                 throw new InvalidOperationException("The game already contains an arrow key listener");
             Game.Components.Add(this);
-        }
-
-        public override void Update(GameTime gameTime)
-        {
-            if (!IgnoreInput && Character.State != CharacterActionState.Walking)
-            {
-                UpdateInputTime();
-                KeyboardState currentKeyState = Keyboard.GetState();
-
-                EODirection direction = _getDirectionFromKeyPress(currentKeyState);
-                if (direction != EODirection.Invalid) //invalid direction: arrow key was not pressed
-                {
-                    byte destX, destY;
-                    _getDestCoordinates(direction, out destX, out destY);
-
-                    //if (Character.RenderData.facing != direction) //face correct direction if needed
-                    //{
-                    //    Character.Face(direction);
-                    //}
-                    if(destX < 255 && destY < 255)
-                    {
-                        _checkSpecAndWalkIfValid(destX, destY, direction);
-                    }
-                }
-            }
-            base.Update(gameTime);
-        }
-
-        private EODirection _getDirectionFromKeyPress(KeyboardState currentKeyState)
-        {
-            EODirection direction;
-            if (currentKeyState.IsKeyHeld(PreviousKeyState, Keys.Up))
-                direction = EODirection.Up;
-            else if (currentKeyState.IsKeyHeld(PreviousKeyState, Keys.Down))
-                direction = EODirection.Down;
-            else if (currentKeyState.IsKeyHeld(PreviousKeyState, Keys.Left))
-                direction = EODirection.Left;
-            else if (currentKeyState.IsKeyHeld(PreviousKeyState, Keys.Right))
-                direction = EODirection.Right;
-            else
-                direction = EODirection.Invalid;
-
-            return direction;
-        }
-
-        private void _getDestCoordinates(EODirection direction, out byte destX, out byte destY)
-        {
-            switch (direction)
-            {
-                case EODirection.Up:
-                    destX = (byte) Character.X;
-                    destY = (byte) (Character.Y - 1);
-                    break;
-                case EODirection.Down:
-                    destX = (byte) Character.X;
-                    destY = (byte) (Character.Y + 1);
-                    break;
-                case EODirection.Right:
-                    destX = (byte) (Character.X + 1);
-                    destY = (byte) Character.Y;
-                    break;
-                case EODirection.Left:
-                    destX = (byte) (Character.X - 1);
-                    destY = (byte) Character.Y;
-                    break;
-                default:
-                    destX = destY = 255;
-                    break;
-            }
         }

         private void _checkSpecAndWalkIfValid(byte destX, byte destY, EODirection direction)


Add rationale.

Add rationale.

--- Eutherion/Win/Storage/ITypeErrorBuilder.cs
+++ Eutherion/Win/Storage/ITypeErrorBuilder.cs
@@ -2,7 +2,7 @@
 /*********************************************************************************
  * ITypeErrorBuilder.cs
  *
- * Copyright (c) 2004-2020 Henk Nicolai
+ * Copyright (c) 2004-2022 Henk Nicolai
  *
  *    Licensed under the Apache License, Version 2.0 (the "License");
  *    you may not use this file except in compliance with the License.
@@ -26,6 +26,20 @@
     /// <summary>
     /// Contains information to build an error message caused by a value being of a different type than expected.
     /// </summary>
+
+    // The idea of this design is that both ITypeErrorBuilders and actual PTypeErrors both allocate little memory,
+    // because:
+    //
+    // a) There are only very few ITypeErrorBuilder instances, one for each PType, plus a few indexed type error
+    //    builders, which in turn are small too.
+    // b) PTypeErrors contain only what's necessary to display the error somewhere, i.e. a source position and range,
+    //    and most of the time a property key and a value display string.
+    // c) No references are kept to any syntax structures, they are only given as arguments to methods of this
+    //    interface to transform an error into a meaningful message in various stages.
+    //
+    // The ITypeErrorBuilder is generated from a typecheck of a single value, regardless of where it occurs in
+    // the source. The builder is then used to generate a proper (unlocalized) PTypeError in the context of the source.
+
     public interface ITypeErrorBuilder
     {
         /// <summary>


Fixed bug in serialization code

Fixed bug in serialization code

--- ExpandoDB.Server/Web/NetJSONSerrializer.cs
+++ ExpandoDB.Server/Web/NetJSONSerrializer.cs
@@ -13,7 +13,8 @@
     /// </summary>
     public class NetJSONSerializer : ISerializer
     {
-        private readonly Json.JavaScriptSerializer _defaultSerializer = new Json.JavaScriptSerializer();
+        private readonly Json.JavaScriptSerializer _defaultSerializer = new Json.JavaScriptSerializer { RetainCasing = true, ISO8601DateFormat = true };
+        private readonly Type _typeOfIResponseDto = typeof(IResponseDto);

         #region Implementation of ISerializer

@@ -43,7 +44,7 @@
                 var modelType = model.GetType();
                 var json = String.Empty;

-                if (modelType is IResponseDto)
+                if (_typeOfIResponseDto.IsAssignableFrom(modelType))
                     json = global::NetJSON.NetJSON.Serialize(modelType, model);
                 else
                     json = _defaultSerializer.Serialize(model);


organized using

organized using

--- FHStarterApp/FHStarterApp/MainPage.xaml.cs
+++ FHStarterApp/FHStarterApp/MainPage.xaml.cs
@@ -1,14 +1,6 @@
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Windows;
-using System.Windows.Controls;
 using System.Windows.Navigation;
 using Microsoft.Phone.Controls;
-using Microsoft.Phone.Shell;
-using FHStarterApp.Resources;
-using FHSDK;
 using FHSDK.Phone;

 namespace FHStarterApp
@@ -24,14 +16,14 @@
             //BuildLocalizedApplicationBar();
         }

-        protected async override void OnNavigatedTo(NavigationEventArgs e)
+        protected override async void OnNavigatedTo(NavigationEventArgs e)
         {
             base.OnNavigatedTo(e);
             try
             {
                 await FHClient.Init();
             }
-            catch (Exception ex)
+            catch (Exception)
             {

             }


i tired....

i tired....

--- Grabacr07.KanColleWrapper/PreviewBattle.cs
+++ Grabacr07.KanColleWrapper/PreviewBattle.cs
@@ -52,6 +52,7 @@
 			proxy.api_req_combined_battle_battle.TryParse<kcsapi_battle>().Subscribe(x => this.Battle(true, x.Data));
 			proxy.api_req_combined_battle_midnight_battle.TryParse<kcsapi_midnight_battle>().Subscribe(x => this.MidBattle(true, x.Data));
 			proxy.api_req_combined_battle_battle_water.TryParse<kcsapi_battle>().Subscribe(x => this.Battle(true, x.Data));
+			proxy.api_req_map_start.Subscribe(x => this.Cleared());

 			proxy.api_req_sortie_battleresult.TryParse().Subscribe(x => this.Result());
 			proxy.api_req_combined_battle_battleresult.TryParse().Subscribe(x => this.Result());


consolidated some extension methods

consolidated some extension methods

--- Bogosoft.Collections.Async/IAsyncEnumerableExtensions.cs
+++ Bogosoft.Collections.Async/IAsyncEnumerableExtensions.cs
@@ -16,20 +16,6 @@
         /// <typeparam name="T">The type of the items capable of being enumerated.</typeparam>
         /// <param name="source">The current <see cref="IAsyncEnumerable{T}"/> implementation.</param>
         /// <param name="target">An indexable collection to copy enumerated items into.</param>
-        /// <returns>
-        /// A value corresponding to the number of items copied.
-        /// </returns>
-        public static Task<int> CopyToAsync<T>(this IAsyncEnumerable<T> source, IList<T> target)
-        {
-            return source.CopyToAsync(target, 0, target.Count, CancellationToken.None);
-        }
-
-        /// <summary>
-        /// Copy items from the current enumerable structure sequentially to a target indexable collection.
-        /// </summary>
-        /// <typeparam name="T">The type of the items capable of being enumerated.</typeparam>
-        /// <param name="source">The current <see cref="IAsyncEnumerable{T}"/> implementation.</param>
-        /// <param name="target">An indexable collection to copy enumerated items into.</param>
         /// <param name="token">A <see cref="CancellationToken"/> object.</param>
         /// <returns>
         /// A value corresponding to the number of items copied.
@@ -37,35 +23,10 @@
         public static Task<int> CopyToAsync<T>(
             this IAsyncEnumerable<T> source,
             IList<T> target,
-            CancellationToken token
+            CancellationToken token = default(CancellationToken)
             )
         {
             return source.CopyToAsync(target, 0, target.Count, token);
-        }
-
-        /// <summary>
-        /// Copy items from the current enumerable structure sequentially to a target indexable collection.
-        /// </summary>
-        /// <typeparam name="T">The type of the items capable of being enumerated.</typeparam>
-        /// <param name="source">The current <see cref="IAsyncEnumerable{T}"/> implementation.</param>
-        /// <param name="target">An indexable collection to copy enumerated items into.</param>
-        /// <param name="start">
-        /// A value corresponding to the index of the target to begin copying into.
-        /// </param>
-        /// <param name="count">
-        /// A value corresponding to the maximum number of items to copy.
-        /// </param>
-        /// <returns>
-        /// A value corresponding to the number of items copied.
-        /// </returns>
-        public static Task<int> CopyToAsync<T>(
-            this IAsyncEnumerable<T> source,
-            IList<T> target,
-            int start,
-            int count
-            )
-        {
-            return source.CopyToAsync(target, start, count, CancellationToken.None);
         }

         /// <summary>
@@ -89,7 +50,7 @@
             IList<T> target,
             int start,
             int count,
-            CancellationToken token
+            CancellationToken token = default(CancellationToken)
             )
         {
             var copied = 0;
@@ -110,20 +71,12 @@
         /// </summary>
         /// <typeparam name="T">The type of the items to be included in the array.</typeparam>
         /// <param name="source">The current <see cref="IAsyncEnumerable{T}"/> implementation.</param>
-        /// <returns>An array of items of the enumerated type.</returns>
-        public static Task<T[]> ToArrayAsync<T>(this IAsyncEnumerable<T> source)
-        {
-            return source.ToArrayAsync(CancellationToken.None);
-        }
-
-        /// <summary>
-        /// Convert the current asynchronously enumerable type to an array.
-        /// </summary>
-        /// <typeparam name="T">The type of the items to be included in the array.</typeparam>
-        /// <param name="source">The current <see cref="IAsyncEnumerable{T}"/> implementation.</param>
         /// <param name="token">A <see cref="CancellationToken"/> object.</param>
         /// <returns>An array of items of the enumerated type.</returns>
-        public static async Task<T[]> ToArrayAsync<T>(this IAsyncEnumerable<T> source, CancellationToken token)
+        public static async Task<T[]> ToArrayAsync<T>(
+            this IAsyncEnumerable<T> source,
+            CancellationToken token = default(CancellationToken)
+            )
         {
             if (token.IsCancellationRequested)
             {
@@ -160,20 +113,12 @@
         /// </summary>
         /// <typeparam name="T">The type of the items to be included in the list.</typeparam>
         /// <param name="source">The current <see cref="IAsyncEnumerable{T}"/> implementation.</param>
-        /// <returns>A list of items of the enumerated type.</returns>
-        public static Task<List<T>> ToListAsync<T>(this IAsyncEnumerable<T> source)
-        {
-            return source.ToListAsync(CancellationToken.None);
-        }
-
-        /// <summary>
-        /// Convert the current asynchronously enumerable type to a list.
-        /// </summary>
-        /// <typeparam name="T">The type of the items to be included in the list.</typeparam>
-        /// <param name="source">The current <see cref="IAsyncEnumerable{T}"/> implementation.</param>
         /// <param name="token">A <see cref="CancellationToken"/> object.</param>
         /// <returns>A list of items of the enumerated type.</returns>
-        public static async Task<List<T>> ToListAsync<T>(this IAsyncEnumerable<T> source, CancellationToken token)
+        public static async Task<List<T>> ToListAsync<T>(
+            this IAsyncEnumerable<T> source,
+            CancellationToken token = default(CancellationToken)
+            )
         {
             if (token.IsCancellationRequested)
             {


bug fix

bug fix

--- DarkStatsCore/SettingsLib.cs
+++ DarkStatsCore/SettingsLib.cs
@@ -6,19 +6,17 @@

 public class SettingsLib
 {
-    public bool InvalidSettings { get; internal set; }
+    public bool InvalidSettings => !string.IsNullOrEmpty(Url);
     public string Url
     {
         get
         {
             try
             {
-                InvalidSettings = false;
                 return GetSetting(_urlKey).StringValue;
             }
             catch
             {
-                InvalidSettings = true;
                 return string.Empty;
             }
         }
@@ -33,7 +31,6 @@
             }
             catch
             {
-                InvalidSettings = true;
                 return TimeSpan.FromSeconds(60);
             }
         }
@@ -48,7 +45,6 @@
             }
             catch
             {
-                InvalidSettings = true;
                 return TimeSpan.FromSeconds(1);
             }
         }


Implement ITextInputMethodClient for TextArea

--- src/AvaloniaEdit/Editing/TextArea.cs
+++ src/AvaloniaEdit/Editing/TextArea.cs
@@ -22,6 +22,7 @@
 using Avalonia.Controls.Primitives;
 using Avalonia.Data;
 using Avalonia.Input;
+using Avalonia.Input.TextInput;
 using Avalonia.Interactivity;
 using Avalonia.Media;
 using Avalonia.Threading;
@@ -54,6 +55,8 @@

         private ILogicalScrollable _logicalScrollable;

+        private readonly TextAreaTextInputMethodClient _imClient = new TextAreaTextInputMethodClient();
+
         #region Constructor
         static TextArea()
         {
@@ -65,6 +68,14 @@

             AffectsArrange<TextArea>(OffsetProperty);
             AffectsRender<TextArea>(OffsetProperty);
+
+            TextInputMethodClientRequestedEvent.AddClassHandler<TextArea>((ta, e) =>
+            {
+                if (!ta.IsReadOnly)
+                {
+                    e.Client = ta._imClient;
+                }
+            });
         }

         /// <summary>
@@ -745,12 +756,14 @@
             // First activate IME, then show caret
             //ime.OnGotKeyboardFocus(e);
             Caret.Show();
+            _imClient.SetTextArea(this);
         }

         protected override void OnLostFocus(RoutedEventArgs e)
         {
             base.OnLostFocus(e);
             Caret.Hide();
+            _imClient.SetTextArea(null);
             //ime.OnLostKeyboardFocus(e);
         }
         #endregion
@@ -1122,6 +1135,122 @@
         {
             _logicalScrollable?.RaiseScrollInvalidated(e);
         }
+
+        private class TextAreaTextInputMethodClient : ITextInputMethodClient
+        {
+            private TextArea _textArea;
+
+            public TextAreaTextInputMethodClient()
+            {
+
+            }
+
+            public event EventHandler CursorRectangleChanged;
+            public event EventHandler TextViewVisualChanged;
+            public event EventHandler SurroundingTextChanged;
+
+            public Rect CursorRectangle
+            {
+                get
+                {
+                    if(_textArea == null)
+                    {
+                        return Rect.Empty;
+                    }
+
+                    var transform = _textArea.TextView.TransformToVisual(_textArea);
+
+                    if (transform == null)
+                    {
+                        return default;
+                    }
+
+                    var rect = _textArea.Caret.CalculateCaretRectangle().TransformToAABB(transform.Value);
+
+                    return rect;
+                }
+            }
+
+            public IVisual TextViewVisual => _textArea;
+
+            public bool SupportsPreedit => true;
+
+            public bool SupportsSurroundingText => true;
+
+            public TextInputMethodSurroundingText SurroundingText
+            {
+                get
+                {
+                    if(_textArea == null)
+                    {
+                        return default;
+                    }
+
+                    var selection = _textArea.Selection;
+
+                    var documentLine = _textArea.Document.GetLineByNumber(selection.StartPosition.Line);
+
+                    var text = _textArea.Document.GetText(documentLine.Offset, documentLine.Length);
+
+                    return new TextInputMethodSurroundingText
+                    {
+                        AnchorOffset = selection.StartPosition.Column,
+                        CursorOffset = selection.EndPosition.Column,
+                        Text = text
+                    };
+                }
+            }
+
+            public void SetTextArea(TextArea textArea)
+            {
+                if(_textArea != null)
+                {
+                    _textArea.Caret.PositionChanged -= Caret_PositionChanged;
+                    _textArea.SelectionChanged -= TextArea_SelectionChanged;
+                }
+
+                _textArea = textArea;
+
+                if(_textArea != null)
+                {
+                    _textArea.Caret.PositionChanged += Caret_PositionChanged;
+                    _textArea.SelectionChanged += TextArea_SelectionChanged;
+                }
+
+                TextViewVisualChanged?.Invoke(this, EventArgs.Empty);
+
+                CursorRectangleChanged?.Invoke(this, EventArgs.Empty);
+            }
+
+            private void Caret_PositionChanged(object sender, EventArgs e)
+            {
+                CursorRectangleChanged?.Invoke(this, e);
+            }
+
+            private void TextArea_SelectionChanged(object sender, EventArgs e)
+            {
+                SurroundingTextChanged?.Invoke(this, e);
+            }
+
+            public void SelectInSurroundingText(int start, int end)
+            {
+                if(_textArea == null)
+                {
+                    return;
+                }
+
+                var selection = _textArea.Selection;
+
+                _textArea.Selection = _textArea.Selection.StartSelectionOrSetEndpoint(
+                    new TextViewPosition(selection.StartPosition.Line, start),
+                    new TextViewPosition(selection.StartPosition.Line, end));
+            }
+
+            public void SetPreeditText(string text)
+            {
+
+            }
+        }
     }

     /// <summary>


Fix the DebugCurrentPDFLayout on Linux

Fix the DebugCurrentPDFLayout on Linux

Using Chrome.exe doesn't work on Linux, so instead we use xdg-open which will
open the file in the default browser.

--- src/BloomExe/Publish/PublishModel.cs
+++ src/BloomExe/Publish/PublishModel.cs
@@ -326,7 +326,11 @@

 //			System.Diagnostics.Process.Start(tempHtml.Path);

-			System.Diagnostics.Process.Start("Chrome.exe",MakeFinalHtmlForPdfMaker().Path);
+			var htmlFilePath = MakeFinalHtmlForPdfMaker().Path;
+			if (Palaso.PlatformUtilities.Platform.IsWindows)
+				Process.Start("Chrome.exe", htmlFilePath);
+			else
+				Process.Start("xdg-open", htmlFilePath);
 		}

 		public void RefreshValuesUponActivation()


Set MoverController angular velocities to zero (#10715)

--- Content.Shared/Movement/Systems/SharedMoverController.cs
+++ Content.Shared/Movement/Systems/SharedMoverController.cs
@@ -233,6 +233,9 @@
                 Accelerate(ref velocity, in worldTotal, accel, frameTime);

             PhysicsSystem.SetLinearVelocity(physicsComponent, velocity);
+
+            // Ensures that players do not spiiiiiiin
+            PhysicsSystem.SetAngularVelocity(physicsComponent, 0);
         }

         private void Friction(float minimumFrictionSpeed, float frameTime, float friction, ref Vector2 velocity)


minor changes

minor changes

--- src/BusinessLogic/CommandsHandler.cs
+++ src/BusinessLogic/CommandsHandler.cs
@@ -199,7 +199,7 @@
             else
             {

-                var fileExists = browsing.IsFileExists(Path.GetFileName(parameters.From));
+                var fileExists = browsing.FileExists(Path.GetFileName(parameters.From));
                 if (fileExists)
                 {
                     if (_output.IsOutputRedirected)


Update PseudoAssembler.cs

Update PseudoAssembler.cs

--- DotNetAsm/PseudoAssembler.cs
+++ DotNetAsm/PseudoAssembler.cs
@@ -1,4 +1,4 @@
-//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
 // Copyright (c) 2017 informedcitizenry <informedcitizenry@gmail.com>
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -116,6 +116,27 @@
         }

         /// <summary>
+        /// Get the offset and size of the operand of a .binary file
+        /// </summary>
+        /// <param name="args">The System.Collections.Generic.List<string> arguments</param>
+        /// <param name="binarysize">The size of the binary file</param>
+        /// <param name="offs">The offset</param>
+        /// <param name="size">The size</param>
+        private void GetBinaryOffsetSize(List<string> args, int binarysize, ref int offs, ref int size)
+        {
+            if (args.Count >= 2)
+            {
+                offs = (int)Controller.Evaluator.Eval(args[1], ushort.MinValue, ushort.MaxValue);
+                if (args.Count == 3)
+                    size = (int)Controller.Evaluator.Eval(args[2], ushort.MinValue, ushort.MaxValue);
+            }
+            if (offs > binarysize - 1)
+                offs = binarysize - 1;
+            if (size > binarysize - offs)
+                size = binarysize - offs;
+        }
+
+        /// <summary>
         /// Assemble an included binary file's bytes.
         /// </summary>
         /// <param name="line">The SourceLine to assemble.</param>
@@ -126,17 +147,7 @@
             if (binary == null)
                 throw new Exception("Unable to find binary file " + args[0]);
             int offs = 0, size = binary.Data.Count;
-
-            if (args.Count >= 2)
-            {
-                offs = (int)Controller.Evaluator.Eval(args[1], ushort.MinValue, ushort.MaxValue);
-                if (args.Count == 3)
-                    size = (int)Controller.Evaluator.Eval(args[2], ushort.MinValue, ushort.MaxValue);
-            }
-            if (offs > binary.Data.Count - 1)
-                offs = binary.Data.Count - 1;
-            if (size > binary.Data.Count - offs)
-                size = binary.Data.Count - offs;
+            GetBinaryOffsetSize(args, size, ref offs, ref size);
             if (size > ushort.MaxValue)
             {
                 Controller.Log.LogEntry(line, ErrorStrings.IllegalQuantity, size.ToString());
@@ -151,9 +162,8 @@
         /// </summary>
         /// <param name="line">The SourceLine to assemble.</param>
         /// <returns>Returns a binary file.</returns>
-        private BinaryFile IncludeBinary(SourceLine line)
-        {
-            var args = line.CommaSeparateOperand();
+        private BinaryFile IncludeBinary(SourceLine line, List<string> args)
+        {
             if (args.Count == 0 || args.First().EnclosedInQuotes() == false)
             {
                 if (args.Count == 0)
@@ -264,24 +274,10 @@
                     }
                 case ".binary":
                     {
-                        Int64 boffset = 0;
-                        var binary = IncludeBinary(line);
-                        Int64 bsize = binary.Data.Count;
-                        if (csv.Count > 1)
-                        {
-                            boffset = Controller.Evaluator.Eval(csv[1]);
-                            if (boffset < 0)
-                            {
-                                Controller.Log.LogEntry(line, ErrorStrings.IllegalQuantity, boffset.ToString());
-                                return 0;
-                            }
-                            if (csv.Count > 2)
-                                bsize = Controller.Evaluator.Eval(csv.Last());
-                            else
-                                bsize = binary.Data.Count;
-                            if (bsize > binary.Data.Count - boffset)
-                                bsize = binary.Data.Count - boffset;
-                        }
+                        int boffset = 0;
+                        var binary = IncludeBinary(line, csv);
+                        int bsize = binary.Data.Count;
+                        GetBinaryOffsetSize(csv, bsize, ref boffset, ref bsize);
                         return Convert.ToUInt16(bsize);
                     }
                 case ".byte":


Broke up dataset generation method into smaller bits

--- EDDiscovery/3DMap/FormMap.cs
+++ EDDiscovery/3DMap/FormMap.cs
@@ -42,8 +42,8 @@
         private SystemClass _centerSystem;
         private bool _loaded = false;

-        private float _screenX = 0.0f;
-        private float _screenY = 0.0f;
+        private float _systemOffsetX = 0.0f;
+        private float _systemOffsetY = 0.0f;
         private float _zoom = 1.0f;
         private float _xAng = 0.0f;
         private float _yAng = 90.0f;
@@ -135,8 +135,8 @@

         private void ResetCamera()
         {
-            _screenX = 0.0f;
-            _screenY = 0.0f;
+            _systemOffsetX = 0.0f;
+            _systemOffsetY = 0.0f;

             _xAng = 0.0f;
             _yAng = 90.0f;
@@ -197,25 +197,47 @@

             _datasets = new List<IData3DSet>();

-
+            BuildGridLines();
+            AddStandardSystemsToDataset();
+            AddStationsToDataset();
+            AddVisitedSystemsToDataset();
+            AddCenterPointToDataset();
+            AddPOIsToDataset();
+            AddTrilaterationInfoToDataset();
+        }
+
+        private void BuildGridLines()
+        {
             if (toolStripButtonGrid.Checked)
             {
                 bool addstations = !toolStripButtonStations.Checked;
                 var datasetGrid = new Data3DSetClass<LineData>("grid", (Color)System.Drawing.ColorTranslator.FromHtml("#296A6C"), 0.6f);

-                for (int xx = -40000; xx <= 40000; xx += 1000)
-                    {
-                        datasetGrid.Add(new LineData(xx - CenterSystem.x, 0 - CenterSystem.y, CenterSystem.x  - - 20000,
-                            xx - CenterSystem.x, 0 - CenterSystem.y, CenterSystem.z - 70000));
-                    }
-                    for (int zz = -20000; zz <= 70000; zz += 1000)
-                                        datasetGrid.Add(new LineData(-40000 - CenterSystem.x, 0 - CenterSystem.y, CenterSystem.z - zz,
-                         40000 - CenterSystem.x, 0 - CenterSystem.y, CenterSystem.z - zz));
-
-                    _datasets.Add(datasetGrid);
-            }
-
-
+                for (int x = -50000; x <= 50000; x += 1000)
+                {
+                    datasetGrid.Add(new LineData(x - CenterSystem.x,
+                        0 - CenterSystem.y,
+                        CenterSystem.x - -20000,
+                        x - CenterSystem.x,
+                        0 - CenterSystem.y,
+                        CenterSystem.z - 70000));
+                }
+                for (int z = -20000; z <= 70000; z += 1000)
+                {
+                    datasetGrid.Add(new LineData(-40000 - CenterSystem.x,
+                        0 - CenterSystem.y,
+                        CenterSystem.z - z,
+                        40000 - CenterSystem.x,
+                        0 - CenterSystem.y,
+                        CenterSystem.z - z));
+                }
+
+                _datasets.Add(datasetGrid);
+            }
+        }
+
+        private void AddStandardSystemsToDataset()
+        {
             if (toolStripButtonShowAllStars.Checked)
             {
                 bool addstations = !toolStripButtonStations.Checked;
@@ -223,31 +245,36 @@

                 foreach (SystemClass si in _starList)
                 {
-                    if (addstations  || si.population==0)
+                    if (addstations || si.population == 0)
                         AddSystem(si, datasetS);
                 }
                 _datasets.Add(datasetS);
             }
-
-
+        }
+
+        private void AddStationsToDataset()
+        {
             if (toolStripButtonStations.Checked)
             {
                 var datasetS = new Data3DSetClass<PointData>("stations", Color.RoyalBlue, 1.0f);

                 foreach (SystemClass si in _starList)
                 {
-                   if (si.population>0)
+                    if (si.population > 0)
                         AddSystem(si, datasetS);
                 }
                 _datasets.Add(datasetS);
             }
-
+        }
+
+        private void AddVisitedSystemsToDataset()
+        {
             if (VisitedSystems != null && VisitedSystems.Any())
             {
                 SystemClass lastknownps = null;
                 foreach (SystemPosition ps in VisitedSystems)
                 {
-                    if (ps.curSystem!=null && ps.curSystem.HasCoordinate)
+                    if (ps.curSystem != null && ps.curSystem.HasCoordinate)
                     {
                         ps.lastKnownSystem = lastknownps;
                         lastknownps = ps.curSystem;
@@ -266,13 +293,13 @@
                 {
                     if (toolStripButtonDrawLines.Checked)
                     {
-                        Data3DSetClass<LineData>  datasetl = new Data3DSetClass<LineData>("visitedstars" + colour.Key.ToString(), Color.FromArgb(colour.Key), 2.0f);
+                        Data3DSetClass<LineData> datasetl = new Data3DSetClass<LineData>("visitedstars" + colour.Key.ToString(), Color.FromArgb(colour.Key), 2.0f);
                         foreach (SystemPosition sp in colour)
                         {
-                            if (sp.curSystem != null && sp.curSystem.HasCoordinate && sp.lastKnownSystem!=null && sp.lastKnownSystem.HasCoordinate)
+                            if (sp.curSystem != null && sp.curSystem.HasCoordinate && sp.lastKnownSystem != null && sp.lastKnownSystem.HasCoordinate)
                             {
                                 datasetl.Add(new LineData(sp.curSystem.x - CenterSystem.x, sp.curSystem.y - CenterSystem.y, CenterSystem.z - sp.curSystem.z,
-                                    sp.lastKnownSystem.x - CenterSystem.x, sp.lastKnownSystem.y - CenterSystem.y,  CenterSystem.z - sp.lastKnownSystem.z));
+                                    sp.lastKnownSystem.x - CenterSystem.x, sp.lastKnownSystem.y - CenterSystem.y, CenterSystem.z - sp.lastKnownSystem.z));

                             }
                         }
@@ -286,7 +313,7 @@
                             SystemClass star = SystemData.GetSystem(sp.Name);
                             if (star != null && star.HasCoordinate)
                             {
-
+
                                 AddSystem(star, datasetvs);
                             }
                         }
@@ -295,21 +322,28 @@

                 }
             }
-
-
+        }
+
+        private void AddCenterPointToDataset()
+        {
             var dataset = new Data3DSetClass<PointData>("Center", Color.Yellow, 5.0f);

             //GL.Enable(EnableCap.ProgramPointSize);
             dataset.Add(new PointData(0, 0, 0));
             _datasets.Add(dataset);
-
-            dataset = new Data3DSetClass<PointData>("Interest", Color.Purple, 10.0f);
+        }
+
+        private void AddPOIsToDataset()
+        {
+            var dataset = new Data3DSetClass<PointData>("Interest", Color.Purple, 10.0f);
             AddSystem("sol", dataset);
             AddSystem("sagittarius a*", dataset);
             //AddSystem("polaris", dataset);
             _datasets.Add(dataset);
-
-
+        }
+
+        private void AddTrilaterationInfoToDataset()
+        {
             if (ReferenceSystems != null && ReferenceSystems.Any())
             {
                 var referenceLines = new Data3DSetClass<LineData>("CurrentReference", Color.Green, 5.0f);
@@ -341,7 +375,6 @@
                 System.Diagnostics.Trace.WriteLine("Reference stars time " + sw.Elapsed.TotalSeconds.ToString("0.000s"));
                 _datasets.Add(lineSet);
             }
-
         }

         private void AddSystem(string systemName, Data3DSetClass<PointData> dataset)
@@ -657,7 +690,7 @@
             GL.MatrixMode(MatrixMode.Modelview);
             GL.LoadIdentity();

-            GL.Translate(_screenX, _screenY, 0); // position triangle according to our x variable
+            GL.Translate(_systemOffsetX, _systemOffsetY, 0); // position triangle according to our x variable
             GL.Rotate(_xAng, 0, 1, 0);
             GL.Rotate(_yAng, 1, 0, 0);
             GL.Scale(_zoom, _zoom, _zoom);
@@ -748,8 +781,8 @@
                 //System.Diagnostics.Trace.WriteLine("dx" + dx.ToString() + " dy " + dy.ToString() + " Button " + e.Button.ToString());

-                _screenX += dx * _zoom;
-                _screenY += -dy * _zoom;
+                _systemOffsetX += dx * _zoom;
+                _systemOffsetY += -dy * _zoom;

                 SetupCursorXYZ();