959.1: shared graphics resources

959.1: shared graphics resources

--- a_mini/projects/PixelFarm/PixelFarm.Drawing.Platforms/PixelFarm.Drawing.Gdi/MiniAggGraphics/GdiPlusCanvasPainter.cs
+++ a_mini/projects/PixelFarm/PixelFarm.Drawing.Platforms/PixelFarm.Drawing.Gdi/MiniAggGraphics/GdiPlusCanvasPainter.cs
@@ -20,6 +20,9 @@
         bool _useSubPixelRendering;
         Graphics _internalGfx;
         PixelFarm.Agg.VertexSource.CurveFlattener curveFlattener;
+        System.Drawing.Font _currentFont;
+        System.Drawing.SolidBrush _currentFillBrush;
+        System.Drawing.Pen _currentPen;
         public GdiPlusCanvasPainter(CanvasGraphics2dGdi gfx)
         {
             _width = 800;
@@ -30,6 +33,9 @@
             //http://stackoverflow.com/questions/1485745/flip-coordinates-when-drawing-to-control
             _internalGfx.ScaleTransform(1.0F, -1.0F);// Flip the Y-Axis
             _internalGfx.TranslateTransform(0.0F, -(float)Height);// Translate the drawing area accordingly
+            _currentFont = new System.Drawing.Font("Tahoma", 10);
+            _currentFillBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);
+            _currentPen = new System.Drawing.Pen(System.Drawing.Color.Black);
         }
         public override RectInt ClipBox
         {
@@ -63,6 +69,7 @@
             set
             {
                 _fillColor = value;
+                _currentFillBrush.Color = VxsHelper.ToDrawingColor(value);
             }
         }

@@ -91,6 +98,7 @@
             set
             {
                 _strokeColor = value;
+                _currentPen.Color = VxsHelper.ToDrawingColor(value);
             }
         }
         public override double StrokeWidth
@@ -102,6 +110,7 @@
             set
             {
                 _strokeWidth = value;
+                _currentPen.Width = (float)value;
             }
         }

@@ -148,15 +157,11 @@
             //this version bmpdata must be 32 argb
             int a_top = area.Top;
             int a_bottom = area.Bottom;
-
             int a_width = area.Width;
             int a_stride = bmpdata.Stride;
-
-
             int a_height = Math.Abs(area.Height);
             int[] src_buffer = new int[(a_stride / 4) * a_height];
             int[] destBuffer = new int[src_buffer.Length];
-
             int a_lineOffset = area.Left * 4;
             unsafe
             {
@@ -202,7 +207,6 @@

         public override void DrawBezierCurve(float startX, float startY, float endX, float endY, float controlX1, float controlY1, float controlX2, float controlY2)
         {
-            throw new NotImplementedException();
         }

         public override void DrawEllipse()
@@ -228,7 +232,11 @@
         public override void DrawString(string text, double x, double y)
         {
             //use current brush and font
-            throw new NotImplementedException();
+            _internalGfx.ResetTransform();
+            _internalGfx.DrawString(text, _currentFont, _currentFillBrush, new System.Drawing.PointF((float)x, (float)y));
+            //restore back
+            _internalGfx.ScaleTransform(1.0F, -1.0F);// Flip the Y-Axis
+            _internalGfx.TranslateTransform(0.0F, -(float)Height);// Translate the drawing area accordingly
         }

         public override void Fill(VertexStore vxs)
@@ -264,24 +272,18 @@

         public override void FillRectangle(double left, double bottom, double right, double top)
         {
-            using (System.Drawing.SolidBrush br = new System.Drawing.SolidBrush(VxsHelper.ToDrawingColor(_fillColor)))
-            {
-                _internalGfx.FillRectangle(br, System.Drawing.RectangleF.FromLTRB((float)left, (float)top, (float)right, (float)bottom));
-            }
+            _internalGfx.FillRectangle(_currentFillBrush, System.Drawing.RectangleF.FromLTRB((float)left, (float)top, (float)right, (float)bottom));
         }
         public override void FillRectangle(double left, double bottom, double right, double top, ColorRGBA fillColor)
         {
-            using (System.Drawing.SolidBrush br = new System.Drawing.SolidBrush(VxsHelper.ToDrawingColor(fillColor)))
-            {
-                _internalGfx.FillRectangle(br, System.Drawing.RectangleF.FromLTRB((float)left, (float)top, (float)right, (float)bottom));
-            }
+            System.Drawing.Color prevColor = _currentFillBrush.Color;
+            _currentFillBrush.Color = VxsHelper.ToDrawingColor(fillColor);
+            _internalGfx.FillRectangle(_currentFillBrush, System.Drawing.RectangleF.FromLTRB((float)left, (float)top, (float)right, (float)bottom));
+            _currentFillBrush.Color = prevColor;
         }
         public override void FillRectLBWH(double left, double bottom, double width, double height)
         {
-            using (System.Drawing.SolidBrush br = new System.Drawing.SolidBrush(VxsHelper.ToDrawingColor(_fillColor)))
-            {
-                _internalGfx.FillRectangle(br, new System.Drawing.RectangleF((float)left, (float)(bottom - height), (float)width, (float)height));
-            }
+            _internalGfx.FillRectangle(_currentFillBrush, new System.Drawing.RectangleF((float)left, (float)(bottom - height), (float)width, (float)height));
         }

         public override void FillRoundRectangle(double left, double bottom, double right, double top, double radius)
@@ -300,18 +302,15 @@

         public override void Line(double x1, double y1, double x2, double y2)
         {
-            using (System.Drawing.Pen p = new System.Drawing.Pen(VxsHelper.ToDrawingColor(_strokeColor)))
-            {
-                _internalGfx.DrawLine(p, new System.Drawing.PointF((float)x1, (float)y1), new System.Drawing.PointF((float)x2, (float)y2));
-            }
+            _internalGfx.DrawLine(_currentPen, new System.Drawing.PointF((float)x1, (float)y1), new System.Drawing.PointF((float)x2, (float)y2));
         }

         public override void Line(double x1, double y1, double x2, double y2, ColorRGBA color)
         {
-            using (System.Drawing.Pen p = new System.Drawing.Pen(VxsHelper.ToDrawingColor(color)))
-            {
-                _internalGfx.DrawLine(p, new System.Drawing.PointF((float)x1, (float)y1), new System.Drawing.PointF((float)x2, (float)y2));
-            }
+            var prevColor = _currentPen.Color;
+            _currentPen.Color = VxsHelper.ToDrawingColor(color);
+            _internalGfx.DrawLine(_currentPen, new System.Drawing.PointF((float)x1, (float)y1), new System.Drawing.PointF((float)x2, (float)y2));
+            _currentPen.Color = prevColor;
         }
         public override void PaintSeries(VertexStore vxs, ColorRGBA[] colors, int[] pathIndexs, int numPath)
         {
@@ -323,22 +322,15 @@

         public override void Rectangle(double left, double bottom, double right, double top)
         {
-            using (System.Drawing.Pen p = new System.Drawing.Pen(VxsHelper.ToDrawingColor(_strokeColor)))
-            {
-                _internalGfx.DrawRectangle(p, System.Drawing.Rectangle.FromLTRB((int)left, (int)top, (int)right, (int)bottom));
-            }
-        }
-
+            _internalGfx.DrawRectangle(_currentPen, System.Drawing.Rectangle.FromLTRB((int)left, (int)top, (int)right, (int)bottom));
+        }
         public override void Rectangle(double left, double bottom, double right, double top, ColorRGBA color)
         {
-            using (System.Drawing.Pen p = new System.Drawing.Pen(VxsHelper.ToDrawingColor(color)))
-            {
-                _internalGfx.DrawRectangle(p, System.Drawing.Rectangle.FromLTRB((int)left, (int)top, (int)right, (int)bottom));
-            }
-        }
-
+            _internalGfx.DrawRectangle(_currentPen, System.Drawing.Rectangle.FromLTRB((int)left, (int)top, (int)right, (int)bottom));
+        }
         public override void SetClipBox(int x1, int y1, int x2, int y2)
         {
+            _internalGfx.SetClip(new System.Drawing.Rectangle(x1, y1, x2 - x1, y2 - y1));
         }
     }
 }


式パーサのテスト追加

式パーサのテスト追加

--- test/ParserTest.cs
+++ test/ParserTest.cs
@@ -27,6 +27,34 @@
             var num = let.Expression.Cast<NumericNode>();
             Assert.AreEqual(num.Format, "123_456");
             Assert.AreEqual(num.Value, 123456);
+        }
+
+        [Test]
+        public void ExpressionTest()
+        {
+            var p = Parse("var a = 1 + 2 - 3");
+            Assert.AreEqual(p.Statements.Count, 1);
+            Assert.IsTrue(p.Statements[0] is LetNode);
+
+            var let = p.Statements[0].Cast<LetNode>();
+            Assert.AreEqual(let.Var.Name, "a");
+
+            Assert.IsTrue(let.Expression is FunctionCallNode);
+            var minus = let.Expression.Cast<FunctionCallNode>();
+            Assert.IsTrue(minus.Arguments[0] is FunctionCallNode);
+            var plus = minus.Arguments[0].Cast<FunctionCallNode>();
+
+            Assert.IsTrue(plus.Expression is TokenNode);
+            Assert.IsTrue(minus.Expression is TokenNode);
+            Assert.IsTrue(plus.Arguments[0] is NumericNode);
+            Assert.IsTrue(plus.Arguments[1] is NumericNode);
+            Assert.IsTrue(minus.Arguments[1] is NumericNode);
+
+            Assert.AreEqual(plus.Expression.Cast<TokenNode>().Token.Name, "+");
+            Assert.AreEqual(minus.Expression.Cast<TokenNode>().Token.Name, "-");
+            Assert.AreEqual(plus.Arguments[0].Cast<NumericNode>().Value, 1);
+            Assert.AreEqual(plus.Arguments[1].Cast<NumericNode>().Value, 2);
+            Assert.AreEqual(minus.Arguments[1].Cast<NumericNode>().Value, 3);
         }

         [Test]


Changed default value for MyInputState

Changed default value for MyInputState

--- MyHalp/MyInput.cs
+++ MyHalp/MyInput.cs
@@ -10,10 +10,10 @@
     /// </summary>
     public enum MyInputState : byte
     {
+        None = 0,
         Down,
         Up,
-        Held,
-        None
+        Held
     }

     /// <summary>


Nicer api

Nicer api

--- src/net45/Samples/WAMP2/WampSharp.Samples.Callee/Program.cs
+++ src/net45/Samples/WAMP2/WampSharp.Samples.Callee/Program.cs
@@ -81,13 +81,10 @@

         private static void ClientCode(string serverAddress, IEnumerable<IWampRpcOperation> operations)
         {
-            JTokenMsgpackObjectBinding binding = new JTokenMsgpackObjectBinding();
-
-            DefaultWampChannelFactory factory =
-                new DefaultWampChannelFactory();
+            DefaultWampChannelFactory factory = new DefaultWampChannelFactory();

             IWampChannel channel =
-                factory.CreateChannel(serverAddress, "realm1", binding);
+                factory.CreateJsonChannel(serverAddress, "realm1");

             Task task = channel.Open();
             task.Wait(5000);
@@ -104,13 +101,11 @@
                 Console.WriteLine("Connected to server.");
             }

-            var dummy = new RegisterOptions();
-
             var tasks = new List<Task>();

             foreach (IWampRpcOperation operation in operations)
             {
-                Task registrationTask = channel.RealmProxy.RpcCatalog.Register(operation, dummy);
+                Task registrationTask = channel.RealmProxy.RpcCatalog.Register(operation, new RegisterOptions());
                 tasks.Add(registrationTask);
             }


* change "* remove StreamReader creation from HttpServer's request handler (passes MemoryStream directly to HttpRequest)" from last commit didn't get committed, this adds it

--- Net/HttpServer.cs
+++ Net/HttpServer.cs
@@ -143,30 +143,29 @@
             HttpRequest req;
             HttpResponse res = new HttpResponse(tcl);

