Removed OnResize

Removed OnResize

--- SliderControlLibrary/Controls/HandleControl.cs
+++ SliderControlLibrary/Controls/HandleControl.cs
@@ -68,11 +68,6 @@

         #endregion

-        private Rectangle HandleRectangle { get; set; } = new Rectangle(0,0,0,0);
-        private Rectangle TextRectangle { get; set; } = new Rectangle(0,0,0,0);
-        private GraphicsPath HandlePath { get; set; } = new GraphicsPath();
-        private GraphicsPath TextPath { get; set; } = new GraphicsPath();
-
         public HandleControl()
         {
             InitializeComponent();
@@ -84,39 +79,35 @@
         {
             base.OnPaint(e);

+            var handleRectangle = new Rectangle(0, Height / 2 - HandleHeight / 2 - 1, HandleWidth, HandleHeight);
+            var textRectangle = new Rectangle(HandleWidth, 0, Width - HandleWidth - 2, Height - 2);
+            var handlePath = GraphicsUtilities.CreateRoundedRectanglePath(handleRectangle, 4);
+            var textPath = GraphicsUtilities.CreateRoundedRectanglePath(textRectangle, 8);
+
             var graphics = e.Graphics;

             using (var brush = new SolidBrush(BackColor))
             {
-                graphics.FillPath(brush, HandlePath);
-                graphics.FillPath(brush, TextPath);
+                graphics.FillPath(brush, handlePath);
+                graphics.FillPath(brush, textPath);
             }
             using (var pen = new Pen(BorderColor))
             {
                 pen.StartCap = LineCap.Round;
                 pen.EndCap = LineCap.Round;
-                graphics.DrawPath(pen, HandlePath);
-                graphics.DrawPath(pen, TextPath);
+                graphics.DrawPath(pen, handlePath);
+                graphics.DrawPath(pen, textPath);
             }
             using (var brush = new SolidBrush(BackColor))
             {
-                var rect = HandleRectangle;
+                var rect = handleRectangle;
                 rect.Inflate(2, -1);
                 graphics.FillRectangle(brush, rect);
             }
-        }

-        protected override void OnResize(EventArgs e)
-        {
-            base.OnResize(e);
-
-            HandleRectangle = new Rectangle(0, Height / 2 - HandleHeight / 2 - 1, HandleWidth, HandleHeight);
-            TextRectangle = new Rectangle(HandleWidth, 0, Width - HandleWidth - 2, Height - 2);
-            HandlePath = GraphicsUtilities.CreateRoundedRectanglePath(HandleRectangle, 4);
-            TextPath = GraphicsUtilities.CreateRoundedRectanglePath(TextRectangle, 8);
-
-            Region = GraphicsUtilities.GetRegionForPath(HandlePath);
-            Region.Union(GraphicsUtilities.GetRegionForPath(TextPath));
+            var region = GraphicsUtilities.GetRegionForPath(handlePath);
+            region.Union(GraphicsUtilities.GetRegionForPath(textPath));
+            Region = region;
         }
     }
 }


Add renderable Point

Add renderable Point

--- SolidworksAddinFramework/OpenGl/IRenderable.cs
+++ SolidworksAddinFramework/OpenGl/IRenderable.cs
@@ -1,6 +1,9 @@
 using System;
 using System.Numerics;
+using OpenTK.Graphics.OpenGL;
 using SolidWorks.Interop.sldworks;
+using MGL = SolidworksAddinFramework.OpenGl.ModernOpenGl;
+using OpenTK.Graphics.OpenGL;

 namespace SolidworksAddinFramework.OpenGl
 {
@@ -9,4 +12,28 @@
         void Render(DateTime time);
         void ApplyTransform(Matrix4x4 transform);
     }
+
+    public class Point : IRenderable
+    {
+        public Point(Vector3 location)
+        {
+            Location = location;
+        }
+
+        private Vector3 Location { get; }
+
+        public void Render(DateTime time)
+        {
+            using (MGL.Begin(PrimitiveType.Points))
+            {
+                Location.GLVertex3();
+            }
+
+        }
+
+        public void ApplyTransform(Matrix4x4 transform)
+        {
+            throw new NotImplementedException();
+        }
+    }
 }


Added an s to some Type names

Added an s to some Type names

--- Source/Applications/openXDA/openXDA/DataHub.cs
+++ Source/Applications/openXDA/openXDA/DataHub.cs
@@ -4035,8 +4035,8 @@
                 { "Breaker", "#A500FF" },
             };

-            List<string> disabledFields = DataContext.Table<DashSettings>().QueryRecords(restriction: new RecordRestriction("Name = 'EventChart' AND Enabled = 0")).Select(x => x.Value).ToList();
-            IEnumerable<DashSettings> usersColors = DataContext.Table<DashSettings>().QueryRecords(restriction: new RecordRestriction("Name = 'EventChartColors' AND Enabled = 1"));
+            List<string> disabledFields = DataContext.Table<DashSettings>().QueryRecords(restriction: new RecordRestriction("Name = 'EventsChart' AND Enabled = 0")).Select(x => x.Value).ToList();
+            IEnumerable<DashSettings> usersColors = DataContext.Table<DashSettings>().QueryRecords(restriction: new RecordRestriction("Name = 'EventsChartColors' AND Enabled = 1"));
             DataTable table = new DataTable();

             foreach (var color in usersColors)
@@ -4081,7 +4081,7 @@
                                     eventSet.Types[eventSet.Types.Count - 1].Color = "#" + r.Next(256).ToString("X2") + r.Next(256).ToString("X2") + r.Next(256).ToString("X2");
                                     DashSettings ds = new DashSettings()
                                     {
-                                        Name = "EventChartColors",
+                                        Name = "EventsChartColors",
                                         Value = column.ColumnName + "," + eventSet.Types[eventSet.Types.Count - 1].Color,
                                         Enabled = true
                                     };
@@ -4111,7 +4111,7 @@
                                     eventSet.Types[eventSet.Types.Count - 1].Color = "#" + r.Next(256).ToString("X2") + r.Next(256).ToString("X2") + r.Next(256).ToString("X2");
                                     DashSettings ds = new DashSettings()
                                     {
-                                        Name = "EventChartColors",
+                                        Name = "EventsChartColors",
                                         Value = column.ColumnName + "," + eventSet.Types[eventSet.Types.Count - 1].Color,
                                         Enabled = true
                                     };
@@ -4306,8 +4306,8 @@

             };

-            List<string> disabledFields = DataContext.Table<DashSettings>().QueryRecords(restriction: new RecordRestriction("Name = 'FaultChart' AND Enabled = 0")).Select(x => x.Value).ToList();
-            IEnumerable<DashSettings> usersColors = DataContext.Table<DashSettings>().QueryRecords(restriction: new RecordRestriction("Name = 'FaultChartColors' AND Enabled = 1"));
+            List<string> disabledFields = DataContext.Table<DashSettings>().QueryRecords(restriction: new RecordRestriction("Name = 'FaultsChart' AND Enabled = 0")).Select(x => x.Value).ToList();
+            IEnumerable<DashSettings> usersColors = DataContext.Table<DashSettings>().QueryRecords(restriction: new RecordRestriction("Name = 'FaultsChartColors' AND Enabled = 1"));
             DataTable table = new DataTable();

             foreach (var color in usersColors)
@@ -4350,7 +4350,7 @@
                                     eventSet.Types[eventSet.Types.Count - 1].Color = "#" + r.Next(256).ToString("X2") + r.Next(256).ToString("X2") + r.Next(256).ToString("X2");
                                     DashSettings ds = new DashSettings()
                                     {
-                                        Name = "FaultChartColors",
+                                        Name = "FaultsChartColors",
                                         Value = column.ColumnName + "," + eventSet.Types[eventSet.Types.Count - 1].Color,
                                         Enabled = true
                                     };
@@ -4380,7 +4380,7 @@
                                     eventSet.Types[eventSet.Types.Count - 1].Color = "#" + r.Next(256).ToString("X2") + r.Next(256).ToString("X2") + r.Next(256).ToString("X2");
                                     DashSettings ds = new DashSettings()
                                     {
-                                        Name = "FaultChartColors",
+                                        Name = "FaultsChartColors",
                                         Value = column.ColumnName + "," + eventSet.Types[eventSet.Types.Count - 1].Color,
                                         Enabled = true
                                     };
@@ -4428,8 +4428,8 @@
                 { "Indeterminate", "#90ed7d" }
             };

-            List<string> disabledFields = DataContext.Table<DashSettings>().QueryRecords(restriction: new RecordRestriction("Name = 'BreakerChart' AND Enabled = 0")).Select(x => x.Value).ToList();
-            IEnumerable<DashSettings> usersColors = DataContext.Table<DashSettings>().QueryRecords(restriction: new RecordRestriction("Name = 'BreakerChartColors' AND Enabled = 1"));
+            List<string> disabledFields = DataContext.Table<DashSettings>().QueryRecords(restriction: new RecordRestriction("Name = 'BreakersChart' AND Enabled = 0")).Select(x => x.Value).ToList();
+            IEnumerable<DashSettings> usersColors = DataContext.Table<DashSettings>().QueryRecords(restriction: new RecordRestriction("Name = 'BreakersChartColors' AND Enabled = 1"));
             DataTable table = new DataTable();

             foreach (var color in usersColors)
@@ -4475,7 +4475,7 @@
                                     eventSet.Types[eventSet.Types.Count - 1].Color = "#" + r.Next(256).ToString("X2") + r.Next(256).ToString("X2") + r.Next(256).ToString("X2");
                                     DashSettings ds = new DashSettings()
                                     {
-                                        Name = "BreakerChartColors",
+                                        Name = "BreakersChartColors",
                                         Value = column.ColumnName + "," + eventSet.Types[eventSet.Types.Count - 1].Color,
                                         Enabled = true
                                     };
