StyleCop

StyleCop

--- Source/GSoft.Dynamite.Multilingualism.Contracts/Constants/MultilingualismEventReceiverInfos.cs
+++ Source/GSoft.Dynamite.Multilingualism.Contracts/Constants/MultilingualismEventReceiverInfos.cs
@@ -31,7 +31,10 @@
         {
             return new EventReceiverInfo(
                 this.publishingContentTypeConfig.GetContentTypeById(PublishingContentTypeInfos.TranslatableItem.ContentTypeId),
-                SPEventReceiverType.ItemAdded) { ClassName = "GSoft.Dynamite.Multilingualism.SP.Events.TranslatableItemEvents" };
+                SPEventReceiverType.ItemAdded)
+            {
+                ClassName = "GSoft.Dynamite.Multilingualism.SP.Events.TranslatableItemEvents"
+            };
         }

         /// <summary>
@@ -42,7 +45,10 @@
         {
             return new EventReceiverInfo(
                 this.publishingContentTypeConfig.GetContentTypeById(PublishingContentTypeInfos.TranslatableItem.ContentTypeId),
-                SPEventReceiverType.ItemUpdated) { ClassName = "GSoft.Dynamite.Multilingualism.SP.Events.TranslatableItemEvents" };
+                SPEventReceiverType.ItemUpdated)
+            {
+                ClassName = "GSoft.Dynamite.Multilingualism.SP.Events.TranslatableItemEvents"
+            };
         }

         #endregion
@@ -57,7 +63,10 @@
         {
             return new EventReceiverInfo(
                 this.publishingContentTypeConfig.GetContentTypeById(PublishingContentTypeInfos.TranslatablePage.ContentTypeId),
-                SPEventReceiverType.ItemAdded) { ClassName = "GSoft.Dynamite.Multilingualism.SP.Events.TranslatablePageEvents" };
+                SPEventReceiverType.ItemAdded)
+            {
+                ClassName = "GSoft.Dynamite.Multilingualism.SP.Events.TranslatablePageEvents"
+            };
         }

         /// <summary>
@@ -71,7 +80,10 @@
             return new EventReceiverInfo(
                 this.publishingContentTypeConfig.GetContentTypeById(PublishingContentTypeInfos.TranslatablePage.ContentTypeId),
                 SPEventReceiverType.ItemUpdated,
-                SPEventReceiverSynchronization.Synchronous) { ClassName = "GSoft.Dynamite.Multilingualism.SP.Events.TranslatablePageEvents" };
+                SPEventReceiverSynchronization.Synchronous)
+            {
+                ClassName = "GSoft.Dynamite.Multilingualism.SP.Events.TranslatablePageEvents"
+            };
         }

         #endregion


More documentation in Binding.

More documentation in Binding.

--- NDProperty.Core/Binding/BindingBase.cs
+++ NDProperty.Core/Binding/BindingBase.cs
@@ -5,16 +5,50 @@

 namespace NDProperty.Binding
 {
-
+    /// <summary>
+    /// This static class provides Methods to implement Binding.
+    /// </summary>
+    /// <remarks>
+    /// Every Method in this class returns an object that implements <see cref="IDisposable"/>.
+    /// To revoke the binding call the Dispose Method on the Object. The <see cref="IDisposable.Dispose"/>
+    /// method will not be called when the object is garbage collected. If you don't want to untie the binding
+    /// you need not to hold an reference to the Binding object. <para/>
+    /// When binding two way to POCO, this implementation assumes that the <see cref="INotifyPropertyChanged.PropertyChanged"/>
+    /// event is fired only when the value actually changes. If this is not the case this can result in unwanted round trips.
+    /// </remarks>
     public static class Bind
     {

+        /// <summary>
+        /// Creaates a One Way Binding using NDPropertys.
+        /// </summary>
+        /// <typeparam name="TValueSource">The type of the source Property</typeparam>
+        /// <typeparam name="TTypeSource">The type of the source object</typeparam>
+        /// <typeparam name="TValueDestination">The type of the destination Property</typeparam>
+        /// <typeparam name="TTypeDestination">The type of the destination object</typeparam>
+        /// <param name="source">The source Object</param>
+        /// <param name="sourceProperty">The source Property</param>
+        /// <param name="destination">The destination Object</param>
+        /// <param name="destinationProperty">The destination Property</param>
+        /// <param name="converter">A converter that is used to translate from source property type to destination proeprty type.</param>
+        /// <returns>The binding object</returns>
         public static OneWayBinding<TValueSource, TTypeSource, TValueDestination, TTypeDestination> OneWay<TValueSource, TTypeSource, TValueDestination, TTypeDestination>(TTypeSource source, NDReadOnlyPropertyKey<TValueSource, TTypeSource> sourceProperty, TTypeDestination destination, NDPropertyKey<TValueDestination, TTypeDestination> destinationProperty, IConverter<TValueSource, TValueDestination> converter)
             where TTypeSource : class
             where TTypeDestination : class
         {
             return new OneWayBinding<TValueSource, TTypeSource, TValueDestination, TTypeDestination>(source, sourceProperty, destination, destinationProperty, converter);
         }
+        /// <summary>
+        /// Creaates a One Way Binding using NDPropertys.
+        /// </summary>
+        /// <typeparam name="TValue">The type of the Property</typeparam>
+        /// <typeparam name="TTypeSource">The type of the source object</typeparam>
+        /// <typeparam name="TTypeDestination">The type of the destination object</typeparam>
+        /// <param name="source">The source Object</param>
+        /// <param name="sourceProperty">The source Property</param>
+        /// <param name="destination">The destination Object</param>
+        /// <param name="destinationProperty">The destination Property</param>
+        /// <returns>The binding object</returns>
         public static OneWayBinding<TValue, TTypeSource, TValue, TTypeDestination> OneWay<TValue, TTypeSource, TTypeDestination>(TTypeSource source, NDReadOnlyPropertyKey<TValue, TTypeSource> sourceProperty, TTypeDestination destination, NDPropertyKey<TValue, TTypeDestination> destinationProperty)
             where TTypeSource : class
             where TTypeDestination : class
@@ -22,25 +56,72 @@
             return new OneWayBinding<TValue, TTypeSource, TValue, TTypeDestination>(source, sourceProperty, destination, destinationProperty, new IdentetyConverter<TValue>());
         }

+        /// <summary>
+        /// Creates one way binding from POCO to NDProperty
+        /// </summary>
+        /// <typeparam name="TValueSource">The type of the source Property</typeparam>
+        /// <typeparam name="TTypeSource">The type of the source object</typeparam>
+        /// <typeparam name="TValueDestination">The type of the destination Property</typeparam>
+        /// <typeparam name="TTypeDestination">The type of the destination object</typeparam>
+        /// <param name="source">The source Object</param>
+        /// <param name="sourceProperty">The name of the source Property</param>
+        /// <param name="destination">The destination Object</param>
+        /// <param name="destinationProperty">The destination Property</param>
+        /// <param name="converter">A converter that is used to translate from source property type to destination proeprty type.</param>
+        /// <returns>The binding object</returns>
         public static NotifyToNDPBinding<TValueSource, TTypeSource, TValueDestination, TTypeDestination> OneWay<TValueSource, TTypeSource, TValueDestination, TTypeDestination>(TTypeSource source, string sourceProperty, TTypeDestination destination, NDPropertyKey<TValueDestination, TTypeDestination> destinationProperty, IConverter<TValueSource, TValueDestination> converter)
             where TTypeSource : INotifyPropertyChanged
             where TTypeDestination : class
         {
             return new NotifyToNDPBinding<TValueSource, TTypeSource, TValueDestination, TTypeDestination>(source, sourceProperty, destination, destinationProperty, converter);
         }
+        /// <summary>
+        /// Creates one way binding from POCO to NDProperty
+        /// </summary>
+        /// <typeparam name="TValue">The type of the Property</typeparam>
+        /// <typeparam name="TTypeSource">The type of the source object</typeparam>
+        /// <typeparam name="TTypeDestination">The type of the destination object</typeparam>
+        /// <param name="source">The source Object</param>
+        /// <param name="sourceProperty">The name of the source Property</param>
+        /// <param name="destination">The destination Object</param>
+        /// <param name="destinationProperty">The destination Property</param>
+        /// <returns>The binding object</returns>
         public static NotifyToNDPBinding<TValue, TTypeSource, TValue, TTypeDestination> OneWay<TValue, TTypeSource, TTypeDestination>(TTypeSource source, string sourceProperty, TTypeDestination destination, NDPropertyKey<TValue, TTypeDestination> destinationProperty)
             where TTypeSource : INotifyPropertyChanged
             where TTypeDestination : class
         {
             return new NotifyToNDPBinding<TValue, TTypeSource, TValue, TTypeDestination>(source, sourceProperty, destination, destinationProperty, new IdentetyConverter<TValue>());
         }
-
+        /// <summary>
+        /// Creates one way binding from NDProperty to POCO
+        /// </summary>
+        /// <typeparam name="TValueSource">The type of the source Property</typeparam>
+        /// <typeparam name="TTypeSource">The type of the source object</typeparam>
+        /// <typeparam name="TValueDestination">The type of the destination Property</typeparam>
+        /// <typeparam name="TTypeDestination">The type of the destination object</typeparam>
+        /// <param name="source">The source Object</param>
+        /// <param name="sourceProperty">The source Property</param>
+        /// <param name="destination">The destination Object</param>
+        /// <param name="destinationProperty">The name of the destination Property</param>
+        /// <param name="converter">A converter that is used to translate from source property type to destination proeprty type.</param>
+        /// <returns>The binding object</returns>
         public static NDPToNotifyBinding<TValueSource, TTypeSource, TValueDestination, TTypeDestination> OneWay<TValueSource, TTypeSource, TValueDestination, TTypeDestination>(TTypeSource source, NDReadOnlyPropertyKey<TValueSource, TTypeSource> sourceProperty, TTypeDestination destination, string destinationProperty, IConverter<TValueSource, TValueDestination> converter)
             where TTypeSource : class
             where TTypeDestination : INotifyPropertyChanged
         {
             return new NDPToNotifyBinding<TValueSource, TTypeSource, TValueDestination, TTypeDestination>(source, sourceProperty, destination, destinationProperty, converter);
         }
+        /// <summary>
+        /// Creates one way binding from NDProperty to POCO
+        /// </summary>
+        /// <typeparam name="TValue">The type of the Property</typeparam>
+        /// <typeparam name="TTypeSource">The type of the source object</typeparam>
+        /// <typeparam name="TTypeDestination">The type of the destination object</typeparam>
+        /// <param name="source">The source Object</param>
+        /// <param name="sourceProperty">The source Property</param>
+        /// <param name="destination">The name of the destination Object</param>
+        /// <param name="destinationProperty">The destination Property</param>
+        /// <returns>The binding object</returns>
         public static NDPToNotifyBinding<TValue, TTypeSource, TValue, TTypeDestination> OneWay<TValue, TTypeSource, TTypeDestination>(TTypeSource source, NDReadOnlyPropertyKey<TValue, TTypeSource> sourceProperty, TTypeDestination destination, string destinationProperty)
             where TTypeSource : class
             where TTypeDestination : INotifyPropertyChanged
@@ -48,12 +129,36 @@
             return new NDPToNotifyBinding<TValue, TTypeSource, TValue, TTypeDestination>(source, sourceProperty, destination, destinationProperty, new IdentetyConverter<TValue>());
         }

+        /// <summary>
+        /// Creates two way Binding between two NDPropertys
+        /// </summary>
+        /// <typeparam name="TValueSource">The type of the source Property</typeparam>
+        /// <typeparam name="TTypeSource">The type of the source object</typeparam>
+        /// <typeparam name="TValueDestination">The type of the destination Property</typeparam>
+        /// <typeparam name="TTypeDestination">The type of the destination object</typeparam>
+        /// <param name="source">The source Object</param>
+        /// <param name="sourceProperty">The source Property</param>
+        /// <param name="destination">The destination Object</param>
+        /// <param name="destinationProperty">The destination Property</param>
+        /// <param name="converter">A converter that is used to translate from source property type to destination proeprty type.</param>
+        /// <returns>The binding object</returns>
         public static TwoWayBinding<TValueSource, TTypeSource, TValueDestination, TTypeDestination> TwoWay<TValueSource, TTypeSource, TValueDestination, TTypeDestination>(TTypeSource source, NDPropertyKey<TValueSource, TTypeSource> sourceProperty, TTypeDestination destination, NDPropertyKey<TValueDestination, TTypeDestination> destinationProperty, ITwoWayConverter<TValueSource, TValueDestination> converter)
             where TTypeSource : class
             where TTypeDestination : class
         {
             return new TwoWayBinding<TValueSource, TTypeSource, TValueDestination, TTypeDestination>(source, sourceProperty, destination, destinationProperty, converter);
         }