-            using (StreamReader sr = new StreamReader(ms))
-            {
-                try
+
+            try
+            {
+                req = new HttpRequest(ms);
+
+                if (this.RequestHandler != null)
                 {
-                    req = new HttpRequest(sr);
-
-                    if (this.RequestHandler != null)
-                    {
-                        this.RequestHandler(req, res);
-                    }
+                    this.RequestHandler(req, res);
                 }
-                catch (HttpException hex)
+            }
+            catch (HttpException hex)
+            {
+
+                if (this.ErrorHandler == null)
                 {
-
-                    if (this.ErrorHandler == null)
-                    {
-                        DefaultErrorHandler(hex.StatusCode, res);
-                    }
-                    else
-                    {
-                        this.ErrorHandler(hex.StatusCode, res);
-                    }
+                    DefaultErrorHandler(hex.StatusCode, res);
                 }
-            }
+                else
+                {
+                    this.ErrorHandler(hex.StatusCode, res);
+                }
+            }
+

             // These calls shouldn't throw an exception, so we'll be fine to
             // call them without checking to see if they've already been called.


Removed CurrentVersion; maybe I'll introduce it later.

--- OpenGL.Net/Egl.cs
+++ OpenGL.Net/Egl.cs
@@ -77,16 +77,6 @@
 		}

 		/// <summary>
-		/// EGL version currently implemented.
-		/// </summary>
-		public static KhronosVersion CurrentVersion { get { return (_CurrentVersion); } }
-
-		/// <summary>
-		/// EGL version currently implemented.
-		/// </summary>
-		internal static KhronosVersion _CurrentVersion;
-
-		/// <summary>
 		/// OpenGL extension support.
 		/// </summary>
 		public static Extensions CurrentExtensions { get { return (_CurrentExtensions); } }


fix compiler warning

fix compiler warning

--- test/XXHashTest.cs
+++ test/XXHashTest.cs
@@ -91,7 +91,7 @@
                 {
                     foreach (object[] item in testVectors)
                     {
-                        yield return new object[] { makeBigEndian32(item[0].ToString()), item[1], item[2], item[3] };
+                        yield return new object[] { makeBigEndian32(item[0].ToString()!), item[1], item[2], item[3] };
                     }
                 }
             }
@@ -102,7 +102,7 @@
                 {
                     foreach (object[] item in testVectors)
                     {
-                        yield return new object[] { makeBigEndian64(item[0].ToString()), item[1], item[2], item[3] };
+                        yield return new object[] { makeBigEndian64(item[0].ToString()!), item[1], item[2], item[3] };
                     }
                 }
             }


Add test for Postgres 5 issue

Add test for Postgres 5 issue

--- DistributedLock.Tests/Tests/Postgres/PostgresBehaviorTest.cs
+++ DistributedLock.Tests/Tests/Postgres/PostgresBehaviorTest.cs
@@ -2,6 +2,7 @@
 using NUnit.Framework;
 using System;
 using System.Collections.Generic;
+using System.Data;
 using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
@@ -164,5 +165,35 @@

             Assert.ThrowsAsync<NullReferenceException>(() => getPidCommand.PrepareAsync());
         }
+
+        // See https://github.com/npgsql/npgsql/issues/3442. Until that's resolved, connection monitoring
+        // is broken in 5.x
+        [Test]
+        public async Task TestExecutingQueryOnKilledConnectionFiresStateChanged()
+        {
+            using var stateChangedEvent = new ManualResetEventSlim(initialState: false);
+
+            using var connection = new NpgsqlConnection(TestingPostgresDb.ConnectionString);
+            await connection.OpenAsync();
+            connection.StateChange += (o, e) => stateChangedEvent.Set();
+
+            using var getPidCommand = connection.CreateCommand();
+            getPidCommand.CommandText = "SELECT pg_backend_pid()";
+            var pid = (int)(await getPidCommand.ExecuteScalarAsync());
+
+            Assert.AreEqual(ConnectionState.Open, connection.State);
+
+            // kill the connection from the back end
+            using var killingConnection = new NpgsqlConnection(TestingPostgresDb.ConnectionString);
+            await killingConnection.OpenAsync();
+            using var killCommand = killingConnection.CreateCommand();
+            killCommand.CommandText = $"SELECT pg_terminate_backend({pid})";
+            await killCommand.ExecuteNonQueryAsync();
+
+            Assert.ThrowsAsync<PostgresException>(() => getPidCommand.ExecuteScalarAsync());
+            Assert.AreNotEqual(ConnectionState.Open, connection.State);
+
+            Assert.IsTrue(stateChangedEvent.Wait(TimeSpan.FromSeconds(5))); // assertion passes in 4.1.4, fails in 5.0.1.1
+        }
     }
 }


Updated to https://docs.microsoft.com/en-us/aspnet/core/blazor/blazor-server-ef-core?view=aspnetcore-5.0

--- DragonSpark.Application/Compose/Entities/ConfigureStorage.cs
+++ DragonSpark.Application/Compose/Entities/ConfigureStorage.cs
@@ -1,5 +1,4 @@
 using DragonSpark.Application.Entities;
-using DragonSpark.Compose;
 using DragonSpark.Composition;
 using DragonSpark.Model.Commands;
 using Microsoft.AspNetCore.Identity;
@@ -24,14 +23,15 @@

 		public void Execute(IServiceCollection parameter)
 		{
-			parameter.AddDbContext<TContext>(_storage.Get(parameter))
-			         .Return(parameter)
+			parameter.AddDbContextFactory<TContext>(_storage.Get(parameter))
+			         .AddScoped(p => p.GetRequiredService<IDbContextFactory<TContext>>().CreateDbContext())
+			         .AddScoped<DbContext>(x => x.GetRequiredService<TContext>())
+			         //
 			         .Start<IStorageInitializer<TContext>>()
 			         .Forward<StorageInitializer<TContext>>()
 			         .Singleton()
-			         .Then.AddScoped<DbContext>(x => x.GetRequiredService<TContext>())
 			         //
-			         .AddDefaultIdentity<T>(_configure)
+			         .Then.AddDefaultIdentity<T>(_configure)
 			         .AddEntityFrameworkStores<TContext>();
 		}
 	}


优化性能。

优化性能。