@@ -4505,7 +4505,7 @@
                                     eventSet.Types[eventSet.Types.Count - 1].Color = "#" + r.Next(256).ToString("X2") + r.Next(256).ToString("X2") + r.Next(256).ToString("X2");
                                     DashSettings ds = new DashSettings()
                                     {
-                                        Name = "BreakerChartColors",
+                                        Name = "BreakersChartColors",
                                         Value = column.ColumnName + "," + eventSet.Types[eventSet.Types.Count - 1].Color,
                                         Enabled = true
                                     };


GSF.COMTRADE: Updated AnanlogChannel.AngleUnit property to be reset if Units are updated.

--- Source/Libraries/GSF.COMTRADE/AnalogChannel.cs
+++ Source/Libraries/GSF.COMTRADE/AnalogChannel.cs
@@ -510,6 +510,8 @@

                 if (m_units.Length > 32)
                     m_units = m_units.Substring(0, 32);
+
+                m_angleUnit = null;
             }
         }

@@ -630,7 +632,7 @@

         // Static Methods

-        // Attempt to parse units as an AngleUnits enum value
+        // Attempt to parse units as an AngleUnit enum value
         private static AngleUnit GetAngleUnit(string units)
         {
             AngleUnit angleUnit;


Removed useless file

Removed useless file

--- Source/Zafiro.Wpf/Services/Contextualizable.cs
+++ Source/Zafiro.Wpf/Services/Contextualizable.cs
@@ -1,22 +0,0 @@
-using System.Windows;
-using Zafiro.Core;
-
-namespace Zafiro.Wpf.Services
-{
-    public class WpfContextualizable : IContextualizable
-    {
-        private readonly FrameworkElement frameworkElement;
-
-        public WpfContextualizable(FrameworkElement frameworkElement)
-        {
-            this.frameworkElement = frameworkElement;
-        }
-
-        public void SetContext(object o)
-        {
-            frameworkElement.DataContext = o;
-        }
-
-        public object Object => frameworkElement;
-    }
-}


add tests for importing from a context

add tests for importing from a context

--- Test/Mono.Cecil.Tests/ImportReflectionTests.cs
+++ Test/Mono.Cecil.Tests/ImportReflectionTests.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
 using SR = System.Reflection;
@@ -201,6 +202,57 @@
 			Assert.AreEqual (42, gen_spec_id (new Generic<string> (), 42));
 		}

+		public class Foo<TFoo> {
+			public List<TFoo> list;
+		}
+
+		[Test]
+		public void ImportGenericTypeFromContext ()
+		{
+			var list_foo = typeof (Foo<>).GetField ("list").FieldType;
+			var generic_list_foo_open = typeof (Generic<>).MakeGenericType (list_foo);
+
+			var foo_def = typeof (Foo<>).ToDefinition ();
+			var module = foo_def.Module;
+
+			var generic_foo = module.Import (generic_list_foo_open, foo_def);
+
+			Assert.AreEqual ("Mono.Cecil.Tests.ImportReflectionTests/Generic`1<System.Collections.Generic.List`1<TFoo>>",
+				generic_foo.FullName);
+		}
+
+		[Test]
+		public void ImportGenericFieldFromContext ()
+		{
+			var list_foo = typeof (Foo<>).GetField ("list").FieldType;
+			var generic_list_foo_open = typeof (Generic<>).MakeGenericType (list_foo);
+			var generic_list_foo_open_field = generic_list_foo_open.GetField ("Field");
+
+			var foo_def = typeof (Foo<>).ToDefinition ();
+			var module = foo_def.Module;
+
+			var generic_field = module.Import (generic_list_foo_open_field, foo_def);
+
+			Assert.AreEqual ("TFoo Mono.Cecil.Tests.ImportReflectionTests/Generic`1<System.Collections.Generic.List`1<TFoo>>::Field",
+				generic_field.FullName);
+		}
+
+		[Test]
+		public void ImportGenericMethodFromContext ()
+		{
+			var list_foo = typeof (Foo<>).GetField ("list").FieldType;
+			var generic_list_foo_open = typeof (Generic<>).MakeGenericType (list_foo);
+			var generic_list_foo_open_method = generic_list_foo_open.GetMethod ("Method");
+
+			var foo_def = typeof (Foo<>).ToDefinition ();
+			var module = foo_def.Module;
+
+			var generic_method = module.Import (generic_list_foo_open_method, foo_def);
+
+			Assert.AreEqual ("TFoo Mono.Cecil.Tests.ImportReflectionTests/Generic`1<System.Collections.Generic.List`1<TFoo>>::Method(TFoo)",
+				generic_method.FullName);
+		}
+
 		delegate void Emitter (ModuleDefinition module, MethodBody body);

 		[MethodImpl (MethodImplOptions.NoInlining)]


Enable all tests again.

Enable all tests again.

--- Tests/Cosmos.TestRunner.Core/TestKernelSets.cs
+++ Tests/Cosmos.TestRunner.Core/TestKernelSets.cs
@@ -7,17 +7,17 @@
     {
         public static IEnumerable<Type> GetStableKernelTypes()
         {
-            //yield return typeof(VGACompilerCrash.Kernel);
-            ////yield return typeof(Cosmos.Compiler.Tests.Encryption.Kernel);
-            //yield return typeof(Cosmos.Compiler.Tests.Bcl.Kernel);
-            //yield return typeof(Cosmos.Compiler.Tests.SingleEchoTest.Kernel);
-            //yield return typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel);
-            //yield return typeof(SimpleStructsAndArraysTest.Kernel);
-            //yield return typeof(Cosmos.Compiler.Tests.Exceptions.Kernel);
-            //yield return typeof(Cosmos.Compiler.Tests.LinqTests.Kernel);
-            //yield return typeof(Cosmos.Compiler.Tests.MethodTests.Kernel);
-            //yield return typeof(Cosmos.Kernel.Tests.Fat.Kernel);
-            yield return typeof(FrotzKernel.Kernel);
+            yield return typeof(VGACompilerCrash.Kernel);
+            //yield return typeof(Cosmos.Compiler.Tests.Encryption.Kernel);
+            yield return typeof(Cosmos.Compiler.Tests.Bcl.Kernel);
+            yield return typeof(Cosmos.Compiler.Tests.SingleEchoTest.Kernel);
+            yield return typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel);
+            yield return typeof(SimpleStructsAndArraysTest.Kernel);
+            yield return typeof(Cosmos.Compiler.Tests.Exceptions.Kernel);
+            yield return typeof(Cosmos.Compiler.Tests.LinqTests.Kernel);
+            yield return typeof(Cosmos.Compiler.Tests.MethodTests.Kernel);
+            yield return typeof(Cosmos.Kernel.Tests.Fat.Kernel);
+            //yield return typeof(FrotzKernel.Kernel);
         }
     }
 }


Fix typo in comment

Fix typo in comment

--- Tiled/TMXGlueLib/TiledMapSave.Serialization.cs
+++ Tiled/TMXGlueLib/TiledMapSave.Serialization.cs
@@ -200,7 +200,7 @@

             foreach(var layer in this.Layers)
             {
-                // Vic says: This wans't doing anything, do we need it?
+                // Vic says: This wasn't doing anything, do we need it?
                 //foreach(var dataItem in layer.data)
                 //{

@@ -995,4 +995,4 @@

 #endregion

-}+}


Add reference to innerException in doc

Add reference to innerException in doc

--- src/III/Error.cs
+++ src/III/Error.cs
@@ -79,13 +79,13 @@
     ///     <para>
     ///     It is possible that in your reasoning about a defined <see cref="Exception"/> you decide its occurence is an
     ///     error in a particular situation. In that case, your handling of the <see cref="Exception"/> could be to
-    ///     translate it into an <c>Error</c>, and to throw the <c>Error</c>. On the other hand, you can also let the
-    ///     original exception fall through your method in the situations where you deem it an error, and not define
-    ///     that type of <see cref="Exception"/> as an expected non-nominal outcome of your method. That is less code,
-    ///     and thus less chance for bugs, and less maintenance. If you do translate the <see cref="Exception"/> into
-    ///     an <c>Error</c>, that code that must be tested like any other code. Since you deem the occurrence of the
-    ///     <see cref="Exception"/> an error in this situation, it will be difficult to produce a test case that covers
-    ///     this code.
+    ///     translate it into an <c>Error</c>, with the <see cref="Exception"/> as an <c>innerException</c>, and to
+    ///     throw the <c>Error</c>. On the other hand, you can also let the original exception fall through your method
+    ///     in the situations where you deem it an error, and not define that type of <see cref="Exception"/> as an
+    ///     expected non-nominal outcome of your method. That is less code, and thus less chance for bugs, and less
+    ///     maintenance. If you do translate the <see cref="Exception"/> into an <c>Error</c>, that code that must be
+    ///     tested like any other code. Since you deem the occurrence of the <see cref="Exception"/> an error in this
+    ///     situation, it will be difficult to produce a test case that covers this code.
     ///     </para>
     /// </remarks>
     [Serializable]


Include jQuery.UI 1.9.2 in the package.

Include jQuery.UI 1.9.2 in the package.

--- jQueryUIGenerator/Generator.cs
+++ jQueryUIGenerator/Generator.cs
@@ -559,7 +559,6 @@
     <Compile Include=""..\..\..\ScriptSharp.cs"">
       <Link>Properties\ScriptSharp.cs</Link>
     </Compile>
-    <None Include=""*.js"" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include=""..\..\CoreLib\CoreLib.csproj"">


增加深拷贝方法

增加深拷贝方法

--- BAH.Extension/ObjectExtension.cs
+++ BAH.Extension/ObjectExtension.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Reflection;
 using System.Text;

 namespace System
@@ -112,6 +113,30 @@
                 return default(T);
             }
         }//end method