+        /// <summary>
+        /// Creates two way Binding between two NDPropertys
+        /// </summary>
+        /// <typeparam name="TValue">The type of the Property</typeparam>
+        /// <typeparam name="TTypeSource">The type of the source object</typeparam>
+        /// <typeparam name="TTypeDestination">The type of the destination object</typeparam>
+        /// <param name="source">The source Object</param>
+        /// <param name="sourceProperty">The source Property</param>
+        /// <param name="destination">The destination Object</param>
+        /// <param name="destinationProperty">The destination Property</param>
+        /// <returns>The binding object</returns>
         public static TwoWayBinding<TValue, TTypeSource, TValue, TTypeDestination> TwoWay<TValue, TTypeSource, TTypeDestination>(TTypeSource source, NDPropertyKey<TValue, TTypeSource> sourceProperty, TTypeDestination destination, NDPropertyKey<TValue, TTypeDestination> destinationProperty)
             where TTypeSource : class
             where TTypeDestination : class
@@ -61,12 +166,36 @@
             return new TwoWayBinding<TValue, TTypeSource, TValue, TTypeDestination>(source, sourceProperty, destination, destinationProperty, new IdentetyConverter<TValue>());
         }

+        /// <summary>
+        /// Creates two way Binding between a NDProperty and a POCO
+        /// </summary>
+        /// <typeparam name="TValueSource">The type of the source Property</typeparam>
+        /// <typeparam name="TTypeSource">The type of the source object</typeparam>
+        /// <typeparam name="TValueDestination">The type of the destination Property</typeparam>
+        /// <typeparam name="TTypeDestination">The type of the destination object</typeparam>
+        /// <param name="source">The source Object</param>
+        /// <param name="sourceProperty">The source Property</param>
+        /// <param name="destination">The destination Object</param>
+        /// <param name="destinationProperty">The name of the destination Property</param>
+        /// <param name="converter">A converter that is used to translate from source property type to destination proeprty type.</param>
+        /// <returns>The binding object</returns>
         public static TwoWayNotifyBinding<TValueSource, TTypeSource, TValueDestination, TTypeDestination> TwoWay<TValueSource, TTypeSource, TValueDestination, TTypeDestination>(TTypeSource source, NDPropertyKey<TValueSource, TTypeSource> sourceProperty, TTypeDestination destination, string destinationProperty, ITwoWayConverter<TValueSource, TValueDestination> converter)
             where TTypeSource : class
             where TTypeDestination : INotifyPropertyChanged
         {
             return new TwoWayNotifyBinding<TValueSource, TTypeSource, TValueDestination, TTypeDestination>(source, sourceProperty, destination, destinationProperty, converter);
         }
+        /// <summary>
+        /// Creates two way Binding between a NDProperty and a POCO
+        /// </summary>
+        /// <typeparam name="TValue">The type of the Property</typeparam>
+        /// <typeparam name="TTypeSource">The type of the source object</typeparam>
+        /// <typeparam name="TTypeDestination">The type of the destination object</typeparam>
+        /// <param name="source">The source Object</param>
+        /// <param name="sourceProperty">The source Property</param>
+        /// <param name="destination">The destination Object</param>
+        /// <param name="destinationProperty">The name of the destination Property</param>
+        /// <returns>The binding object</returns>
         public static TwoWayNotifyBinding<TValue, TTypeSource, TValue, TTypeDestination> TwoWay<TValue, TTypeSource, TTypeDestination>(TTypeSource source, NDPropertyKey<TValue, TTypeSource> sourceProperty, TTypeDestination destination, string destinationProperty)
             where TTypeSource : class
             where TTypeDestination : INotifyPropertyChanged


Default GetCurrentRecipe to False

Default GetCurrentRecipe to False


Fix en helper para TinyMce Editor.

Fix en helper para TinyMce Editor.

--- Framework.MVC/Extensions/TinyMceExtensions.cs
+++ Framework.MVC/Extensions/TinyMceExtensions.cs
@@ -61,7 +61,7 @@
             (this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, IDictionary<string, object> options)
             where TModel : class
         {
-            return TinyMce(htmlHelper, expression.GetNameFor(), expression.GetValueFrom(htmlHelper.ViewData.Model).ToString(), options);
+            return TinyMce(htmlHelper, HtmlHelper.GenerateIdFromName(expression.GetNameFor()), expression.GetValueFrom(htmlHelper.ViewData.Model).ToString(), options);
         }
     }
 }


Checks the user is approved before allowing them to be logged in.

--- yafsrc/YAF.Providers/Membership/YafMembershipProvider.cs
+++ yafsrc/YAF.Providers/Membership/YafMembershipProvider.cs
@@ -783,7 +783,7 @@
         {
             UserPasswordInfo currentUser = UserPasswordInfo.CreateInstanceFromDB(this.ApplicationName, username, false, this.UseSalt);

-            if (currentUser != null)
+            if (currentUser != null && currentUser.IsApproved)
             {
                 return currentUser.IsCorrectPassword(password);
             }


Fixed StyleCop issue

Fixed StyleCop issue

Fixes #63

--- Corale.Colore/Core/NativeWrapper.cs
+++ Corale.Colore/Core/NativeWrapper.cs
@@ -162,7 +162,6 @@
             return CreateMouseEffect(effect, IntPtr.Zero);
         }

-
         /// <summary>
         /// Creates a custom effect for the mouse.
         /// </summary>


modified apiKey usage

modified apiKey usage

--- Core/FREDApi/UnitTest1/UnitTest1.cs
+++ Core/FREDApi/UnitTest1/UnitTest1.cs
@@ -16,7 +16,8 @@
 		[TestMethod]
 		public void FetchCategory()
 		{
-			var api = new Category() { ApiKey = apiKey };
+			var api = new Category();
+			api.Arguments.ApiKey = apiKey;
 			api.Arguments.category_id = 13;
 			var categoryContainer = api.Fetch();

@@ -29,7 +30,8 @@
 		[TestMethod]
 		public async Task FetchCategoryAsync()
 		{
-			var api = new Category() { ApiKey = apiKey };
+			var api = new Category();
+			api.Arguments.ApiKey = apiKey;
 			api.Arguments.category_id = 13;
 			var categoryContainer = await api.FetchAsync();


更新模型逻辑

更新模型逻辑

添加了一个显示/隐藏的方法


Pass the federations field to the Federation ctor.

--- src/HtmlGenerator/Program.cs
+++ src/HtmlGenerator/Program.cs
@@ -3,7 +3,6 @@
 using System.Collections.Immutable;
 using System.IO;
 using System.Text.RegularExpressions;
-using System.Threading;
 using Microsoft.CodeAnalysis;
 using Microsoft.SourceBrowser.Common;

@@ -142,7 +141,7 @@

             using (Disposable.Timing("Generating website"))
             {
-                var federation = noBuiltInFederations ? new Federation(null) : new Federation();
+                var federation = noBuiltInFederations ? new Federation(null) : new Federation(federations);
                 foreach (var entry in offlineFederations)
                 {
                     federation.AddFederation(entry.Key, entry.Value);


Next/Prev Image Fixes

Next/Prev Image Fixes

- Fixed the last image showing for a split-second and the new image's
location (by setting the new window position after drawing the new
image).
- Fixed the window jumping around if the user spams next/prev frame.
- Fixed Reset Button not un-flipping the image (needed to set FlippedX
to false).

--- vimage/Source/ImageViewer.cs
+++ vimage/Source/ImageViewer.cs
@@ -27,6 +27,11 @@
         private bool Updated = false;
         private bool CloseNextTick = false;

+        /// <summary>
+        /// Instead of setting the Window Position directly when the image is going to be Updated, this is set.
+        /// This prevents the old image being shown at the new image location for a split-second before the new image is loaded.
+        /// </summary>
+        private Vector2i NextWindowPos = new Vector2i();
         private bool Dragging = false;
         private Vector2i DragPos = new Vector2i();
         private Vector2i MousePos = new Vector2i();
@@ -111,7 +116,6 @@
                 if (Config.Setting_LimitImagesToMonitorHeight && Image.Texture.Size.Y > bounds.Height)
                 {
                     // Fit to monitor height if it's higher than monitor height.
-                    //Window.Position = new Vector2i(Window.Position.X, 0);
                     Zoom(1 + (((float)bounds.Height - Image.Texture.Size.Y) / Image.Texture.Size.Y), true);
                     FitToMonitorHeightForced = true;
                 }
@@ -154,6 +158,7 @@
             BackgroundsForImagesWithTransparency = Config.Setting_BackgroundForImagesWithTransparencyDefault;

             Redraw();
+            NextWindowPos = Window.Position;

             // Interaction
             Window.Closed += OnWindowClosed;
@@ -194,6 +199,7 @@
                 {
                     Updated = false;
                     Redraw();
+                    Window.Position = NextWindowPos;
                 }

                 if (ForceAlwaysOnTopNextTick)
@@ -295,10 +301,10 @@
             }

 			// Reset Image
-			if(Config.IsControl(e.Code, Config.Control_ResetImage))
+			if (Config.IsControl(e.Code, Config.Control_ResetImage))
 			{
 				Zoom(1f);
-				Image.Scale = new Vector2f(Math.Abs(Image.Scale.X), Math.Abs(Image.Scale.Y));
+                FlippedX = false;
 				RotateImage(0);
 			}

@@ -320,7 +326,7 @@
             }

             // Next/Prev Image in Folder
-            if (Config.IsControl(e.Code, Config.Control_PrevImage))
+            if (!Updated && Config.IsControl(e.Code, Config.Control_PrevImage))
             {
                 GetFolderContents();
                 bool success = false;
@@ -331,7 +337,7 @@
                 }
                 while (!success);
             }
-            if (Config.IsControl(e.Code, Config.Control_NextImage))
+            if (!Updated && Config.IsControl(e.Code, Config.Control_NextImage))
             {
                 GetFolderContents();
                 bool success = false;
@@ -447,7 +453,7 @@
                 Window.Size = newSize;

                 Vector2i difference = new Vector2i((int)newSize.X, (int)newSize.Y) - new Vector2i((int)Window.Size.X, (int)Window.Size.Y);
-                Window.Position = new Vector2i(Window.Position.X - (difference.X / 2), Window.Position.Y - (difference.Y / 2));
+                NextWindowPos = new Vector2i(Window.Position.X - (difference.X / 2), Window.Position.Y - (difference.Y / 2));
             }
             else
             {
@@ -495,7 +501,7 @@

             Window.Size = WindowSize;
             if (aroundCenter)
-                Window.Position = new Vector2i((int)center.X - (int)(WindowSize.X / 2), (int)center.Y - (int)(WindowSize.Y / 2));
+                NextWindowPos = new Vector2i((int)center.X - (int)(WindowSize.X / 2), (int)center.Y - (int)(WindowSize.Y / 2));

             Updated = true;
         }
@@ -518,19 +524,19 @@
                     Zoom(1 + (((float)bounds.Height - Image.Texture.Size.X) / Image.Texture.Size.X), true);
                 else
                     Zoom(1 + (((float)bounds.Height - Image.Texture.Size.Y) / Image.Texture.Size.Y), true);
-                Window.Position = new Vector2i(Window.Position.X, 0);
+                NextWindowPos = new Vector2i(NextWindowPos.X, 0);
             }
             else
             {
                 // Full Size
                 FitToMonitorHeight = false;
                 Zoom(1, true);
-                Window.Position = new Vector2i(Window.Position.X < 0 ? 0 : Window.Position.X, Window.Position.Y < 0 ? 0 : Window.Position.Y);
+                NextWindowPos = new Vector2i(NextWindowPos.X < 0 ? 0 : NextWindowPos.X, NextWindowPos.Y < 0 ? 0 : NextWindowPos.Y);
             }

             if (Image.Texture.Size.X * CurrentZoom >= VideoMode.DesktopMode.Width)