--- ImageLoader.UWP/ImageLoader.UWP/HttpClientImageDownloader.cs
+++ ImageLoader.UWP/ImageLoader.UWP/HttpClientImageDownloader.cs
@@ -5,8 +5,8 @@

 namespace Noear.UWP.Loader {
     public class HttpClientImageDownloader : IImageDownloader {
-        public virtual Task<IBuffer> download(string url, object extra) {
-            return new HttpClient().GetBufferAsync(new Uri(url)).AsTask();
+        public async Task<IBuffer> download(string url, object extra) {
+            return await new HttpClient().GetBufferAsync(new Uri(url));
         }
     }
 }


Fix up a test that no longer words since we are now a bit better at doing index variable renaming.

--- LINQToTTree/LINQToTTreeLib.Tests/TestQueriesGreaterLevels.cs
+++ LINQToTTree/LINQToTTreeLib.Tests/TestQueriesGreaterLevels.cs
@@ -128,7 +128,8 @@
             Assert.IsInstanceOfType(loop.Statements.First(), typeof(StatementLoopOnVector), "Expected 2nd level loop");

             var loop2 = loop.Statements.First() as StatementLoopOnVector;
-            Assert.AreEqual("(*((*this).other)[m]).deeper", loop2.VectorToLoopOver.RawValue, "2nd vector loop variable is not correct");
+            Assert.IsTrue(loop2.VectorToLoopOver.RawValue.StartsWith("(*((*this).other)["), "Bad vector loop index: " + loop2.VectorToLoopOver.RawValue);
+            Assert.IsTrue(loop2.VectorToLoopOver.RawValue.EndsWith("]).deeper"), "Bad vector loop index: " + loop2.VectorToLoopOver.RawValue);

             ///
             /// And below that should be one statement that does the incrementing


Add more log

Add more log

--- umbShop/Models/Stock/UmbShopStockRepository.cs
+++ umbShop/Models/Stock/UmbShopStockRepository.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Linq;
 using Umbraco.Core;
+using Umbraco.Core.Logging;
 using Umbraco.Core.Persistence;

 namespace UmbShop.Models.Stock
@@ -29,6 +30,7 @@

             try
             {
+                LogHelper.Info<UmbShopStockRepository>("BEGIN AddProductsToStock productId:" + productId + " variantId:" + variantId + " count:" + count);
                 for (int i = 1; i <= countInt; i++)
                 {
                     UmbShopStock stock = new UmbShopStock
@@ -41,9 +43,11 @@

                     databaseContext.Database.Insert(stock);
                 }
+                LogHelper.Info<UmbShopStockRepository>("END AddProductsToStock productId:" + productId + " variantId:" + variantId + " count:" + count);
             }
-            catch
+            catch (Exception exception)
             {
+                LogHelper.Info<UmbShopStockRepository>("ERROR AddProductsToStock " + exception.Message);
                 return false;
             }

@@ -71,14 +75,17 @@

             try
             {
+                LogHelper.Info<UmbShopStockRepository>("BEGIN RemoveProductsFromStock productId:" + productId + " variantId:" + variantId + " count:" + count);
                 for (int i = 1; i <= countInt; i++)
                 {
                     UmbShopStock stock = databaseContext.Database.Fetch<UmbShopStock>("SELECT TOP 1 * FROM " + UmbShopStock.TableName + " WHERE ProductUniqueId = @0 AND VariantUniqueId = @1 AND BasketUniqueId = '';", productUniqueId, variantUniqueId).FirstOrDefault();
                     databaseContext.Database.Delete<UmbShopStock>(stock);
                 }
+                LogHelper.Info<UmbShopStockRepository>("END RemoveProductsFromStock productId:" + productId + " variantId:" + variantId + " count:" + count);
             }
-            catch
+            catch (Exception exception)
             {
+                LogHelper.Info<UmbShopStockRepository>("ERROR RemoveProductsFromStock " + exception.Message);
                 return false;
             }


#747 Fixed newline support in dictionaries.

--- unity/Assets/Scripts/Content/DictionaryI18n.cs
+++ unity/Assets/Scripts/Content/DictionaryI18n.cs
@@ -102,13 +102,46 @@
         /// <param name="languageData">Language data</param>
         public void AddData(string[] languageData)
         {
+            List<string> textToAdd = new List<string>();
+            string partialLine = "";
+
+            // Remove extra new lines
+            foreach (string rawLine in languageData)
+            {
+                int sections = rawLine.Split('\"').Length;
+                if ((sections % 2) == 1)
+                {
+                    if (partialLine.Length == 0)
+                    {
+                        textToAdd.Add(rawLine);
+                    }
+                    else
+                    {
+                        partialLine += "\\n" + rawLine;
+                    }
+                }
+                else
+                {
+                    if (partialLine.Length == 0)
+                    {
+                        partialLine = rawLine;
+                    }
+                    else
+                    {
+                        partialLine += "\\n" + rawLine;
+                        textToAdd.Add(partialLine);
+                        partialLine = "";
+                    }
+                }
+            }
+
             string newLanguage = languageData[0].Split(COMMA)[1].Trim('"');

             if (!rawData.ContainsKey(newLanguage))
             {
                 rawData.Add(newLanguage, new List<string>());
             }
-            rawData[newLanguage].AddRange(languageData);
+            rawData[newLanguage].AddRange(textToAdd);
         }

         /// <summary>


Revert unintended scheduler change in `TestAsyncThrows`

--- osu.Framework.Tests/Visual/Drawables/TestSceneSynchronizationContext.cs
+++ osu.Framework.Tests/Visual/Drawables/TestSceneSynchronizationContext.cs
@@ -116,7 +116,7 @@
             AddStep("throw on update thread", () =>
             {
                 // ReSharper disable once AsyncVoidLambda
-                Scheduler.Add(async () =>
+                host.UpdateThread.Scheduler.Add(async () =>
                 {
                     Assert.That(ThreadSafety.IsUpdateThread);


Move BindValueChanged subscriptions to LoadComplete

--- osu.Game/Screens/OnlinePlay/Multiplayer/CreateMultiplayerMatchButton.cs
+++ osu.Game/Screens/OnlinePlay/Multiplayer/CreateMultiplayerMatchButton.cs
@@ -27,9 +27,14 @@
             Text = "Create room";

             isConnected = multiplayerClient.IsConnected.GetBoundCopy();
+            operationInProgress = ongoingOperationTracker.InProgress.GetBoundCopy();
+        }
+
+        protected override void LoadComplete()
+        {
+            base.LoadComplete();
+
             isConnected.BindValueChanged(_ => updateState());
-
-            operationInProgress = ongoingOperationTracker.InProgress.GetBoundCopy();
             operationInProgress.BindValueChanged(_ => updateState(), true);
         }


[xcode] Adding forwarding from LLVMGcc-4.2 for ObjectiveC++ exception handling for Xcode

--- packages/LLVMGcc/4.2/Scripts/ObjCxxCompilerOptionCollectionDelegates.cs
+++ packages/LLVMGcc/4.2/Scripts/ObjCxxCompilerOptionCollectionDelegates.cs
@@ -9,9 +9,11 @@
         #region C.ICxxCompilerOptions Option delegates
         private static void ExceptionHandlerCommandLineProcessor(object sender, Opus.Core.StringArray commandLineBuilder, Opus.Core.Option option, Opus.Core.Target target)
         {
+            GccCommon.ObjCxxCompilerOptionCollection.ExceptionHandlerCommandLineProcessor(sender, commandLineBuilder, option, target);
         }
         private static void ExceptionHandlerXcodeProjectProcessor(object sender, XcodeBuilder.PBXProject project, XcodeBuilder.XCodeNodeData currentObject, XcodeBuilder.XCBuildConfiguration configuration, Opus.Core.Option option, Opus.Core.Target target)
         {
+            GccCommon.ObjCxxCompilerOptionCollection.ExceptionHandlerXcodeProjectProcessor(sender, project, currentObject, configuration, option, target);
         }
         #endregion
         protected override void SetDelegates(Opus.Core.DependencyNode node)


Pass model to more methods (needed for next change)

--- CodeGen/CodeGen.cs
+++ CodeGen/CodeGen.cs
@@ -149,7 +149,7 @@
       sourceWriter.WriteLine("public interface IAccessBridgeFunctions {{");
       sourceWriter.IncIndent();
       foreach (var function in model.Functions) {
-        WriteFunction(sourceWriter, function);
+        WriteFunction(model, sourceWriter, function);
       }
       sourceWriter.DecIndent();
       sourceWriter.WriteLine("}}");
@@ -175,7 +175,7 @@
       sourceWriter.IsNativeTypes = false;
       sourceWriter.WriteLine("#region Platform agnostic event handler delegate types");
       foreach (var eventDefinition in model.Events) {
-        WriteEventHandlerType(sourceWriter, eventDefinition);
+        WriteEventHandlerType(model, sourceWriter, eventDefinition);
       }
       sourceWriter.WriteLine("#endregion");
       sourceWriter.WriteLine();
@@ -243,7 +243,7 @@

       sourceWriter.WriteLine("#region Event handlers");
       foreach (var eventDefinition in model.Events) {
-        WriteApplicationLevelEventHandler(sourceWriter, eventDefinition);
+        WriteApplicationLevelEventHandler(model, sourceWriter, eventDefinition);
       }
       sourceWriter.WriteLine("#endregion");
       sourceWriter.WriteLine();
@@ -259,7 +259,7 @@

       sourceWriter.WriteLine("#region Event forwarders");
       foreach (var eventDefinition in model.Events) {
-        WriteApplicationLevelEventForwarder(sourceWriter, eventDefinition);
+        WriteApplicationLevelEventForwarder(model, sourceWriter, eventDefinition);
       }
       sourceWriter.WriteLine("#endregion");

@@ -292,7 +292,7 @@

       sourceWriter.WriteLine("#region Function delegate types");
       foreach (var function in model.Functions) {
-        WriteLibrayrFunctionsDelegate(sourceWriter, function);
+        WriteLibrayrFunctionsDelegate(model, sourceWriter, function);
       }
       sourceWriter.WriteLine("#endregion");
       sourceWriter.WriteLine();
@@ -300,7 +300,7 @@
       sourceWriter.WriteLine("#region Event delegate types");
       foreach (var definition in model.Events) {
         sourceWriter.WriteLine("[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Unicode)]");
-        WriteDelegateType(sourceWriter, definition.DelegateFunction);
+        WriteDelegateType(model, sourceWriter, definition.DelegateFunction);
       }
       sourceWriter.WriteLine("#endregion");
       sourceWriter.WriteLine();
@@ -351,28 +351,25 @@
       sourceWriter.WriteLine();
       sourceWriter.WriteLine("#region Event handlers");
       foreach (var eventDefinition in model.Events) {
-        WriteNativeEventHandler(sourceWriter, eventDefinition);
-      }
-      sourceWriter.WriteLine("#endregion");
-      sourceWriter.DecIndent();
-      sourceWriter.WriteLine("}}");
-      sourceWriter.WriteLine();
-    }
-
-    private void WriteFunction(SourceCodeWriter sourceWriter, FunctionDefinition definition) {
-      sourceWriter.WriteIndent();
-      WriteFunctionSignature(sourceWriter, definition);
+        WriteNativeEventHandler(model, sourceWriter, eventDefinition);
+      }
+      sourceWriter.WriteLine("#endregion");
+      sourceWriter.DecIndent();
+      sourceWriter.WriteLine("}}");
+      sourceWriter.WriteLine();
+    }
+
+    private void WriteFunction(WindowsAccessBridgeModel model, SourceCodeWriter sourceWriter, FunctionDefinition definition) {
+      sourceWriter.WriteIndent();
+      WriteFunctionSignature(model, sourceWriter, definition);
       sourceWriter.Write(";");
       sourceWriter.WriteLine();
     }

-    private void WriteApplicationFunctionImplementation(
-      WindowsAccessBridgeModel model,
-      SourceCodeWriter sourceWriter,
-      FunctionDefinition definition) {
+    private void WriteApplicationFunctionImplementation(WindowsAccessBridgeModel model, SourceCodeWriter sourceWriter, FunctionDefinition definition) {
       sourceWriter.WriteIndent();
       sourceWriter.Write("public ");
-      WriteFunctionSignature(sourceWriter, definition);
+      WriteFunctionSignature(model, sourceWriter, definition);
       sourceWriter.Write(" {{");
       sourceWriter.WriteLine();
       sourceWriter.IncIndent();
@@ -653,20 +650,20 @@
       }
     }

-    private void WriteDelegateType(SourceCodeWriter sourceWriter, FunctionDefinition definition) {
+    private void WriteDelegateType(WindowsAccessBridgeModel model, SourceCodeWriter sourceWriter, FunctionDefinition definition) {
       sourceWriter.WriteMarshalAsLine(definition.MarshalAs);
       sourceWriter.WriteIndent();
       sourceWriter.Write("public delegate ");
-      WriteFunctionSignature(sourceWriter, definition);
+      WriteFunctionSignature(model, sourceWriter, definition);
       sourceWriter.Write(";");
       sourceWriter.WriteLine();
     }

-    private void WriteFunctionSignature(SourceCodeWriter sourceWriter, FunctionDefinition definition) {
-      WriteFunctionSignature(sourceWriter, definition, definition.Name);
-    }
-
-    private void WriteFunctionSignature(SourceCodeWriter sourceWriter, FunctionDefinition definition, string name) {
+    private void WriteFunctionSignature(WindowsAccessBridgeModel model, SourceCodeWriter sourceWriter, FunctionDefinition definition) {
+      WriteFunctionSignature(model, sourceWriter, definition, definition.Name);
+    }
+
+    private void WriteFunctionSignature(WindowsAccessBridgeModel model, SourceCodeWriter sourceWriter, FunctionDefinition definition, string name) {
       sourceWriter.WriteType(definition.ReturnType);
       sourceWriter.Write(" ");
       sourceWriter.Write(name);
@@ -678,12 +675,12 @@
         else {
           sourceWriter.Write(", ");
         }
-        WriteParameter(sourceWriter, p);
+        WriteParameter(model, sourceWriter, p);
       }
       sourceWriter.Write(")");
     }

-    private void WriteLibrayrFunctionsDelegate(SourceCodeWriter sourceWriter, FunctionDefinition function) {
+    private void WriteLibrayrFunctionsDelegate(WindowsAccessBridgeModel model, SourceCodeWriter sourceWriter, FunctionDefinition function) {
       sourceWriter.WriteLine("[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Unicode)]");
       sourceWriter.WriteIndent();
       sourceWriter.Write("public delegate ");
@@ -698,7 +695,7 @@
         else {
           sourceWriter.Write(", ");
         }
-        WriteParameter(sourceWriter, p);
+        WriteParameter(model, sourceWriter, p);
       }
       sourceWriter.Write(");");
       sourceWriter.WriteLine();
@@ -794,10 +791,10 @@
       sourceWriter.WriteLine("}}");
     }

-    private void WriteNativeEventHandler(SourceCodeWriter sourceWriter, EventDefinition definition) {
+    private void WriteNativeEventHandler(WindowsAccessBridgeModel model, SourceCodeWriter sourceWriter, EventDefinition definition) {
       sourceWriter.WriteIndent();
       sourceWriter.Write("protected virtual ");
-      WriteFunctionSignature(sourceWriter, definition.DelegateFunction, "On" + definition.Name);
+      WriteFunctionSignature(model, sourceWriter, definition.DelegateFunction, "On" + definition.Name);
       sourceWriter.Write(" {{");
       sourceWriter.WriteLine();
       sourceWriter.IncIndent();
@@ -821,10 +818,10 @@
       sourceWriter.WriteLine("}}");
     }

-    private void WriteApplicationLevelEventHandler(SourceCodeWriter sourceWriter, EventDefinition definition) {
+    private void WriteApplicationLevelEventHandler(WindowsAccessBridgeModel model, SourceCodeWriter sourceWriter, EventDefinition definition) {
       sourceWriter.WriteIndent();
       sourceWriter.Write("protected virtual ");
-      WriteFunctionSignature(sourceWriter, definition.DelegateFunction, "On" + definition.Name);
+      WriteFunctionSignature(model, sourceWriter, definition.DelegateFunction, "On" + definition.Name);
       sourceWriter.Write(" {{");
       sourceWriter.WriteLine();
       sourceWriter.IncIndent();
@@ -848,11 +845,11 @@
       sourceWriter.WriteLine("}}");
     }

-    private void WriteApplicationLevelEventForwarder(SourceCodeWriter sourceWriter, EventDefinition definition) {
+    private void WriteApplicationLevelEventForwarder(WindowsAccessBridgeModel model, SourceCodeWriter sourceWriter, EventDefinition definition) {
       sourceWriter.IsNativeTypes = true;
       sourceWriter.WriteIndent();
       sourceWriter.Write("private ");
-      WriteFunctionSignature(sourceWriter, definition.DelegateFunction, "Forward" + definition.Name);
+      WriteFunctionSignature(model, sourceWriter, definition.DelegateFunction, "Forward" + definition.Name);
       sourceWriter.Write(" {{");
       sourceWriter.WriteLine();

@@ -906,7 +903,7 @@
       return name.Name == "void";
     }

-    private void WriteParameter(SourceCodeWriter sourceWriter, ParameterDefinition parameterDefinition) {
+    private void WriteParameter(WindowsAccessBridgeModel model, SourceCodeWriter sourceWriter, ParameterDefinition parameterDefinition) {
       if (parameterDefinition.IsOutAttribute) {
         sourceWriter.Write("[Out]");
       }
@@ -926,8 +923,8 @@
       sourceWriter.WriteLine("event {0}EventHandler {0};", eventDefinition.Name);
     }

-    private void WriteEventHandlerType(SourceCodeWriter sourceWriter, EventDefinition eventDefinition) {
-      WriteDelegateType(sourceWriter, eventDefinition.DelegateFunction);
+    private void WriteEventHandlerType(WindowsAccessBridgeModel model, SourceCodeWriter sourceWriter, EventDefinition eventDefinition) {
+      WriteDelegateType(model, sourceWriter, eventDefinition.DelegateFunction);
     }

     private void WriteLibraryStruct(WindowsAccessBridgeModel model, SourceCodeWriter sourceWriter, StrucDefinition definition) {


Remove different grid size tests

Remove different grid size tests

--- osu.Framework.Tests/Visual/Layout/TestCaseGridContainer.cs
+++ osu.Framework.Tests/Visual/Layout/TestCaseGridContainer.cs
@@ -18,13 +18,12 @@
 {
     public class TestCaseGridContainer : TestCase
     {
-        private Container gridParent;
         private GridContainer grid;

         [SetUp]
         public void Setup() => Schedule(() =>
         {
-            Child = gridParent = new Container
+            Child = new Container
             {
                 Anchor = Anchor.Centre,
                 Origin = Anchor.Centre,
@@ -520,39 +519,36 @@
                 },
             }.Invert(), dimensions, row);

-            AddStep("set size = (0.5, 0.5)", () => gridParent.Size = new Vector2(0.5f));
-            checkSizes();
-            AddStep("set size = (0.5f, 0.1f)", () => gridParent.Size = new Vector2(0.5f, 0.1f));
-            checkSizes();
-            AddStep("set size = (0.1f, 0.5f)", () => gridParent.Size = new Vector2(0.1f, 0.5f));
-            checkSizes();
-
-            void checkSizes()
-            {
-                AddAssert("max size not overflowed", () =>
-                {
-                    for (int i = 0; i < 8; i++)
-                    {
-                        if (dimensions[i].Mode != GridSizeMode.Distributed)
-                            continue;
-
-                        if (row && boxes[i].DrawHeight > dimensions[i].MaxSize)
-                            return false;
-
-                        if (!row && boxes[i].DrawWidth > dimensions[i].MaxSize)
-                            return false;
-                    }
-
-                    return true;
-                });
-
-                AddAssert("column span total length", () =>
-                {
-                    return row
-                        ? Precision.AlmostEquals(grid.DrawHeight, boxes.Sum(b => b.DrawHeight))
-                        : Precision.AlmostEquals(grid.DrawWidth, boxes.Sum(b => b.DrawWidth));
-                });
-            }
+            checkClampedSizes(row, boxes, dimensions);
+        }
+
+        private void checkClampedSizes(bool row, FillBox[] boxes, Dimension[] dimensions)
+        {
+            AddAssert("sizes not over/underflowed", () =>
+            {
+                for (int i = 0; i < 8; i++)
+                {
+                    if (dimensions[i].Mode != GridSizeMode.Distributed)
+                        continue;
+
+                    if (row && boxes[i].DrawHeight > dimensions[i].MaxSize)
+                        return false;
+
+                    if (!row && boxes[i].DrawWidth > dimensions[i].MaxSize)
+                        return false;
+                }
+
+                return true;
+            });
+
+            AddAssert("column span total length", () =>
+            {
+                float expectedSize = row ? grid.DrawHeight : grid.DrawWidth;
+                float totalSize = row ? boxes.Sum(b => b.DrawHeight) : boxes.Sum(b => b.DrawWidth);
+
+                // Allowed to exceed the length of the columns due to absolute sizing
+                return totalSize >= expectedSize;
+            });
         }

         private void setSingleDimensionContent(Func<Drawable[][]> contentFunc, Dimension[] dimensions = null, bool row = false) => AddStep("set content", () =>


Add logic to gain bonus score from spinner ticks

--- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs
+++ osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs
@@ -12,7 +12,9 @@
 using osu.Framework.Extensions.Color4Extensions;
 using osu.Framework.Allocation;
 using osu.Framework.Bindables;
+using osu.Framework.Extensions.IEnumerableExtensions;
 using osu.Framework.Graphics.Sprites;
+using osu.Game.Graphics.Sprites;
 using osu.Game.Screens.Ranking;
 using osu.Game.Rulesets.Scoring;

@@ -22,6 +24,9 @@
     {
         protected readonly Spinner Spinner;

+        private readonly Container<DrawableSpinnerTick> ticks;
+        private readonly OsuSpriteText bonusCounter;
+
         public readonly SpinnerDisc Disc;
         public readonly SpinnerTicks Ticks;
         private readonly SpinnerSpmCounter spmCounter;
@@ -58,6 +63,7 @@

             InternalChildren = new Drawable[]
             {
+                ticks = new Container<DrawableSpinnerTick>(),
                 circleContainer = new Container
                 {
                     AutoSizeAxes = Axes.Both,
@@ -115,8 +121,24 @@
                     Origin = Anchor.Centre,
                     Y = 120,
                     Alpha = 0
+                },
+                bonusCounter = new OsuSpriteText
+                {
+                    Anchor = Anchor.Centre,
+                    Origin = Anchor.Centre,
+                    Y = -120,
+                    Font = OsuFont.Numeric.With(size: 24),
+                    Alpha = 0,
                 }
             };
+
+            foreach (var tick in Spinner.NestedHitObjects.OfType<SpinnerTick>())
+            {
+                var drawableTick = new DrawableSpinnerTick(tick);
+
+                ticks.Add(drawableTick);
+                AddNested(drawableTick);
+            }
         }

         [BackgroundDependencyLoader]
@@ -182,6 +204,8 @@
             base.Update();
         }

+        private int currentSpins;
+
         protected override void UpdateAfterChildren()
         {
             base.UpdateAfterChildren();
@@ -189,6 +213,22 @@
             circle.Rotation = Disc.Rotation;
             Ticks.Rotation = Disc.Rotation;
             spmCounter.SetRotation(Disc.RotationAbsolute);
+
+            var newSpins = (int)(Disc.RotationAbsolute / 360) - currentSpins;
+
+            for (int i = currentSpins; i < currentSpins + newSpins; i++)
+            {
+                if (i < 0 || i >= ticks.Count)
+                    break;
+
+                var tick = ticks[i];
+
+                tick.HasBonusPoints = Progress >= 1 && i > Spinner.SpinsRequired;
+
+                tick.TriggerResult(HitResult.Great);
+            }
+
+            currentSpins += newSpins;

             float relativeCircleScale = Spinner.Scale * circle.DrawHeight / mainContainer.DrawHeight;
             Disc.ScaleTo(relativeCircleScale + (1 - relativeCircleScale) * Progress, 200, Easing.OutQuint);
@@ -232,6 +272,9 @@
                     break;
             }

+            if (state != ArmedState.Idle)
+                Schedule(() => NestedHitObjects.Where(t => !t.IsHit).OfType<DrawableSpinnerTick>().ForEach(t => t.TriggerResult(HitResult.Miss)));
+
             Expire();
         }
     }


Add comment regarding feedback

Add comment regarding feedback

--- osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs
+++ osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs
@@ -112,6 +112,7 @@
                 case Visibility.Visible:
                     if (OverlayActivationMode.Value == OverlayActivation.Disabled)
                     {
+                        // todo: visual/audible feedback that this operation could not complete.
                         State.Value = Visibility.Hidden;
                         return;
                     }


Use IEnumerable<T> instead

Use IEnumerable<T> instead

--- osu.Game/IO/Serialization/Converters/TypedListConverter.cs
+++ osu.Game/IO/Serialization/Converters/TypedListConverter.cs
@@ -2,7 +2,6 @@
 // See the LICENCE file in the repository root for full licence text.

 using System;
-using System.Collections;
 using System.Collections.Generic;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
@@ -62,7 +61,7 @@

         public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
         {
-            var list = (IList)value;
+            var list = (IEnumerable<T>)value;

             var lookupTable = new List<string>();
             var objects = new List<JObject>();


Remove strings for compare and use types instead

So that not e.g. some implementation of .NET spec uses other format
for e.g. generic types. This code path is cached and only called once
so should not be a big deal.

--- src/projects/Routemeister/IlMessageHandlerInvokerFactory.cs
+++ src/projects/Routemeister/IlMessageHandlerInvokerFactory.cs
@@ -1,4 +1,5 @@
-using System.Linq;
+using System;
+using System.Linq;
 using System.Reflection;
 using System.Reflection.Emit;
 using System.Threading.Tasks;
@@ -7,20 +8,22 @@
 {
     internal static class IlMessageHandlerInvokerFactory
     {
+        private static readonly Type TaskType = typeof(Task);
+        private static readonly Type GenericTaskType = typeof(Task<>);
+        private static readonly Type VoidType = typeof(void);
+
         internal static MessageHandlerInvoker GetMethodInvoker(MethodInfo methodInfo)
         {
-            if (methodInfo.ReturnType.Name == "Task" || methodInfo.ReturnType.Name.StartsWith("Task`"))
-            {
+            if (methodInfo.ReturnType == VoidType)
+                return GetVoidMethodInvoker(methodInfo);
+
+            if (methodInfo.ReturnType == TaskType)
                 return GetAsyncMethodInvoker(methodInfo);
-            }
-            else if (methodInfo.ReturnType.Name == "Void")
-            {
-                return GetVoidMethodInvoker(methodInfo);
-            }
-            else
-            {
-                return GetObjectMethodInvoker(methodInfo);
-            }
+
+            if (methodInfo.ReturnType.GetTypeInfo().IsGenericType && methodInfo.ReturnType.GetGenericTypeDefinition() == GenericTaskType)
+                return GetAsyncMethodInvoker(methodInfo);
+
+            return GetObjectMethodInvoker(methodInfo);
         }

         private static MessageHandlerInvoker GetAsyncMethodInvoker(MethodInfo methodInfo)


MyGenerationMDI: Remove FirstLoad logic

MyGenerationMDI: Remove FirstLoad logic

--- src/mygeneration/MyGeneration/MyGenerationMDI.cs
+++ src/mygeneration/MyGeneration/MyGenerationMDI.cs
@@ -1,28 +1,16 @@
 using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Drawing;
 using System.IO;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
+using System.Threading;
 using System.Windows.Forms;
-using System.Diagnostics;
-using System.Threading;
-using System.Reflection;
-
-using WeifenLuo.WinFormsUI;
+using MyGeneration.Forms;
+using Scintilla;
+using Scintilla.Configuration.Legacy;
+using Scintilla.Forms;
 using WeifenLuo.WinFormsUI.Docking;
-
-using Scintilla;
-using Scintilla.Enums;
-using Scintilla.Forms;
-using Scintilla.Printing;
-using Scintilla.Configuration;
-using Scintilla.Configuration.SciTE;
-using Scintilla.Configuration.Legacy;
-
 using Zeus;
-using MyGeneration.Forms;

 namespace MyGeneration
 {
@@ -32,9 +20,6 @@
         private const string SCINTILLA_CONFIG_FILE = @"\settings\scintillanet.xml";
         private const string REPLACEMENT_SUFFIX = "$REPLACEMENT$.dll";

-        private const string URL_HOMEPAGE = "http://www.mygenerationsoftware.com/home/";
-        private const string URL_DOCUMENTATION = "http://www.mygenerationsoftware.com/Documentation.aspx";
-        private const string URL_LATESTVERSION = "http://www.mygenerationsoftware.com/LatestVersion";
         private const string URL_SOURCEFORGE_DOWNLOAD = "http://sourceforge.net/project/showfiles.php?group_id=198893";

         private static ConfigFile configFile;
@@ -52,7 +37,7 @@
         private UserMetaData userMetaData;
         private GlobalUserMetaData globalUserMetaData;
         private MetaProperties metaProperties;
-        private DefaultProperties options;
+        private DefaultSettingsDialog options;
         private TemplateBrowser templateBrowser;
         private ConsoleForm consoleForm;
         private ErrorsForm errorsForm;
@@ -196,23 +181,6 @@
             if (this.startupFiles != null)
             {
                 OpenDocuments(startupFiles);
-            }
-
-            // Show Default Properties if this is the first load.
-            if (settings.FirstLoad)
-            {
-                if (!settings.EnableDocumentStyleSettings)
-                {
-                    if (options != null) { this.OptionsDockContent.Hide(); this.options = null; }
-                    DefaultSettingsDialog dsd = new DefaultSettingsDialog(this);
-                    dsd.ShowDialog(this);
-                }
-                else
-                {
-                    if (this.OptionsDockContent.IsHidden)
-                        this.OptionsDockContent.Show(this.dockPanel);
-                    this.OptionsDockContent.Activate();
-                }
             }
         }

@@ -475,7 +443,7 @@
                 {
                     content = this.TemplateBrowserDockContent;
                 }
-                else if (type == typeof(DefaultProperties).ToString() && settings.EnableDocumentStyleSettings)
+                else if (type == typeof(DefaultSettingsDialog).ToString() && settings.EnableDocumentStyleSettings)
                 {
                     content = this.OptionsDockContent;
                 }
@@ -723,47 +691,23 @@
             ab.ShowDialog(this);
         }

-        private void jScriptTemplateToolStripMenuItem_Click(object sender, EventArgs e)
-        {
-            CreateDocument(ZeusConstants.Engines.MICROSOFT_SCRIPT, ZeusConstants.Languages.JSCRIPT);
-        }
-
-        private void vBScriptTemplateToolStripMenuItem_Click(object sender, EventArgs e)
-        {
-            CreateDocument(ZeusConstants.Engines.MICROSOFT_SCRIPT, ZeusConstants.Languages.VBSCRIPT);
-        }
-
-        private void cTemplateToolStripMenuItem_Click(object sender, EventArgs e)
-        {
-            CreateDocument(ZeusConstants.Engines.DOT_NET_SCRIPT, ZeusConstants.Languages.CSHARP);
-        }
-
-        private void vBNetTemplateToolStripMenuItem_Click(object sender, EventArgs e)
-        {
-            CreateDocument(ZeusConstants.Engines.DOT_NET_SCRIPT, ZeusConstants.Languages.VBNET);
-        }
-
-        private void projectToolStripMenuItem1_Click(object sender, EventArgs e)
-        {
-        }
-
         private void defaultSettingsToolStripMenuItem_Click(object sender, EventArgs e)
         {
             if (!settings.EnableDocumentStyleSettings)
             {
-                if (options != null) { this.OptionsDockContent.Hide(); this.options = null; }
-                DefaultSettingsDialog dsd = new DefaultSettingsDialog(this);
-                dsd.ShowDialog(this);
+                if (options != null) { OptionsDockContent.Hide(); this.options = null; }
+                var defaultProperties = new DefaultSettingsDialog(this);
+                defaultProperties.ShowDialog(this);
             }
             else
             {
-                if (this.OptionsDockContent.IsHidden)
-                {
-                    this.OptionsDockContent.Show(this.dockPanel);
+                if (OptionsDockContent.IsHidden)
+                {
+                    OptionsDockContent.Show(this.dockPanel);
                 }
                 else
                 {
-                    this.OptionsDockContent.Activate();
+                    OptionsDockContent.Activate();
                 }
             }
         }
@@ -830,7 +774,7 @@
             if (!settings.EnableDocumentStyleSettings)
             {
                 if (options != null) { this.OptionsDockContent.Hide(); this.options = null; }
-                DefaultSettingsDialog dsd = new DefaultSettingsDialog(this);
+                var dsd = new DefaultSettingsDialog(this);
                 dsd.ShowDialog(this);
             }
             else
@@ -1001,12 +945,12 @@
                 return errorDetail;
             }
         }
-        public DefaultProperties OptionsDockContent
+        public DefaultSettingsDialog OptionsDockContent
         {
             get
             {
                 if ((options != null) && options.IsDisposed) options = null;
-                if (options == null) options = new DefaultProperties(this);
+                if (options == null) options = new DefaultSettingsDialog(this);
                 return options;
             }
         }
@@ -1510,6 +1454,5 @@
             catch { }
         }
         #endregion
-
     }
 }


demo: fix globe scene

demo: fix globe scene

--- unity/demo/Assets/Scripts/GlobeLevelBehaviour.cs
+++ unity/demo/Assets/Scripts/GlobeLevelBehaviour.cs
@@ -52,16 +52,16 @@
                 // NOTE it's better not to mix borders and admin areas due to polygon clipping issues.
                 if (LoadBorder)
                 {
-                    _mapDataLoader.AddToStore(MapStorageType.InMemory, @"/NaturalEarth/ne_110m_admin_0_boundary_lines_land", stylesheet, range);
-                    _mapDataLoader.AddToStore(MapStorageType.InMemory, @"/NaturalEarth/ne_110m_land", stylesheet, range);
+                    _mapDataLoader.AddToStore(MapStorageType.InMemory, @"NaturalEarth/ne_110m_admin_0_boundary_lines_land", stylesheet, range);
+                    _mapDataLoader.AddToStore(MapStorageType.InMemory, @"NaturalEarth/ne_110m_land", stylesheet, range);
                 }
                 else
                 {
-                    _mapDataLoader.AddToStore(MapStorageType.InMemory, @"/NaturalEarth/ne_110m_admin_0_scale_rank", stylesheet, range);
+                    _mapDataLoader.AddToStore(MapStorageType.InMemory, @"NaturalEarth/ne_110m_admin_0_scale_rank", stylesheet, range);
                 }

-                _mapDataLoader.AddToStore(MapStorageType.InMemory, @"/NaturalEarth/ne_110m_lakes", stylesheet, range);
-                _mapDataLoader.AddToStore(MapStorageType.InMemory, @"/NaturalEarth/ne_110m_rivers_lake_centerlines", stylesheet, range);
+                _mapDataLoader.AddToStore(MapStorageType.InMemory, @"NaturalEarth/ne_110m_lakes", stylesheet, range);
+                _mapDataLoader.AddToStore(MapStorageType.InMemory, @"NaturalEarth/ne_110m_rivers_lake_centerlines", stylesheet, range);

                 _appManager.RunGame();


Rename FoundStringCallbacks to LineActions

--- MatterControl.Printing/Communication/FoundStringCallBacks.cs
+++ MatterControl.Printing/Communication/FoundStringCallBacks.cs
@@ -32,7 +32,7 @@

 namespace MatterHackers.SerialPortCommunication
 {
-	public class FoundStringCallbacks
+	public class LineActions
 	{
 		public Dictionary<string, Action<string>> dictionaryOfCallbacks = new Dictionary<string, Action<string>>();

@@ -69,7 +69,7 @@
 		}
 	}

-	public class FoundStringStartsWithCallbacks : FoundStringCallbacks
+	public class FoundStringStartsWithCallbacks : LineActions
 	{
 		public void CheckForKeys(string s)
 		{
@@ -83,7 +83,7 @@
 		}
 	}

-	public class FoundStringContainsCallbacks : FoundStringCallbacks
+	public class FoundStringContainsCallbacks : LineActions
 	{
 		public void CheckForKeys(string s)
 		{


Adding some integration tests to help understand the problem

--- src/tests/IntegrationTests/Events/RepositoryManagerTests.cs
+++ src/tests/IntegrationTests/Events/RepositoryManagerTests.cs
@@ -294,6 +294,9 @@
             RepositoryManager.ActiveRemote.Value.Name.Should().Be("origin");
             RepositoryManager.ActiveRemote.Value.Url.Should().Be("https://github.com/EvilStanleyGoldman/IOTestsRepo.git");

+            RepositoryManager.Repository.CloneUrl.Should().Be("https://github.com/EvilStanleyGoldman/IOTestsRepo");
+            RepositoryManager.Repository.Owner.Should().Be("EvilStanleyGoldman");
+
             await RepositoryManager.RemoteRemove("origin").StartAsAsync();
             await TaskManager.Wait();

@@ -305,6 +308,9 @@

             RepositoryManager.ActiveRemote.HasValue.Should().BeFalse();

+            RepositoryManager.Repository.CloneUrl.Should().BeNull();
+            RepositoryManager.Repository.Owner.Should().BeNull();
+
             repositoryManagerListener.DidNotReceive().OnRepositoryChanged(Args.GitStatus);
             repositoryManagerListener.ReceivedWithAnyArgs().OnIsBusyChanged(Args.Bool);
             repositoryManagerListener.Received().OnActiveBranchChanged();
@@ -319,7 +325,7 @@

             Logger.Trace("Issuing Command");

-            await RepositoryManager.RemoteAdd("origin", "https://github.com/EvilStanleyGoldman/IOTestsRepo.git").StartAsAsync();
+            await RepositoryManager.RemoteAdd("origin", "https://github.com/EvilShana/IOTestsRepo.git").StartAsAsync();
             await TaskManager.Wait();

             managerAutoResetEvent.OnActiveRemoteChanged.WaitOne(TimeSpan.FromSeconds(2)).Should().BeTrue();
@@ -329,7 +335,10 @@

             RepositoryManager.ActiveRemote.HasValue.Should().BeTrue();
             RepositoryManager.ActiveRemote.Value.Name.Should().Be("origin");
-            RepositoryManager.ActiveRemote.Value.Url.Should().Be("https://github.com/EvilStanleyGoldman/IOTestsRepo.git");
+            RepositoryManager.ActiveRemote.Value.Url.Should().Be("https://github.com/EvilShana/IOTestsRepo.git");
+
+            RepositoryManager.Repository.CloneUrl.Should().Be("https://github.com/EvilShana/IOTestsRepo.git");
+            RepositoryManager.Repository.Owner.Should().Be("EvilStanleyGoldman");

             repositoryManagerListener.DidNotReceive().OnRepositoryChanged(Args.GitStatus);
             repositoryManagerListener.ReceivedWithAnyArgs().OnIsBusyChanged(Args.Bool);


Minor download fix

Minor download fix

--- Core/ModManager.cs
+++ Core/ModManager.cs
@@ -21,6 +21,7 @@

 		public List<Item> installedMods = new List<Item> ();

+		private WebClient wc;
 		private bool modDownloaded = false;

 		public ModManager(ModLoader loader) {
@@ -152,12 +153,12 @@

 		public bool downloadMod(LocalMod mod, String location) {
 			Console.WriteLine (mod.source.url + "download/mod/" + mod.id);
-			WebClient wc = new WebClient();
+			wc = new WebClient();

 			wc.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged);
 			wc.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted);

-			wc.DownloadData (mod.source.url + "download/mod/" + mod.id, location);
+			wc.DownloadDataAsync (mod.source.url + "download/mod/" + mod.id, location);

 			return modDownloaded;
 		}


Fixed a typo in the parameter form.

Fixed a typo in the parameter form.

--- GUI/ParameterForm.Designer.cs
+++ GUI/ParameterForm.Designer.cs
@@ -58,7 +58,7 @@
       this.cancelButton.Name = "cancelButton";
       this.cancelButton.Size = new System.Drawing.Size(75, 23);
       this.cancelButton.TabIndex = 3;
-      this.cancelButton.Text = "Canel";
+      this.cancelButton.Text = "Cancel";
       this.cancelButton.UseVisualStyleBackColor = true;
       //
       // captionLabel


made Compile() protected as its supposed to be used within the shader itself

--- IIS.SLSharp/Shaders/Shader.cs
+++ IIS.SLSharp/Shaders/Shader.cs
@@ -131,7 +131,7 @@
         /// Compiles Fragment as well as Vertex shader any exists.
         /// </summary>
         /// <param name="version">The GLSL version to use</param>
-        public void Compile(int version = 130)
+        protected void Compile(int version = 130)
         {
             if (HasType(typeof(FragmentShaderAttribute)))
                 CompileShader(ShaderType.FragmentShader, version);
@@ -169,9 +169,6 @@

             // now we can pull and cache uniform locations
             CacheUniforms();
-
-            // and set up attribute bindings
-            SetupAttributeBindings();
         }

         private static readonly Dictionary<string, string> _globalNames = new Dictionary<string, string>();
@@ -462,6 +459,7 @@
                       select new VariableDescription(type, name, semantic, comment));

             // TODO: what was this supposed to be good for?
+            /*
             var s2 = (from prop in _shader.Properties
                       let attrs = prop.CustomAttributes.Where(a => a.AttributeType.IsVertexIn())
                       where attrs.Count() != 0
@@ -473,6 +471,8 @@
                       select new VariableDescription(type, name, semantic, comment)).ToList();

             return s1.Concat(s2).ToList();
+             */
+            return s1.ToList();
         }

         /// <summary>
@@ -529,7 +529,7 @@
         /// shader that is going to be accessed.
         /// </summary>
         /// <param name="main"></param>
-        public void BeginLibrary(Shader main)
+        protected void BeginLibrary(Shader main)
         {
             Program = main.Program;
             CacheUniforms();
@@ -597,16 +597,6 @@

                 //var f = typeBuilder.DefineField("m_" + prop.Name, typeof(int), FieldAttributes.Private);
             }
-        }
-
-
-        /// <summary>
-        /// Invokes the SLSharp binding to set up attribute usage.
-        /// the purpose of this is to associate [VertexIn] fields with mesh data streams
-        /// </summary>
-        private void SetupAttributeBindings()
-        {
-            // TODO: going to implement this next
         }

         /// <summary>


Adding covering test for issue #23

Adding covering test for issue #23

--- ReadableExpressions.UnitTests/WhenTranslatingConditionals.cs
+++ ReadableExpressions.UnitTests/WhenTranslatingConditionals.cs
@@ -1,10 +1,13 @@
 namespace AgileObjects.ReadableExpressions.UnitTests
 {
     using System;
+    using System.Collections.Generic;
     using NetStandardPolyfills;
 #if !NET35
     using System.Linq.Expressions;
     using Xunit;
+    using static Issue22;
+    using static Issue22.InheritanceTests;
 #else
     using Expression = Microsoft.Scripting.Ast.Expression;
     using Fact = NUnit.Framework.TestAttribute;
@@ -499,6 +502,102 @@

             translated.ShouldBe("flag => (flag ? Test.One : Test.Two) == Test.Two");
         }
+
+#if !NET35
+        [Fact]
+        public void ShouldTranslateConditionalWithConditionalTest()
+        {
+            var dataContext = Expression.Parameter(typeof(IDataContext), "dctx");
+            var dataReader = Expression.Parameter(typeof(IDataReader), "rd");
+
+            var ldr = Expression.Variable(typeof(SqLiteDataReader), "ldr");
+
+            var onEntityCreatedMethod = typeof(TableContext)
+                .GetPublicStaticMethod(nameof(TableContext.OnEntityCreated));
+
+            var mapperBody = Expression.Block(
+                new[] { ldr },
+                Expression.Assign(ldr, Expression.Convert(dataReader, typeof(SqLiteDataReader))),
+                Expression.Condition(
+                    Expression.Equal(
+                        Expression.Condition(
+                            Expression.Call(ldr, nameof(SqLiteDataReader.IsDbNull), null, Expression.Constant(0)),
+                            Expression.Constant(TypeCodeEnum.Base),
+                            Expression.Convert(
+                                Expression.Call(ldr, nameof(SqLiteDataReader.GetInt32), null, Expression.Constant(0)),
+                                typeof(TypeCodeEnum))),
+                        Expression.Constant(TypeCodeEnum.A1)),
+                    Expression.Convert(
+                        Expression.Convert(
+                            Expression.Call(
+                                onEntityCreatedMethod,
+                                dataContext,
+                                Expression.MemberInit(
+                                    Expression.New(typeof(InheritanceA1)),
+                                    Expression.Bind(
+                                        typeof(InheritanceA1).GetPublicInstanceProperty(nameof(InheritanceBase.GuidValue)),
+                                        Expression.Condition(
+                                            Expression.Call(ldr, nameof(SqLiteDataReader.IsDbNull), null, Expression.Constant(1)),
+                                            Expression.Constant(Guid.Empty),
+                                            Expression.Call(ldr, nameof(SqLiteDataReader.GetGuid), null, Expression.Constant(1))))
+                                )
+                            ),
+                            typeof(InheritanceA1)),
+                        typeof(InheritanceA)),
+                    Expression.Convert(
+                        Expression.Convert(
+                            Expression.Call(
+                                onEntityCreatedMethod,
+                                dataContext,
+                                Expression.MemberInit(
+                                    Expression.New(typeof(InheritanceA2)),
+                                    Expression.Bind(
+                                        typeof(InheritanceA2).GetPublicInstanceProperty(nameof(InheritanceBase.GuidValue)),
+                                        Expression.Condition(
+                                            Expression.Call(ldr, nameof(SqLiteDataReader.IsDbNull), null, Expression.Constant(1)),
+                                            Expression.Constant(Guid.Empty),
+                                            Expression.Call(ldr, nameof(SqLiteDataReader.GetGuid), null, Expression.Constant(1))))
+                                )
+                            ),
+                            typeof(InheritanceA2)),
+                        typeof(InheritanceA))));
+
+            var mapper = Expression.Lambda<Func<IDataContext, IDataReader, InheritanceA>>(
+                mapperBody,
+                dataContext,
+                dataReader);
+
+            var body = Expression.Invoke(mapper, dataContext, dataReader);
+
+            var lambda = Expression.Lambda<Func<IDataContext, IDataReader, InheritanceA>>(body, dataContext, dataReader);
+
+            const string EXPECTED = @"
+(dctx, rd) => ((dctx, rd) =>
+{
+    var ldr = (Issue22.SqLiteDataReader)rd;
+
+    return ((ldr.IsDbNull(0)
+        ? Issue22.InheritanceTests.TypeCodeEnum.Base
+        : (Issue22.InheritanceTests.TypeCodeEnum)ldr.GetInt32(0)) == Issue22.InheritanceTests.TypeCodeEnum.A1)
+        ? (Issue22.InheritanceTests.InheritanceA)((Issue22.InheritanceTests.InheritanceA1)Issue22.TableContext.OnEntityCreated(
+            dctx,
+            new Issue22.InheritanceTests.InheritanceA1
+            {
+                GuidValue = ldr.IsDbNull(1) ? default(Guid) : ldr.GetGuid(1)
+            }))
+        : (Issue22.InheritanceTests.InheritanceA)((Issue22.InheritanceTests.InheritanceA2)Issue22.TableContext.OnEntityCreated(
+            dctx,
+            new Issue22.InheritanceTests.InheritanceA2
+            {
+                GuidValue = ldr.IsDbNull(1) ? default(Guid) : ldr.GetGuid(1)
+            }));
+}).Invoke(dctx, rd)";
+
+            var translated = ToReadableString(lambda);
+
+            translated.ShouldBe(EXPECTED.TrimStart());
+        }
+#endif
     }

     #region Helpers
@@ -513,5 +612,71 @@

     internal enum Test { One, Two };

+#if !NET35
+    internal static class Issue22
+    {
+        public interface IDataContext
+        {
+        }
+
+        public interface IDataReader
+        {
+        }
+
+        public class SqLiteDataReader : IDataReader
+        {
+            public bool IsDbNull(int idx) => default(bool);
+
+            public int GetInt32(int idx) => default(int);
+
+            public Guid GetGuid(int idx) => default(Guid);
+        }
+
+        public static class InheritanceTests
+        {
+            public enum TypeCodeEnum
+            {
+                Base,
+                A,
+                A1,
+                A2,
+            }
+
+            public abstract class InheritanceBase
+            {
+                public Guid GuidValue { get; set; }
+            }
+
+            public abstract class InheritanceA : InheritanceBase
+            {
+                public List<InheritanceB> Bs { get; set; }
+            }
+
+            public class InheritanceB : InheritanceBase
+            {
+            }
+
+            public class InheritanceA2 : InheritanceA
+            {
+            }
+
+            public class InheritanceA1 : InheritanceA
+            {
+            }
+        }
+
+        public class TableContext
+        {
+            public static object OnEntityCreated(IDataContext context, object entity) => entity;
+        }
+
+        public enum Test
+        {
+            One,
+            Two
+        }
+    }
+#endif
+
     #endregion
 }


Adding logstatement for cachemiss on book notes

--- ReadingList.Notes.Github/Services/GithubBookRecordService.cs
+++ ReadingList.Notes.Github/Services/GithubBookRecordService.cs
@@ -1,5 +1,4 @@
 using System.Collections.Generic;
-using System.Net.Http;
 using System.Threading.Tasks;
 using Octokit;
 using ReadingList.Logging;
@@ -54,6 +53,7 @@
             {
                 return bookRecord;
             }
+            _logger.Info($"Cache miss for {content.Name} with sha {content.Sha}");
             bookRecord = await GetBookRecordFromApi(content);
             _bookRecordCache.TryAdd(content.Sha, bookRecord);
             return bookRecord;


rename to invalidationUrls

rename to invalidationUrls

--- Signum.Engine.Extensions/Cache/SimpleHttpCacheInvalidator.cs
+++ Signum.Engine.Extensions/Cache/SimpleHttpCacheInvalidator.cs
@@ -16,12 +16,12 @@

     HttpClient client = new HttpClient();
     readonly string invalidationSecretHash;
-    readonly string[] invalidateUrls;
+    readonly string[] invalidationUrls;

-    public SimpleHttpCacheInvalidator(string invalidationSecret, string[] invalidateUrls)
+    public SimpleHttpCacheInvalidator(string invalidationSecret, string[] invalidationUrls)
     {
         this.invalidationSecretHash = Convert.ToBase64String(Security.EncodePassword(invalidationSecret));
-        this.invalidateUrls = invalidateUrls;
+        this.invalidationUrls = invalidationUrls;
     }

     public event Action<string>? ReceiveInvalidation;
@@ -53,7 +53,7 @@
             OriginApplicationName = Schema.Current.ApplicationName,
         };

-        foreach (var url in invalidateUrls)
+        foreach (var url in invalidationUrls)
         {
             try
             {


PackageName Equality #ADD: Added Equals and equality operator support to PackageName.

--- Source/Editor/DualityEditor/PackageManagement/PackageName.cs
+++ Source/Editor/DualityEditor/PackageManagement/PackageName.cs
@@ -5,12 +5,12 @@

 namespace Duality.Editor.PackageManagement
 {
-	public struct PackageName
+	public struct PackageName : IEquatable<PackageName>
 	{
 		public static readonly PackageName None = new PackageName(null, null);

-		public string	Id;
-		public Version	Version;
+		public string  Id;
+		public Version Version;

 		public PackageName VersionInvariant
 		{
@@ -28,9 +28,40 @@
 			this.Version = version;
 		}

+		public bool Equals(PackageName other)
+		{
+			return
+				this.Id == other.Id &&
+				this.Version == other.Version;
+		}
+		public override bool Equals(object obj)
+		{
+			if (obj is PackageName)
+				return this.Equals((PackageName)obj);
+			else
+				return false;
+		}
+		public override int GetHashCode()
+		{
+			unchecked
+			{
+				return
+					92357 * this.Id.GetHashCode() +
+					this.Version.GetHashCode();
+			}
+		}
 		public override string ToString()
 		{
 			return string.Format("{0}, {1}", this.Id, this.Version);
 		}
+
+		public static bool operator == (PackageName a, PackageName b)
+		{
+			return a.Equals(b);
+		}
+		public static bool operator != (PackageName a, PackageName b)
+		{
+			return !a.Equals(b);
+		}
 	}
 }


GSF.PhasorProtocols.UI: Added optional analog scalars collection to Device save operations.

--- Source/Libraries/GSF.PhasorProtocols/UI/DataModels/Device.cs
+++ Source/Libraries/GSF.PhasorProtocols/UI/DataModels/Device.cs
@@ -1035,11 +1035,11 @@
         /// <param name="analogCount">Number of analog measurements to add.</param>
         /// <param name="digitalLabels">Collection of digital labels associated with a device in configuration frame.</param>
         /// <param name="analogLabels">Collection of analog labels associated with a device in configuration frame.</param>
+        /// <param name="analogScalars">Collection of analog scalars associated with a device in configuration frame.</param>
         /// <returns>String, for display use, indicating success.</returns>
-        public static string SaveWithAnalogsDigitals(AdoDataConnection database, Device device, bool notifyService, int digitalCount, int analogCount, List<string> digitalLabels = null, List<string> analogLabels = null)
+        public static string SaveWithAnalogsDigitals(AdoDataConnection database, Device device, bool notifyService, int digitalCount, int analogCount, List<string> digitalLabels = null, List<string> analogLabels = null, Tuple<float, float>[] analogScalars = null)
         {
             bool createdConnection = false;
-            string query;

             try
             {
@@ -1048,6 +1048,7 @@
                 createdConnection = CreateConnection(ref database);

                 object nodeID = device.NodeID == Guid.Empty ? database.CurrentNodeID() : database.Guid(device.NodeID);
+                string query;

                 if (device.ID == 0)
                 {
@@ -1138,6 +1139,13 @@

                                     if (!(analogLabels?[i - 1] is null))
                                         measurement.AlternateTag = analogLabels[i - 1];
+
+                                    if (!(analogScalars?[i -1] is null))
+                                    {
+                                        Tuple<float, float> scalarSet = analogScalars?[i - 1];
+                                        measurement.Adder = scalarSet.Item1;
+                                        measurement.Multiplier = scalarSet.Item2;
+                                    }

                                     Measurement.Save(database, measurement);
                                 }


EnumDescriptionConverter: check for null

--- Source/PropertyEditor/Converters/EnumDescriptionConverter.cs
+++ Source/PropertyEditor/Converters/EnumDescriptionConverter.cs
@@ -17,10 +17,22 @@

         public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
         {
-            var enumType = value.GetType();
-            var field = enumType.GetFields(BindingFlags.Static | BindingFlags.GetField | BindingFlags.Public).First(f => f.GetValue(null).Equals(value));
-            var descriptionAttribute = field.GetCustomAttributes<DescriptionAttribute>(true).FirstOrDefault();
-            return descriptionAttribute != null ? descriptionAttribute.Description : value;
+            // Default, non-converted result.
+            string result = value.ToString();
+
+            var field = value.GetType().GetFields(BindingFlags.Static | BindingFlags.GetField | BindingFlags.Public).FirstOrDefault(f => f.GetValue(null).Equals(value));
+
+            if (field != null)
+            {
+                var descriptionAttribute = field.GetCustomAttributes<DescriptionAttribute>(true).FirstOrDefault();
+                if (descriptionAttribute != null)
+                {
+                    // Found the attribute, assign description
+                    result = descriptionAttribute.Description;
+                }
+            }
+
+            return result;
         }

         public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)


Do not assume case insensitivity in the FileSystem for ExternalFile locations. (changeset 1217524)

--- Src/Compilers/Core/Source/Diagnostic/ExternalFileLocation.cs
+++ Src/Compilers/Core/Source/Diagnostic/ExternalFileLocation.cs
@@ -72,7 +72,7 @@
             }

             return obj != null &&
-                StringComparer.OrdinalIgnoreCase.Equals(this.filePath, obj.filePath) &&
+                StringComparer.Ordinal.Equals(this.filePath, obj.filePath) &&
                 this.sourceSpan == obj.sourceSpan &&
                 this.lineSpan.Equals(obj.lineSpan);
         }
@@ -81,7 +81,7 @@
         {
             return
                 Hash.Combine(this.lineSpan.GetHashCode(),
-                Hash.Combine(this.sourceSpan.GetHashCode(), StringComparer.OrdinalIgnoreCase.GetHashCode(this.filePath)));
+                Hash.Combine(this.sourceSpan.GetHashCode(), StringComparer.Ordinal.GetHashCode(this.filePath)));
         }
     }
 }