-
+
+        /// <summary>
+        /// 对象深拷贝。
+        /// </summary>
+        /// <typeparam name="T">对象泛型定义。</typeparam>
+        /// <param name="obj">Object对象。</param>
+        /// <returns>返回深拷贝后的对象。</returns>
+        public static T DeepCopy<T>(this T obj)
+        {
+            //如果是字符串或值类型则直接返回
+            if (obj is string || obj.GetType().IsValueType) return obj;
+
+            object retval = Activator.CreateInstance(obj.GetType());
+            FieldInfo[] fields = obj.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
+            foreach (FieldInfo field in fields)
+            {
+                try
+                {
+                    field.SetValue(retval, DeepCopy(field.GetValue(obj)));
+                }
+                catch { }
+            }
+            return (T)retval;
+        }//end method
+
     }//end class
 }//end namespace


Remove BrowserLink ref

Remove BrowserLink ref

--- Battery-Commander.Web/Startup.cs
+++ Battery-Commander.Web/Startup.cs
@@ -238,11 +238,6 @@
             loggerFactory.AddSerilog();
             loggerFactory.AddDebug();

-            if (env.IsDevelopment())
-            {
-                app.UseBrowserLink();
-            }
-
             app.UseDeveloperExceptionPage();

             app.UseStaticFiles();


don't prune past the pruning limit; once fully synced, the leftover blocks can be flushed to disk

--- BitSharp.Daemon/PruningWorker.cs
+++ BitSharp.Daemon/PruningWorker.cs
@@ -93,7 +93,7 @@
                     break;

                 case PruningMode.Full:
-                    for (var i = minHeight; i < chain.Blocks.Count /*- pruneBuffer*/; i++)
+                    for (var i = minHeight; i < chain.Blocks.Count - pruneBuffer; i++)
                     {
                         var block = chain.Blocks[i];


cleanup old comment

cleanup old comment

--- BitSharp.Storage/BoundedCache.cs
+++ BitSharp.Storage/BoundedCache.cs
@@ -13,8 +13,6 @@

 namespace BitSharp.Storage
 {
-    //TODO add shared key storage so that things like BlockHeaderSqlStorage and BlockSqlStorage share a single view of keys on the same underlying table
-
     public class BoundedCache<TKey, TValue> : UnboundedCache<TKey, TValue>
     {
         // known keys


Cloning returns a ScratchySprite not a game object

--- ScratchyObject.cs
+++ ScratchyObject.cs
@@ -148,15 +148,35 @@
     /// </summary>
     /// <param name="prefab">The prefab to instantiate</param>
     /// <returns>The new cloned object</returns>
-    public object Clone(GameObject prefab)
+    public ScratchySprite Clone(GameObject prefab)
     {
-        return Instantiate(prefab, this.transform.position, this.transform.rotation);
+        return Clone(prefab, this.transform.position, this.transform.rotation);
     }

-    public static object Clone(GameObject prefab, Vector3 position)
+    public static ScratchySprite Clone(GameObject prefab, Vector3 position)
     {
-        return Instantiate(prefab, position, Quaternion.identity);
+        return Clone(prefab, position, Quaternion.identity);
     }

+    public static ScratchySprite Clone(GameObject prefab, Vector3 position, Quaternion rotation)
+    {
+        var gameObject = (GameObject)Instantiate(prefab, position, Quaternion.identity);
+        ScratchySprite sprite;
+        try
+        {
+            sprite = gameObject.GetComponent<ScratchySprite>();
+        }
+        catch
+        {
+            sprite = null;
+        }
+
+        if (sprite == null)
+        {
+            throw new Exception("Clone only works for ScratchySprite objects");
+        }
+
+        return sprite;
+    }

 }


Tweaks to sample app to prevent the React warning - Each child in an array or iterator should have a unique "key" prop

Two changes were required. The dynamic elements (the individual TODO
cards) need to have a Key value on them, which is easy enough since each
Todo instance has an Id property (though I changed this to always
increment, rather than taking the count of the Todo list, to ensure that
values are not reused when items are removed and then new ones added).
The non-dynamic elements (the header and the input form) are now
specified using the original method signature, which is not intended for
use with dynamic elements and so the warning is avoided (there is
potential for a naughty workaround to avoid the dynamic children warning
by passing a pre-populated array reference instead of listing the static
elements one-by-one as params - I'd like to look into adding an analyser
to detect this).

--- Bridge.React.Examples/TodoApp.cs
+++ Bridge.React.Examples/TodoApp.cs
@@ -1,154 +1,148 @@
 using System;
+using System.Collections.Generic;
 using System.Linq;
-using Bridge.React;
-using System.Collections.Generic;
-using Bridge.Html5;

 namespace Bridge.React.Examples
 {
-    public class TodoApp : Component<TodoApp.Props, TodoApp.State>
-    {
-        public TodoApp(string label)
-            : base(new Props { Label = label }) { }
+	public class TodoApp : Component<TodoApp.Props, TodoApp.State>
+	{
+		private int _nextAvailableId = 0;
+		public TodoApp(string label) : base(new Props { Label = label }) { }

-        protected override State GetInitialState()
-        {
-            return new State
-            {
-                InputValue = "",
-                Todos = new Todo[]
-                {
-                    new Todo { Id = 0, Description = "Learn C#", Done = true },
-                    new Todo { Id = 1, Description = "Learn React", Done = false },
-                    new Todo { Id = 2, Description = "Build an awesome app with C# and React", Done = false }
-                }
-            };
-        }
+		protected override State GetInitialState()
+		{
+			return new State
+			{
+				InputValue = "",
+				Todos = new Todo[]
+				{
+					new Todo { Id = _nextAvailableId++, Description = "Learn C#", Done = true },
+					new Todo { Id = _nextAvailableId++, Description = "Learn React", Done = false },
+					new Todo { Id = _nextAvailableId++, Description = "Build an awesome app with C# and React", Done = false }
+				}
+			};
+		}

-        private State AppendTodo(string todoDescription)
-        {
-            var count = state.Todos.Count();
-            var todo = new Todo
-            {
-                Description = todoDescription,
-                Done = false,
-                Id = count + 1
-            };
+		private State AppendTodo(string todoDescription)
+		{
+			var count = state.Todos.Count();
+			var todo = new Todo
+			{
+				Description = todoDescription,
+				Done = false,
+				Id = _nextAvailableId++
+			};

-            return new State
-            {
-                InputValue = "",
-                Todos = state.Todos.Append(todo)
-            };
-        }
+			return new State
+			{
+				InputValue = "",
+				Todos = state.Todos.Append(todo)
+			};
+		}

-        private State RemoveTodo(int id)
-        {
-            return new State
-            {
-                InputValue = state.InputValue,
-                Todos = state.Todos.Where(todo => todo.Id != id)
-            };
-        }
+		private State RemoveTodo(int id)
+		{
+			return new State
+			{
+				InputValue = state.InputValue,
+				Todos = state.Todos.Where(todo => todo.Id != id)
+			};
+		}

-        private State ToggleDone(int id)
-        {
-            var todos = state.Todos.ToArray();
-            for(int i = 0; i < todos.Length; i++)
-            {
-                if (todos[i].Id == id)
-                {
-                    todos[i].Done = !todos[i].Done;
-                }
-            }
+		private State ToggleDone(int id)
+		{
+			var todos = state.Todos.ToArray();
+			for(int i = 0; i < todos.Length; i++)
+			{
+				if (todos[i].Id == id)
+				{
+					todos[i].Done = !todos[i].Done;
+				}
+			}

-            return new State
-            {
-                InputValue = state.InputValue,
-                Todos = todos
-            };
-        }
+			return new State
+			{
+				InputValue = state.InputValue,
+				Todos = todos
+			};
+		}

-        private IEnumerable<T> ListOf<T>(params T[] items)
-        {
-            return items;
-        }
+		public override ReactElement Render()
+		{
+			return DOM.Div(new Attributes { ClassName = "wrapper" },
+				DOM.H3(props.Label),
+				DOM.Label("Description"),
+				DOM.Input(new InputAttributes
+				{
+					Value = state.InputValue,
+					OnChange = e => SetState(new State { InputValue = e.CurrentTarget.Value, Todos = state.Todos })
+				}),
+				DOM.Button(
+					new ButtonAttributes
+					{
+						Disabled = string.IsNullOrWhiteSpace(state.InputValue),
+						OnClick = e => SetState(AppendTodo(state.InputValue))
+					},
+					"Add"
+				),
+				DOM.Div(
+					state.Todos
+						 .Select(todo =>
+								DOM.H4(new Attributes { ClassName = todo.Done ? "done" : "not-done" }, todo.Description),
+								DOM.Button(
+									new ButtonAttributes
+									{
+										ClassName = todo.Done ? "toggle-done" : "toggle-not-done",
+										OnClick = e => SetState(ToggleDone(todo.Id))
+									},
+									todo.Done ? "Not done yet!" : "Finished!"
+								),
+								DOM.Button(
+									new ButtonAttributes
+									{
+										ClassName = "remove-btn",
+										OnClick = e => SetState(RemoveTodo(todo.Id))
+									},
+									"Remove"
+								)
+						 ))
+						 .Pipe(DOM.Div)
+				)
+			);
+		}

-        public override ReactElement Render()
-        {
-            return DOM.Div(new Attributes { ClassName = "wrapper" },
-                DOM.Div(ListOf(
-                    DOM.H3(props.Label),
-                    DOM.Label("Description"),
-                    DOM.Input(new InputAttributes
-                    {
-                        Value = state.InputValue,
-                        OnChange = e => SetState(new State { InputValue = e.CurrentTarget.Value, Todos = state.Todos })
-                    }),
-                    DOM.Button(
-                    new ButtonAttributes
-                    {
-                        Disabled = string.IsNullOrWhiteSpace(state.InputValue),
-                        OnClick = e => SetState(AppendTodo(state.InputValue))
-                    },
-                    "Add"
-                ))),
-                state.Todos
-                     .Select(todo =>
-                        DOM.Div(new Attributes { ClassName = "todo-container" },
-                            DOM.H4(new Attributes
-                            {
-                                ClassName = todo.Done ? "done" : "not-done"
-                            }, todo.Description),
-                            DOM.Button(new ButtonAttributes
-                            {
-                                ClassName = todo.Done ? "toggle-done" : "toggle-not-done",
-                                OnClick = e => SetState(ToggleDone(todo.Id))
-                            }, todo.Done ? "Not done yet!" : "Finished!"),
-                            DOM.Button(new ButtonAttributes
-                            {
-                                ClassName = "remove-btn",
-                                OnClick = e => SetState(RemoveTodo(todo.Id))
-                            }, "Remove")
-                     ))
-                     .Pipe(DOM.Div)
-            );
-        }
+		[ObjectLiteral]
+		public class Props
+		{
+			public string Label;
+		}

-        [ObjectLiteral]
-        public class Props
-        {
-            public string Label;
-        }
+		[ObjectLiteral]
+		public class State
+		{
+			public string InputValue;
+			public IEnumerable<Todo> Todos;
+		}

-        [ObjectLiteral]
-        public class State
-        {
-            public string InputValue;
-            public IEnumerable<Todo> Todos;
-        }
+		[ObjectLiteral]
+		public class Todo
+		{
+			public int Id { get; set; }
+			public string Description { get; set; }
+			public bool Done { get; set; }
+		}
+	}

-        [ObjectLiteral]
-        public class Todo
-        {
-            public int Id { get; set; }
-            public string Description { get; set; }
-            public bool Done { get; set; }
-        }
-    }
+	public static class Extenstions
+	{
+		public static U Pipe<T, U>(this T value, Func<T, U> f)
+		{
+			return f(value);
+		}

-
-
-    public static class Extenstions
-    {
-        public static U Pipe<T, U>(this T value, Func<T, U> f)
-        {
-            return f(value);
-        }
-
-        public static IEnumerable<T> Append<T>(this IEnumerable<T> source, T value)
-        {
-            return source.Concat(new T[] { value });
-        }
-    }
+		public static IEnumerable<T> Append<T>(this IEnumerable<T> source, T value)
+		{
+			return source.Concat(new T[] { value });
+		}
+	}
 }


Bump version for pull request #471 fixing #468

Bump version.cs and describe fix

--- Source/Version.cs
+++ Source/Version.cs
@@ -6,6 +6,7 @@
 [assembly: CLSCompliant(true)]

 // Note: until version 1.0 expect breaking changes on 0.X versions.
+// 0.50.3.0 Bug fix, Polymorphic request-response did not work with polymorphic response types
 // 0.50.2.0 Updated RabbitMQ client to 3.5.4 and Json.NET to 7.0.1
 // 0.50.1.0 Fix type in Extensions
 // 0.50.0.0 Updated to RabbitMQ.Client 3.5.3


Made proposed changes.

Made proposed changes.

--- Src/Fare/State.cs
+++ Src/Fare/State.cs
@@ -172,15 +172,15 @@
         {
             if (other == null)
             {
-                return 0;
+                return 1;
             }

             if (other.GetType() != typeof(State))
             {
-                return 0;
-            }
-
-            return ((State)other).Id - this.Id;
+                throw new ArgumentException("Object is not a State");
+            }
+
+            return this.CompareTo((State)other);
         }

         /// <summary>