-                Window.Position = new Vector2i(0, 0); // Position Window at 0,0 if the image is large (ie: a Desktop wallpaper)
+                NextWindowPos = new Vector2i(0, 0); // Position Window at 0,0 if the image is large (ie: a Desktop wallpaper)
             else if (!FitToMonitorHeightAlternative)
                 ForceAlwaysOnTopNextTick = true;
         }
@@ -540,6 +546,7 @@
             float prevRotation = Image.Rotation;

             Image.Dispose();
+            Dragging = false;

             if (Graphics.NumberOfFramesInImage(fileName) > 1)
             {
@@ -573,7 +580,7 @@
             {
                 // Fit to monitor height if it's higher than monitor height (or FitToMonitorHeight is true).
                 Zoom(1 + (((float)bounds.Height - Image.Texture.Size.Y) / Image.Texture.Size.Y), true);
-                Window.Position = new Vector2i(Window.Position.X, bounds.Top);
+                NextWindowPos = new Vector2i(NextWindowPos.X, bounds.Top);
                 if (!FitToMonitorHeight)
                     FitToMonitorHeightForced = true;
             }
@@ -587,7 +594,7 @@

             // Position Window at 0,0 if the image is wide (ie: a Desktop Wallpaper / Screenshot)
             if (Config.Setting_PositionLargeWideImagesInCorner && Image.Texture.Size.X > Image.Texture.Size.Y && Image.Texture.Size.X * CurrentZoom >= VideoMode.DesktopMode.Width)
-                Window.Position = new Vector2i(0, 0);
+                NextWindowPos = new Vector2i(0, 0);

             // Force Always On Top Mode (so it's above the task bar) - will only happen if height >= window height
             ForceAlwaysOnTopNextTick = true;


Refactoring

Refactoring

--- examples/PolygonPathing/PolygonPathing.cs
+++ examples/PolygonPathing/PolygonPathing.cs
@@ -286,7 +286,7 @@
 					avoid = new PathFinder(polygonsToPathAround, avoidInset, null); // -600 is for a .4 nozzle in matterslice
 				}

-				IVertexSource outlineShape = new VertexSourceApplyTransform(VertexSourceToClipperPolygons.CreatePathStorage(MSPolygonsToPolygons(avoid.OutlineData.Polygons), 1), TotalTransform);
+				IVertexSource outlineShape = new VertexSourceApplyTransform(VertexSourceToClipperPolygons.CreatePathStorage(MSPolygonsToPolygons(avoid.OutsideData.Polygons), 1), TotalTransform);
 				IVertexSource pathingShape = new VertexSourceApplyTransform(VertexSourceToClipperPolygons.CreatePathStorage(MSPolygonsToPolygons(avoid.PathingData.Polygons), 1), TotalTransform);

 				if (StayInside.Checked)
@@ -349,7 +349,7 @@

 				//RenderQuadTree(graphics2D, avoid.BoundaryEdgeQuadTrees, 0);

-				if (avoid.OutlineData.Polygons.PointIsInside(pathEnd, avoid.OutlineData.EdgeQuadTrees, avoid.OutlineData.EdgeQuadTrees, avoid.OutlineData.PointIsInside))
+				if (avoid.OutsideData.Polygons.PointIsInside(pathEnd, avoid.OutsideData.EdgeQuadTrees, avoid.OutsideData.EdgeQuadTrees, avoid.OutsideData.PointIsInside))
 				{
 					graphics2D.DrawString("Inside", 30, Height - 60, color: RGBA_Bytes.Green);
 				}