Renaming

Renaming

--- test/Narochno.Primitives.Parsing.Tests/EnumParserTests.cs
+++ test/Narochno.Primitives.Parsing.Tests/EnumParserTests.cs
@@ -17,7 +17,7 @@
         }

         [Fact]
-        public void TestParseEnumAttribute()
+        public void TestParseAttribute()
         {
             Assert.Equal(TestEnum.One, "test_one".To<TestEnum>());
             Assert.Equal(TestEnum.Two, "test_two".To<TestEnum>());
@@ -25,7 +25,7 @@
         }

         [Fact]
-        public void TestParseEnumNoAttribute()
+        public void TestParseNoAttribute()
         {
             Assert.Equal(TestEnum.One, "One".To<TestEnum>());
             Assert.Equal(TestEnum.Two, "Two".To<TestEnum>());
@@ -33,7 +33,7 @@
         }

         [Fact]
-        public void TestParseEnumAttributeToOptional()
+        public void TestParseAttributeToOptional()
         {
             Assert.Equal(TestEnum.One, "test_one".ToOptional<TestEnum>().Value);
             Assert.Equal(TestEnum.Two, "test_two".ToOptional<TestEnum>().Value);
@@ -41,7 +41,7 @@
         }

         [Fact]
-        public void TestParseEnumNoAttributeToOptional()
+        public void TestParseNoAttributeToOptional()
         {
             Assert.Equal(TestEnum.One, "One".ToOptional<TestEnum>().Value);
             Assert.Equal(TestEnum.Two, "Two".ToOptional<TestEnum>().Value);


Added ShardKey serialization tests for Guid

--- Test/ElasticScale.ShardManagement.UnitTests/ShardKeyTests.cs
+++ Test/ElasticScale.ShardManagement.UnitTests/ShardKeyTests.cs
@@ -52,6 +52,7 @@
         private readonly ShardKeyAndRawValue[] _shardKeyAndRawValues =
         {
             #region Int32
+
             new ShardKeyAndRawValue
             {
                 ShardKey = ShardKey.MinInt32,
@@ -98,8 +99,11 @@
                 ShardKey = ShardKey.MaxInt32,
                 RawValue = null
             },
+
             #endregion
+
             #region Int64
+
             new ShardKeyAndRawValue
             {
                 ShardKey = ShardKey.MinInt64,
@@ -146,6 +150,36 @@
                 ShardKey = ShardKey.MaxInt64,
                 RawValue = null
             },
+
+            #endregion
+
+            #region Guid
+
+            new ShardKeyAndRawValue
+            {
+                ShardKey = ShardKey.MinGuid,
+                RawValue = new byte[] {}
+            },
+
+            new ShardKeyAndRawValue
+            {
+                ShardKey = new ShardKey(Guid.Empty),
+                RawValue = new byte[] {}
+            },
+
+            new ShardKeyAndRawValue
+            {
+                ShardKey = new ShardKey(Guid.Parse("a0a1a2a3-a4a5-a6a7-a8a9-aaabacadaeaf")),
+                RawValue = new byte[] {0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* - */ 0xa8, 0xa9,
+                                        /* - */ 0xa7, 0xa6, /* - */ 0xa5, 0xa4, /* - */ 0xa3, 0xa2, 0xa1, 0xa0}
+            },
+
+            new ShardKeyAndRawValue
+            {
+                ShardKey = ShardKey.MaxGuid,
+                RawValue = null
+            },
+
             #endregion
         };

@@ -155,7 +189,8 @@
         private Dictionary<ShardKeyType, int> _shardKeyTypeLength = new Dictionary<ShardKeyType, int>
         {
             {ShardKeyType.Int32, 4},
-            {ShardKeyType.Int64, 8}
+            {ShardKeyType.Int64, 8},
+            {ShardKeyType.Guid, 16},
         };

         [TestMethod]


Fix MovingAverageType in KeltnerChannels Indicator (#5954)

The Simple Moving Average was always used instead of the one passed to
the KeltnerChannels constructor.

--- Indicators/KeltnerChannels.cs
+++ Indicators/KeltnerChannels.cs
@@ -68,7 +68,7 @@
             WarmUpPeriod = period;

             //Initialise ATR and SMA
-            AverageTrueRange = new AverageTrueRange(name + "_AverageTrueRange", period, MovingAverageType.Simple);
+            AverageTrueRange = new AverageTrueRange(name + "_AverageTrueRange", period, movingAverageType);
             MiddleBand = movingAverageType.AsIndicator(name + "_MiddleBand", period);

             //Compute Lower Band


Add unit test

Add unit test


LibraryManager: Disable the TextLineEvent to avaid too many refresh

--- VisualStudio/ProjectPackage/Library/TextLineEventListener.cs
+++ VisualStudio/ProjectPackage/Library/TextLineEventListener.cs
@@ -95,7 +95,7 @@
             {
                 eh(this, pTextLineChange, fLast);
             }
-
+            // As soon as we have a modification on a buffer... Maybe a little bit too much !! :)
             isDirty = true;
         }
         #endregion
@@ -127,7 +127,8 @@
             {
                 HierarchyEventArgs args = new HierarchyEventArgs(fileId.ItemID, fileName);
                 args.TextBuffer = buffer;
-                onFileChanged(fileId.Hierarchy, args);
+                // Enqueue a Library Request
+                //onFileChanged(fileId.Hierarchy, args);
             }

             isDirty = false;


[skip ci] format

[skip ci] format

--- WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
+++ WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
@@ -177,10 +177,6 @@
 				}
 			});