Added a "cleanup" command for admins to cleanup a certain number of messages from the bot

--- CSSBot/Commands/BasicCommands.cs
+++ CSSBot/Commands/BasicCommands.cs
@@ -106,5 +106,22 @@
             await ReplyAsync(txt);
         }

+        [Command("Cleanup", RunMode = RunMode.Async)]
+        [Summary("Deletes a specified number of the bot's recent messages.")]
+        [RequireUserPermission(GuildPermission.ManageMessages)]
+        [RequireContext(ContextType.Guild)]
+        public async Task CleanupRecent([Name("NumMsg")] int amountToCleanup = 10)
+        {
+            // ensure bounds
+            // don't allow deleting more than 25 because that's a lot to delete
+            // and we don't want to spam api either
+            if (amountToCleanup < 0 || amountToCleanup > 25) amountToCleanup = 10;
+            foreach( var message in await Context.Channel.GetMessagesAsync(Context.Message.Id, Direction.Before, amountToCleanup).Flatten())
+            {
+                if(message.Author.Id == Context.Client.CurrentUser.Id)
+                    await message.DeleteAsync();
+            }
+        }
+
     }
 }


Use a flag to indicate if the shader stage has been successfully compiled.

--- ChamberLib.OpenTK/ShaderStage.cs
+++ ChamberLib.OpenTK/ShaderStage.cs
@@ -2,6 +2,7 @@
 using OpenTK.Graphics.OpenGL;
 using System.Diagnostics;
 using ChamberLib.Content;
+using _OpenTK = global::OpenTK;

 namespace ChamberLib.OpenTK
 {
@@ -23,25 +24,35 @@
         public string Source { get; protected set; }
         public ShaderType ShaderType { get; protected set; }

+        public bool IsCompiled { get; protected set; }
+
         public void MakeReady()
         {
-            if (ShaderID != 0) return;
+            GLHelper.CheckError();
+            if (ShaderID == 0)
+            {
+                ShaderID = GL.CreateShader(ShaderType.ToOpenTK());
+                GLHelper.CheckError();
+                IsCompiled = false;
+            }

-            GLHelper.CheckError();
-            ShaderID = GL.CreateShader(ShaderType.ToOpenTK());
-            GLHelper.CheckError();
-            GL.ShaderSource(ShaderID, Source);
-            GLHelper.CheckError();
-            GL.CompileShader(ShaderID);
-            GLHelper.CheckError();
+            if (!IsCompiled)
+            {
+                GL.ShaderSource(ShaderID, Source);
+                GLHelper.CheckError();
+                GL.CompileShader(ShaderID);
+                GLHelper.CheckError();

-            int result;
-            GL.GetShader(ShaderID, ShaderParameter.CompileStatus, out result);
-            Debug.WriteLine("{1} compile status: {0}", result, ShaderType);
-            GLHelper.CheckError();
-            Debug.WriteLine("{0} info:", ShaderType);
-            Debug.WriteLine(GL.GetShaderInfoLog(ShaderID));
-            GLHelper.CheckError();
+                int result;
+                GL.GetShader(ShaderID, ShaderParameter.CompileStatus, out result);
+                Debug.WriteLine("{1} compile status: {0}", result, ShaderType);
+                GLHelper.CheckError();
+                Debug.WriteLine("{0} info:", ShaderType);
+                Debug.WriteLine(GL.GetShaderInfoLog(ShaderID));
+                GLHelper.CheckError();
+
+                IsCompiled = (result == 1);
+            }
         }
     }
 }


fix error check in update info checker

fix error check in update info checker

--- CompatBot/Commands/CompatList.cs
+++ CompatBot/Commands/CompatList.cs
@@ -20,6 +20,7 @@
 using DSharpPlus.Interactivity;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.Extensions.Caching.Memory;
+using Newtonsoft.Json;

 namespace CompatBot.Commands
 {
@@ -181,10 +182,13 @@
                 if (emptyBotMsg != null && info?.CurrentBuild != null)
                     info.LatestBuild = info.CurrentBuild;
                 var embed = await info.AsEmbedAsync().ConfigureAwait(false);
-                if (info == null || embed.Color == Config.Colors.Maintenance)
+                if (info == null || embed.Color.Value.Value == Config.Colors.Maintenance.Value)
                 {
                     if (emptyBotMsg != null)
+                    {
+                        Config.Log.Debug($"Failed to get update info for commit {sinceCommit}: {JsonConvert.SerializeObject(info)}");
                         return false;
+                    }

                     embed = await CachedUpdateInfo.AsEmbedAsync().ConfigureAwait(false);
                 }
@@ -194,7 +198,7 @@
                     await channel.SendMessageAsync(embed: embed.Build()).ConfigureAwait(false);
                 else if (emptyBotMsg != null)
                 {
-                    if (embed.Color == Config.Colors.Maintenance)
+                    if (embed.Title == "Error")
                         return false;

                     Config.Log.Debug($"Restoring update announcement for build {sinceCommit}: {embed.Title}\n{embed.Description}");


Quick fix to properly load icons from assembly resources

--- src/Utilities.cs
+++ src/Utilities.cs
@@ -94,6 +94,14 @@
 				return ret.ScaleSimple (size, size, Gdk.InterpType.Bilinear);
 			} catch (ArgumentException) {}

+			// TODO: This is a temporary fix to allow installing all icons as assembly
+			//       resources. The proper thing to do is to ship the actual icons,
+			//       and append to the default gtk+ icon theme path. See Tomboy.
+			try {
+				Gdk.Pixbuf ret = new Gdk.Pixbuf (null, String.Format ("{0}-{1}.png", iconName, size));
+				return ret.ScaleSimple (size, size, Gdk.InterpType.Bilinear);
+			} catch (ArgumentException) { }
+
 			Logger.Debug ("Unable to load icon '{0}'.", iconName);
 			return null;
 		}


replace validation in _ with Require.NotNull

--- src/Xbehave/_.cs
+++ src/Xbehave/_.cs
@@ -10,6 +10,7 @@
     using System.Linq.Expressions;

     using Xbehave.Fluent;
+    using Xbehave.Internal;
     using Xbehave.Naming;

     /// <summary>