@@ -375,7 +375,7 @@
 				if(true)
 				{
 					MSPolygons pathsWithOverlapsRemoved;
-					var insetPolys = MSClipperLib.CLPolygonsExtensions.Offset(avoid.OutlineData.Polygons, 0);
+					var insetPolys = MSClipperLib.CLPolygonsExtensions.Offset(avoid.OutsideData.Polygons, 0);
 					if (insetPolys != null && insetPolys.Count > 0)
 					{
 						var pathHadOverlaps = QTPolygonExtensions.MergePerimeterOverlaps(insetPolys[0], avoidInset*2, out pathsWithOverlapsRemoved, true);
@@ -401,7 +401,7 @@

 		private void RenderCrossings(Graphics2D graphics2D, MSIntPoint pathStart, MSIntPoint pathEnd, PathFinder avoid)
 		{
-			var crossings = new List<Tuple<int, int, MSIntPoint>>(avoid.OutlineData.Polygons.FindCrossingPoints(pathStart, pathEnd, avoid.OutlineData.EdgeQuadTrees));
+			var crossings = new List<Tuple<int, int, MSIntPoint>>(avoid.OutsideData.Polygons.FindCrossingPoints(pathStart, pathEnd, avoid.OutsideData.EdgeQuadTrees));
 			crossings.Sort(new PolygonAndPointDirectionSorter(pathStart, pathEnd));

 			int index = 0;
@@ -488,10 +488,10 @@

 				var avoid2 = new PathFinder(sample, avoidInset, null); // -600 is for a .4 nozzle in matterslice
 				if (!avoid2.CreatePathInsideBoundary(start, end, pathThatIsInside)
-					&& avoid2.OutlineData.Polygons.PointIsInside(start)
-					&& PointCount(avoid2.OutlineData.Polygons) <= bestPointCount)
-				{
-					bestPointCount = PointCount(avoid2.OutlineData.Polygons);
+					&& avoid2.OutsideData.Polygons.PointIsInside(start)
+					&& PointCount(avoid2.OutsideData.Polygons) <= bestPointCount)
+				{
+					bestPointCount = PointCount(avoid2.OutsideData.Polygons);
 					overrideBadPolys = sample;
 					badCount = 0;
 				}


IsEnum fix

IsEnum fix

--- Reinforced.Typings/Generators/ParameterCodeGenerator.cs
+++ Reinforced.Typings/Generators/ParameterCodeGenerator.cs
@@ -56,7 +56,7 @@
             {
                 //if parameter is having enum type then simple string value assignment is now right
                 //so for Enum type result.DefaultValue should be equal to ENUME_NAME+"."+DefaultValue
-                if (element.ParameterType.IsEnum)
+                if (element.ParameterType._IsEnum())
                 {
                     result.DefaultValue = result.Type + "." + defaultValue;
                 }


Added other contributors

Added other contributors

--- Dblp.WebUi/Views/About/Index.cshtml
+++ Dblp.WebUi/Views/About/Index.cshtml
@@ -29,7 +29,7 @@

dblp: Uni Trier Die Daten

GitHub: GitHub.com Das Hosten des Codes

Pezmc: GitHub.com Dateicheck

+Knockout, typeahead, jquery, mvc

-


open file dialog save the lase path.

open file dialog save the lase path.

--- DependencyViewer/MainWindow.xaml.cs
+++ DependencyViewer/MainWindow.xaml.cs
@@ -76,7 +76,7 @@
 			                  Multiselect = false,
 			                  InitialDirectory = Directory.GetCurrentDirectory()
 			              };
-
+            ofd.RestoreDirectory = true;
 		    if(ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
 			{
 				tbFilename.Text = ofd.FileName;
@@ -85,15 +85,15 @@

 		private void OutputBrowseButton_Click(object sender, RoutedEventArgs e)
 		{
-			var ofd = new System.Windows.Forms.OpenFileDialog
+            var sfd = new System.Windows.Forms.SaveFileDialog
 			              {
-			                  Multiselect = false,
 			                  InitialDirectory = Directory.GetCurrentDirectory()
 			              };
-
-		    if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
-			{
-				tbOutputFilename.Text = ofd.FileName;
+            sfd.Filter = @"png|*.png";
+            sfd.RestoreDirectory = true;
+            if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+			{
+                tbOutputFilename.Text = sfd.FileName;
 			}
 		}

@@ -201,7 +201,7 @@
                     if (solution.GetProject(projectRef) == null) continue;
                     project_ref_index++;
                     Project refproject = solution.GetProject(projectRef);
-                    sw.WriteLine(index + "--" + project_ref_index + "--" + refproject.Name);
+                    sw.WriteLine(index + ": " + project_ref_index + "--" + refproject.Name);
                 }
                 if (project_ref_index > max_project_ref)
                 {
@@ -212,7 +212,7 @@
                 sw.WriteLine();
             }
             if (max_project_ref > 0)
-              sw.WriteLine("Max project refs is " + max_project_ref + " of" + max_ref_of_project);
+              sw.WriteLine("Max project refs is " + max_project_ref + " of " + max_ref_of_project);
             sw.Close();
             fs.Close();
         }


Moved repo creation after the config file writing because a bad config file will break otherwise...

--- Naos.Deployment.Core/PackageManager.cs
+++ Naos.Deployment.Core/PackageManager.cs
@@ -99,11 +99,13 @@
             HttpClient.DefaultCredentialProvider = credentialProvider;

             // logic taken from: http://blog.nuget.org/20130520/Play-with-packages.html
-            var repo = packageSourceProvider.CreateAggregateRepository(PackageRepositoryFactory.Default, true);
             var nugetSourcesFilePath = Path.Combine(Environment.GetEnvironmentVariable("APPDATA") ?? ".", "Nuget\\NuGet.Config");
             var nugetSourcesFileObject = NuGetConfigFile.BuildConfigFileFromRepositoryConfiguration(this.repoConfig);
             var nugetSourcesFileContents = NuGetConfigFile.Serialize(nugetSourcesFileObject);
             File.WriteAllText(nugetSourcesFilePath, nugetSourcesFileContents, Encoding.UTF8);
+
+            // This is where the file get evaluated so it must exist before reaching here...
+            var repo = packageSourceProvider.CreateAggregateRepository(PackageRepositoryFactory.Default, true);

             var packageManager = new NuGet.PackageManager(repo, workingDirectory);


Login button is back

Login button is back

--- NewBeanfunLogin/Form_Login.Designer.cs
+++ NewBeanfunLogin/Form_Login.Designer.cs
@@ -128,11 +128,11 @@
             //
             this.btnLogin.Enabled = false;
             this.btnLogin.Font = new System.Drawing.Font("微軟正黑體", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.btnLogin.Location = new System.Drawing.Point(137, 157);
+            this.btnLogin.Location = new System.Drawing.Point(218, 12);
             this.btnLogin.Name = "btnLogin";
-            this.btnLogin.Size = new System.Drawing.Size(75, 23);
+            this.btnLogin.Size = new System.Drawing.Size(57, 55);
             this.btnLogin.TabIndex = 15;
-            this.btnLogin.Text = "登入";
+            this.btnLogin.Text = "登入 (Enter)";
             this.btnLogin.UseVisualStyleBackColor = true;
             this.btnLogin.Visible = false;
             this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
@@ -146,7 +146,7 @@
             //
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(239, 76);
+            this.ClientSize = new System.Drawing.Size(289, 76);
             this.Controls.Add(this.btnLogin);
             this.Controls.Add(this.btnRecaptcha);
             this.Controls.Add(this.pbCaptcha);


dont create guids client side => (see EntityEditHandler)

--- NinjaHive.Contract/Models/TierModel.cs
+++ NinjaHive.Contract/Models/TierModel.cs
@@ -1,11 +1,7 @@
 using NinjaHive.Core.Helpers;
 using NinjaHive.Core.Validations;
 using System;
-using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;

 namespace NinjaHive.Contract.Models
 {
@@ -13,7 +9,6 @@
     {
         public TierModel()
         {
-            Id = Guid.NewGuid();
             StatInfo = new StatInfoModel();
         }


apply patch to animation

apply patch to animation

--- hkxPoser/Viewer.cs
+++ hkxPoser/Viewer.cs
@@ -214,10 +214,33 @@
         public void AssignAnimationPose(int pose_i)
         {
             pose_i %= anim.numOriginalFrames;
-            int len = System.Math.Min(skeleton.bones.Length, anim.pose[pose_i].transforms.Length);
-            for (int i = 0; i < len; i++)
-            {
-                skeleton.bones[i].local = anim.pose[pose_i].transforms[i];
+            hkaPose pose = anim.pose[pose_i];
+            int nbones = System.Math.Min(skeleton.bones.Length, anim.pose[pose_i].transforms.Length);
+            for (int i = 0; i < nbones; i++)
+            {
+                skeleton.bones[i].local = pose.transforms[i];
+            }
+        }
+
+        public void ApplyPatchToAnimation()
+        {
+            foreach (hkaPose pose in anim.pose)
+            {
+                int nbones = System.Math.Min(skeleton.bones.Length, pose.transforms.Length);
+                for (int i = 0; i < nbones; i++)
+                {
+                    pose.transforms[i] *= skeleton.bones[i].patch;
+                }
+            }
+            ClearPatch();
+            ClearCommands();
+        }
+
+        public void ClearPatch()
+        {
+            foreach (hkaBone bone in skeleton.bones)
+            {
+                bone.patch = new Transform();
             }
         }

@@ -261,8 +284,10 @@
         {
             string file = CreateTempFileName(dest_file);

-            anim.numOriginalFrames = 1;
-            anim.duration = 1.0f/30.0f;
+            ApplyPatchToAnimation();
+
+            //anim.numOriginalFrames = 1;
+            //anim.duration = 1.0f/30.0f;
             anim.Save(file);

             ProcessStartInfo info = new ProcessStartInfo(


Implemented NuGet restore in the unit tests and made them async.

--- OctoPack.Precompile.Tests/BuildTest.cs
+++ OctoPack.Precompile.Tests/BuildTest.cs
@@ -3,6 +3,8 @@
 using System.IO;
 using System.IO.Compression;
 using System.Linq;
+using System.Net;
+using System.Threading.Tasks;
 using Xunit;
 using Xunit.Abstractions;

@@ -23,9 +25,9 @@
         }

         [Fact]
-        public void EnablingOctoPackEnablesOctoPackPrecompileAutomatically()
+        public async Task EnablingOctoPackEnablesOctoPackPrecompileAutomatically()
         {
-            this.Build("/p:RunOctoPack=true");
+            await this.BuildAsync("/p:RunOctoPack=true");
             using (ZipArchive archive = ZipFile.OpenRead(NuGetPackagePath))
             {
                 Assert.True(archive.Entries.Any(x => x.Name.EndsWith(".compiled")), "Couldn't find compiled files in the output NuGet package.");
@@ -33,18 +35,41 @@
         }

         [Fact]
-        public void RunOctoPackPrecompile_CanBeUsedToDisableThePrecompilation()
+        public async Task RunOctoPackPrecompile_CanBeUsedToDisableThePrecompilation()
         {
-            this.Build("/p:RunOctoPack=true /p:RunOctoPackPrecompile=false");
+            await this.BuildAsync("/p:RunOctoPack=true /p:RunOctoPackPrecompile=false");
             using (ZipArchive archive = ZipFile.OpenRead(NuGetPackagePath))
             {
                 Assert.False(archive.Entries.Any(x => x.Name.EndsWith(".compiled")), "Found compiled files in the output NuGet package.");
             }
         }

-        private void Build(string arguments)
+        private async Task BuildAsync(string arguments)
         {
-            ProcessStartInfo psi = new ProcessStartInfo(MSBuildPath, $"{SolutionFilePath} /target:Rebuild {arguments}")
+            await this.RestoreNuGetPackagesAsync();
+            await this.ExecuteProcessAsync(MSBuildPath, $"{SolutionFilePath} /target:Rebuild {arguments}");
+        }
+
+        private async Task RestoreNuGetPackagesAsync()
+        {
+            await this.EnsureNuGetIsDownloadedAsync();
+            await this.ExecuteProcessAsync("nuget.exe", $"restore {SolutionFilePath}");
+        }
+
+        private async Task EnsureNuGetIsDownloadedAsync()
+        {
+            if (File.Exists("nuget.exe"))
+            {
+                return;
+            }
+
+            WebClient wc = new WebClient();
+            await wc.DownloadFileTaskAsync(new Uri("https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"), "nuget.exe");
+        }
+
+        private async Task ExecuteProcessAsync(string filePath, string arguments)
+        {
+            ProcessStartInfo psi = new ProcessStartInfo(filePath, arguments)
             {
                 UseShellExecute = false,
                 RedirectStandardOutput = true
@@ -52,11 +77,11 @@

             using (Process process = Process.Start(psi))
             {
-                string log = process.StandardOutput.ReadToEnd();
+                string log = await process.StandardOutput.ReadToEndAsync();
+                this.output.WriteLine(log);
                 if (process.ExitCode != 0)
                 {
-                    this.output.WriteLine(log);
-                    Assert.True(false, "MSBuild process failed. See test output.");
+                    Assert.True(false, $"{Path.GetFileName(filePath)} failed with exit code {process.ExitCode}. See test output.");
                 }
             }
         }


slightly changed evaluation

slightly changed evaluation

--- GeneticSharporithmProgram/FitnessEvaluator.cs
+++ GeneticSharporithmProgram/FitnessEvaluator.cs
@@ -36,7 +36,7 @@
                     evaluation += 1;
                 } else
                 {
-                    evaluation = 1d / (Math.Abs(targetValue - geneValue));
+                    evaluation = 1d / (1.5 * Math.Abs(targetValue - geneValue));
                 }
             }


Fixes #5 (#6)

Fixes #5 (#6)

--- Geocaching-Analysis/src/Geocaching/Program.cs
+++ Geocaching-Analysis/src/Geocaching/Program.cs
@@ -65,10 +65,7 @@
             }

             if (pq != null)
-            {
-                //pq = pocketQuery;
-                //ctx.Entry(pq).State = System.Data.Entity.EntityState.Modified;
-
+            {
                 ctx.PocketQueries.Attach(pocketQuery);
                 ctx.Entry(pocketQuery).State = System.Data.Entity.EntityState.Modified;
             }


Removed PickupDate property (not available at API anymore)

--- GuiStracini.Mandae/Transport/OrderResponse.cs
+++ GuiStracini.Mandae/Transport/OrderResponse.cs
@@ -91,12 +91,6 @@
         public String PartnerOrderId { get; set; }

         /// <summary>
-        /// The pickup date
-        /// </summary>
-        [JsonProperty("pickupDate")]
-        public DateTime PickupDate { get; set; }
-
-        /// <summary>
         /// The processing date
         /// </summary>
         [JsonProperty("processingDate")]


(EriFormat): implemented reference-based images (#14)

--- ArcFormats/Entis/ImageERI.cs
+++ ArcFormats/Entis/ImageERI.cs
@@ -24,8 +24,11 @@
 //

 using System;
+using System.Collections.Generic;
 using System.ComponentModel.Composition;
 using System.IO;
+using System.Text;
+using System.Text.RegularExpressions;
 using System.Windows.Media;
 using GameRes.Utility;

@@ -47,6 +50,8 @@
         public int      LappedBlock;
         public int      FrameTransform;
         public int      FrameDegree;
+        public EriFileHeader Header;
+        public string   Description;
     }

     public enum CvType
@@ -55,6 +60,15 @@
         DCT_ERI      =  0x00000001,
         LOT_ERI      =  0x00000005,
         LOT_ERI_MSS  =  0x00000105,
+    }
+
+    internal class EriFileHeader
+    {
+        public int      Version;
+        public int      ContainedFlag;
+        public int      KeyFrameCount;
+        public int      FrameCount;
+        public int      AllFrameTime;
     }

     public enum EriCode
@@ -84,7 +98,7 @@
             public long         Length;
         }

-        public EriFile (Stream stream) : base (stream, System.Text.Encoding.ASCII, true)
+        public EriFile (Stream stream) : base (stream, Encoding.Unicode, true)
         {
         }

@@ -138,14 +152,27 @@
                     return null;
                 int header_size = (int)section.Length;
                 int stream_pos = 0x50 + header_size;
+                EriFileHeader file_header = null;
                 EriMetaData info = null;
+                string desc = null;
                 while (header_size > 8)
                 {
                     section = reader.ReadSection();
                     header_size -= 8;
                     if (section.Length <= 0 || section.Length > header_size)
                         break;
-                    if ("ImageInf" == section.Id)
+                    if ("FileHdr " == section.Id)
+                    {
+                        file_header = new EriFileHeader();
+                        file_header.Version          = reader.ReadInt32();
+                        if (file_header.Version > 0x00020100)
+                            throw new InvalidFormatException ("Invalid ERI file version");
+                        file_header.ContainedFlag    = reader.ReadInt32();
+                        file_header.KeyFrameCount    = reader.ReadInt32();
+                        file_header.FrameCount       = reader.ReadInt32();
+                        file_header.AllFrameTime     = reader.ReadInt32();
+                    }
+                    else if ("ImageInf" == section.Id)
                     {
                         int version = reader.ReadInt32();
                         if (version != 0x00020100 && version != 0x00020200)
@@ -168,10 +195,33 @@
                         info.LappedBlock = reader.ReadInt32();
                         info.FrameTransform = reader.ReadInt32();
                         info.FrameDegree = reader.ReadInt32();
-                        break;
+                    }
+                    else if ("descript" == section.Id)
+                    {
+                        if (0xFEFF == reader.PeekChar())
+                        {
+                            reader.Read();
+                            var desc_chars = reader.ReadChars ((int)section.Length/2 - 1);
+                            desc = new string (desc_chars);
+                        }
+                        else
+                        {
+                            var desc_chars = reader.ReadBytes ((int)section.Length);
+                            desc = Encoding.UTF8.GetString (desc_chars);
+                        }
+                    }
+                    else
+                    {
+                        reader.BaseStream.Seek (section.Length, SeekOrigin.Current);
                     }
                     header_size -= (int)section.Length;
-                    reader.BaseStream.Seek (section.Length, SeekOrigin.Current);
+                }
+                if (info != null)
+                {
+                    if (file_header != null)
+                        info.Header = file_header;
+                    if (desc != null)
+                        info.Description = desc;
                 }
                 return info;
             }
@@ -179,31 +229,8 @@

         public override ImageData Read (Stream stream, ImageMetaData info)
         {
-            var meta = info as EriMetaData;
-            if (null == meta)
-                throw new ArgumentException ("EriFormat.Read should be supplied with EriMetaData", "info");
-            stream.Position = meta.StreamPos;
-            using (var input = new EriFile (stream))
-            {
-                Color[] palette = null;
-                for (;;) // ReadSection throws an exception in case of EOF
-                {
-                    var section = input.ReadSection();
-                    if ("Stream  " == section.Id)
-                        continue;
-                    if ("ImageFrm" == section.Id)
-                        break;
-                    if ("Palette " == section.Id && info.BPP <= 8 && section.Length <= 0x400)
-                    {
-                        palette = ReadPalette (stream, (int)section.Length);
-                        continue;
-                    }
-                    input.BaseStream.Seek (section.Length, SeekOrigin.Current);
-                }
-                var reader = new EriReader (stream, meta, palette);
-                reader.DecodeImage();
-                return ImageData.Create (info, reader.Format, reader.Palette, reader.Data, reader.Stride);
-            }
+            var reader = ReadImageData (stream, (EriMetaData)info);
+            return ImageData.Create (info, reader.Format, reader.Palette, reader.Data, reader.Stride);
         }

         private Color[] ReadPalette (Stream input, int palette_length)
@@ -221,6 +248,122 @@
             return colors;
         }

+        private EriReader ReadImageData (Stream stream, EriMetaData meta)
+        {
+            stream.Position = meta.StreamPos;
+            using (var input = new EriFile (stream))
+            {
+                Color[] palette = null;
+                for (;;) // ReadSection throws an exception in case of EOF
+                {
+                    var section = input.ReadSection();
+                    if ("Stream  " == section.Id)
+                        continue;
+                    if ("ImageFrm" == section.Id)
+                        break;
+                    if ("Palette " == section.Id && meta.BPP <= 8 && section.Length <= 0x400)
+                    {
+                        palette = ReadPalette (stream, (int)section.Length);
+                        continue;
+                    }
+                    input.BaseStream.Seek (section.Length, SeekOrigin.Current);
+                }
+                var reader = new EriReader (stream, meta, palette);
+                reader.DecodeImage();
+
+                if (!string.IsNullOrEmpty (meta.Description))
+                {
+                    var tags = ParseTagInfo (meta.Description);
+                    string ref_file;
+                    if (tags.TryGetValue ("reference-file", out ref_file))
+                    {
+                        ref_file = ref_file.TrimEnd (null);
+                        if (!string.IsNullOrEmpty (ref_file))
+                        {
+                            if ((meta.BPP + 7) / 8 < 3)
+                                throw new InvalidFormatException();
+
+                            ref_file = VFS.CombinePath (Path.GetDirectoryName (meta.FileName), ref_file);
+                            using (var ref_src = VFS.OpenSeekableStream (ref_file))
+                            {
+                                var ref_info = ReadMetaData (ref_src) as EriMetaData;
+                                if (null == ref_info)
+                                    throw new FileNotFoundException ("Referenced image not found");
+                                ref_info.FileName = ref_file;
+                                var ref_reader = ReadImageData (ref_src, ref_info);
+                                AddImageBuffer (meta, reader.Data, ref_info, ref_reader.Data);
+                            }
+                        }
+                    }
+                }
+                return reader;
+            }
+        }
+
+        void AddImageBuffer (EriMetaData dst_info, byte[] dst_img, EriMetaData src_info, byte[] src_img)
+        {
+            int src_bpp = (src_info.BPP + 7) / 8;
+            int dst_bpp = (dst_info.BPP + 7) / 8;
+            bool has_alpha = src_bpp == 4 && src_bpp == dst_bpp;
+            int dst = 0;
+            int src = 0;
+            while (dst < dst_img.Length)
+            {
+                dst_img[dst  ] += src_img[src  ];
+                dst_img[dst+1] += src_img[src+1];
+                dst_img[dst+2] += src_img[src+2];
+                if (has_alpha)
+                    dst_img[dst+3] += src_img[src+3];
+                dst += dst_bpp;
+                src += src_bpp;
+            }
+        }
+
+        static readonly Regex s_TagRe = new Regex (@"^\s*#\s*(\S+)");
+
+        Dictionary<string, string> ParseTagInfo (string desc)
+        {
+            var dict = new Dictionary<string, string>();
+            if (string.IsNullOrEmpty (desc))
+            {
+                return dict;
+            }
+            if ('#' != desc[0])
+            {
+                dict["comment"] = desc;
+                return dict;
+            }
+            var tag_value = new StringBuilder();
+            using (var reader = new StringReader (desc))
+            {
+                string line = reader.ReadLine();
+                while (null != line)
+                {
+                    var match = s_TagRe.Match (line);
+                    if (!match.Success)
+                        break;
+                    string tag = match.Groups[1].Value;
+
+                    tag_value.Clear();
+                    for (;;)
+                    {
+                        line = reader.ReadLine();
+                        if (null == line)
+                            break;
+                        if (line.StartsWith ("#"))
+                        {
+                            if (line.Length < 2 || '#' != line[1])
+                                break;
+                            line = line.Substring (1);
+                        }
+                        tag_value.AppendLine (line);
+                    }
+                    dict[tag] = tag_value.ToString();
+                }
+            }
+            return dict;
+        }
+
         public override void Write (Stream file, ImageData image)
         {
             throw new NotImplementedException ("EriFormat.Write not implemented");


Bump Version.

Bump Version.

--- ArchiSteamFarm/SharedInfo.cs
+++ ArchiSteamFarm/SharedInfo.cs
@@ -42,7 +42,7 @@
 		}

         internal const string VersionNumber = "2.1.6.3";
-        internal const string MyVersionNumber = "2.1.5.8";
+        internal const string MyVersionNumber = "2.1.5.9";
         internal const string Copyright = "Copyright © ArchiSteamFarm 2015-2016";

 		internal const string GithubRepo = "Blackpanther989/ArchiSteamFarm";


Catch exceptions when creating HtmlDocument from stream (#1725)

* Catch exceptions when creating HtmlDocument from stream

* Use proper retry logic if exception occured

* Add null check for document

--- ArchiSteamFarm/WebBrowser.cs
+++ ArchiSteamFarm/WebBrowser.cs
@@ -105,9 +105,44 @@
 				return null;
 			}

-			using StreamResponse response = await UrlGetToStream(request, referer, requestOptions, maxTries).ConfigureAwait(false);
-
-			return response != null ? await HtmlDocumentResponse.Create(response).ConfigureAwait(false) : null;
+			HtmlDocumentResponse result = null;
+
+			for (int i = 0; i < maxTries; i++) {
+				using StreamResponse response = await UrlGetToStream(request, referer, requestOptions, maxTries).ConfigureAwait(false);
+
+				if (response == null) {
+					return null;
+				}
+
+				if (response.StatusCode.IsClientErrorCode()) {
+					if (requestOptions.HasFlag(ERequestOptions.ReturnClientErrors)) {
+						result = new HtmlDocumentResponse(response);
+					}
+
+					break;
+				}
+
+				if (response.Content == null) {
+					continue;
+				}
+
+				try {
+					result = await HtmlDocumentResponse.Create(response).ConfigureAwait(false);
+				} catch (Exception e) {
+					ArchiLogger.LogGenericWarningException(e);
+
+					continue;
+				}
+
+				return result;
+			}
+
+			if (maxTries > 1) {
+				ArchiLogger.LogGenericWarning(string.Format(Strings.ErrorRequestFailedTooManyTimes, maxTries));
+				ArchiLogger.LogGenericDebug(string.Format(Strings.ErrorFailingRequest, request));
+			}
+
+			return result;
 		}

 		[ItemCanBeNull]
@@ -149,12 +184,8 @@
 					JsonSerializer serializer = new JsonSerializer();

 					obj = serializer.Deserialize<T>(jsonReader);
-				} catch (JsonException e) {
+				} catch (Exception e) {
 					ArchiLogger.LogGenericWarningException(e);
-
-					if (Debugging.IsUserDebugging) {
-						ArchiLogger.LogGenericDebug(string.Format(Strings.Content, response.Content));
-					}

 					continue;
 				}
@@ -305,9 +336,44 @@
 				return null;
 			}

-			using StreamResponse response = await UrlPostToStream(request, data, referer, requestOptions, maxTries).ConfigureAwait(false);
-
-			return response != null ? await HtmlDocumentResponse.Create(response).ConfigureAwait(false) : null;
+			HtmlDocumentResponse result = null;
+
+			for (int i = 0; i < maxTries; i++) {
+				using StreamResponse response = await UrlPostToStream(request, data, referer, requestOptions, maxTries).ConfigureAwait(false);
+
+				if (response == null) {
+					return null;
+				}
+
+				if (response.StatusCode.IsClientErrorCode()) {
+					if (requestOptions.HasFlag(ERequestOptions.ReturnClientErrors)) {
+						result = new HtmlDocumentResponse(response);
+					}
+
+					break;
+				}
+
+				if (response.Content == null) {
+					continue;
+				}
+
+				try {
+					result = await HtmlDocumentResponse.Create(response).ConfigureAwait(false);
+				} catch (Exception e) {
+					ArchiLogger.LogGenericWarningException(e);
+
+					continue;
+				}
+
+				return result;
+			}
+
+			if (maxTries > 1) {
+				ArchiLogger.LogGenericWarning(string.Format(Strings.ErrorRequestFailedTooManyTimes, maxTries));
+				ArchiLogger.LogGenericDebug(string.Format(Strings.ErrorFailingRequest, request));
+			}
+
+			return result;
 		}

 		[ItemCanBeNull]
@@ -348,12 +414,8 @@
 					JsonSerializer serializer = new JsonSerializer();

 					obj = serializer.Deserialize<T>(jsonReader);
-				} catch (JsonException e) {
+				} catch (Exception e) {
 					ArchiLogger.LogGenericWarningException(e);
-
-					if (Debugging.IsUserDebugging) {
-						ArchiLogger.LogGenericDebug(string.Format(Strings.Content, response.Content));
-					}

 					continue;
 				}