-
-
-
-
 			this.WhenAnyValue(x => x.Password).Subscribe(x =>
 			{
 				if (x.NotNullAndNotEmpty())


Log the value of negative fee.

Log the value of negative fee.

--- WalletWasabi/CoinJoin/Coordinator/Rounds/CoordinatorRound.cs
+++ WalletWasabi/CoinJoin/Coordinator/Rounds/CoordinatorRound.cs
@@ -766,7 +766,7 @@
 				}
 				else if (fee <= Money.Zero)
 				{
-					Logger.LogError($"Round ({RoundId}): CoinJoin transaction is not paying any fee.");
+					Logger.LogError($"Round ({RoundId}): CoinJoin transaction is not paying any fee. Fee: {fee.ToString(fplus: true)}.");
 				}
 				else
 				{


creation

creation

--- WebAdressBook/WebAdressBook/Controllers/AccountController.cs
+++ WebAdressBook/WebAdressBook/Controllers/AccountController.cs
@@ -15,7 +15,65 @@
     [Authorize]
     public class AccountController : Controller
     {
-
+        private ApplicationSignInManager _signInManager;
+        private ApplicationUserManager _userManager;
+
+        public AccountController()
+        {
+        }
+
+        public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager)
+        {
+            UserManager = userManager;
+            SignInManager = signInManager;
+        }
+
+        public ApplicationSignInManager SignInManager
+        {
+            get
+            {
+                return _signInManager ?? HttpContext.GetOwinContext().Get<ApplicationSignInManager>();
+            }
+            private set
+            {
+                _signInManager = value;
+            }
+        }
+
+        public ApplicationUserManager UserManager
+        {
+            get
+            {
+                return _userManager ?? HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>();
+            }
+            private set
+            {
+                _userManager = value;
+            }
+        }
+
+        // The Authorize Action is the end point which gets called when you access any
+        // protected Web API. If the user is not logged in then they will be redirected to
+        // the Login page. After a successful login you can call a Web API.
+        [HttpGet]
+        public ActionResult Authorize()
+        {
+            var claims = new ClaimsPrincipal(User).Claims.ToArray();
+            var identity = new ClaimsIdentity(claims, "Bearer");
+            AuthenticationManager.SignIn(identity);
+            return new EmptyResult();
+        }
+
+        //
+        // GET: /Account/Login
+        [AllowAnonymous]
+        public ActionResult Login(string returnUrl)
+        {
+            ViewBag.ReturnUrl = returnUrl;
+            return View();
+        }
+
+        //
         // POST: /Account/Login
         [HttpPost]
         [AllowAnonymous]
@@ -30,13 +88,401 @@
             // This doesn't count login failures towards account lockout
             // To enable password failures to trigger account lockout, change to shouldLockout: true

-            if (model.Login == "test1" && model.Password == "test2")
-            {
-                return RedirectToAction("Index", "Main");
+            if (model.Login == "test1" && model.Password == "test2"{
+                return RedirectToLocal(returnUrl);
             }
             return View(model);
-        }
-
-
+       }
+
+        //
+        // GET: /Account/VerifyCode
+        [AllowAnonymous]
+        public async Task<ActionResult> VerifyCode(string provider, string returnUrl, bool rememberMe)
+        {
+            // Require that the user has already logged in via username/password or external login
+            if (!await SignInManager.HasBeenVerifiedAsync())
+            {
+                return View("Error");
+            }
+            return View(new VerifyCodeViewModel { Provider = provider, ReturnUrl = returnUrl, RememberMe = rememberMe });
+        }
+
+        //
+        // POST: /Account/VerifyCode
+        [HttpPost]
+        [AllowAnonymous]
+        [ValidateAntiForgeryToken]
+        public async Task<ActionResult> VerifyCode(VerifyCodeViewModel model)
+        {
+            if (!ModelState.IsValid)
+            {
+                return View(model);
+            }
+
+            // The following code protects for brute force attacks against the two factor codes.
+            // If a user enters incorrect codes for a specified amount of time then the user account
+            // will be locked out for a specified amount of time.
+            // You can configure the account lockout settings in IdentityConfig
+            var result = await SignInManager.TwoFactorSignInAsync(model.Provider, model.Code, isPersistent: model.RememberMe, rememberBrowser: model.RememberBrowser);
+            switch (result)
+            {
+                case SignInStatus.Success:
+                    return RedirectToLocal(model.ReturnUrl);
+                case SignInStatus.LockedOut:
+                    return View("Lockout");
+                case SignInStatus.Failure:
+                default:
+                    ModelState.AddModelError("", "Invalid code.");
+                    return View(model);
+            }
+        }
+
+        //
+        // GET: /Account/Register
+        [AllowAnonymous]
+        public ActionResult Register()
+        {
+            return View();
+        }
+
+        //
+        // POST: /Account/Register
+        [HttpPost]
+        [AllowAnonymous]
+        [ValidateAntiForgeryToken]
+        public async Task<ActionResult> Register(RegisterViewModel model)
+        {
+            if (ModelState.IsValid)
+            {
+                var user = new ApplicationUser { UserName = model.Email, Email = model.Email, Hometown = model.Hometown };
+                var result = await UserManager.CreateAsync(user, model.Password);
+                if (result.Succeeded)
+                {
+                    await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
+
+                    // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=320771
+                    // Send an email with this link
+                    // string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id);
+                    // var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
+                    // await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking here");
+
+                    return RedirectToAction("Index", "Home");
+                }
+                AddErrors(result);
+            }
+
+            // If we got this far, something failed, redisplay form
+            return View(model);
+        }
+
+        //
+        // GET: /Account/ConfirmEmail
+        [AllowAnonymous]
+        public async Task<ActionResult> ConfirmEmail(string userId, string code)
+        {
+            if (userId == null || code == null)
+            {
+                return View("Error");
+            }
+            var result = await UserManager.ConfirmEmailAsync(userId, code);
+            return View(result.Succeeded ? "ConfirmEmail" : "Error");
+        }
+
+        //
+        // GET: /Account/ForgotPassword
+        [AllowAnonymous]
+        public ActionResult ForgotPassword()
+        {
+            return View();
+        }
+
+        //
+        // POST: /Account/ForgotPassword
+        [HttpPost]
+        [AllowAnonymous]
+        [ValidateAntiForgeryToken]
+        public async Task<ActionResult> ForgotPassword(ForgotPasswordViewModel model)
+        {
+            if (ModelState.IsValid)
+            {
+                var user = await UserManager.FindByNameAsync(model.Email);
+                if (user == null || !(await UserManager.IsEmailConfirmedAsync(user.Id)))
+                {
+                    // Don't reveal that the user does not exist or is not confirmed
+                    return View("ForgotPasswordConfirmation");
+                }
+
+                // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=320771
+                // Send an email with this link
+                // string code = await UserManager.GeneratePasswordResetTokenAsync(user.Id);
+                // var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
+                // await UserManager.SendEmailAsync(user.Id, "Reset Password", "Please reset your password by clicking here");
+                // return RedirectToAction("ForgotPasswordConfirmation", "Account");
+            }
+
+            // If we got this far, something failed, redisplay form
+            return View(model);
+        }
+
+        //
+        // GET: /Account/ForgotPasswordConfirmation
+        [AllowAnonymous]
+        public ActionResult ForgotPasswordConfirmation()
+        {
+            return View();
+        }
+
+        //
+        // GET: /Account/ResetPassword
+        [AllowAnonymous]
+        public ActionResult ResetPassword(string code)
+        {
+            return code == null ? View("Error") : View();
+        }
+
+        //
+        // POST: /Account/ResetPassword
+        [HttpPost]
+        [AllowAnonymous]
+        [ValidateAntiForgeryToken]
+        public async Task<ActionResult> ResetPassword(ResetPasswordViewModel model)
+        {
+            if (!ModelState.IsValid)
+            {
+                return View(model);
+            }
+            var user = await UserManager.FindByNameAsync(model.Email);
+            if (user == null)
+            {
+                // Don't reveal that the user does not exist
+                return RedirectToAction("ResetPasswordConfirmation", "Account");
+            }
+            var result = await UserManager.ResetPasswordAsync(user.Id, model.Code, model.Password);
+            if (result.Succeeded)
+            {
+                return RedirectToAction("ResetPasswordConfirmation", "Account");
+            }
+            AddErrors(result);
+            return View();
+        }
+
+        //
+        // GET: /Account/ResetPasswordConfirmation
+        [AllowAnonymous]
+        public ActionResult ResetPasswordConfirmation()
+        {
+            return View();
+        }
+
+        //
+        // POST: /Account/ExternalLogin
+        [HttpPost]
+        [AllowAnonymous]
+        [ValidateAntiForgeryToken]
+        public ActionResult ExternalLogin(string provider, string returnUrl)
+        {
+            // Request a redirect to the external login provider
+            return new ChallengeResult(provider, Url.Action("ExternalLoginCallback", "Account", new { ReturnUrl = returnUrl }));
+        }
+
+        //
+        // GET: /Account/SendCode
+        [AllowAnonymous]
+        public async Task<ActionResult> SendCode(string returnUrl, bool rememberMe)
+        {
+            var userId = await SignInManager.GetVerifiedUserIdAsync();
+            if (userId == null)
+            {
+                return View("Error");
+            }
+            var userFactors = await UserManager.GetValidTwoFactorProvidersAsync(userId);
+            var factorOptions = userFactors.Select(purpose => new SelectListItem { Text = purpose, Value = purpose }).ToList();
+            return View(new SendCodeViewModel { Providers = factorOptions, ReturnUrl = returnUrl, RememberMe = rememberMe });
+        }
+
+        //
+        // POST: /Account/SendCode
+        [HttpPost]
+        [AllowAnonymous]
+        [ValidateAntiForgeryToken]
+        public async Task<ActionResult> SendCode(SendCodeViewModel model)
+        {
+            if (!ModelState.IsValid)
+            {
+                return View();
+            }
+
+            // Generate the token and send it
+            if (!await SignInManager.SendTwoFactorCodeAsync(model.SelectedProvider))
+            {
+                return View("Error");
+            }
+            return RedirectToAction("VerifyCode", new { Provider = model.SelectedProvider, ReturnUrl = model.ReturnUrl, RememberMe = model.RememberMe });
+        }
+
+        //
+        // GET: /Account/ExternalLoginCallback
+        [AllowAnonymous]
+        public async Task<ActionResult> ExternalLoginCallback(string returnUrl)
+        {
+            var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();
+            if (loginInfo == null)
+            {
+                return RedirectToAction("Login");
+            }
+
+            // Sign in the user with this external login provider if the user already has a login
+            var result = await SignInManager.ExternalSignInAsync(loginInfo, isPersistent: false);
+            switch (result)
+            {
+                case SignInStatus.Success:
+                    return RedirectToLocal(returnUrl);
+                case SignInStatus.LockedOut:
+                    return View("Lockout");
+                case SignInStatus.RequiresVerification:
+                    return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = false });
+                case SignInStatus.Failure:
+                default:
+                    // If the user does not have an account, then prompt the user to create an account
+                    ViewBag.ReturnUrl = returnUrl;
+                    ViewBag.LoginProvider = loginInfo.Login.LoginProvider;
+                    return View("ExternalLoginConfirmation", new ExternalLoginConfirmationViewModel { Email = loginInfo.Email });
+            }
+        }
+
+        //
+        // POST: /Account/ExternalLoginConfirmation
+        [HttpPost]
+        [AllowAnonymous]
+        [ValidateAntiForgeryToken]
+        public async Task<ActionResult> ExternalLoginConfirmation(ExternalLoginConfirmationViewModel model, string returnUrl)
+        {
+            if (User.Identity.IsAuthenticated)
+            {
+                return RedirectToAction("Index", "Manage");
+            }
+
+            if (ModelState.IsValid)
+            {
+                // Get the information about the user from the external login provider
+                var info = await AuthenticationManager.GetExternalLoginInfoAsync();
+                if (info == null)
+                {
+                    return View("ExternalLoginFailure");
+                }
+                var user = new ApplicationUser { UserName = model.Email, Email = model.Email, Hometown = model.Hometown };
+                var result = await UserManager.CreateAsync(user);
+                if (result.Succeeded)
+                {
+                    result = await UserManager.AddLoginAsync(user.Id, info.Login);
+                    if (result.Succeeded)
+                    {
+                        await SignInManager.SignInAsync(user, isPersistent: false, rememberBrowser: false);
+                        return RedirectToLocal(returnUrl);
+                    }
+                }
+                AddErrors(result);
+            }
+
+            ViewBag.ReturnUrl = returnUrl;
+            return View(model);
+        }
+
+        //
+        // POST: /Account/LogOff
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public ActionResult LogOff()
+        {
+            AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
+            return RedirectToAction("Index", "Home");
+        }
+
+        //
+        // GET: /Account/ExternalLoginFailure
+        [AllowAnonymous]
+        public ActionResult ExternalLoginFailure()
+        {
+            return View();
+        }
+
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing)
+            {
+                if (_userManager != null)
+                {
+                    _userManager.Dispose();
+                    _userManager = null;
+                }
+
+                if (_signInManager != null)
+                {
+                    _signInManager.Dispose();
+                    _signInManager = null;
+                }
+            }
+
+            base.Dispose(disposing);
+        }
+
+        #region Helpers
+        // Used for XSRF protection when adding external logins
+        private const string XsrfKey = "XsrfId";
+
+        private IAuthenticationManager AuthenticationManager
+        {
+            get
+            {
+                return HttpContext.GetOwinContext().Authentication;
+            }
+        }
+
+        private void AddErrors(IdentityResult result)
+        {
+            foreach (var error in result.Errors)
+            {
+                ModelState.AddModelError("", error);
+            }
+        }
+
+        private ActionResult RedirectToLocal(string returnUrl)
+        {
+            if (Url.IsLocalUrl(returnUrl))
+            {
+                return Redirect(returnUrl);
+            }
+            return RedirectToAction("Index", "Home");
+        }
+
+        internal class ChallengeResult : HttpUnauthorizedResult
+        {
+            public ChallengeResult(string provider, string redirectUri)
+                : this(provider, redirectUri, null)
+            {
+            }
+
+            public ChallengeResult(string provider, string redirectUri, string userId)
+            {
+                LoginProvider = provider;
+                RedirectUri = redirectUri;
+                UserId = userId;
+            }
+
+            public string LoginProvider { get; set; }
+            public string RedirectUri { get; set; }
+            public string UserId { get; set; }
+
+            public override void ExecuteResult(ControllerContext context)
+            {
+                var properties = new AuthenticationProperties { RedirectUri = RedirectUri };
+                if (UserId != null)
+                {
+                    properties.Dictionary[XsrfKey] = UserId;
+                }
+                context.HttpContext.GetOwinContext().Authentication.Challenge(properties, LoginProvider);
+            }
+        }
+        #endregion
     }
 }