@@ -28,7 +29,7 @@
         [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Validated in helper method.")]
         public static IGiven Given(Expression<Action> arrange)
         {
-            ValidateArrange(arrange);
+            Require.NotNull(arrange, "arrange");
             return arrange.Body.ToGivenName().Given(arrange.Compile());
         }

@@ -41,7 +42,7 @@
         [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Validated in helper method.")]
         public static IGiven Given(Expression<Func<IDisposable>> arrange)
         {
-            ValidateArrange(arrange);
+            Require.NotNull(arrange, "arrange");
             return arrange.Body.ToGivenName().Given(arrange.Compile());
         }

@@ -54,7 +55,7 @@
         [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Validated in helper method.")]
         public static IGiven Given(Expression<Func<IEnumerable<IDisposable>>> arrange)
         {
-            ValidateArrange(arrange);
+            Require.NotNull(arrange, "arrange");
             return arrange.Body.ToGivenName().Given(arrange.Compile());
         }

@@ -67,7 +68,7 @@
         [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Validated in helper method.")]
         public static IGiven Given(Expression<Action> arrange, Action dispose)
         {
-            ValidateArrange(arrange);
+            Require.NotNull(arrange, "arrange");
             return arrange.Body.ToGivenName().Given(arrange.Compile(), dispose);
         }

@@ -79,7 +80,7 @@
         [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Validated in helper method.")]
         public static IWhen When(Expression<Action> act)
         {
-            ValidateAct(act);
+            Require.NotNull(act, "act");
             return act.Body.ToWhenName().When(act.Compile());
         }

@@ -91,7 +92,7 @@
         [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Validated in helper method.")]
         public static IThen Then(Expression<Action> assert)
         {
-            ValidateAssert(assert);
+            Require.NotNull(assert, "assert");
             return assert.Body.ToThenName().Then(assert.Compile());
         }

@@ -103,7 +104,7 @@
         [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Validated in helper method.")]
         public static IThen ThenInIsolation(Expression<Action> assert)
         {
-            ValidateAssert(assert);
+            Require.NotNull(assert, "assert");
             return assert.Body.ToThenName().ThenInIsolation(assert.Compile());
         }

@@ -119,32 +120,8 @@
         [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Justification = "Validated in helper method.")]
         public static IThen ThenSkip(Expression<Action> assert)
         {
-            ValidateAssert(assert);
+            Require.NotNull(assert, "assert");
             return assert.Body.ToThenName().ThenSkip(assert.Compile());
-        }
-
-        private static void ValidateArrange(object arrange)
-        {
-            if (arrange == null)
-            {
-                throw new ArgumentNullException("arrange");
-            }
-        }
-
-        private static void ValidateAct(object act)
-        {
-            if (act == null)
-            {
-                throw new ArgumentNullException("act");
-            }
-        }
-
-        private static void ValidateAssert(object assert)
-        {
-            if (assert == null)
-            {
-                throw new ArgumentNullException("assert");
-            }
         }
     }
 }


エフェクトのオプション外部化を実装

エフェクトのオプション外部化を実装

--- Dev/Editor/EffekseerCore/Core.cs
+++ Dev/Editor/EffekseerCore/Core.cs
@@ -9,6 +9,8 @@
 	public class Core
 	{
         public const string Version = "0.50.1";
+
+		public const string OptionFilePath = "config.option.xml";

 		static Data.NodeBase selected_node = null;

@@ -382,11 +384,15 @@
 					}
 				}
 			}
+
+			LoadOption();
 		}

 		public static void Dispose()
 		{
 			Script.Compiler.Dispose();
+
+			SaveOption();
 		}

 		/// <summary>
@@ -471,21 +477,17 @@

 			var element = Data.IO.SaveObjectToElement(doc, "Root", Core.Root);

-			var optionElement = Data.IO.SaveObjectToElement(doc, "Option", Option);
-
 			var behaviorElement = Data.IO.SaveObjectToElement(doc, "Behavior", EffectBehavior);

 			System.Xml.XmlElement project_root = doc.CreateElement("EffekseerProject");

 			project_root.AppendChild(element);
-			project_root.AppendChild(optionElement);
 			project_root.AppendChild(behaviorElement);
 			project_root.AppendChild(doc.CreateTextElement("ToolVersion", Core.Version));
 			project_root.AppendChild(doc.CreateTextElement("Version", 3));
 			project_root.AppendChild(doc.CreateTextElement("StartFrame", StartFrame));
 			project_root.AppendChild(doc.CreateTextElement("EndFrame", EndFrame));
 			project_root.AppendChild(doc.CreateTextElement("IsLoop", IsLoop.ToString()));
-			project_root.AppendChild(doc.CreateTextElement("ExportMagnification", ExportMagnification.ToString()));

 			doc.AppendChild(project_root);

@@ -543,13 +545,6 @@
 			var root = doc["EffekseerProject"]["Root"];
 			if (root == null) return false;

-			var optionElement = doc["EffekseerProject"]["Option"];
-			if (optionElement != null)
-			{
-				var o = option as object;
-				Data.IO.LoadObjectFromElement(optionElement as System.Xml.XmlElement, ref o);
-			}
-
 			var behaviorElement = doc["EffekseerProject"]["Behavior"];
 			if (behaviorElement != null)
 			{
@@ -561,8 +556,6 @@
 			EndFrame = doc["EffekseerProject"]["EndFrame"].GetTextAsInt();
 			StartFrame = doc["EffekseerProject"]["StartFrame"].GetTextAsInt();
 			IsLoop = bool.Parse(doc["EffekseerProject"]["IsLoop"].GetText());
-			ExportMagnification = doc["EffekseerProject"]["ExportMagnification"].GetTextAsFloat();
-			if (ExportMagnification == 0.0f) ExportMagnification = 1.0f;

 			int version = 0;
 			if (doc["EffekseerProject"]["Version"] != null)
@@ -621,6 +614,55 @@
 			return true;
 		}

+		static public bool LoadOption()
+		{
+			var path = System.IO.Path.GetFullPath(OptionFilePath);
+
+			if (!System.IO.File.Exists(path)) return false;
+
+			var doc = new System.Xml.XmlDocument();
+
+			doc.Load(path);
+
+			if (doc.ChildNodes.Count != 2) return false;
+			if (doc.ChildNodes[1].Name != "EffekseerProject") return false;
+
+			var optionElement = doc["EffekseerProject"]["Option"];
+			if (optionElement != null)
+			{
+				var o = option as object;
+				Data.IO.LoadObjectFromElement(optionElement as System.Xml.XmlElement, ref o);
+			}
+
+			ExportMagnification = doc["EffekseerProject"]["ExportMagnification"].GetTextAsFloat();
+			if (ExportMagnification == 0.0f) ExportMagnification = 1.0f;
+
+			IsChanged = false;
+
+			return true;
+		}
+
+		static public void SaveOption()
+		{
+			var path = System.IO.Path.GetFullPath(OptionFilePath);
+
+			System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
+
+			var optionElement = Data.IO.SaveObjectToElement(doc, "Option", Option);
+
+			System.Xml.XmlElement project_root = doc.CreateElement("EffekseerProject");
+
+			project_root.AppendChild(optionElement);
+			project_root.AppendChild(doc.CreateTextElement("ExportMagnification", ExportMagnification.ToString()));
+
+			doc.AppendChild(project_root);
+
+			var dec = doc.CreateXmlDeclaration("1.0", "utf-8", null);
+			doc.InsertBefore(dec, project_root);
+			doc.Save(path);
+			IsChanged = false;
+		}
+
 		static uint ParseVersion(string versionText)
 		{
 			versionText = versionText.Replace("α1", "");


新增註解

新增註解

新增註解

--- UartOscilloscope/CSharpFiles/UARTConnection.cs
+++ UartOscilloscope/CSharpFiles/UARTConnection.cs
@@ -140,7 +140,7 @@
 			ConnectedCOMPortCount = NewConnectedCOMPortCount;					//	設定ConnectedCOMPortCount數值
 		}                                                                       //	結束SetConnectedCOMPortCount方法
 		/// <summary>
-		///
+		/// SetUartComportConnected方法用於設定UartComportConnected狀態
 		/// </summary>
 		/// <param name="NewUartComportConnected"></param>
 		public void SetUartComportConnected(bool NewUartComportConnected)		//	SetUartComportConnected方法


建立GetComportList方法

建立GetComportList方法

建立GetComportList方法

--- UartOscilloscope/CSharpFiles/UARTConnection.cs
+++ UartOscilloscope/CSharpFiles/UARTConnection.cs
@@ -118,11 +118,14 @@
 		{                                                                       //	進入GetUartComportConnected方法
 			return UartComportConnected;										//	回傳UartComportConnected狀態
 		}                                                                       //	結束GetUartComportConnected方法
-		public static string[] ListSerialPort()                                 //	ListSerialPort方法
+		public ComportList GetComportList()                                     //	GetComportList方法
+		{                                                                       //	進入GetComportList方法
+			ListSerialPort();                                                   //	呼叫ListSerialPort方法
+			return ComportList1;                                                //	回傳ComportList1物件
+		}                                                                       //	結束GetComportList方法
+		private void ListSerialPort()											//	ListSerialPort方法
 		{                                                                       //	進入ListSerialPort方法
-			string[] SerialPortList;                                            //	宣告SerialPortList字串陣列
-			SerialPortList = SerialPort.GetPortNames();                         //	偵測已連線的SerialPort並儲存結果
-			return SerialPortList;                                              //	回傳SerialPortList
+			ComportList1.SetComportList(SerialPort.GetPortNames());				//	偵測已連線的SerialPort並儲存結果
 		}                                                                       //	結束ListSerialPort方法

 	}                                                                           //	結束UARTConnection類別


Fixed a crash when trying to add an element to uninstall list

--- UninstallTools/Controls/UninstallListEditor.cs
+++ UninstallTools/Controls/UninstallListEditor.cs
@@ -39,7 +39,7 @@
                 OnCurrentListChanged(this, EventArgs.Empty);
             }
         }
-
+
         private Filter CurrentlySelected
         {
             get
@@ -54,13 +54,23 @@

         private void OnCurrentListChanged(object sender, EventArgs e)
         {
-            OnFiltersChanged(sender,e);
+            OnFiltersChanged(sender, e);
             CurrentListChanged?.Invoke(sender, e);
         }

         private void buttonAdd_Click(object sender, EventArgs e)
         {
-            var newItem = new Filter(Localisation.UninstallListEditor_NewFilter, null);
+            Filter newItem;
+            try
+            {
+                newItem = new Filter(Localisation.UninstallListEditor_NewFilter, Localisation.UninstallListEditor_NewFilter);
+            }
+            catch (Exception ex)
+            {
+                PremadeDialogs.GenericError(ex);
+                return;
+            }
+
             CurrentList.Add(newItem);
             PopulateList();
             OnFiltersChanged(sender, e);
@@ -156,7 +166,7 @@
                     Filter.ExcludeToString(x.Exclude),
                     x.ComparisonEntries.Count.ToString()
                 })