@@ -749,18 +811,33 @@
 			[PublicAPI]
 			public readonly IDocument Content;

-			private HtmlDocumentResponse(BasicResponse streamResponse, IDocument document) : base(streamResponse) => Content = document;
-
-			[ItemNotNull]
+			internal HtmlDocumentResponse([NotNull] BasicResponse basicResponse) : base(basicResponse) { }
+
+			private HtmlDocumentResponse([NotNull] StreamResponse streamResponse, [NotNull] IDocument document) : base(streamResponse) {
+				if ((streamResponse == null) || (document == null)) {
+					throw new ArgumentNullException(nameof(streamResponse) + " || " + nameof(document));
+				}
+
+				Content = document;
+			}
+
+			[ItemCanBeNull]
 			internal static async Task<HtmlDocumentResponse> Create([NotNull] StreamResponse streamResponse) {
 				if (streamResponse == null) {
 					throw new ArgumentNullException(nameof(streamResponse));
 				}

 				IBrowsingContext context = BrowsingContext.New(Configuration.Default.WithXPath());
-				IDocument document = await context.OpenAsync(req => req.Content(streamResponse.Content, true)).ConfigureAwait(false);
-
-				return new HtmlDocumentResponse(streamResponse, document);
+
+				try {
+					IDocument document = await context.OpenAsync(req => req.Content(streamResponse.Content, true)).ConfigureAwait(false);
+
+					return new HtmlDocumentResponse(streamResponse, document);
+				} catch (Exception e) {
+					ASF.ArchiLogger.LogGenericWarningException(e);
+
+					return null;
+				}
 			}
 		}


Limit number of rows returned by cache load to 10.

--- Assets/Carrot/CarrotCache.cs
+++ Assets/Carrot/CarrotCache.cs
@@ -344,7 +344,7 @@
     private const int SQLITE_DONE = 101;

     private const string kCacheCreateSQL = "CREATE TABLE IF NOT EXISTS cache(request_servicetype INTEGER, request_endpoint TEXT, request_payload TEXT, request_id TEXT, request_date REAL, retry_count INTEGER)";
-    private const string kCacheReadSQL = "SELECT rowid, request_servicetype, request_endpoint, request_payload, request_id, request_date, retry_count FROM cache WHERE request_servicetype<={0} ORDER BY retry_count";
+    private const string kCacheReadSQL = "SELECT rowid, request_servicetype, request_endpoint, request_payload, request_id, request_date, retry_count FROM cache WHERE request_servicetype<={0} ORDER BY retry_count LIMIT 10";
     private const string kCacheInsertSQL = "INSERT INTO cache (request_servicetype, request_endpoint, request_payload, request_id, request_date, retry_count) VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}')";
     private const string kCacheUpdateSQL = "UPDATE cache SET retry_count='{0}' WHERE rowid='{1}'";
     private const string kCacheDeleteSQL = "DELETE FROM cache WHERE rowid='{0}'";


Changed formatting

Changed formatting

--- AngleSharp.Demos.DeveloperWeek.Samples/WebsiteAccessor.cs
+++ AngleSharp.Demos.DeveloperWeek.Samples/WebsiteAccessor.cs
@@ -22,7 +22,9 @@
             if (url.IsInvalid)
                 throw new ArgumentException("The provided parameter does not form a valid URL.", nameof(baseUrl));

-            var config = new Configuration().WithDefaultLoader().With(new SharedCookieService());
+            var config = Configuration.Default
+                .WithDefaultLoader()
+                .With(new SharedCookieService());
             var context = BrowsingContext.New(config);
             await context.OpenAsync(url);
             return new WebsiteAccessor(context);


Minor tweaks

Minor tweaks

--- src/Common/Info/AppInfo.cs
+++ src/Common/Info/AppInfo.cs
@@ -95,7 +95,7 @@
             {
                 Name = assembly.GetAttributeValue((AssemblyTitleAttribute x) => x.Title) ?? assemblyInfo.Name,
                 ProductName = assembly.GetAttributeValue((AssemblyProductAttribute x) => x.Product) ?? assemblyInfo.Name,
-                Version = FileVersionInfo.GetVersionInfo(assembly.Location).ProductVersion?.GetLeftPartAtFirstOccurrence("+"), // trim Git commit hash
+                Version = FileVersionInfo.GetVersionInfo(assembly.Location).ProductVersion?.GetLeftPartAtFirstOccurrence('+'), // trim Git commit hash
                 Description = assembly.GetAttributeValue((AssemblyDescriptionAttribute x) => x.Description),
                 Copyright = assembly.GetAttributeValue((AssemblyCopyrightAttribute x) => x.Copyright)
             };


enemy balancing

enemy balancing

--- Assets/Scripts/Game/Defined/Characters/Areas/RuinsNPCs.cs
+++ Assets/Scripts/Game/Defined/Characters/Areas/RuinsNPCs.cs
@@ -60,7 +60,7 @@

         public static Character Villager() {
             return CharacterUtil.StandardEnemy(
-                new Stats(2, 1, 1, 1, 2),
+                new Stats(2, 1, 1, 1, 1),
                 new Look(
                     "Ghost",
                     "villager",
@@ -75,7 +75,7 @@

         public static Character Knight() {
             return CharacterUtil.StandardEnemy(
-                new Stats(3, 1, 2, 2, 5),
+                new Stats(3, 2, 2, 2, 5),
                 new Look(
                     "Knight",
                     "knight",
@@ -91,7 +91,7 @@

         public static Character BigKnight() {
             return CharacterUtil.StandardEnemy(
-                new Stats(3, 10, 2, 2, 15),
+                new Stats(3, 3, 2, 2, 15),
                 new Look(
                     "Big Knight",
                     "big-knight",
@@ -116,7 +116,7 @@

         public static Character Wizard() {
             return CharacterUtil.StandardEnemy(
-                new Stats(3, 1, 1, 2, 3),
+                new Stats(3, 1, 1, 2, 10),
                 new Look(
                     "Wizard",
                     "wizard",
@@ -194,7 +194,7 @@

         public static Character Replicant() {
             return CharacterUtil.StandardEnemy(
-                new Stats(5, 5, 5, 10, 30),
+                new Stats(5, 5, 5, 10, 60),
                 ReplicantDisguisedLook(),
                 new Replicant()
                 )


GC Alloc削減

GC Alloc削減

--- Assets/SpriteStudio/ScriptLibrary/Library_SpriteStudio.cs
+++ Assets/SpriteStudio/ScriptLibrary/Library_SpriteStudio.cs
@@ -5043,8 +5043,12 @@
 				goto MeshCreate_MeshNoDraw;
 			}

+			if(InstanceMaterialWrite == null || InstanceMaterialWrite.Length != CountMaterial)
+			{
+				InstanceMaterialWrite = new Material[CountMaterial];
+			}
+			Material[] TableMaterial = InstanceMaterialWrite;
 			int CountMesh = 0;
-			Material[] TableMaterial = new Material[CountMaterial];
 			Index = 0;
 			ClusterNow = ClusterTerminal.ChainTop;
 			while(null != ClusterNow)
@@ -5058,7 +5062,6 @@
 			{
 				goto MeshCreate_MeshNoDraw;
 			}
-			InstanceMaterialWrite = TableMaterial;
 			if(null != InstanceMaterialDraw)
 			{
 				InstanceMeshRenderer.sharedMaterials = InstanceMaterialDraw;


fix bug drawpolygon function doesn't stroke border

--- src/D2DLibExport/D2DLib.cs
+++ src/D2DLibExport/D2DLib.cs
@@ -542,9 +542,9 @@
 		}

 		public void DrawPolygon(D2DPoint[] points,
-			D2DColor strokeColor, FLOAT strokeWidth  = 1f, D2DDashStyle dashStyle = D2DDashStyle.Solid)
-		{
-			this.DrawPolygon(points, D2DColor.Transparent, 0, D2DDashStyle.Solid, D2DColor.Transparent);
+			D2DColor strokeColor, FLOAT strokeWidth = 1f, D2DDashStyle dashStyle = D2DDashStyle.Solid)
+		{
+			this.DrawPolygon(points, strokeColor, strokeWidth, dashStyle, D2DColor.Transparent);
 		}

 		public void DrawPolygon(D2DPoint[] points,


perf(ControllerEvents): don't create garbage on vector comparison

Two `Vector2`s were compared by using a string based method which
creates garbage on every call which decreases performance. The solution
is to do it without using strings and only relying on stack allocated
structs.
Thanks to @reznovvr for this performance fix.

--- Assets/VRTK/Scripts/Interactions/VRTK_ControllerEvents.cs
+++ Assets/VRTK/Scripts/Interactions/VRTK_ControllerEvents.cs
@@ -2,6 +2,7 @@
 namespace VRTK
 {
     using UnityEngine;
+    using System;

     /// <summary>
     /// Event Payload
@@ -1065,8 +1066,9 @@

         private bool Vector2ShallowEquals(Vector2 vectorA, Vector2 vectorB)
         {
-            return (vectorA.x.ToString("F" + axisFidelity) == vectorB.x.ToString("F" + axisFidelity) &&
-                    vectorA.y.ToString("F" + axisFidelity) == vectorB.y.ToString("F" + axisFidelity));
+            var distanceVector = vectorA - vectorB;
+            return Math.Round(Mathf.Abs(distanceVector.x), axisFidelity, MidpointRounding.AwayFromZero) < float.Epsilon
+                   && Math.Round(Mathf.Abs(distanceVector.y), axisFidelity, MidpointRounding.AwayFromZero) < float.Epsilon;
         }

         private void DisableEvents()


Resolved issue : Duplicate IDrawable interfaces

--- BackToBg/BackToBg.Business/UtilityInterfaces/IDrawable.cs
+++ BackToBg/BackToBg.Business/UtilityInterfaces/IDrawable.cs
@@ -1,7 +0,0 @@
-namespace BackToBg.Business.UtilityInterfaces
-{
-    public interface IDrawable
-    {
-        void Draw();
-    }
-}


v0.1.1

--- Batch/Foreman/ForemanBase.cs
+++ Batch/Foreman/ForemanBase.cs
@@ -21,9 +21,6 @@
         private WorkerActivator WorkerActivator;
         private ForemanConfiguration Config;

-        private int WorkerCounter;
-        private int NodeCounter;
-        private int QueueCounter;
         private WorkerNode[] Nodes; // id is nodeId
         private BlockingCollection<object>[] Queues;    // id is queueId

@@ -34,7 +31,6 @@
         private bool[] QueueIsToEl;   // id is queueId
         private bool[] QueueIsFromEl; // id is queueId

-
         private bool Disposed;

@@ -65,6 +61,10 @@

             if (!File.Exists(PathToSettingsFile))
                 throw new FileNotFoundException(PathToSettingsFile);
+
+            int WorkerCounter = 0;
+            int NodeCounter = 0;
+            int QueueCounter = 0;

             WorkerActivator = new WorkerActivator();

@@ -82,7 +82,6 @@
             if (Config.workers == null || Config.workers.Count == 0)
                 throw new ArgumentException("No workers in config file");

-            WorkerCounter = 0;
             WorkerNameToId = new Dictionary<string, int>(Config.workers.Count);
             foreach (var configWorker in Config.workers)
             {
@@ -107,7 +106,6 @@
             if (Config.nodes == null || Config.nodes.Count == 0)
                 throw new ArgumentException("No nodes in config file");

-            NodeCounter = 0;
             Nodes = new WorkerNode[Config.nodes.Count];
             NodeNameToId = new Dictionary<string, int>(Config.nodes.Count);
             foreach (var configNode in Config.nodes)
@@ -135,7 +133,6 @@
             if (Config.queues == null || Config.queues.Count == 0)
                 throw new ArgumentException("No queues in config file");

-            QueueCounter = 0;
             Queues = new BlockingCollection<object>[Config.queues.Count];
             QueueNameToId = new Dictionary<string, int>(Config.queues.Count);
             QueueIsToEl = new bool[Config.queues.Count];
@@ -205,7 +202,7 @@

             DryRun();

-            // dispose of helper dicts
+            // dispose of helpers
             WorkerNameToId = null;
             NodeNameToId = null;
             QueueNameToId = null;
@@ -213,6 +210,7 @@

         public void DryRun()
         {
+            // verify connections
             // iterate over all tree and check if there are any unconnected nodes
             foreach (var node in Nodes)
                 if (!node.IsConnected)
@@ -225,14 +223,17 @@
                     throw new Exception("A queue cannot be an edge, but must connect a node as input and another node as output");
             }

-            // several independent topologies can coexist in a foreman
+            // several independent topologies can coexist in a single foreman
+
+            // dispose of helpers
+            QueueIsFromEl = null;
+            QueueIsToEl = null;
         }

         public void Run()
         {
             var f = new TaskFactory(TaskCreationOptions.LongRunning, TaskContinuationOptions.None);
             Task[] tasks = new Task[Nodes.Length];
-

             foreach (var node in Nodes)
             {
@@ -240,18 +241,6 @@
                 tasks[node.Id] = f.StartNew(() => node.Run());
             }

-            /*
-
-            for (var i = 0; i < nodes.Count; i++)
-            {
-                Console.WriteLine("Starting new thread with " + nodes[i].name);
-
-                tasks[i] = f.StartNew(() => nodes[i].Run());
-                //nodes[i].Run();
-
-            }
-
-            */
             Task.WaitAll(tasks);
         }


React to Http namespace changes.

React to Http namespace changes.

--- src/Kestrel/ServerRequest.cs
+++ src/Kestrel/ServerRequest.cs
@@ -7,7 +7,7 @@
 using System.Linq;
 using System.Threading.Tasks;
 using Microsoft.AspNet.FeatureModel;
-using Microsoft.AspNet.Http;
+using Microsoft.AspNet.Http.Features;
 using Microsoft.AspNet.Server.Kestrel.Http;

 namespace Kestrel


Fixed Simian diagonal movement and added limits for sim boundary

git-svn-id: baf6e02d125cf6f9bfcfe153b2eb83d6e1f5ace6@2105 52acb1d6-8a22-11de-b505-999d5b087335

--- Programs/Simian/Extensions/Movement.cs
+++ Programs/Simian/Extensions/Movement.cs
@@ -49,7 +49,7 @@

                     float speed = 0.5f;
                     if ((heldForward || heldBack) && (heldLeft || heldRight))
-                        speed *= SQRT_TWO;
+                        speed /= SQRT_TWO;

                     if (heldForward)
                     {
@@ -79,6 +79,13 @@
                         agent.Avatar.Velocity.X -= left.X * speed;
                         agent.Avatar.Velocity.Y -= left.Y * speed;
                     }
+
+                    if (agent.Avatar.Position.X < 0) agent.Avatar.Position.X = 0f;
+                    else if (agent.Avatar.Position.X > 255) agent.Avatar.Position.X = 255f;
+
+                    if (agent.Avatar.Position.Y < 0) agent.Avatar.Position.Y = 0f;
+                    else if (agent.Avatar.Position.Y > 255) agent.Avatar.Position.Y = 255f;
+
                 }
             }
         }


git-svn-id: https://gorgonlib.googlecode.com/svn/trunk@32 a61f9e97-bd4c-0410-8c65-85b29eaa70ff


Auto refresh quick view.

Auto refresh quick view.

--- src/Distribox.GUI/Form1.cs
+++ src/Distribox.GUI/Form1.cs
@@ -180,6 +180,7 @@
                 FileItem item = vc.VersionList.GetFileByName(name);
                 this.visualTree1.SetTree(new Tree(item));
                 this.tabControl2.TabPages[0].Text = name;
+                this.visualTree1_NodeClick(this.visualTree1.Current.Event);
             }
         }


Update RepoSync.cs

Update RepoSync.cs

--- src/GitHubSync/RepoSync.cs
+++ src/GitHubSync/RepoSync.cs
@@ -207,7 +207,9 @@
         }

         public async Task Sync(SyncOutput syncOutput = SyncOutput.CreatePullRequest)
-        {
+        public async Task<List<string>> Sync(SyncOutput syncOutput = SyncOutput.CreatePullRequest)
+        {
+            var list = new List<string>();
             foreach (var targetRepository in targets)
             {
                 var targetRepositoryDisplayName = $"{targetRepository.Owner}/{targetRepository.Repository}";
@@ -237,7 +239,10 @@
                 {
                     log($"Pull created for {targetRepositoryDisplayName}, click here to review and pull: {createdSyncBranch}");
                 }
-            }
+                list.Add(createdSyncBranch);
+            }
+
+            return list;
         }
     }
 }


Doc updates

Doc updates

--- src/History/PencilMarks.cs
+++ src/History/PencilMarks.cs
@@ -2,49 +2,28 @@

 namespace SudokuSharp.History
 {
-    /// <summary>
-    /// The base class for PencilMark history items. It contains logic useful for all three.
-    /// </summary>
     [DataContract]
-    public abstract class PencilActionBase
+    internal abstract class PencilActionBase
     {
-        /// <summary>
-        /// Initializes a new instance of the <see cref="PencilActionBase"/> class.
-        /// </summary>
-        /// <param name="Target">The <see cref="PencilGrid"/> being marked.</param>
-        /// <param name="Where">The <see cref="Location"/> of the mark.</param>
-        /// <param name="Value">The number being marked.</param>
-        public PencilActionBase(PencilGrid Target, Location Where, int Value)
+        internal PencilActionBase(PencilGrid Target, Location Where, int Value)
         {
             _target = Target;
             _where = Where;
             _value = Value;
         }
-
-        /// <summary>
-        /// Internal. Do not reference.
-        /// </summary>
+
         [DataMember]
         protected PencilGrid _target;
-        /// <summary>
-        /// Internal. Do not reference.
-        /// </summary>
         [DataMember]
         protected Location _where;
-        /// <summary>
-        /// Internal. Do not reference.
-        /// </summary>
         [DataMember]
         protected int _value;
-        /// <summary>
-        /// Internal. Do not reference.
-        /// </summary>
         [DataMember]
         protected bool _prior;
     }
-
+
     [DataContract]
-    public class PencilToggle : PencilActionBase, IHistoryAction
+    internal class PencilToggle : PencilActionBase, IHistoryAction
     {
         public PencilToggle(PencilGrid Target, Location Where, int Value) : base(Target, Where, Value) { }
         public void Apply() { _target.Toggle(_where, _value); }
@@ -52,7 +31,7 @@
     }

     [DataContract]
-    public class PencilSet : PencilActionBase, IHistoryAction
+    internal class PencilSet : PencilActionBase, IHistoryAction
     {
         public PencilSet(PencilGrid Target, Location Where, int Value) : base(Target, Where, Value) { }
         public void Apply()
@@ -67,7 +46,7 @@
     }

     [DataContract]
-    public class PencilClear : PencilActionBase, IHistoryAction
+    internal class PencilClear : PencilActionBase, IHistoryAction
     {
         public PencilClear(PencilGrid Target, Location Where, int Value) : base(Target, Where, Value) { }
         public void Apply()


Update Converter.cs

Update Converter.cs

--- src/Hprose.IO/Converter.cs
+++ src/Hprose.IO/Converter.cs
@@ -8,7 +8,7 @@
 |                                                          |
 |  hprose Converter class for C#.                          |
 |                                                          |
-|  LastModified: Feb 21, 2019                              |
+|  LastModified: Apr 5, 2019                               |
 |  Author: Ma Bingyao <andot@hprose.com>                   |
 |                                                          |
 \*________________________________________________________*/
@@ -16,6 +16,7 @@
 using Hprose.IO.Converters;
 using System;
 using System.Text;
+using System.Globalization;

 namespace Hprose.IO {
     internal class Converter<TInput, TOutput> {
@@ -40,6 +41,12 @@
                     return (TOutput)converter.ConvertFromString(new string(chars));
                 case StringBuilder sb:
                     return (TOutput)converter.ConvertFromString(sb.ToString());
+                case System.ComponentModel.ICustomTypeDescriptor typeDescriptor:
+                    var typeConverter = typeDescriptor.GetConverter();
+                    if (typeConverter != null) {
+                        return (TOutput)typeConverter.ConvertTo(value, typeof(TOutput));
+                    }
+                    goto default;
                 default:
                     return (TOutput)converter.ConvertFrom(value);
             }


Fixed dust log parameter issue

Fixed dust log parameter issue

--- Binance.Net/BinanceClient.cs
+++ Binance.Net/BinanceClient.cs
@@ -1348,8 +1348,10 @@
         /// <returns>Dust transfer result</returns>
         public async Task<WebCallResult<BinanceDustTransferResult>> DustTransferAsync(IEnumerable<string> assets, int? receiveWindow = null, CancellationToken ct = default)
         {
-            assets.ValidateNotNull(nameof(assets));
-            foreach (var asset in assets)
+            var assetsArray = assets.ToArray();
+
+            assetsArray.ValidateNotNull(nameof(assets));
+            foreach (var asset in assetsArray)
                 asset.ValidateNotNull(nameof(asset));

             var timestampResult = await CheckAutoTimestamp(ct).ConfigureAwait(false);
@@ -1358,7 +1360,7 @@

             var parameters = new Dictionary<string, object>
             {
-                { "asset", assets },
+                { "asset", assetsArray },
                 { "timestamp", GetTimestamp() }
             };
             parameters.AddOptionalParameter("recvWindow", receiveWindow?.ToString(CultureInfo.InvariantCulture) ?? defaultReceiveWindow.TotalMilliseconds.ToString(CultureInfo.InvariantCulture));


disable incoming connections for now

disable incoming connections for now

--- BitSharp.Node/LocalClient.cs
+++ BitSharp.Node/LocalClient.cs
@@ -234,7 +234,7 @@
             var stopwatch = Stopwatch.StartNew();

             // start listening for incoming peers
-            StartListening();
+            //StartListening();

             // add seed peers
             AddSeedPeers();


DNN-8707: remove path info in file name.

--- Browser/ProcessImage.ashx.cs
+++ Browser/ProcessImage.ashx.cs
@@ -176,7 +176,7 @@
             string sExtension = Path.GetExtension(sSourceFullPath);

             string sNewFilePath = !string.IsNullOrEmpty(sNewFileName)
-                                      ? Path.Combine(sSourcePath, sNewFileName + sExtension)
+                                      ? Path.Combine(sSourcePath, CleanName(sNewFileName) + sExtension)
                                       : Path.Combine(
                                           sSourcePath,
                                           string.Format(
@@ -289,6 +289,17 @@
             return (Bitmap)img.GetThumbnailImage(width, height, callback, IntPtr.Zero);
         }

+        private static string CleanName(string name)
+        {
+            name = name.Replace("\\", "/");
+            if (name.Contains("/"))
+            {
+                name = name.Substring(name.LastIndexOf('/') + 1);
+            }
+
+            return name;
+        }
+
         #endregion
     }
 }


Added xmldoc for signatures2Tasks dictionary.

--- Bud.Building/BuildContext.cs
+++ Bud.Building/BuildContext.cs
@@ -15,6 +15,8 @@
     /// <param name="thisTaskNumber"><see cref="ThisTaskNumber"/></param>
     /// <param name="totalTasks"><see cref="TotalTasks"/></param>
     /// <param name="baseDir"><see cref="BaseDir"/></param>
+    /// <param name="signatures2Tasks">a dictionary of signatures and tasks. The signatures uniquely identify
+    /// tasks.</param>
     public BuildContext(TextWriter stdout, Stopwatch buildStopwatch, int thisTaskNumber, int totalTasks,
                         string baseDir, ConcurrentDictionary<string, BuildTask> signatures2Tasks) {
       Stdout = stdout;


Calculate home distance from set home system

--- EDDiscovery/TravelHistoryControl.cs
+++ EDDiscovery/TravelHistoryControl.cs
@@ -456,7 +456,18 @@
                     textBoxY.Text = syspos.System.y.ToString(SingleCoordinateFormat);
                     textBoxZ.Text = syspos.System.z.ToString(SingleCoordinateFormat);

-                    textBoxHomeDist.Text = Math.Sqrt(syspos.System.x * syspos.System.x + syspos.System.y * syspos.System.y + syspos.System.z * syspos.System.z).ToString("0.00");
+                    ISystem homesys = _discoveryForm.GetHomeSystem();
+
+                    if (homesys == null || !homesys.HasCoordinate)
+                    {
+                        homesys = new SystemClass("Sol", 0, 0, 0);
+                    }
+
+                    double xdist = syspos.System.x - homesys.x;
+                    double ydist = syspos.System.y - homesys.y;
+                    double zdist = syspos.System.z - homesys.z;
+
+                    textBoxHomeDist.Text = Math.Sqrt(xdist * xdist + ydist * ydist + zdist * zdist).ToString("0.00");
                 }
                 else
                 {


Settings dark theme fixes

Settings dark theme fixes

--- EarTrumpet/Services/ThemeService.cs
+++ EarTrumpet/Services/ThemeService.cs
@@ -73,10 +73,10 @@
             }

             newDictionary["CloseButtonForeground"] = Lookup(isLightTheme ? "ImmersiveSystemText" : "ImmersiveApplicationTextDarkTheme");
-            newDictionary["SettingsHeaderBackground"] = Lookup(isLightTheme ? "ImmersiveLightChromeMediumLow" : "ImmersiveApplicationTextDarkTheme");
+            newDictionary["SettingsHeaderBackground"] = Lookup(isLightTheme ? "ImmersiveLightChromeMediumLow" : "ImmersiveDarkChromeMedium");

-            newDictionary["SecondaryText"] = Lookup(isLightTheme ? "ImmersiveLightSecondaryText" : "ImmersiveDarkSecondaryText");
+            newDictionary["SecondaryText"] = Lookup(isLightTheme ? "ImmersiveLightSecondaryText" : "ImmersiveLightDisabledText");
             newDictionary["SystemAccent"] = Lookup("ImmersiveSystemAccent");


If MultiControl is uneditable, hide all sub-editors

--- EditorControls/MultiControl.xaml.cs
+++ EditorControls/MultiControl.xaml.cs
@@ -147,6 +147,11 @@
                     m_storedValues[typeName] = value;
                 }
             }
+            else
+            {
+                CurrentEditor = null;
+                HideOtherEditors();
+            }
         }

         private string GetTypeName(object value)


Fixed Namibia Iso2 Value

Fixed Namibia Iso2 Value

--- HermaFx.Foundation/Globalization/Countries.cs
+++ HermaFx.Foundation/Globalization/Countries.cs
@@ -72,9 +72,38 @@
 				Continent = row[22],
 				Tld = row[23],
 				Languages = row[24]
-			})
-			.OrderBy(row => row.Iso3)
-			.Select(x =>
+			}).ToList();
+
+			/// We modify Namibia entry due to wrong source data because Namibia dont have Iso2 value filled.
+			var Namibia = countries.Single(c => c.Iso3 == "NAM");
+
+			countries.Remove(Namibia);
+			countries.Add(new
+			{
+				Name = Namibia.Name,
+				Official_Name_EN = Namibia.Official_Name_EN,
+				Iso2 = "NA",
+				Iso3 = Namibia.Iso3,
+				IsoNum = Namibia.IsoNum,
+				Itu = Namibia.Itu,
+				Marc = Namibia.Marc,
+				Wmo = Namibia.Wmo,
+				Ds = Namibia.Ds,
+				Dial = Namibia.Dial,
+				Fips = Namibia.Fips,
+				CurrencyAlphabetic = Namibia.CurrencyAlphabetic,
+				CurrencyCountry = Namibia.CurrencyCountry,
+				CurrencyMinorUnit = Namibia.CurrencyCountry,
+				CurrencyName = Namibia.CurrencyName,
+				CurrencyNumeric = Namibia.CurrencyNumeric,
+				IsIndependent = Namibia.IsIndependent,
+				Capital = Namibia.Capital,
+				Continent = Namibia.Continent,
+				Tld = Namibia.Tld,
+				Languages = Namibia.Languages
+			});
+
+			countries.OrderBy(row => row.Iso3).Select(x =>
 						string.Format("public static Country {0} = new Country(\"{0}\", () => \"{1}\",() => \"{2}\", \"{3}\", \"{4}\", \"{5}\", \"{6}\"" +
 							", \"{7}\", \"{8}\", \"{9}\", \"{10}\", \"{11}\", \"{12}\", \"{13}\", \"{14}\", \"{15}\", {16}" +
 							", {17}, \"{18}\", \"{19}\", \"{20}\", new string[] {{\"{21}\"}} , {22});",
@@ -264,7 +293,7 @@
 		public static Country MWI = new Country("MWI", () => "Malawi", () => "Malawi", "MW", "454", "MWI", "mw", "MW", "MW", "265", "MI", "MWK", "MALAWI", "2", "Kwacha", "454", true, null, "Lilongwe", "AF", ".mw", new string[] { "ny", "yao", "tum", "swk" }, false);
 		public static Country MYS = new Country("MYS", () => "Malaysia", () => "Malaysia", "MY", "458", "MLA", "my", "MS", "MAL", "60", "MY", "MYR", "MALAYSIA", "2", "Malaysian Ringgit", "458", true, null, "Kuala Lumpur", "AS", ".my", new string[] { "ms-MY", "en", "zh", "ta", "te", "ml", "pa", "th" }, false);
 		public static Country MYT = new Country("MYT", () => "Mayotte", () => "Mayotte", "YT", "175", "MYT", "ot", "", "", "262", "MF", "EUR", "MAYOTTE", "2", "Euro", "978", false, "Part of FR", "Mamoudzou", "AF", ".yt", new string[] { "fr-YT" }, false);
-		public static Country NAM = new Country("NAM", () => "Namibia", () => "Namibia", "", "516", "NMB", "sx", "NM", "NAM", "264", "WA", "ZAR", "NAMIBIA", "2", "Rand", "710", true, null, "Windhoek", "AF", ".na", new string[] { "en-NA", "af", "de", "hz", "naq" }, false);
+		public static Country NAM = new Country("NAM", () => "Namibia", () => "Namibia", "NA", "516", "NMB", "sx", "NM", "NAM", "264", "WA", "ZAR", "NAMIBIA", "NAMIBIA", "Rand", "710", true, null, "Windhoek", "AF", ".na", new string[] { "en-NA", "af", "de", "hz", "naq" }, false);
 		public static Country NCL = new Country("NCL", () => "New Caledonia", () => "New Caledonia", "NC", "540", "NCL", "nl", "NC", "F", "687", "NC", "XPF", "NEW CALEDONIA", "0", "CFP Franc", "953", false, "Territory of FR", "Noumea", "OC", ".nc", new string[] { "fr-NC" }, false);
 		public static Country NER = new Country("NER", () => "Niger", () => "Niger", "NE", "562", "NGR", "ng", "NR", "RN", "227", "NG", "XOF", "NIGER", "0", "CFA Franc BCEAO", "952", true, null, "Niamey", "AF", ".ne", new string[] { "fr-NE", "ha", "kr", "dje" }, false);
 		public static Country NFK = new Country("NFK", () => "Norfolk Island", () => "Norfolk Island", "NF", "574", "NFK", "nx", "NF", "AUS", "672", "NF", "AUD", "NORFOLK ISLAND", "2", "Australian Dollar", "036", false, "Territory of AU", "Kingston", "OC", ".nf", new string[] { "en-NF" }, false);


commented out the database job

commented out the database job

--- Purchasing.Web/App_Start/CreateJobs.cs
+++ Purchasing.Web/App_Start/CreateJobs.cs
@@ -25,7 +25,7 @@
             CreateNightlySyncJobs();
             CreateEmailJob();

-            CreateDatabaseBackupJob();
+            //CreateDatabaseBackupJob();
         }

         private static void CreateNightlySyncJobs()


Minor correction to TypeFactory.

Minor correction to TypeFactory.

--- Reflection/Construction/TypeFactory.cs
+++ Reflection/Construction/TypeFactory.cs
@@ -123,7 +123,7 @@
       /// <seealso cref="Org.Edgerunner.DotSerialize.Reflection.TypeMemberInfo"/>
       public static T CreateInstance<T>(IDictionary<TypeMemberInfo, object> data, bool useConstructor = false)
       {
-         return (T)CreateInstance(typeof(T), data, false);
+         return (T)CreateInstance(typeof(T), data, useConstructor);
       }

       /// <summary>Attempts to create an instance of Type and populate its members with data from the supplied IDictionary.</summary>


Ajout des unittests TestEditionRoute avec l'orientation nord, est, sud et ouest.

--- EnVoitureUnitTest/TestGenerateur.cs
+++ EnVoitureUnitTest/TestGenerateur.cs
@@ -10,13 +10,59 @@
     public class TestGenerateur
     {
         [TestMethod]
-        public void TestEditionRoute()
+        public void TestEditionRouteNorth()
         {
+            Orientation orientation = Orientation.NORTH;
             Route route = new Route(0, 0, 1, 1, new List<Orientation>());
             Generateur generateur = new Generateur(route);
-            generateur.EditionRoute(Orientation.NORTH);
+            generateur.EditionRoute(orientation);

-            Assert.AreEqual(route.GetDictionaire[Orientation.NORTH], false);
+            bool obstacle = false;
+            if (route.GetDictionaire.ContainsKey(orientation))
+                obstacle = route.GetDictionaire[orientation];
+            Assert.AreEqual(obstacle, false);
+        }
+
+        [TestMethod]
+        public void TestEditionRouteEast()
+        {
+            Orientation orientation = Orientation.EAST;
+            Route route = new Route(0, 0, 1, 1, new List<Orientation>());
+            Generateur generateur = new Generateur(route);
+            generateur.EditionRoute(orientation);
+
+            bool obstacle = false;
+            if (route.GetDictionaire.ContainsKey(orientation))
+                obstacle = route.GetDictionaire[orientation];
+            Assert.AreEqual(obstacle, false);
+        }
+
+        [TestMethod]
+        public void TestEditionRouteSouth()
+        {
+            Orientation orientation = Orientation.SOUTH;
+            Route route = new Route(0, 0, 1, 1, new List<Orientation>());
+            Generateur generateur = new Generateur(route);
+            generateur.EditionRoute(orientation);
+
+            bool obstacle = false;
+            if (route.GetDictionaire.ContainsKey(orientation))
+                obstacle = route.GetDictionaire[orientation];
+            Assert.AreEqual(obstacle, false);
+        }
+
+        [TestMethod]
+        public void TestEditionRouteWest()
+        {
+            Orientation orientation = Orientation.WEST;
+            Route route = new Route(0, 0, 1, 1, new List<Orientation>());
+            Generateur generateur = new Generateur(route);
+            generateur.EditionRoute(orientation);
+
+            bool obstacle = false;
+            if (route.GetDictionaire.ContainsKey(orientation))
+                obstacle = route.GetDictionaire[orientation];
+            Assert.AreEqual(obstacle, false);
         }
     }
 }


Handling war mode in hidding script.

Handling war mode in hidding script.

--- ExampleScripts/UOErebor/hidding.csx
+++ ExampleScripts/UOErebor/hidding.csx
@@ -13,6 +13,8 @@

     public static void Hide()
     {
+        UO.WarModeOff();
+
         var originalLocation = UO.Me.Location;

         bool hidden = false;
@@ -36,6 +38,11 @@
                 .When("Nepovedlo se ti schovat", () =>
                     // when hidding fails, do while loop continues
                     hidden = false)
+                .When("You are preoccupied with thoughts of battle.", () =>
+                {
+                    UO.WarModeOff();
+                    hidden = false;
+                })
                 // if server sends neither "Skryti se povedlo." nor "Nepovedlo se ti schovat"
                 // in one minute, then the script terminates with an TimoutException.
                 .WaitAny(TimeSpan.FromMinutes(1));


Add pitch bend support for -cs

Add pitch bend support for -cs

--- src/MidiSplit/MidiSplit.cs
+++ src/MidiSplit/MidiSplit.cs
@@ -130,6 +130,7 @@
             public IDictionary<int, int> ControlValue;
             public IDictionary<int, int> RPNValue;
             public IDictionary<int, int> NRPNValue;
+            public int PitchBendValue;
             public int? CurrentRPN;
             public int? CurrentNRPN;

@@ -140,6 +141,7 @@
                 NRPNValue = new Dictionary<int, int>();
                 CurrentRPN = null;
                 CurrentNRPN = null;
+                PitchBendValue = 0;
             }

             public MidiChannelStatus(MidiChannelStatus previousStatus)
@@ -149,6 +151,7 @@
                 NRPNValue = new Dictionary<int, int>(previousStatus.NRPNValue);
                 CurrentRPN = previousStatus.CurrentRPN;
                 CurrentNRPN = previousStatus.CurrentNRPN;
+                PitchBendValue = previousStatus.PitchBendValue;
             }

             public void AddControllerMessage(MTrkChunk midiTrack, long absoluteTime, int channel, MidiControllerType controller, int value)
@@ -553,14 +556,8 @@
                     {
                         MidiControllerMessage controllerMessage = midiEvent.Message as MidiControllerMessage;

-                        // bank select
-                        if (controllerMessage.ControllerType == MidiControllerType.BankSelect ||
-                            controllerMessage.ControllerType == MidiControllerType.BankSelectFine)
-                        {
-                            // ignore it
-                        }
                         // RPN/NRPN
-                        else if (controllerMessage.ControllerType == MidiControllerType.RegisteredParameterCoarse)
+                        if (controllerMessage.ControllerType == MidiControllerType.RegisteredParameterCoarse)
                         {
                             if (!status[channelMessage.MidiChannel].CurrentRPN.HasValue)
                             {
@@ -643,12 +640,48 @@
                                 }
                             }
                         }
+                        // Reset All Controllers
+                        else if (controllerMessage.ControllerType == MidiControllerType.AllControllersOff)
+                        {
+                            // See: General MIDI Level 2 Recommended Practice (RP024)
+                            MidiChannelStatus st = status[channelMessage.MidiChannel];
+                            st.ControlValue[(int)MidiControllerType.ModulationWheel] = 0;
+                            st.ControlValue[(int)MidiControllerType.Expression] = 127;
+                            st.ControlValue[(int)MidiControllerType.HoldPedal] = 0;
+                            st.ControlValue[(int)MidiControllerType.Portamento] = 0;
+                            st.ControlValue[(int)MidiControllerType.SustenutoPedal] = 0;
+                            st.ControlValue[(int)MidiControllerType.SoftPedal] = 0;
+                            st.CurrentRPN = null; // 0x3fff
+                            st.PitchBendValue = 0;
+                            // Channel pressure 0 (off)
+                        }
                         // anything else
-                        else
+                        else if (controllerMessage.ControllerType != MidiControllerType.BankSelect &&
+                            controllerMessage.ControllerType != MidiControllerType.BankSelectFine &&
+                            controllerMessage.ControllerType != MidiControllerType.AllSoundOff &&
+                            controllerMessage.ControllerType != MidiControllerType.LocalKeyboard &&
+                            controllerMessage.ControllerType != MidiControllerType.AllNotesOff &&
+                            controllerMessage.ControllerType != MidiControllerType.OmniModeOff &&
+                            controllerMessage.ControllerType != MidiControllerType.OmniModeOn &&
+                            controllerMessage.ControllerType != MidiControllerType.MonoOperation &&
+                            controllerMessage.ControllerType != MidiControllerType.PolyOperation)
                         {
                             IDictionary<int, int> currentValue = status[channelMessage.MidiChannel].ControlValue;
                             currentValue[(int)controllerMessage.ControllerType] = controllerMessage.Value;
                         }
+                    }
+                    else if (channelMessage.Command == MidiChannelCommand.PitchWheel)
+                    {
+                        int pitchBendValue = (channelMessage.Parameter1 | (channelMessage.Parameter2 << 7)) - 8192;
+                        status[channelMessage.MidiChannel].PitchBendValue = pitchBendValue;
+                    }
+                    else if (channelMessage.Command == MidiChannelCommand.ChannelPressure)
+                    {
+                        // not supported
+                    }
+                    else if (channelMessage.Command == MidiChannelCommand.PolyPressure)
+                    {
+                        // not supported
                     }
                 }
                 else