-            {Tag = x}).ToArray());
+            { Tag = x }).ToArray());
         }

         private void OnFiltersChanged(object sender, EventArgs e)
@@ -164,7 +174,7 @@
             listBoxConditions.Update();
             FiltersChanged?.Invoke(sender, e);
         }
-
+
         /// <summary>
         /// Fires whenever the filters can potentially give a different result
         /// </summary>


Accept a handful more resharper suggestions. Rebuild solution.

--- Vendord/Vendord.SmartDevice.Linked/Database.cs
+++ Vendord/Vendord.SmartDevice.Linked/Database.cs
@@ -207,24 +207,24 @@

     public class Database
     {
-        private static string sqlCeConnectionStringTemplate = @"Data Source={0};Persist Security Info=False;";
-
-        private List<Product> products;
-        private List<Order> order;
-        private List<OrderProduct> orderProducts;
-        private string connectionString;
+        private const string SqlCeConnectionStringTemplate = @"Data Source={0};Persist Security Info=False;";
+
+        private List<Product> _products;
+        private List<Order> _order;
+        private List<OrderProduct> _orderProducts;
+        private readonly string _connectionString;

         public Database()
         {
             string fullPath = Constants.DatabaseFullPath;
-            this.connectionString = GenerateSqlCeConnString(fullPath);
+            this._connectionString = GenerateSqlCeConnString(fullPath);
             this.CreateCeDB(fullPath);
             this.CreateTables();
         }

         public Database(string fullPath)
         {
-            this.connectionString = GenerateSqlCeConnString(fullPath);
+            this._connectionString = GenerateSqlCeConnString(fullPath);
             this.CreateCeDB(fullPath);
             this.CreateTables();
         }
@@ -236,10 +236,10 @@
                 SqlCeDataReader reader;
                 System.Data.SqlServerCe.SqlCeCommand command;

-                if (this.order == null)
+                if (this._order == null)
                 {
-                    this.order = new List<Order>();
-                    using (SqlCeConnection conn = new SqlCeConnection(this.connectionString))
+                    this._order = new List<Order>();
+                    using (SqlCeConnection conn = new SqlCeConnection(this._connectionString))
                     {
                         conn.Open();
                         command = new SqlCeCommand(@"SELECT * FROM tblOrder WHERE IsInTrash IS NULL OR IsInTrash = 0", conn);
@@ -251,12 +251,12 @@
                                 ID = new Guid(reader["ID"].ToString()),
                                 Name = Convert.ToString(reader["Name"])
                             };
-                            this.order.Add(item);
+                            this._order.Add(item);
                         }
                     }
                 }

-                return this.order;
+                return this._order;
             }
         }

@@ -267,10 +267,10 @@
                 SqlCeDataReader reader;
                 SqlCeCommand command;

-                if (this.products == null)
+                if (this._products == null)
                 {
-                    this.products = new List<Product>();
-                    using (SqlCeConnection conn = new SqlCeConnection(this.connectionString))
+                    this._products = new List<Product>();
+                    using (SqlCeConnection conn = new SqlCeConnection(this._connectionString))
                     {
                         conn.Open();
                         command = new SqlCeCommand(@"SELECT * FROM tblProduct", conn);
@@ -283,12 +283,12 @@
                                 UPC = Convert.ToString(reader["UPC"]),
                                 VendorName = Convert.ToString(reader["VendorName"])
                             };
-                            this.products.Add(item);
+                            this._products.Add(item);
                         }
                     }
                 }

-                return this.products;
+                return this._products;
             }
         }

@@ -296,13 +296,13 @@
         {
             get
             {
-                if (this.orderProducts == null)
+                if (this._orderProducts == null)
                 {
                     SqlCeDataReader reader;
                     SqlCeCommand command;

-                    this.orderProducts = new List<OrderProduct>();
-                    using (SqlCeConnection conn = new SqlCeConnection(this.connectionString))
+                    this._orderProducts = new List<OrderProduct>();
+                    using (SqlCeConnection conn = new SqlCeConnection(this._connectionString))
                     {
                         conn.Open();
                         command = new SqlCeCommand(@"SELECT * FROM tblOrderProduct WHERE IsInTrash IS NULL OR IsInTrash = 0", conn);
@@ -315,19 +315,19 @@
                                 OrderID = new Guid(reader["OrderID"].ToString()),
                                 CasesToOrder = Convert.ToInt32(reader["CasesToOrder"])
                             };
-                            this.orderProducts.Add(item);
+                            this._orderProducts.Add(item);
                         }
                     }
                 }

-                return this.orderProducts;
+                return this._orderProducts;
             }
         }

         public static string GenerateSqlCeConnString(string databaseFullPath)
         {
             string sqlCeConnString;
-            sqlCeConnString = string.Format(sqlCeConnectionStringTemplate, databaseFullPath);
+            sqlCeConnString = string.Format(SqlCeConnectionStringTemplate, databaseFullPath);
             return sqlCeConnString;
         }

@@ -341,7 +341,7 @@
         public object ExecuteScalar(string cmdText, SqlCeParameter[] parameters)
         {
             object result = null;
-            using (var conn = new SqlCeConnection(this.connectionString))
+            using (var conn = new SqlCeConnection(this._connectionString))
             {
                 conn.Open();
                 SqlCeCommand cmd = conn.CreateCommand();
@@ -361,7 +361,7 @@
             int rowsAffected;
             rowsAffected = 0;

-            using (SqlCeConnection conn = new SqlCeConnection(this.connectionString))
+            using (SqlCeConnection conn = new SqlCeConnection(this._connectionString))
             {
                 conn.Open();
                 SqlCeCommand cmd = conn.CreateCommand();
@@ -384,7 +384,7 @@
             IOHelpers.CreateDirectoryIfNotExists(Constants.ApplicationDataStoreFullPath);
             if (!File.Exists(databaseFullPath))
             {
-                var engine = new SqlCeEngine(this.connectionString);
+                var engine = new SqlCeEngine(this._connectionString);
                 engine.CreateDatabase();
                 engine.Dispose();
             }


logtrace

logtrace

--- WalletWasabi/Extensions/RPCClientExtensions.cs
+++ WalletWasabi/Extensions/RPCClientExtensions.cs
@@ -159,7 +159,7 @@
 			}
 			catch (Exception ex) when (!(ex is OperationCanceledException || ex is TaskCanceledException || ex is TimeoutException))
 			{
-				Logger.LogError(ex);
+				Logger.LogTrace(ex);
 				return RpcStatus.Unresponsive;
 			}
 		}


Provide parsing options

Provide parsing options

--- AngleSharp.Core.Tests/TestExtensions.cs
+++ AngleSharp.Core.Tests/TestExtensions.cs
@@ -3,6 +3,7 @@
     using AngleSharp.Dom;
     using AngleSharp.Dom.Css;
     using AngleSharp.Dom.Html;
+    using AngleSharp.Extensions;
     using AngleSharp.Parser.Css;
     using AngleSharp.Parser.Html;
     using AngleSharp.Parser.Xml;
@@ -52,7 +53,12 @@

             if (element != null)
             {
-                return parser.ParseFragment(element).DocumentElement.ChildNodes;
+                var options = new HtmlParserOptions
+                {
+                    IsEmbedded = false,
+                    IsScripting = configuration.IsScripting()
+                };
+                return parser.ParseFragment(options, element).DocumentElement.ChildNodes;
             }
             else
             {


bugfix

bugfix

--- AppMetrics/BasicAuthenticationModule.cs
+++ AppMetrics/BasicAuthenticationModule.cs
@@ -21,42 +21,30 @@
 		static void AuthenticateRequest(object sender, EventArgs e)
 		{
 			var application = (HttpApplication)sender;
-			if (!Authenticate(application.Context))
+			var context = application.Context;
+			if (!Authenticate(context))
 			{
-				application.Context.Response.Status = "401 Unauthorized";
-				application.Context.Response.StatusCode = 401;
-				application.Context.Response.AddHeader("WWW-Authenticate", "Basic");
-				application.CompleteRequest();
+				context.Response.Status = "401 Unauthorized";
+				context.Response.StatusCode = 401;
+				context.Response.AddHeader("WWW-Authenticate", "Basic");
+				context.Response.End();
 			}
 		}

 		static bool Authenticate(HttpContext context)
 		{
-			//if (!context.Request.IsSecureConnection)
-			//    return false;
-
-			if (!context.Request.Headers.AllKeys.Contains("Authorization"))
+			var authHeader = context.Request.Headers.Get("Authorization");
+			if (string.IsNullOrEmpty(authHeader))
 				return false;

-			var authHeader = context.Request.Headers["Authorization"];
+			var creds = ParseAuthHeader(authHeader);
+			if (creds == null)
+				return true; // anonymous user

-			IPrincipal principal;
-			if (TryGetPrincipal(authHeader, out principal))
-			{
-				context.User = principal;
-				return true;
-			}
-			return false;
-		}
-
-		private static bool TryGetPrincipal(string authHeader, out IPrincipal principal)
-		{
-			var creds = ParseAuthHeader(authHeader);
-			if (creds != null && TryGetPrincipal(creds, out principal))
-				return true;
-
-			principal = null;
-			return false;
+			var principal = TryGetPrincipal(creds);
+
+			context.User = principal;
+			return true;
 		}

 		private static string[] ParseAuthHeader(string authHeader)
@@ -73,7 +61,7 @@
 			return credentials;
 		}

-		private static bool TryGetPrincipal(string[] creds, out IPrincipal principal)
+		private static IPrincipal TryGetPrincipal(string[] creds)
 		{
 			var users = GetUsers();

@@ -81,13 +69,11 @@
 			{
 				if (creds[0] == pair.Key && creds[1] == pair.Value)
 				{
-					principal = new GenericPrincipal(new GenericIdentity(pair.Key), new[] { "Administrator", "User" });
-					return true;
+					return new GenericPrincipal(new GenericIdentity(pair.Key), new[] { "Administrator", "User" });
 				}
 			}

-			principal = null;
-			return false;
+			return null;
 		}

 		private static Dictionary<string, string> _users;
@@ -105,7 +91,7 @@
 						var text = File.ReadAllText(fileName);

 						_users = new Dictionary<string, string>();
-						var lines = text.Split(new[] {'\r', '\n'}, StringSplitOptions.RemoveEmptyEntries);
+						var lines = text.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
 						foreach (var line in lines)
 						{
 							var parts = line.Split('\t');


refs #11 Add private field access methods

--- Application/MatchGeneratorTest/Utils.cs
+++ Application/MatchGeneratorTest/Utils.cs
@@ -1,7 +1,43 @@
+using System.Reflection;
+
 namespace MatchGeneratorTest
 {
 	internal static class Utils
 	{
+		/// <summary>
+		/// インスタンスのプライベートなフィールドに値を設定する
+		/// </summary>
+		public static void SetPrivateField(this object instance, string fieldName, object value)
+		{
+			FieldInfo fieldInfo = instance.GetType().GetField(fieldName,
+				BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Instance);
+			fieldInfo.SetValue(instance, value);
+		}

+		/// <summary>
+		/// インスタンスのプライベートなフィールドから値を取得する
+		/// </summary>
+		public static object GetPrivateField(this object instance, string fieldName)
+		{
+			FieldInfo fieldInfo = instance.GetType().GetField(fieldName,
+				BindingFlags.SetField | BindingFlags.NonPublic | BindingFlags.Instance);
+			return fieldInfo.GetValue(instance);
+		}
+
+		/// <summary>
+		/// インスタンスの自動実装プロパティのBackingFieldに値を設定する
+		/// </summary>
+		public static void SetBackingField(this object instance, string propertyName, object value)
+		{
+			instance.SetPrivateField($"<{propertyName}>k__BackingField", value);
+		}
+
+		/// <summary>
+		/// インスタンスの自動実装プロパティのBackingFieldから値を取得する
+		/// </summary>
+		public static object GetBackingField(this object instance, string propertyName)
+		{
+			return instance.GetPrivateField($"<{propertyName}>k__BackingField");
+		}
 	}
 }


Stage activates child canvas on startup #84

--- Assets/Fungus/Portrait/Scripts/Stage.cs
+++ Assets/Fungus/Portrait/Scripts/Stage.cs
@@ -7,6 +7,8 @@

 namespace Fungus
 {
+
+	[ExecuteInEditMode]
 	public class Stage : MonoBehaviour
 	{
 		public Canvas portraitCanvas;
@@ -23,7 +25,6 @@
 		[HideInInspector]
 		static public List<Stage> activeStages = new List<Stage>();

-		[ExecuteInEditMode]
 		protected virtual void OnEnable()
 		{
 			if (!activeStages.Contains(this))
@@ -31,11 +32,21 @@
 				activeStages.Add(this);
 			}
 		}
-		[ExecuteInEditMode]
+
 		protected virtual void OnDisable()
 		{
 			activeStages.Remove(this);
 		}
+
+		protected virtual void Start()
+		{
+			if (Application.isPlaying &&
+			    portraitCanvas != null)
+			{
+				// Ensure the stage canvas is active
+				portraitCanvas.gameObject.SetActive(true);
+			}
+		}
 	}
 }


Use volume for starting volume on Voiceover

--- Assets/Fungus/UI/Scripts/WriterAudio.cs
+++ Assets/Fungus/UI/Scripts/WriterAudio.cs
@@ -84,7 +84,7 @@

 			playingVoiceover = true;

-			targetAudioSource.volume = 1f;
+			targetAudioSource.volume = volume;
 			targetVolume = volume;
 			targetAudioSource.loop = false;
 			targetAudioSource.clip = voiceOverClip;


Fix variable size buildings getting no materials.

--- Assets/MapGen/Buildings/BuildingRoom.cs
+++ Assets/MapGen/Buildings/BuildingRoom.cs
@@ -8,16 +8,16 @@
     {
         public GameObject part;

-        List<GameObject> setParts = new List<GameObject>();
-        List<IBuildingPart> activeParts = new List<IBuildingPart>();
+        public List<GameObject> setParts = new List<GameObject>();
+        public List<IBuildingPart> activeParts = new List<IBuildingPart>();

         public void UpdatePart(BuildingInstance buildingInput)
         {
             if (setParts.Count > 0)
             {
-                foreach (var part in activeParts)
+                foreach (var activePart in activeParts)
                 {
-                    part.UpdatePart(buildingInput);
+                    activePart.UpdatePart(buildingInput);
                 }
                 return;
             }
@@ -47,9 +47,13 @@
                         setParts.Add(newPart);
                     }

-            foreach (var part in setParts)
+            foreach (var setPart in setParts)
             {
-                activeParts.AddRange(part.GetInterfacesInChildren<IBuildingPart>());
+                activeParts.AddRange(setPart.GetInterfacesInChildren<IBuildingPart>());
+            }
+            foreach (var activePart in activeParts)
+            {
+                activePart.UpdatePart(buildingInput);
             }
         }
     }