Document the Story itself

Document the Story itself

--- ink-engine-runtime/Story.cs
+++ ink-engine-runtime/Story.cs
@@ -8,6 +8,10 @@

 namespace Ink.Runtime
 {
+    /// <summary>
+    /// A Story is the core class that represents a complete Ink narrative, and
+    /// manages the evaluation and state of it.
+    /// </summary>
 	public class Story : Runtime.Object
 	{
         public const int inkVersionCurrent = 11;


Always dispatch any error op

Always dispatch any error op

--- src/projects/MyNatsClient/NatsClient.cs
+++ src/projects/MyNatsClient/NatsClient.cs
@@ -389,23 +389,19 @@

             DoDisconnect(DisconnectReason.DueToFailure);

-            if (t.IsFaulted)
-            {
-                var ex = t.Exception?.GetBaseException();
-                if (ex == null)
-                    return;
-
-                Logger.Error("Consumer exception.", ex);
-                OnConsumerFailed(ex);
-            }
-            else
-            {
-                var errOp = t.Result;
-                if (errOp == null)
-                    return;
-
+            var errOp = t.Result;
+            if (errOp != null)
                 _opMediator.Dispatch(errOp);
-            }
+
+            if (!t.IsFaulted)
+                return;
+
+            var ex = t.Exception?.GetBaseException();
+            if (ex == null)
+                return;
+
+            Logger.Error("Consumer exception.", ex);
+            OnConsumerFailed(ex);
         }

         private void Release()