Comment out crummy camera auto-rotate logic

--- Assets/Scripts/Player/MovementPlayer.cs
+++ Assets/Scripts/Player/MovementPlayer.cs
@@ -98,7 +98,7 @@
                     cameraRig.rotation.eulerAngles.SetY(playerMesh.rotation.eulerAngles.y),
                     1f);
             }
-            else if ((rotationDifference < 150 || rotationDifference > 220)
+            /*else if ((rotationDifference < 150 || rotationDifference > 220)
                 && (cameraRig.gameObject.GetComponent<iTween>() == null
                     || !cameraRig.gameObject.GetComponent<iTween>().isRunning))
             {
@@ -106,7 +106,7 @@
                 var rotationMagnitude = 400f / (Mathf.Abs(rotationDifference - 180) + 40);
                 iTween.RotateUpdate(cameraRig.gameObject,
                     cameraRig.rotation.eulerAngles.SetY(playerMesh.rotation.eulerAngles.y), rotationMagnitude);
-            }
+            }*/
         }

         void OnGUI()


fix gc alloc

fix gc alloc

--- Assets/SpriteGlow/SpriteGlowMaterial.cs
+++ Assets/SpriteGlow/SpriteGlowMaterial.cs
@@ -27,17 +27,17 @@

         public static Material GetSharedFor (SpriteGlowEffect spriteGlow)
         {
-            var material = sharedMaterials.Find(m =>
-                m.SpriteTexture == spriteGlow.Renderer.sprite.texture &&
-                m.DrawOutside == spriteGlow.DrawOutside &&
-                m.InstancingEnabled == spriteGlow.EnableInstancing);
+            for (int i = 0; i < sharedMaterials.Count; i++)
+            {
+                if (sharedMaterials[i].SpriteTexture == spriteGlow.Renderer.sprite.texture &&
+                    sharedMaterials[i].DrawOutside == spriteGlow.DrawOutside &&
+                    sharedMaterials[i].InstancingEnabled == spriteGlow.EnableInstancing)
+                    return sharedMaterials[i];
+            }

-            if (!material)
-            {
-                material = new SpriteGlowMaterial(spriteGlow.Renderer.sprite.texture, spriteGlow.DrawOutside, spriteGlow.EnableInstancing);
-                material.hideFlags = HideFlags.DontSaveInBuild | HideFlags.DontSaveInEditor | HideFlags.NotEditable;
-                sharedMaterials.Add(material);
-            }
+            var material = new SpriteGlowMaterial(spriteGlow.Renderer.sprite.texture, spriteGlow.DrawOutside, spriteGlow.EnableInstancing);
+            material.hideFlags = HideFlags.DontSaveInBuild | HideFlags.DontSaveInEditor | HideFlags.NotEditable;
+            sharedMaterials.Add(material);

             return material;
         }


Enforce board UT

Enforce board UT

--- Assets/Tests/Editor/Engine/BoardTest.cs
+++ Assets/Tests/Editor/Engine/BoardTest.cs
@@ -81,5 +81,16 @@
 			tileA1Mock.Verify( x => x.PlacePiece( It.IsAny<Piece>() ), Times.Once() );
 			tileB1Mock.Verify( x => x.PlacePiece( It.IsAny<Piece>() ), Times.Once() );
 		}
+
+		[Test()]
+		public void Board_Publish_List_Of_Tile_Names()
+		{
+			string firstCoord = hCoord[0] + vCoord[0];
+			string lastCoord = hCoord[hCoord.Length - 1] + vCoord[vCoord.Length - 1];
+
+			ArrayList list = board.ListBoardTiles();
+			Assert.That( list.Contains( firstCoord ) );
+			Assert.That( list.Contains( lastCoord ) );
+		}
 	}
 }


Updated student create page with place holder

--- AutogearWeb/Views/Student/Create.cshtml
+++ AutogearWeb/Views/Student/Create.cshtml
@@ -15,7 +15,7 @@

                     @Html.LabelFor(model => model.FirstName, htmlAttributes: new { @class = "col-sm-2 control-label no-padding-right" })

-                        @Html.EditorFor(model => model.FirstName, new { htmlAttributes = new { @class = "col-xs-10 col-sm-8", placeholder = "" } })
+                        @Html.EditorFor(model => model.FirstName, new { htmlAttributes = new { @class = "col-xs-10 col-sm-8", placeholder = "First Name" } })
                         @Html.ValidationMessageFor(model => model.FirstName, "", new { @class = "text-danger" })

@@ -39,7 +39,7 @@
                     @Html.LabelFor(model => model.Gender, htmlAttributes: new { @class = "control-label col-sm-2 no-padding-right" })

-

+

                                 @Html.DropDownListFor(model => model.Gender, Model.GendersList, new { @class = "chosen-select form-control", data_placeholder = "Choose a Gender..." })

@@ -266,13 +266,13 @@
                     @Html.LabelFor(model => model.StartTime, htmlAttributes: new { @class = "control-label col-sm-2 no-padding-right" })

-                            @Html.EditorFor(model => model.StartTime, new {htmlAttributes = new {@class = "form-control", placeholder = "Start Time"}})
+                            @Html.EditorFor(model => model.StartTime, new { htmlAttributes = new { @class = "form-control", placeholder = "Start Time" } })

-                            @Html.ValidationMessageFor(model => model.StartTime, "", new {@class = "text-danger"})
-

-

+                            @Html.ValidationMessageFor(model => model.StartTime, "", new { @class = "text-danger" })
+

+

                     @Html.LabelFor(model => model.StopTime, htmlAttributes: new { @class = "control-label col-sm-2 no-padding-right" })
@@ -320,7 +320,7 @@

                     @Html.LabelFor(model => model.DrivingTestPackageDisacount, htmlAttributes: new { @class = "control-label col-sm-2 no-padding-right" })

-                        @Html.EditorFor(model => model.DrivingTestPackageDisacount, new { htmlAttributes = new { @class = "col-xs-10 col-sm-8" } })
+                        @Html.EditorFor(model => model.DrivingTestPackageDisacount, new { htmlAttributes = new { @class = "col-xs-10 col-sm-8", placeholder = "Disacount" } })
                         @Html.ValidationMessageFor(model => model.DrivingTestPackageDisacount, "", new { @class = "text-danger" })

@@ -439,12 +439,12 @@
                     });
                 });
                 //SuburbName
-                $.getJSON(baseUrl + "GetInstructorNames").then(function (data) {
-                    $("#InstructorName").autocomplete({
-                        source: data,
-                        minLength: 2
-                    });
-                });
+                //$.getJSON(baseUrl + "GetInstructorNames").then(function (data) {
+                //    $("#InstructorName").autocomplete({
+                //        source: data,
+                //        minLength: 2
+                //    });
+                //});
                 $("#StartDate,#ExpiryDate,#LicensePassedDate,#BookingStartDate,#BookingEndDate,#DrivingTestDate").datepicker({
                     minDate: 0,
                     dateFormat: "dd-mm-yy"
@@ -472,11 +472,11 @@
                     var newhour = (e.time.hours) + 1;
                     var newTime = newhour + ":" + e.time.minutes ;
                     if (self.id.indexOf("StartTime") > -1) {
-                        if (self.id.indexOf("DrivingTest") > -1) {
-                            $("#DrivingTestStopTime").val(newTime);
-                        } else {
+                        //if (self.id.indexOf("DrivingTest") > -1) {
+                        //    $("#DrivingTestStopTime").val(newTime);
+                        //} else {
                             $("#StopTime").val(newTime);
-                        }
+                        //}
                     }
                 });
             });


Properly read symlink entry

Properly read symlink entry

--- UnixZipArchive.cs
+++ UnixZipArchive.cs
@@ -50,13 +50,14 @@

 		public ZipEntry CreateSymbolicLink (string linkName, string linkDestination, EntryPermissions requestedPermissions= EntryPermissions.Default, Encoding encoding = null)
 		{
-			long index = -1;
 			ZipEntry entry = AddEntry (linkName, linkDestination, encoding ?? Encoding.UTF8, CompressionMethod.Store);
+			if (entry == null)
+				return null;
 			if (!SetEntryUnixPermissions (entry.Index, requestedPermissions == EntryPermissions.Default ? DefaultFilePermissions : requestedPermissions, UnixExternalPermissions.IFLNK))
 				throw GetErrorException ();

 			// We read it again to update permissions, flags, extra fields etc
-			return ReadEntry ((ulong)index);
+			return ReadEntry (entry.Index);
 		}

 		internal bool SetEntryUnixPermissions (ulong index, EntryPermissions requestedPermissions, UnixExternalPermissions unixPermissions)


Fix last read

Fix last read

--- AwfulRedux/Tools/Web/WebViewCommands.cs
+++ AwfulRedux/Tools/Web/WebViewCommands.cs
@@ -151,7 +151,7 @@
                             {
                                 var lastreadObject = JsonConvert.DeserializeObject<PostQuote>(command.Id);
                                 var threadManager = new ThreadManager(Views.Shell.Instance.ViewModel.WebManager);
-                                await threadManager.MarkPostAsLastReadAs(Convert.ToInt32(lastreadObject.thread_id), Convert.ToInt32(command.Id));
+                                await threadManager.MarkPostAsLastReadAs(Convert.ToInt32(lastreadObject.thread_id), Convert.ToInt32(lastreadObject.post_id));
                                 int nextPost = Convert.ToInt32(command.Id) + 1;
                                 await webview.InvokeScriptAsync("ScrollToDiv", new[] { string.Concat("#postId", nextPost.ToString()) });
                                 NotifyStatusTile.CreateToastNotification("Last Read", "Post marked as last read.");


Add comments

Add comments

--- Bellona/Analysis/Core/DeviationModel.cs
+++ Bellona/Analysis/Core/DeviationModel.cs
@@ -38,9 +38,17 @@
         public bool HasRecords { get { return Records.Length > 0; } }

         Lazy<ArrayVector> _mean;
+
+        /// <summary>
+        /// Gets the mean of features for the records.
+        /// </summary>
         public ArrayVector Mean { get { return _mean.Value; } }

         Lazy<double> _standardDeviation;
+
+        /// <summary>
+        /// Gets the standard deviation of features for the records.
+        /// </summary>
         public double StandardDeviation { get { return _standardDeviation.Value; } }

         internal DeviationModel(IEnumerable<T> source, Func<T, ArrayVector> featuresSelector)
@@ -52,6 +60,11 @@
         }
     }

+    /// <summary>
+    /// Represents the record in the statistical deviation model.
+    /// This object is immutable.
+    /// </summary>
+    /// <typeparam name="T"></typeparam>
     [DebuggerDisplay(@"\{{ToDebugString()}\}")]
     public class DeviationRecord<T>
     {
@@ -60,9 +73,19 @@
         public ArrayVector Features { get; private set; }

         Lazy<double> _deviation;
+
+        /// <summary>
+        /// Gets the deviation of the features in the records.
+        /// The value represents the distance between the mean and this features.
+        /// </summary>
         public double Deviation { get { return _deviation.Value; } }

         Lazy<double> _standardScore;
+
+        /// <summary>
+        /// Gets the standard score of the features in the records.
+        /// The unit is σ (the standard deviation).
+        /// </summary>
         public double StandardScore { get { return _standardScore.Value; } }

         internal DeviationRecord(DeviationModel<T> model, T element, ArrayVector features)


Refactor sprite dump second part

Refactor sprite dump second part

--- WLEditor/Level.cs
+++ WLEditor/Level.cs
@@ -600,15 +600,19 @@
 					int spriteDataAddress;
 					if(enemiesIdsToSpriteData.TryGetValue(enemyId, out spriteDataAddress))
 					{
-						LoadEnemiesTiles(rom, i, spriteDataAddress, tilesDataAddress, tiles8x8, tilesEnemies);
+						if (LoadEnemiesTiles(rom, i, spriteDataAddress, tilesDataAddress, tiles8x8))
+						{
+							Rectangle rectangle = DumpSprite(rom, 32, 56 + i * 64, spriteDataAddress, tiles8x8, tilesEnemies);
+							loadedSprites[i] = rectangle;
+						}
 					}
 				}
 			}
 		}

-		static void LoadEnemiesTiles(Rom rom, int enemyIndex, int spriteDataAddress, int tilesDataAddress, DirectBitmap tiles8x8, DirectBitmap tilesEnemies)
-		{
-			int enemyIndexCounter = 0;
+		static bool LoadEnemiesTiles(Rom rom, int enemyIndex, int spriteDataAddress, int tilesDataAddress, DirectBitmap tiles8x8)
+		{
+			int index = 0;

 			do
 			{
@@ -619,21 +623,21 @@

 				if(tilesCount == 0xFF)
 				{
-					break;
+					return false;
 				}

-				if(enemyIndexCounter == enemyIndex)
+				if(index == enemyIndex)
 				{
-					LoadEnemiesTiles(rom, enemyIndex, spriteDataAddress, tilesBank, tilesCount, tilesAddress, tiles8x8, tilesEnemies);
-					break;
+					LoadEnemiesTilesInternal(rom, spriteDataAddress, tilesBank, tilesCount, tilesAddress, tiles8x8);
+					return true;
 				}

-				enemyIndexCounter++;
+				index++;
 			}
 			while(true);
 		}

-		static void LoadEnemiesTiles(Rom rom, int enemyIndex, int spriteDataAddress, int tilesBank, int tilesCount, int tilesAddress, DirectBitmap tiles8x8, DirectBitmap tilesEnemies)
+		static void LoadEnemiesTilesInternal(Rom rom, int spriteDataAddress, int tilesBank, int tilesCount, int tilesAddress, DirectBitmap tiles8x8)
 		{
 			rom.SetBank(tilesBank);
 			int pos = rom.ReadWord(spriteDataAddress);
@@ -641,10 +645,7 @@
 			int palette = (spriteFlags & 0x10) != 0 ? 0xD1 : 0x1E;

 			Array.Clear(tiles8x8.Bits, 0, tiles8x8.Bits.Length);
-			Dump8x8Tiles(rom, tilesAddress, tiles8x8, tilesCount, 0, (byte)palette, enemyPalette, true);
-
-			Rectangle rectangle = DumpSprite(rom, 32, 56 + enemyIndex * 64, spriteDataAddress, tiles8x8, tilesEnemies);
-			loadedSprites[enemyIndex] = rectangle;
+			Dump8x8Tiles(rom, tilesAddress, tiles8x8, tilesCount, 0, (byte)palette, enemyPalette, true);
 		}

 		public static List<KeyValuePair<int, int>> GetCourseIds(Rom rom)


Fixed repository

Fixed repository

--- CSharp/Supermarket/ProductRepository.cs
+++ CSharp/Supermarket/ProductRepository.cs
@@ -43,7 +43,7 @@

         public Product GetProductByName(string name)
         {
-            return Products.FindLast(p => p.Name == name);
+            return Products.Single(p => p.Name == name);
         }
     }
 }