フォームのサイズ調整

フォームのサイズ調整

--- MiriaCore/MainControl.Designer.cs
+++ MiriaCore/MainControl.Designer.cs
@@ -106,7 +106,7 @@
             //
             this.splitContainer1.Panel2.Controls.Add(this.tabControl2);
             this.splitContainer1.Size = new System.Drawing.Size(687, 489);
-            this.splitContainer1.SplitterDistance = 162;
+            this.splitContainer1.SplitterDistance = 221;
             this.splitContainer1.SplitterWidth = 8;
             this.splitContainer1.TabIndex = 2;
             //
@@ -119,7 +119,7 @@
             this.tabControl1.Location = new System.Drawing.Point(0, 0);
             this.tabControl1.Name = "tabControl1";
             this.tabControl1.SelectedIndex = 0;
-            this.tabControl1.Size = new System.Drawing.Size(683, 158);
+            this.tabControl1.Size = new System.Drawing.Size(683, 217);
             this.tabControl1.TabIndex = 2;
             //
             // tabPage1
@@ -133,7 +133,7 @@
             this.tabPage1.Location = new System.Drawing.Point(4, 22);
             this.tabPage1.Name = "tabPage1";
             this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
-            this.tabPage1.Size = new System.Drawing.Size(675, 132);
+            this.tabPage1.Size = new System.Drawing.Size(675, 191);
             this.tabPage1.TabIndex = 0;
             this.tabPage1.Text = "Single Input";
             this.tabPage1.UseVisualStyleBackColor = true;
@@ -228,7 +228,7 @@
             this.tabControl2.Location = new System.Drawing.Point(0, 0);
             this.tabControl2.Name = "tabControl2";
             this.tabControl2.SelectedIndex = 0;
-            this.tabControl2.Size = new System.Drawing.Size(683, 315);
+            this.tabControl2.Size = new System.Drawing.Size(683, 256);
             this.tabControl2.TabIndex = 1;
             //
             // tabPage4
@@ -243,7 +243,7 @@
             this.tabPage4.Location = new System.Drawing.Point(4, 22);
             this.tabPage4.Name = "tabPage4";
             this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
-            this.tabPage4.Size = new System.Drawing.Size(675, 289);
+            this.tabPage4.Size = new System.Drawing.Size(675, 230);
             this.tabPage4.TabIndex = 0;
             this.tabPage4.Text = "Single Process";
             this.tabPage4.UseVisualStyleBackColor = true;


mod dump is working!!

mod dump is working!!

--- ModAssetMapper/MainWindow.xaml.cs
+++ ModAssetMapper/MainWindow.xaml.cs
@@ -122,7 +122,7 @@

             // log the results
             // TODO: This should be handled better.
-            LogMessage(ModDump.GetBuffer());
+            //LogMessage(ModDump.GetBuffer());

             if (deleteAfter) {
                 File.Delete(pluginPath);


Replace Thread.CurrentThread.CurrentCulture with CultureInfo.CurrentCulture since gets the culture per thread, too

--- src/Lucene.Net.Core/Support/CultureContext.cs
+++ src/Lucene.Net.Core/Support/CultureContext.cs
@@ -11,7 +11,7 @@
     public class CultureContext : IDisposable
     {
         public CultureContext(int culture)
-            : this(new CultureInfo(culture), Thread.CurrentThread.CurrentUICulture)
+            : this(new CultureInfo(culture), CultureInfo.CurrentUICulture)
         {
         }

@@ -21,7 +21,7 @@
         }

         public CultureContext(string cultureName)
-            : this(new CultureInfo(cultureName), Thread.CurrentThread.CurrentUICulture)
+            : this(new CultureInfo(cultureName), CultureInfo.CurrentUICulture)
         {
         }

@@ -31,7 +31,7 @@
         }

         public CultureContext(CultureInfo culture)
-            : this(culture, Thread.CurrentThread.CurrentUICulture)
+            : this(culture, CultureInfo.CurrentUICulture)
         {
         }

@@ -45,12 +45,12 @@
             this.currentThread = Thread.CurrentThread;

             // Record the current culture settings so they can be restored later.
-            this.originalCulture = this.currentThread.CurrentCulture;
-            this.originalUICulture = this.currentThread.CurrentUICulture;
+            this.originalCulture = CultureInfo.CurrentCulture;
+            this.originalUICulture = CultureInfo.CurrentUICulture;

             // Set both the culture and UI culture for this context.
-            this.currentThread.CurrentCulture = culture;
-            this.currentThread.CurrentUICulture = uiCulture;
+            CultureInfo.CurrentCulture = culture;
+            CultureInfo.CurrentUICulture = uiCulture;
         }

         private readonly Thread currentThread;
@@ -70,8 +70,8 @@
         public void RestoreOriginalCulture()
         {
             // Restore the culture to the way it was before the constructor was called.
-            this.currentThread.CurrentCulture = this.originalCulture;
-            this.currentThread.CurrentUICulture = this.originalUICulture;
+            CultureInfo.CurrentCulture = this.originalCulture;
+            CultureInfo.CurrentUICulture = this.originalUICulture;
         }
         public void Dispose()
         {


daily

daily

--- Module2/Module2/Tools/BinTools.cs
+++ Module2/Module2/Tools/BinTools.cs
@@ -20,16 +20,7 @@

 		public static int Comp(byte[] a, byte[] b)
 		{
-			int minlen = Math.Min(a.Length, b.Length);
-
-			for (int index = 0; index < minlen; index++)
-			{
-				int ret = Comp(a[index], b[index]);
-
-				if (ret != 0)
-					return ret;
-			}
-			return IntTools.Comp(a.Length, b.Length);
+			return ArrayTools.Comp(a, b, Comp);
 		}
 	}
 }


Added ping endpoint.

Added ping endpoint.

--- Simple.Web.Server/Startup.cs
+++ Simple.Web.Server/Startup.cs
@@ -1,5 +1,7 @@
-using Microsoft.AspNetCore.Builder;
+using System.Reflection;
+using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Logging;
@@ -18,9 +20,13 @@
                 .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                 .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true);
             Configuration = builder.Build();
+
+            Version = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
         }

         public IConfigurationRoot Configuration { get; }
+
+        public string Version { get; }

         // This method gets called by the runtime. Use this method to add services to the container.
         public void ConfigureServices(IServiceCollection services)
@@ -30,6 +36,18 @@
         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
         public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
         {
+            app.Map("/ping", subApp =>
+            {
+                subApp.UseDowntime(Configuration);
+                subApp.Run(async context =>
+                {
+                    context.Response.StatusCode = 200;
+                    context.Response.ContentType = "text/json";
+
+                    await context.Response.WriteAsync($@"{{""version"":""{Version}""}}");
+                });
+            });
+
             app.UseDowntime(Configuration);
             app.UseStaticFiles();
             app.UseIndex();


Incomplete build test.

Incomplete build test.

--- Source/BuildSpyNark_Test/Project_Test.cs
+++ Source/BuildSpyNark_Test/Project_Test.cs
@@ -48,5 +48,22 @@
     }

     //-------------------------------------------------------------------------
+
+    [TestMethod]
+    public void AddIncompleteBuild()
+    {
+      DateTime start = new DateTime( 0 );
+      DateTime? end = null;
+      string[] tags = { "TestTag" };
+
+      TestObject.AddBuild( start, end, tags );
+
+      Assert.AreEqual< uint >( 1, TestObject.GetStats().GetTotalBuildsCount() );
+      Assert.AreEqual< uint >( 0, TestObject.GetStats().GetCompletedBuildsCount() );
+      Assert.AreEqual( new TimeSpan(), TestObject.GetStats().GetTotalBuildTime() );
+      Assert.AreEqual( 1, TestObject.GetStats().GetBuildStats().Count );
+    }
+
+    //-------------------------------------------------------------------------
   }
 }


Remove Public Read header from presigned PUT

--- Source/Codecov/Upload/CodecovUploader.cs
+++ Source/Codecov/Upload/CodecovUploader.cs
@@ -42,13 +42,9 @@
             content.Headers.ContentType = new MediaTypeHeaderValue("application/x-gzip");
         }

-        protected virtual void ConfigureRequest(HttpRequestMessage request)
-            => request.Headers.TryAddWithoutValidation("x-amz-acl", "public-read");
-
+
         protected virtual HttpResponseMessage CreateResponse(HttpRequestMessage request)
         {
-            ConfigureRequest(request);
-
             request.Content = new ByteArrayContent(GetReportBytes());

             ConfigureContent(request.Content);


Added PaddedMetrics class

Added PaddedMetrics class

To be used when shifting barnumbers and region info boxes.

--- Moritz.Symbols/Metrics/Metrics.cs
+++ Moritz.Symbols/Metrics/Metrics.cs
@@ -230,5 +230,44 @@
 		public static IReadOnlyList<CSSColorClass> UsedCSSColorClasses { get => _usedCSSColorClasses as IReadOnlyList<CSSColorClass>; }
 		private static List<CSSColorClass> _usedCSSColorClasses = new List<CSSColorClass>();
 	}
+
+	public class PaddedMetrics : Metrics
+	{
+		public PaddedMetrics(Metrics embeddedMetrics, float topPadding, float rightPadding, float bottomPadding, float leftPadding)
+			: base(embeddedMetrics.CSSObjectClass)
+		{
+			_top = embeddedMetrics.Top - topPadding;
+			_right = embeddedMetrics.Right + rightPadding;
+			_bottom = embeddedMetrics.Bottom + bottomPadding;
+			_left = embeddedMetrics.Left - leftPadding;
+			_originX = embeddedMetrics.OriginX;
+			_originY = embeddedMetrics.OriginY;
+
+			TopPadding = topPadding;
+			RightPadding = rightPadding;
+			BottomPadding = bottomPadding;
+			LeftPadding = leftPadding;
+
+			EmbeddedMetrics = embeddedMetrics;
+		}
+
+		public override void WriteSVG(SvgWriter w)
+		{
+			throw new NotImplementedException();
+		}
+
+		public override void Move(float dx, float dy)
+		{
+			base.Move(dx, dy);
+			EmbeddedMetrics.Move(dx, dy);
+		}
+
+		public float TopPadding { get; }
+		public float RightPadding { get; }
+		public float BottomPadding { get; }
+		public float LeftPadding { get; }
+
+		private Metrics EmbeddedMetrics { get; }
+	}
 }


Fix numerical lib calls up

Fix numerical lib calls up

--- SketchSolveC#/SketchSolve.cs
+++ SketchSolveC#/SketchSolve.cs
@@ -180,6 +180,10 @@
     //Note that the total number of iterations allowed is MaxIterations *xLength;
     const double MaxIterations = 50 ;

+    static double _hypot(double a, double b){
+      return Math.Sqrt(a*a+b*b);
+    }
+

     public static Result solve(Parameter []x, constraint[] cons, int isFine)
     {
@@ -230,7 +234,7 @@
         x[j].Value=temper;
         norm = norm+(grad[j]*grad[j]);
       }
-      norm = sqrt(norm);
+      norm = Math.Sqrt(norm);
       //Estimate the norm of N

       //Initialize N and calculate s
@@ -636,7 +640,7 @@
           deltaXnorm+=deltaX[i]*deltaX[i];
           grad[i]=gradnew[i];
         }
-        deltaXnorm=sqrt(deltaXnorm);
+        deltaXnorm=Math.Sqrt(deltaXnorm);
         iterations++;
         /////////////////////////////////////////////////////////////
         ///End of Main loop
@@ -894,7 +898,7 @@

     if(cons[i].type==lineLength)
     {
-      temp= sqrt(pow(L1_P2_x - L1_P1_x,2) + pow(L1_P2_y - L1_P1_y,2)) - length;
+      temp= Math.Sqrt(pow(L1_P2_x - L1_P1_x,2) + pow(L1_P2_y - L1_P1_y,2)) - length;
       //temp=_hypot(L1_P2_x - L1_P1_x , L1_P2_y - L1_P1_y) - length;
       error += temp*temp*100;
     }


Remove dead code

Remove dead code

--- MultiMiner.Win/Forms/MinerForm.cs
+++ MultiMiner.Win/Forms/MinerForm.cs
@@ -93,7 +93,6 @@
         //fields
         private int startupMiningCountdownSeconds = 0;
         private int coinStatsCountdownMinutes = 0;
-        private bool settingsLoaded = false;
         private readonly double difficultyMuliplier = Math.Pow(2, 32);
         private bool applicationSetup = false;
         private bool editingDeviceListView = false;
@@ -1751,8 +1750,6 @@

             //allow resize/maximize/etc to render
             System.Windows.Forms.Application.DoEvents();
-
-            this.settingsLoaded = true;
         }

         private void SetupNetworkDeviceDetection()
@@ -7188,22 +7185,7 @@
             closeApiButton.Visible = false;
             apiLogGridView.Visible = false;
         }
-
-        private bool expandingAdvancedPanel = false;
-        private void ExpandAdvancedPanel()
-        {
-            expandingAdvancedPanel = true;
-            try
-            {
-                advancedAreaContainer.Panel2Collapsed = false;
-                advancedAreaContainer.Panel2.Show();
-            }
-            finally
-            {
-                expandingAdvancedPanel = false;
-            }
-        }
-
+
         private void ShowApiMonitor()
         {
             apiLogGridView.BorderStyle = BorderStyle.None;


Preserve network device properties when pruning - Sticky is being lost

--- MultiMiner.Win/Forms/MinerForm.cs
+++ MultiMiner.Win/Forms/MinerForm.cs
@@ -1795,9 +1795,15 @@
             prunedDevices.AddRange(
                 existingDevices
                     .Where(d1 => d1.Sticky && !prunedDevices.Any(d2 => d2.IPAddress.Equals(d1.IPAddress) && (d2.Port == d1.Port)))
-            );
-
-            networkDevicesConfiguration.Devices = prunedDevices;
+            );
+
+            //filter the devices by prunedDevices - do not assign directly as we need to
+            //preserve properties on the existing configurations - e.g. Sticky
+            networkDevicesConfiguration.Devices =
+                networkDevicesConfiguration.Devices
+                .Where(ed => prunedDevices.Any(pd => pd.IPAddress.Equals(ed.IPAddress) && (pd.Port == ed.Port)))
+                .ToList();
+
             networkDevicesConfiguration.SaveNetworkDevicesConfiguration();
         }


verified that it worked

verified that it worked

--- AngularProto/Controllers/AuthenticationController.cs
+++ AngularProto/Controllers/AuthenticationController.cs
@@ -8,13 +8,12 @@
 {
     public class AuthenticationController : Controller
     {
-		//TODO refator this to Authentication Orchestrator
-		readonly AuthenticationOrchestrator _homeOrchestrator;
+		readonly AuthenticationOrchestrator _authenticationOrchestrator;

 		[HttpPost]
 		public JsonResult Login(UserLoginViewModel userLoginViewModel)
 		{
-			IUser user = _homeOrchestrator.OrchestrateValidateUser(userLoginViewModel);
+			IUser user = _authenticationOrchestrator.OrchestrateValidateUser(userLoginViewModel);
 			bool isSuccessful = false;

 			if (user != null)
@@ -24,13 +23,14 @@

 				isSuccessful = true;
 			}
+			//TODO should user be authenticated and session cleared if Login failed?

 			return Json(isSuccessful);
 		}

 		public AuthenticationController(AuthenticationOrchestrator homeOrchestrator)
 		{
-			_homeOrchestrator = homeOrchestrator;
+			_authenticationOrchestrator = homeOrchestrator;
 		}
     }
 }


Add item ids to deposit url request

Add item ids to deposit url request

Add appId, contextId, and assetId for use when trading the items back to
the winner

--- SteamBot/DepositTradeOfferUserHandler.cs
+++ SteamBot/DepositTradeOfferUserHandler.cs
@@ -78,9 +78,14 @@

 					int itemValue = Convert.ToInt32 (itemValueStr, 10) * 100;

+					long appId = item.AppId, contextId = item.ContextId, assetId = item.AssetId;
+
 					CSGOItem itemObj = new CSGOItem();
 					itemObj.name = name;
 					itemObj.price = itemValue;
+					itemObj.appId = appId;
+					itemObj.contextId = contextId;
+					itemObj.assetId = assetId;

 					allItems.Add (itemObj);
 				}
@@ -145,5 +150,9 @@
 	public class CSGOItem {
 		public string name;
 		public int price;
+
+		public long appId;
+		public long contextId;
+		public long assetId;
 	}
 }


Make behaviour of IsSubclass consistent with .net

--- MarkerMetro.Unity.WinLegacyUnity/System/Reflection/ReflectionExtensions.cs
+++ MarkerMetro.Unity.WinLegacyUnity/System/Reflection/ReflectionExtensions.cs
@@ -542,7 +542,7 @@
         public static bool IsSubclassOf(this Type type, global::System.Type parent)
         {
 #if NETFX_CORE
-            return parent.GetTypeInfo().IsAssignableFrom(type.GetTypeInfo());
+            return !parent.GetTypeInfo().Equals(type.GetTypeInfo()) && parent.GetTypeInfo().IsAssignableFrom(type.GetTypeInfo());
 #else
             throw new NotImplementedException();
 #endif


Doc info update.

Doc info update.

--- src/ModernWpf/Messages/ChooseFolderMessage.cs
+++ src/ModernWpf/Messages/ChooseFolderMessage.cs
@@ -74,10 +74,9 @@

         /// <summary>
         /// Handles the <see cref="ChooseFolderMessage" /> on a window by showing a folder dialog based on the message options.
-        /// This uses the ancient folder browser and is not recommended.
         /// </summary>
-        /// <param name="owner">The owner.</param>
-        /// </exception>
+        /// <param name="owner">The owner.</pa
+        /// <exception cref="System.NotSupportedException"></exception>
         public virtual void HandleWithPlatform(Window owner)
         {
             if (HackyFolderBrowserDialog.IsSupported)


made ParcelDownloader data structures public

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

--- libsecondlife-cs/libsecondlife.Utilities/Utilities.cs
+++ libsecondlife-cs/libsecondlife.Utilities/Utilities.cs
@@ -468,9 +468,9 @@
         private SecondLife Client;
         /// Dictionary of 64x64 arrays of parcels which have been successfully downloaded
         /// for each simulator (and their LocalID's, 0 = Null)
-        private Dictionary<Simulator, int[,]> ParcelMarked = new Dictionary<Simulator, int[,]>();
+        public Dictionary<Simulator, int[,]> ParcelMarked = new Dictionary<Simulator, int[,]>();
         ///
-        private Dictionary<Simulator, Dictionary<int, Parcel>> Parcels = new Dictionary<Simulator, Dictionary<int, Parcel>>();
+        public Dictionary<Simulator, Dictionary<int, Parcel>> Parcels = new Dictionary<Simulator, Dictionary<int, Parcel>>();

         ///
         /// Default constructor


Add missing newline

Add missing newline

--- osu.Framework/Input/Bindings/InputKey.cs
+++ osu.Framework/Input/Bindings/InputKey.cs
@@ -342,6 +342,7 @@
         /// The media stop key.
         /// </summary>
         Stop = 69,
+
         /// <summary>
         /// The media volume up key.
         /// </summary>


Add another keyframe to UT

Add another keyframe to UT

--- tests/Avalonia.Markup.Xaml.UnitTests/SetterTests.cs
+++ tests/Avalonia.Markup.Xaml.UnitTests/SetterTests.cs
@@ -18,6 +18,9 @@
     <KeyFrame>
         <Setter Property='Content' Value='{Binding}'/>
     </KeyFrame>
+    <KeyFrame>
+        <Setter Property='Content' Value='{Binding}'/>
+    </KeyFrame>
 </Animation>";
                 var animation = (Animation.Animation)AvaloniaRuntimeXamlLoader.Load(xaml);
                 var setter = (Setter)animation.Children[0].Setters[0];


Added a switch to neglect winning states so the ratings will be distributed more even. Made for Bart

--- Engine/Extensions.cs
+++ Engine/Extensions.cs
@@ -421,7 +421,7 @@
         /// <param name="field"></param>
         /// <param name="player">The player that will perform the next move</param>
         /// <returns></returns>
-        public static int[] rate_columns(this Field field, players player, int depth)
+        public static int[] rate_columns(this Field field, players player, int depth, bool rate_winning_state = false)
         {
             int[] score = new int[field.Width];

@@ -442,17 +442,20 @@
                 _field.doMove(i, player);

                 // Check if the placed stone wins the game, if so, the score is maximum
-                if (_field.check_for_win((byte)i, (byte)(field.getEmptyCell(i)), player))
-                {
-                    if (player == players.Alice)
+                if (rate_winning_state)
+                {
+                    if (_field.check_for_win((byte)i, (byte)(field.getEmptyCell(i)), player))
                     {
-                        score[i] = int.MaxValue-1;
+                        if (player == players.Alice)
+                        {
+                            score[i] = int.MaxValue - 1;
+                        }
+                        else if (player == players.Bob)
+                        {
+                            score[i] = int.MinValue + 1;
+                        }
+                        continue;
                     }
-                    else if (player == players.Bob)
-                    {
-                        score[i] = int.MinValue+1;
-                    }
-                    continue;
                 }

                 // If the game is still going on, check if we reached the maximum depth


Weave choices can also divert afterwards

--- inklecate2Sharp/Parser/ParsedObjects/Choice.cs
+++ inklecate2Sharp/Parser/ParsedObjects/Choice.cs
@@ -58,9 +58,16 @@
                 _weaveContentContainer.AddContent (new Runtime.Text (contentTextSB.ToString ()));
                 _weaveContentContainer.name = "c";

+                if (this.explicitPath != null) {
+                    _weaveContentEndDivert = new Runtime.Divert ();
+                    _weaveContentContainer.AddContent (_weaveContentEndDivert);
+                }
+
                 _weaveOuterContainer = new Runtime.Container ();
                 _weaveOuterContainer.AddContent (_runtimeChoice);
                 _weaveOuterContainer.AddToNamedContentOnly (_weaveContentContainer);
+
+

                 return _weaveOuterContainer;
             }
@@ -78,14 +85,18 @@
                 _runtimeChoice.pathOnChoice = _weaveContentContainer.path;
             }

-            // Normal/old style choice - resolve path that was explicitly specified
-            else if (explicitPath != null) {
+            // Resolve path that was explicitly specified (either at the end of the weave choice, or just as the normal choice path)
+            if (explicitPath != null) {
                 Parsed.Object obj = ResolvePath (explicitPath);
                 if (obj == null) {
                     Error ("Choice: target not found: '" + explicitPath.ToString () + "'");
                 }

-                _runtimeChoice.pathOnChoice = obj.runtimeObject.path;
+                if (_weaveContentEndDivert != null) {
+                    _weaveContentEndDivert.targetPath = obj.runtimeObject.path;
+                } else {
+                    _runtimeChoice.pathOnChoice = obj.runtimeObject.path;
+                }
             }

 		}
@@ -93,6 +104,7 @@
         Runtime.Choice _runtimeChoice;
         Runtime.Container _weaveContentContainer;
         Runtime.Container _weaveOuterContainer;
+        Runtime.Divert _weaveContentEndDivert;
 	}

 }


Fixed string Contains indexOf query

Fixed string Contains indexOf query

--- NoRM/Linq/MongoQueryTranslator.cs
+++ NoRM/Linq/MongoQueryTranslator.cs
@@ -447,7 +447,7 @@
                         Visit(m.Object);
                         _sb.Append(".indexOf(");
                         Visit(m.Arguments[0]);
-                        _sb.Append(")>0)");
+                        _sb.Append(")>-1)");
                         return m;
                     case "IndexOf":
                         Visit(m.Object);


Modified email service for disposable resource safety.

--- MichaelBrandonMorris.KingsportMillSafetyTraining/App_Start/EmailService.cs
+++ MichaelBrandonMorris.KingsportMillSafetyTraining/App_Start/EmailService.cs
@@ -18,7 +18,7 @@
         /// <param name="message">The message.</param>
         /// <returns>Task.</returns>
         /// TODO Edit XML Comment Template for SendAsync
-        public Task SendAsync(IdentityMessage message)
+        public async Task SendAsync(IdentityMessage message)
         {
             if (message == null)
             {
@@ -38,7 +38,7 @@
                     }
                 })
                 {
-                    return smtpClient.SendMailAsync(mailMessage);
+                    await smtpClient.SendMailAsync(mailMessage);
                 }
             }
         }


Fix typo

Fix typo

--- src/MsgPack/UnassignedMessageTypeException.cs
+++ src/MsgPack/UnassignedMessageTypeException.cs
@@ -43,7 +43,7 @@
 		public UnassignedMessageTypeException( string message ) : this( message, null ) { }

 		/// <summary>
-		///		Initializes a new instance of the <see cref="MessageTypeUnassignedMessageTypeExceptionException"/> class with a specified error message and a reference to the inner exception that is the cause of this exception.
+		///		Initializes a new instance of the <see cref="UnassignedMessageTypeException"/> class with a specified error message and a reference to the inner exception that is the cause of this exception.
 		/// </summary>
 		/// <param name="message">The error message that explains the reason for the exception. </param>
 		/// <param name="inner">


Updated ThreadAgnosticAttributeTest in ThreadAgnosticTests.cs to skip enumerated types.

--- tests/NLog.UnitTests/Layouts/ThreadAgnosticTests.cs
+++ tests/NLog.UnitTests/Layouts/ThreadAgnosticTests.cs
@@ -49,9 +49,9 @@
             {
                 if (t.Namespace == typeof(WrapperLayoutRendererBase).Namespace)
                 {
-                    if (t.IsAbstract)
+                    if (t.IsAbstract || t.IsEnum)
                     {
-                        // skip non-concrete types
+                        // skip non-concrete types and enumerations
                         continue;
                     }


Fixed tokenized url when pasting

Fixed tokenized url when pasting

--- src/N2.Templates.Mvc/N2/Content/paste.aspx.cs
+++ src/N2.Templates.Mvc/N2/Content/paste.aspx.cs
@@ -19,7 +19,7 @@
 			else
 			{
 				string url = string.Format("{{ManagementUrl}}/Content/{0}.aspx?selected={1}&memory={2}", action, Server.UrlEncode(selected), Server.UrlEncode(memory));
-				Response.Redirect(url);
+				Response.Redirect(Url.ResolveTokens(url));
 			}
 		}
 	}


Fixed Line Ending Mode Tests for Different Operating Systems

Updated unit test to check the system.environment.newline and use
either LF or CRLF.

--- tests/NLog.UnitTests/Targets/LineEndingModeTests.cs
+++ tests/NLog.UnitTests/Targets/LineEndingModeTests.cs
@@ -41,41 +41,67 @@
     public class LineEndingModeTests : NLogTestBase
     {
         [Fact]
+		[Trait("Test", "Test")]
         public void LineEndingModeEqualityTest()
         {
             LineEndingMode modeDefault = LineEndingMode.Default;
             LineEndingMode modeNone = LineEndingMode.None;
             LineEndingMode modeLF = LineEndingMode.LF;
+			LineEndingMode modeCRLF = LineEndingMode.CRLF;

             Assert.True(LineEndingMode.Default == modeDefault);
             Assert.True(LineEndingMode.None == modeNone);
             Assert.True(LineEndingMode.LF == modeLF);
             Assert.False(LineEndingMode.Default == modeNone);
             Assert.False(LineEndingMode.None == modeLF);
-            Assert.False(LineEndingMode.LF == modeDefault);
+			Assert.False(LineEndingMode.None == modeCRLF);
+
+			// Handle running tests on different operating systems
+			if (modeCRLF.NewLineCharacters == System.Environment.NewLine) {
+				Assert.False(LineEndingMode.LF == modeDefault);
+				Assert.True(LineEndingMode.CRLF == modeDefault);
+			} else {
+				Assert.True(LineEndingMode.LF == modeDefault);
+				Assert.False(LineEndingMode.CRLF == modeDefault);
+			}
         }

         [Fact]
+		[Trait("Test", "Test")]
         public void LineEndingModeInequalityTest()
         {
             LineEndingMode modeDefault = LineEndingMode.Default;
             LineEndingMode modeNone = LineEndingMode.None;
             LineEndingMode modeLF = LineEndingMode.LF;
+			LineEndingMode modeCRLF = LineEndingMode.CRLF;

             Assert.True(LineEndingMode.Default != modeNone);
             Assert.True(LineEndingMode.None != modeLF);
-            Assert.True(LineEndingMode.LF != modeDefault);
+			Assert.True(LineEndingMode.None != modeCRLF);
             Assert.False(LineEndingMode.Default != modeDefault);
             Assert.False(LineEndingMode.None != modeNone);
             Assert.False(LineEndingMode.LF != modeLF);
+			Assert.False(LineEndingMode.CRLF != modeCRLF);

             Assert.True(null != LineEndingMode.LF);
             Assert.True(null != modeLF);
             Assert.True(LineEndingMode.LF != null);
             Assert.True(modeLF != null);
+			Assert.True(null != LineEndingMode.CRLF);
+			Assert.True(null != modeCRLF);
+			Assert.True(LineEndingMode.CRLF != null);
+			Assert.True(modeCRLF != null);
+
+			// Handle running tests on different operating systems
+			if (modeCRLF.NewLineCharacters == System.Environment.NewLine) {
+				Assert.True(LineEndingMode.LF != modeDefault);
+			} else {
+				Assert.True(LineEndingMode.CRLF != modeDefault);
+			}
         }

         [Fact]
+		[Trait("Test", "Test")]
         public void LineEndingModeNullComparison()
         {
             LineEndingMode mode1 = LineEndingMode.LF;
@@ -92,6 +118,7 @@
         }

         [Fact]
+		[Trait("Test", "Test")]
         public void LineEndingModeToStringTest()
         {
             Assert.Equal(LineEndingMode.None.ToString(), "None");


Fixed warning about 0.2.0.* not being in the normal 'major.minor.build.revision' format.

--- src/NCrontab.Tests/Properties/AssemblyInfo.cs
+++ src/NCrontab.Tests/Properties/AssemblyInfo.cs
@@ -30,5 +30,5 @@
 [assembly: AssemblyTitle("NCrontab.Tests")]
 [assembly: AssemblyDescription("NUnit tests for NCrontab")]

-[assembly: AssemblyVersion("0.2.0.*")]
-[assembly: AssemblyFileVersion("0.2.0.*")]
+[assembly: AssemblyVersion("0.2.0.0")]
+[assembly: AssemblyFileVersion("0.2.0.0")]


NHibernateProxyHelper.cs - fix line endings and indents

--- src/NHibernate/Proxy/NHibernateProxyHelper.cs
+++ src/NHibernate/Proxy/NHibernateProxyHelper.cs
@@ -1,74 +1,65 @@
 using NHibernate.Cfg;
-using NHibernate.Intercept;
-using NHibernate.Persister.Entity;
-
-namespace NHibernate.Proxy
-{
-	/// <summary>
-	/// NHibernateProxyHelper provides convenience methods for working with
-	/// objects that might be instances of Classes or the Proxied version of
-	/// the Class.
-	/// </summary>
-	public static class NHibernateProxyHelper
-	{
-		static  NHibernateProxyHelper()
-		{
-			//can't instantiate
-		}
-
-		/// <summary>
-		/// Get the class of an instance or the underlying class of a proxy (without initializing the proxy!).
-		/// It is almost always better to use the entity name!
-		/// </summary>
-		/// <param name="obj">The object to get the type of.</param>
-		/// <returns>The Underlying Type for the object regardless of if it is a Proxy.</returns>
-		public static System.Type GetClassWithoutInitializingProxy(object obj)
-		{
-			if (obj.IsProxy())
-			{
-                INHibernateProxy proxy = obj as INHibernateProxy;
-
-                return proxy.HibernateLazyInitializer.PersistentClass;
-			}
-			else
-			{
-				return obj.GetType();
-			}
-		}
-
-		/// <summary>
-		/// Get the true, underlying class of a proxied persistent class. This operation
-		/// will NOT initialize the proxy and thus may return an incorrect result.
-		/// </summary>
-		/// <param name="entity">a persistable object or proxy</param>
-		/// <returns>guessed class of the instance</returns>
-		/// <remarks>
-		/// This method is approximate match for Session.bestGuessEntityName in H3.2
-		/// </remarks>
-		public static System.Type GuessClass(object entity)
-		{
-			if (entity.IsProxy())
-			{
-                var proxy = entity as INHibernateProxy;
-                ILazyInitializer li = proxy.HibernateLazyInitializer;
-				if (li.IsUninitialized)
-				{
-					return li.PersistentClass;
-				}
-				return li.GetImplementation().GetType();
-			}
-			var fieldInterceptorAccessor = entity as IFieldInterceptorAccessor;
-			if (fieldInterceptorAccessor != null)
-			{
-				var fieldInterceptor = fieldInterceptorAccessor.FieldInterceptor;
-				return fieldInterceptor.MappedClass;
-			}
-			return entity.GetType();
-		}
-
-        public static bool IsProxy(this object entity)
-        {
-            return Environment.BytecodeProvider.ProxyFactoryFactory.IsProxy(entity);
-        }
-	}
-}
+using NHibernate.Intercept;
+
+namespace NHibernate.Proxy
+{
+	/// <summary>
+	/// NHibernateProxyHelper provides convenience methods for working with
+	/// objects that might be instances of Classes or the Proxied version of
+	/// the Class.
+	/// </summary>
+	public static class NHibernateProxyHelper
+	{
+		/// <summary>
+		/// Get the class of an instance or the underlying class of a proxy (without initializing the proxy!).
+		/// It is almost always better to use the entity name!
+		/// </summary>
+		/// <param name="obj">The object to get the type of.</param>
+		/// <returns>The Underlying Type for the object regardless of if it is a Proxy.</returns>
+		public static System.Type GetClassWithoutInitializingProxy(object obj)
+		{
+			if (obj.IsProxy())
+			{
+				var proxy = obj as INHibernateProxy;
+
+				return proxy.HibernateLazyInitializer.PersistentClass;
+			}
+			return obj.GetType();
+		}
+
+		/// <summary>
+		/// Get the true, underlying class of a proxied persistent class. This operation
+		/// will NOT initialize the proxy and thus may return an incorrect result.
+		/// </summary>
+		/// <param name="entity">a persistable object or proxy</param>
+		/// <returns>guessed class of the instance</returns>
+		/// <remarks>
+		/// This method is approximate match for Session.bestGuessEntityName in H3.2
+		/// </remarks>
+		public static System.Type GuessClass(object entity)
+		{
+			if (entity.IsProxy())
+			{
+				var proxy = entity as INHibernateProxy;
+				var li = proxy.HibernateLazyInitializer;
+				if (li.IsUninitialized)
+				{
+					return li.PersistentClass;
+				}
+				return li.GetImplementation().GetType();
+			}
+			var fieldInterceptorAccessor = entity as IFieldInterceptorAccessor;
+			if (fieldInterceptorAccessor != null)
+			{
+				var fieldInterceptor = fieldInterceptorAccessor.FieldInterceptor;
+				return fieldInterceptor.MappedClass;
+			}
+			return entity.GetType();
+		}
+
+		public static bool IsProxy(this object entity)
+		{
+			return Environment.BytecodeProvider.ProxyFactoryFactory.IsProxy(entity);
+		}
+	}
+}


Bot will no longer reconnect the channel between songs

--- src/NadekoBot/Services/Music/MusicControls.cs
+++ src/NadekoBot/Services/Music/MusicControls.cs
@@ -131,9 +131,8 @@
                         if (CurrentSong == null)
                             continue;

-                        if (AudioClient != null)
-                            try { await AudioClient.StopAsync().ConfigureAwait(false); } catch { }
-                        AudioClient = await PlaybackVoiceChannel.ConnectAsync().ConfigureAwait(false);
+                        if (AudioClient == null || AudioClient.ConnectionState == ConnectionState.Disconnected || AudioClient.ConnectionState == ConnectionState.Disconnecting)
+                            AudioClient = await PlaybackVoiceChannel.ConnectAsync().ConfigureAwait(false);

                         var index = _playlist.IndexOf(CurrentSong);
                         if (index != -1)


Move GetNewRelicClient method

Move GetNewRelicClient method

--- src/Noobot.Modules.NewRelic/NewRelicPlugin.cs
+++ src/Noobot.Modules.NewRelic/NewRelicPlugin.cs
@@ -28,11 +28,6 @@

 		public void Stop()
 		{
-		}
-
-		internal NewRelicRestClient GetNewRelicClient()
-		{
-			return new NewRelicRestClient(this.apiKey);
 		}

 		internal static bool ApplicationTargetedCommandMisformed(string message)
@@ -126,6 +121,11 @@
 			return $"NewRelic metrics summary for {applicationId}\n{metricsMessage}";
 		}

+		private NewRelicRestClient GetNewRelicClient()
+		{
+			return new NewRelicRestClient(this.apiKey);
+		}
+
 		private List<Application> FetchApplications()
 		{
 			var newRelic = this.GetNewRelicClient();


CURLOPT_ENCODING alias CURLOPT_ACCEPT_ENCODING sets correct header for the request

fixes https://github.com/peachpiecompiler/peachpie/issues/614
- sets Accept-Encoding instead of Accept

--- src/Peachpie.Library.Network/CURLFunctions.cs
+++ src/Peachpie.Library.Network/CURLFunctions.cs
@@ -306,7 +306,7 @@
             if (ch.CookieHeader != null) TryAddCookieHeader(req, ch.CookieHeader);
             if (ch.CookieFileSet) req.CookieContainer = new CookieContainer();
             if (ch.Username != null) req.Credentials = new NetworkCredential(ch.Username, ch.Password ?? string.Empty);
-            if (ch.AcceptEncoding != null) req.Accept = ch.AcceptEncoding;
+            if (ch.AcceptEncoding != null) req.Headers[HttpRequestHeader.AcceptEncoding] = ch.AcceptEncoding;
             // TODO: certificate
             if (!string.IsNullOrEmpty(ch.ProxyType) && !string.IsNullOrEmpty(ch.ProxyHost))
             {


#167 finally got nested pointers addressed

--- src/Rocks/Extensions/ITypeSymbolExtensions.cs
+++ src/Rocks/Extensions/ITypeSymbolExtensions.cs
@@ -53,15 +53,44 @@
 			}
 		}

+		static INamedTypeSymbol? GetContainingType(ITypeSymbol symbol)
+		{
+			if (symbol is IPointerTypeSymbol pointerSymbol)
+			{
+				return pointerSymbol.PointedAtType.ContainingType;
+			}
+			else
+			{
+				return symbol.ContainingType;
+			}
+		}
+
 		if (options == TypeNameOption.IncludeGenerics)
 		{
-			return self.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat);
+			if(self.Kind == SymbolKind.PointerType)
+			{
+				var name = self.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat);
+				var containingType = GetContainingType(self);
+
+				if (containingType is not null)
+				{
+					return $"{containingType.GetName(options)}.{name}";
+				}
+				else
+				{
+					return name;
+				}
+			}
+			else
+			{
+				return self.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat);
+			}
 		}
 		else if (options == TypeNameOption.Flatten)
 		{
 			if (self.Kind == SymbolKind.PointerType)
 			{
-				return self.ToDisplayString().Replace("*", "Pointer");
+				return self.ToDisplayString().Replace(".", "_").Replace("*", "Pointer");
 			}
 			else if (self.Kind == SymbolKind.FunctionPointerType)
 			{


Passed reference type instead of name to GetTypeString()

--- Src/Graphology/Graphology.cs
+++ Src/Graphology/Graphology.cs
@@ -118,7 +118,7 @@

         private string Draw(GraphNode graphNode, int depth)
         {
-            string graph = this.GetTypeString(graphNode.ReferenceType.Name, depth, graphNode.ObjectType);
+            string graph = this.GetTypeString(graphNode.ReferenceType, depth, graphNode.ObjectType);

             foreach (GraphNode subGraphNode in graphNode.SubGraph)
             {
@@ -130,7 +130,7 @@
             return graph;
         }

-        private string GetTypeString(string referenceTypeName, int depth, Type objectType)
+        private string GetTypeString(Type referenceType, int depth, Type objectType)
         {
             var depthString = "";
             if (depth > 0)
@@ -139,7 +139,7 @@
                 depthString += " >";
             }

-            var memberTypeString = this.GetMemberTypeString(referenceTypeName);
+            var memberTypeString = this.GetMemberTypeString(referenceType.Name);
             var graph = string.Format("{0} {1}{2}{3}", depthString, objectType.Name, memberTypeString, Environment.NewLine);

             return graph;


fixed literal format detection

fixed literal format detection

--- src/Serilog.Sinks.NLog/Sinks/NLog/NLogSink.cs
+++ src/Serilog.Sinks.NLog/Sinks/NLog/NLogSink.cs
@@ -41,10 +41,9 @@
             // pass along the event's properties to nlog
             foreach (var property in logEvent.Properties)
             {
-                // format simple scalar strings without wrapping quotes, which is more likely to be what nlog users expect
-                var format = (property.Value is ScalarValue && property.Value.GetType() == typeof(string))
-                    ? "l" // literal
-                    : null;
+                // format simple scalar strings as literals (without wrapping quotes), which is more likely to be what nlog users expect
+                var sv = property.Value as ScalarValue;
+                var format = (sv != null && sv.Value is string) ? "l" : null;

                 nlogEvent.Properties[property.Key] = property.Value.ToString(format, null);
             }


convert Snapshot to struct, use array to store values

--- Src/Metrics/Core/Snapshot.cs
+++ Src/Metrics/Core/Snapshot.cs
@@ -4,17 +4,16 @@

 namespace Metrics.Core
 {
-    public class Snapshot
+    public struct Snapshot
     {
-        private readonly List<long> values;
+        private readonly long[] values;

         public Snapshot(IEnumerable<long> values)
         {
-            this.values = new List<long>(values);
-            this.values.Sort();
+            this.values = values.OrderBy(v => v).ToArray();
         }

-        public int Size { get { return this.values.Count; } }
+        public int Size { get { return this.values.Length; } }

         public long Max { get { return this.values.LastOrDefault(); } }
         public long Min { get { return this.values.FirstOrDefault(); } }
@@ -56,16 +55,16 @@
                 return 0;
             }

-            double pos = quantile * (values.Count + 1);
+            double pos = quantile * (values.Length + 1);

             if (pos < 1)
             {
                 return values[0];
             }

-            if (pos >= values.Count)
+            if (pos >= values.Length)
             {
-                return values[values.Count - 1];
+                return values[values.Length - 1];
             }

             double lower = values[(int)pos - 1];


Fixed ProcessStructure_Test.cs for writingsystem zxx.

--- src/SolidEngine.Test/ProcessStructure_Test.cs
+++ src/SolidEngine.Test/ProcessStructure_Test.cs
@@ -227,7 +227,7 @@
         public void ProcessStructure_LiftMapping_Correct()
         {
             string xmlIn = "<entry record=\"4\"><lx field=\"1\">b</lx></entry>";
-            string xmlEx = "<entry record=\"4\"><lx field=\"1\" lift=\"a\"><data>b</data></lx></entry>";
+            string xmlEx = "<entry record=\"4\"><lx field=\"1\" lift=\"a\" writingsystem=\"zxx\"><data>b</data></lx></entry>";

             Init();
             SolidMarkerSetting setting = _settings.FindMarkerSetting("lx");
@@ -247,7 +247,7 @@
         public void ProcessStructure_FlexMapping_Correct()
         {
             string xmlIn = "<entry record=\"5\"><lx field=\"1\">b</lx></entry>";
-            string xmlEx = "<entry record=\"5\"><lx field=\"1\" flex=\"a\"><data>b</data></lx></entry>";
+            string xmlEx = "<entry record=\"5\"><lx field=\"1\" flex=\"a\" writingsystem=\"zxx\"><data>b</data></lx></entry>";

             Init();
             SolidMarkerSetting setting = _settings.FindMarkerSetting("lx");


Updated test with path fill from MSDN.

Updated test with path fill from MSDN.

--- SvgGdiTest/SvgGdiTestForm.cs
+++ SvgGdiTest/SvgGdiTestForm.cs
@@ -505,21 +505,26 @@
             }
             else if (s == "Path 2 (Slow)")
             {
-                /* The following example GraphicsPath code comes from the MSDN docs on the GraphicsPathIterator class
-                 * https://msdn.microsoft.com/en-us/library/79k451ts.aspx
-                 *
-                 */
-                // Create a graphics path.
-                GraphicsPath myPath = new GraphicsPath();
-                myPath.AddString("String path", FontFamily.GenericMonospace, (int)FontStyle.Regular, 24,
-                    new PointF(0, 0), StringFormat.GenericTypographic);
-                ig.DrawPath(new Pen(Color.Green), myPath);
-                GraphicsPath myPath2 = new GraphicsPath();
-                myPath2.AddString("String path filled", FontFamily.GenericMonospace, (int)FontStyle.Regular, 24,
-                    new PointF(100, 50), StringFormat.GenericTypographic);
-                SolidBrush redBrush = new SolidBrush(Color.Red);
-                ig.DrawPath(new Pen(Color.Black), myPath2);
-                ig.FillPath(redBrush, myPath2);
+                SolidBrush mySolidBrush = new SolidBrush(Color.Aqua);
+                GraphicsPath myGraphicsPath = new GraphicsPath();
+
+                Point[] myPointArray = {
+                    new Point(15, 20),
+                    new Point(20, 40),
+                    new Point(50, 30)};
+
+                FontFamily myFontFamily = new FontFamily("Times New Roman");
+                PointF myPointF = new PointF(50, 20);
+                StringFormat myStringFormat = new StringFormat();
+
+                myGraphicsPath.AddArc(0, 0, 30, 20, -90, 180);
+                myGraphicsPath.AddCurve(myPointArray);
+                myGraphicsPath.AddString("a string in a path filled", myFontFamily,
+                   0, 24, myPointF, myStringFormat);
+                myGraphicsPath.AddPie(230, 10, 40, 40, 40, 110);
+
+                ig.FillPath(mySolidBrush, myGraphicsPath);
+                ig.DrawPath(new Pen(Color.Green), myGraphicsPath);
             }
             else
             {


Changing DateTime Parser behavior (#1)

Changing DateTime Parser behavior (#1)

Changing DateTime Parser behavior

--- Sweet.Jayson/JaysonCommon.cs
+++ Sweet.Jayson/JaysonCommon.cs
@@ -33,8 +33,6 @@
 using System.Linq.Expressions;
 using System.Reflection;
 using System.Runtime.Serialization;
-using System.Text;
-using System.Threading;

 namespace Sweet.Jayson
 {
@@ -46,7 +44,7 @@

         private static int s_IsMono = -1;

-        private static readonly int LowerCaseDif = (int)'a' - (int)'A';
+        private static readonly int LowerCaseDif = 'a' - 'A';

         private static TimeSpan s_UtcOffsetUpdate;
         private static long s_LastUtcOffsetUpdate = -1;
@@ -68,8 +66,8 @@
         private static readonly JaysonSynchronizedDictionary<string, Type> s_TypeCache = new JaysonSynchronizedDictionary<string, Type>(JaysonConstants.CacheInitialCapacity, StringComparer.OrdinalIgnoreCase);
         private static readonly JaysonSynchronizedDictionary<string, Assembly> s_AssemblyCache = new JaysonSynchronizedDictionary<string, Assembly>(JaysonConstants.CacheInitialCapacity, StringComparer.OrdinalIgnoreCase);
         private static readonly JaysonSynchronizedDictionary<Assembly, string> s_AssemblyNameCache = new JaysonSynchronizedDictionary<Assembly, string>(JaysonConstants.CacheInitialCapacity);
-        private static readonly JaysonSynchronizedDictionary<Type, Type> s_GenericListArgs = new JaysonSynchronizedDictionary<Type, Type>(JaysonConstants.CacheInitialCapacity);
-        private static readonly JaysonSynchronizedDictionary<Type, Type> s_GenericCollectionArgs = new JaysonSynchronizedDictionary<Type, Type>(JaysonConstants.CacheInitialCapacity);
+        private static readonly JaysonSynchronizedDictionary<Type, Type> s_GenericListArgs = new JaysonSynchronizedDictionary<Type, Type>(JaysonConstants.CacheInitialCapacity);
+        private static readonly JaysonSynchronizedDictionary<Type, Type> s_GenericCollectionArgs = new JaysonSynchronizedDictionary<Type, Type>(JaysonConstants.CacheInitialCapacity);
         private static readonly JaysonSynchronizedDictionary<Type, Type[]> s_GenericDictionaryArgs = new JaysonSynchronizedDictionary<Type, Type[]>(JaysonConstants.CacheInitialCapacity);
 #if !(NET3500 || NET3000 || NET2000)
         private static readonly JaysonSynchronizedDictionary<Type, Type> s_ProducerConsumerCollectionArgs = new JaysonSynchronizedDictionary<Type, Type>(JaysonConstants.CacheInitialCapacity);
@@ -391,26 +389,34 @@
             {
                 case JaysonDateTimeZoneType.ConvertToUtc:
                     {
-                        if (timeSpan == TimeSpan.Zero)
+                        if (timeSpan == TimeSpan.Zero || dateTime == DateTime.MinValue || dateTime == DateTime.MaxValue)
                         {
                             return new DateTime(dateTime.Ticks, DateTimeKind.Utc);
                         }
+
                         return new DateTime(dateTime.Subtract(timeSpan).Ticks, DateTimeKind.Utc);
                     }
                 case JaysonDateTimeZoneType.ConvertToLocal:
                     {
+                        if (dateTime == DateTime.MinValue || dateTime == DateTime.MaxValue)
+                        {
+                            return dateTime;
+                        }
+
                         if (timeSpan == TimeSpan.Zero)
                         {
                             return ToLocalTime(dateTime);
                         }
+
                         return ToLocalTime(dateTime.Subtract(timeSpan));
                     }
                 default:
                     {
-                        if (timeSpan == TimeSpan.Zero)
+                        if (timeSpan == TimeSpan.Zero || dateTime == DateTime.MinValue || dateTime == DateTime.MaxValue)
                         {
                             return dateTime;
                         }
+
                         return ToLocalTime(dateTime.Subtract(timeSpan));
                     }
             }
@@ -467,30 +473,30 @@

                 if (str[2] == '-')
                 {
-                    day = 10 * (int)(str[0] - '0') + (int)(str[1] - '0');
-                    month = 10 * (int)(str[3] - '0') + (int)(str[4] - '0');
-
-                    year = 1000 * (int)(str[6] - '0') + 100 * (int)(str[7] - '0') +
-                        10 * (int)(str[8] - '0') + (int)(str[9] - '0');
+                    day = 10 * (str[0] - '0') + (str[1] - '0');
+                    month = 10 * (str[3] - '0') + (str[4] - '0');
+
+                    year = 1000 * (str[6] - '0') + 100 * (str[7] - '0') +
+                        10 * (str[8] - '0') + (str[9] - '0');
                     pos = 10;
                 }
                 else
                 {
-                    year = 1000 * (int)(str[0] - '0') + 100 * (int)(str[1] - '0') +
-                        10 * (int)(str[2] - '0') + (int)(str[3] - '0');
+                    year = 1000 * (str[0] - '0') + 100 * (str[1] - '0') +
+                        10 * (str[2] - '0') + (str[3] - '0');

                     ch = str[4];
                     basic = ch >= '0' && ch <= '9';
                     if (basic)
                     {
-                        month = 10 * (int)(str[4] - '0') + (int)(str[5] - '0');
-                        day = 10 * (int)(str[6] - '0') + (int)(str[7] - '0');
+                        month = 10 * (str[4] - '0') + (str[5] - '0');
+                        day = 10 * (str[6] - '0') + (str[7] - '0');
                         pos = 8;
                     }
                     else
                     {
-                        month = 10 * (int)(str[5] - '0') + (int)(str[6] - '0');
-                        day = 10 * (int)(str[8] - '0') + (int)(str[9] - '0');
+                        month = 10 * (str[5] - '0') + (str[6] - '0');
+                        day = 10 * (str[8] - '0') + (str[9] - '0');
                         pos = 10;
                     }
                 }
@@ -519,7 +525,7 @@
                 int second = 0;
                 int millisecond = 0;

-                int hour = 10 * (int)(str[pos + 1] - '0') + (int)(str[pos + 2] - '0');
+                int hour = 10 * (str[pos + 1] - '0') + (str[pos + 2] - '0');
                 pos += 3;

                 if (pos < length)
@@ -527,7 +533,7 @@
                     ch = str[pos];
                     if (ch == ':')
                     {
-                        minute = 10 * (int)(str[pos + 1] - '0') + (int)(str[pos + 2] - '0');
+                        minute = 10 * (str[pos + 1] - '0') + (str[pos + 2] - '0');
                         pos += 3;

                         if (pos < length)
@@ -535,14 +541,14 @@
                             ch = str[pos];
                             if (ch == ':')
                             {
-                                second = 10 * (int)(str[pos + 1] - '0') + (int)(str[pos + 2] - '0');
+                                second = 10 * (str[pos + 1] - '0') + (str[pos + 2] - '0');
                                 pos += 3;
                             }
                         }
                     }
                     else if (basic)
                     {
-                        minute = 10 * (int)(str[pos] - '0') + (int)(str[pos + 1] - '0');
+                        minute = 10 * (str[pos] - '0') + (str[pos + 1] - '0');
                         pos += 2;

                         if (pos < length)
@@ -550,7 +556,7 @@
                             ch = str[pos];
                             if (ch >= '0' || ch <= '9')
                             {
-                                second = 10 * (int)(str[pos] - '0') + (int)(str[pos + 1] - '0');
+                                second = 10 * (str[pos] - '0') + (str[pos + 1] - '0');
                                 pos += 2;
                             }
                         }
@@ -580,7 +586,7 @@
                                 if (msIndex < 4)
                                 {
                                     millisecond *= 10;
-                                    millisecond += (int)(ch - '0');
+                                    millisecond += ch - '0';
                                 }
                             }
                         }
@@ -590,7 +596,7 @@
                             ch = str[pos];
                             if (ch == '+' || ch == '-')
                             {
-                                int tzHour = 10 * (int)(str[pos + 1] - '0') + (int)(str[pos + 2] - '0');
+                                int tzHour = 10 * (str[pos + 1] - '0') + (str[pos + 2] - '0');
                                 int tzMinute = 0;
                                 pos += 3;

@@ -602,7 +608,7 @@
                                         pos++;
                                     }

-                                    tzMinute = 10 * (int)(str[pos] - '0') + (int)(str[pos + 1] - '0');
+                                    tzMinute = 10 * (str[pos] - '0') + (str[pos + 1] - '0');
                                 }

                                 timeSpan = new TimeSpan(tzHour, tzMinute, 0);
@@ -659,12 +665,15 @@
                 if (ch < '0' || ch > '9')
                 {
                     if (l == 0 && IsWhiteSpace(ch))
+                    {
                         continue;
+                    }
+
                     throw new JaysonException(JaysonError.InvalidJsonDateFormat);
                 }

                 l *= 10;
-                l += (long)(ch - '0');
+                l += ch - '0';
             }

             if (timeZonePos == -1)
@@ -1165,7 +1174,9 @@
                     for (int i = 0; i < length2; i++)
                     {
                         if (str1[i] != str2[i])
+                        {
                             return false;
+                        }
                     }
                     return true;
                 }
@@ -1190,7 +1201,9 @@
                     for (int i = 0; i < length2; i++)
                     {
                         if (str1[i] != str2[i])
+                        {
                             return false;
+                        }
                     }
                     return true;
                 }
@@ -1199,7 +1212,9 @@
                     for (int i = length2 - 1; i > -1; i--)
                     {
                         if (str1[offset + i] != str2[i])
+                        {
                             return false;
+                        }
                     }
                     return true;
                 }
@@ -1254,7 +1269,7 @@
                             chArray[j] = asciiStr[j];
                         }
                     }
-                    chArray[i] = (char)((int)ch + LowerCaseDif);
+                    chArray[i] = (char)(ch + LowerCaseDif);
                     start = i + 1;
                 }
             }
@@ -1313,7 +1328,7 @@
                             chArray[j] = asciiStr[j];
                         }
                     }
-                    chArray[i] = (char)((int)ch - LowerCaseDif);
+                    chArray[i] = (char)(ch - LowerCaseDif);
                     start = i + 1;
                 }
             }
@@ -1569,7 +1584,10 @@
         public static string GetAssemblyName(Assembly asm)
         {
             if (asm != null)
+            {
                 return s_AssemblyNameCache.GetValueOrUpdate(asm, (a) => a.GetName().Name);
+            }
+
             return null;
         }

@@ -1582,7 +1600,9 @@
                         foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies())
                         {
                             if (GetAssemblyName(asm).Equals(assemblyName, StringComparison.OrdinalIgnoreCase))
+                            {
                                 return asm;
+                            }
                         }
                         return null;
                     });
@@ -1640,10 +1660,10 @@
                             }

                             s_TypeCache[typeName] = null;
-                            return (Type)null;
+                            return null;
                         }

-                        #if (NET3500 || NET3000 || NET2000)
+#if (NET3500 || NET3000 || NET2000)
                         var assemblyName = (typeName.Substring(asmNameSepPos + 1, typeName.Length - asmNameSepPos - 1) ?? String.Empty).Trim();
                         if (!String.IsNullOrEmpty(assemblyName))
                         {
@@ -1668,7 +1688,7 @@
                                 }
                             }
                         }
-                        #else
+#else
                         result = Type.GetType(typeName,
                             (assemblyRef) =>
                                 {
@@ -1709,7 +1729,7 @@
                                             { }
                                         }
                                     }
-                                    return (Assembly)null;
+                                    return null;
                                 },
                             (assembly, name, ignoreCase) =>
                                 {
@@ -1732,14 +1752,14 @@
                                                 {
                                                     typeRef = asm.GetType(name, false, ignoreCase);
                                                     if (typeRef != null)
-                                                    {
+                                                    {
                                                         return typeRef;
                                                     }
                                                 }
                                             }
                                         }
                                     }
-                                    return (Type)null;
+                                    return null;
                                 });
 #endif
                     }
@@ -2010,7 +2030,7 @@
                 var s = (string)value;
                 if (s.Length == 0)
                 {
-                    return (byte?)null;
+                    return null;
                 }
                 return (byte?)byte.Parse(s, NumberStyles.Integer, JaysonConstants.InvariantCulture);
             }
@@ -2042,7 +2062,7 @@
                 var s = (string)value;
                 if (s.Length == 0)
                 {
-                    return (sbyte?)null;
+                    return null;
                 }
                 return (sbyte?)sbyte.Parse(s, NumberStyles.Integer, JaysonConstants.InvariantCulture);
             }
@@ -2060,7 +2080,7 @@
                 var s = (string)value;
                 if (s.Length == 0)
                 {
-                    return (ushort?)null;
+                    return null;
                 }
                 return (ushort?)ushort.Parse(s, NumberStyles.Integer, JaysonConstants.InvariantCulture);
             }
@@ -2078,7 +2098,7 @@
                 var s = (string)value;
                 if (s.Length == 0)
                 {
-                    return (ulong?)null;
+                    return null;
                 }
                 return (ulong?)ulong.Parse(s, NumberStyles.Integer, JaysonConstants.InvariantCulture);
             }
@@ -2096,7 +2116,7 @@
                 var s = (string)value;
                 if (s.Length == 0)
                 {
-                    return (uint?)null;
+                    return null;
                 }
                 return (uint?)uint.Parse(s, NumberStyles.Integer, JaysonConstants.InvariantCulture);
             }
@@ -2179,14 +2199,14 @@
         {
             if (value == null)
             {
-                return (char?)null;
+                return null;
             }
             if (value is string)
             {
                 var s = (string)value;
                 if (s.Length == 0)
                 {
-                    return (char?)null;
+                    return null;
                 }
                 return (char?)s[0];
             }
@@ -2208,7 +2228,7 @@
                 var s = (string)value;
                 if (s.Length == 0)
                 {
-                    return (TimeSpan?)null;
+                    return null;
                 }
 #if !(NET3500 || NET3000 || NET2000)
                 return (TimeSpan?)TimeSpan.Parse(s, JaysonConstants.InvariantCulture);
@@ -2276,7 +2296,7 @@
                 var s = (string)value;
                 if (s.Length == 0)
                 {
-                    return (decimal?)null;
+                    return null;
                 }
                 return (decimal?)decimal.Parse(s, NumberStyles.Float, JaysonConstants.InvariantCulture);
             }
@@ -2294,7 +2314,7 @@
                 var s = (string)value;
                 if (s.Length == 0)
                 {
-                    return (float?)null;
+                    return null;
                 }
 #if !(NET3500 || NET3000 || NET2000)
                 float result;
@@ -2488,7 +2508,7 @@
                 var s = (string)value;
                 if (s.Length == 0)
                 {
-                    return (short?)null;
+                    return null;
                 }
                 return (short?)short.Parse(s, NumberStyles.Integer, JaysonConstants.InvariantCulture);
             }
@@ -2506,7 +2526,7 @@
                 var s = (string)value;
                 if (s.Length == 0)
                 {
-                    return (double?)null;
+                    return null;
                 }
 #if !(NET3500 || NET3000 || NET2000)
                 double result;
@@ -2540,7 +2560,7 @@
                 var s = (string)value;
                 if (s.Length == 0)
                 {
-                    return (long?)null;
+                    return null;
                 }
                 return (long?)long.Parse(s, NumberStyles.Integer, JaysonConstants.InvariantCulture);
             }
@@ -2558,7 +2578,7 @@
                 var s = (string)value;
                 if (s.Length == 0)
                 {
-                    return (bool?)null;
+                    return null;
                 }
                 return (bool?)ParseBoolean(s);
             }
@@ -2576,7 +2596,7 @@
                 var s = (string)value;
                 if (s.Length == 0)
                 {
-                    return (int?)null;
+                    return null;
                 }
                 return (int?)int.Parse(s, NumberStyles.Integer, JaysonConstants.InvariantCulture);
             }
@@ -2709,7 +2729,10 @@
         public static bool IsWhiteSpace(int ch)
         {
             if (ch != 32 && (ch < 9 || ch > 13) && ch != 160)
+            {
                 return ch == 133;
+            }
+
             return true;
         }

@@ -2741,7 +2764,7 @@

         internal static bool IsGenericCollection(Type objType)
         {
-            return s_IsGenericCollection.GetValueOrUpdate(objType, (t) =>
+            return s_IsGenericCollection.GetValueOrUpdate(objType, (t) =>
                 {
                     Type[] arguments;
                     var found = FindInterface(t, typeof(ICollection<>), out arguments);
@@ -2795,13 +2818,13 @@

         internal static Type GetGenericCollectionArgs(Type objType)
         {
-            return s_GenericCollectionArgs.GetValueOrUpdate(objType, (t) =>
+            return s_GenericCollectionArgs.GetValueOrUpdate(objType, (t) =>
                 {
                     Type[] arguments;
                     var found = FindInterface(t, typeof(ICollection<>), out arguments);

                     s_IsGenericCollection[t] = found;
-
+
                     return found ? arguments[0] : null;
                 });
         }
@@ -2824,7 +2847,7 @@

         internal static Type[] GetGenericDictionaryArgs(Type objType)
         {
-            return s_GenericDictionaryArgs.GetValueOrUpdate(objType, (t) =>
+            return s_GenericDictionaryArgs.GetValueOrUpdate(objType, (t) =>
                 {
                     Type[] arguments;
                     s_IsGenericDictionary[t] = FindInterface(t, typeof(IDictionary<,>), out arguments);
@@ -2851,7 +2874,9 @@
             for (int i = stack.Count - 1; i > -1; i--)
             {
                 if (obj == stack[i])
+                {
                     return true;
+                }
             }
             return false;
         }
@@ -3012,7 +3037,9 @@
                     {
                         method = methods[i];
                         if (method.Name == "Add" && method.GetParameters().Length == 1)
+                        {
                             return PrepareMethodCall(method);
+                        }
                     }

                     return null;
@@ -3030,10 +3057,12 @@
                     {
                         method = methods[i];
                         if (method.Name == "Push" && method.GetParameters().Length == 1)
+                        {
                             return PrepareMethodCall(method);
+                        }
                     }
                     return null;
-                });
+                });
         }

         internal static Action<object, object[]> GetQueueEnqueueMethod(Type objType)
@@ -3047,7 +3076,9 @@
                     {
                         method = methods[i];
                         if (method.Name == "Enqueue" && method.GetParameters().Length == 1)
+                        {
                             return PrepareMethodCall(method);
+                        }
                     }
                     return null;
                 });
@@ -3065,7 +3096,9 @@
                     {
                         method = methods[i];
                         if (method.Name == "Add" && method.GetParameters().Length == 1)
+                        {
                             return PrepareMethodCall(method);
+                        }
                     }
                     return null;
                 });
@@ -3089,12 +3122,14 @@
                             {
                                 method = methods[i];
                                 if (method.Name == "TryAdd" && method.GetParameters().Length == 1)
+                                {
                                     return PrepareMethodCall(method);
+                                }
                             }
                         }
                     }
                     return null;
-                });
+                });
         }
 #endif

@@ -3109,7 +3144,9 @@
                     {
                         method = methods[i];
                         if (method.Name == "Add" && method.GetParameters().Length == 2)
+                        {
                             return PrepareMethodCall(method);
+                        }
                     }
                     return null;
                 });
@@ -3147,26 +3184,30 @@
             return JaysonDictionaryType.Undefined;
         }

-        public static bool IsNull (object value, JaysonFloatSerStrategy floatNanStrategy,
+        public static bool IsNull(object value, JaysonFloatSerStrategy floatNanStrategy,
             JaysonFloatSerStrategy floatInfinityStrategy)
         {
             if ((value == null) || (value == DBNull.Value))
+            {
                 return true;
-
-            if (value is double) {
+            }
+
+            if (value is double)
+            {
                 var d = (double)value;
-                return (double.IsNaN (d) && floatNanStrategy == JaysonFloatSerStrategy.ToNull) ||
-                    (double.IsInfinity (d) && floatInfinityStrategy == JaysonFloatSerStrategy.ToNull);
-            }
-
-            if (value is float) {
+                return (double.IsNaN(d) && floatNanStrategy == JaysonFloatSerStrategy.ToNull) ||
+                    (double.IsInfinity(d) && floatInfinityStrategy == JaysonFloatSerStrategy.ToNull);
+            }
+
+            if (value is float)
+            {
                 var f = (float)value;
-                return (float.IsNaN (f) && floatNanStrategy == JaysonFloatSerStrategy.ToNull) ||
-                    (float.IsInfinity (f) && floatInfinityStrategy == JaysonFloatSerStrategy.ToNull);
+                return (float.IsNaN(f) && floatNanStrategy == JaysonFloatSerStrategy.ToNull) ||
+                    (float.IsInfinity(f) && floatInfinityStrategy == JaysonFloatSerStrategy.ToNull);
             }
             return false;
         }

         # endregion Helper Methods
     }
-}+}


logout

logout

--- Synology/Auth/AuthRequest.cs
+++ Synology/Auth/AuthRequest.cs
@@ -5,20 +5,29 @@
 {
 	public class AuthRequest : SynologyRequest
 	{
-		private readonly Random _rand;
+		string _sessionNumber;

 		public AuthRequest(SynologyConnection connection) : base(connection, "auth.cgi", "SYNO.API.Auth", 4)
 		{
-			_rand = new Random((int)DateTime.Now.Ticks);
+			var rand = new Random((int)DateTime.Now.Ticks);
+			_sessionNumber = string.Format("session{0}", rand.Next());
 		}

 		public ResultData<AuthResult> Login(string username, string password, string otpCode = null)
 		{
 			var extraLoginParams = !string.IsNullOrWhiteSpace(otpCode) ? string.Format("&otp_code={0}", otpCode) : string.Empty;
-			var additionalParams = string.Format("account={0}&passwd={1}&session=session{2}&format=sid{3}", username, password, _rand.Next() % 1000, extraLoginParams);
+			var additionalParams = string.Format("account={0}&passwd={1}&session={2}&format=sid{3}", username, password, _sessionNumber, extraLoginParams);
 			var url = GetApiUrl("login", additionalParams);

 			return Connection.GetDataFromUrl<AuthResult>(url);
 		}
+
+		public ResultData<object> Logout()
+		{
+			var additionalParams = string.Format("session={0}", _sessionNumber);
+			var url = GetApiUrl("logout", additionalParams);
+
+			return Connection.GetDataFromUrl<object>(url);
+		}
 	}
 }


- Fixed formatting issue with non-US locale

--- ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook_Load.cs
+++ ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook_Load.cs
@@ -12,6 +12,7 @@
 using System.Linq;
 using System.Text;
 using System.IO;
+using System.Globalization;

@@ -243,7 +244,7 @@
                         }
                         else if (dCell.DataType == CellValues.Date)
                         {
-                            xlCell.Value = DateTime.FromOADate(Double.Parse(dCell.CellValue.Text));
+                            xlCell.Value = DateTime.FromOADate(Double.Parse(dCell.CellValue.Text, CultureInfo.InvariantCulture));
                         }
                         else if (dCell.DataType == CellValues.Boolean)
                         {
@@ -251,7 +252,7 @@
                         }
                         else if (dCell.DataType == CellValues.Number)
                         {
-                            xlCell.Value = dCell.CellValue.Text;
+                            xlCell.Value = Double.Parse(dCell.CellValue.Text, CultureInfo.InvariantCulture);
                             var numberFormatId = ((CellFormat)((CellFormats)s.CellFormats).ElementAt(styleIndex)).NumberFormatId;
                             if (numberFormatId == 46U)
                                 xlCell.DataType = XLCellValues.TimeSpan;
@@ -263,7 +264,7 @@
                     {
                         //var styleIndex = Int32.Parse(dCell.StyleIndex.InnerText);
                         var numberFormatId = ((CellFormat)((CellFormats)s.CellFormats).ElementAt(styleIndex)).NumberFormatId; //. [styleIndex].NumberFormatId;
-                        ws.Cell(dCell.CellReference).Value = dCell.CellValue.Text;
+                        ws.Cell(dCell.CellReference).Value = Double.Parse(dCell.CellValue.Text, CultureInfo.InvariantCulture);
                         ws.Cell(dCell.CellReference).Style.NumberFormat.NumberFormatId = Int32.Parse(numberFormatId);
                     }


added precondition checks to JsonSerializerBuilder

--- Code/Light.Serialization.Json/JsonSerializerBuilder.cs
+++ Code/Light.Serialization.Json/JsonSerializerBuilder.cs
@@ -62,8 +62,11 @@
         /// </summary>
         /// <param name="characterEscaper">The character escaper used for characters and strings.</param>
         /// <returns>The builder for method chaining.</returns>
+        /// <exception cref="ArgumentNullException">Thrown when <paramref name="characterEscaper"/> is null.</exception>
         public JsonSerializerBuilder WithCharacterEscaper(ICharacterEscaper characterEscaper)
         {
+            characterEscaper.MustNotBeNull(nameof(characterEscaper));
+
             _characterEscaper = characterEscaper;

             foreach (var primitiveTypeFormatter in _primitiveTypeFormattersMapping.Values.OfType<ISetCharacterEscaper>())
@@ -79,8 +82,11 @@
         /// </summary>
         /// <param name="typeAnalyzer">The object that creates value providers for the given type.</param>
         /// <returns>The builder for method chaining.</returns>
+        /// <exception cref="ArgumentNullException">Thrown when <paramref name="typeAnalyzer"/> is null.</exception>
         public JsonSerializerBuilder WithTypeAnalyzer(IReadableValuesTypeAnalyzer typeAnalyzer)
         {
+            typeAnalyzer.MustNotBeNull(nameof(typeAnalyzer));
+
             _typeAnalyzer = typeAnalyzer;

             foreach (var instructor in WriterInstructors.OfType<ISetTypeAnalyzer>())
@@ -205,8 +211,11 @@
         /// </summary>
         /// <param name="instructorCache">The dictionary used as the instructorCache.</param>
         /// <returns>The builder for method chaining.</returns>
+        /// <exception cref="ArgumentNullException">Thrown when <paramref name="instructorCache"/> is null.</exception>
         public JsonSerializerBuilder WithInstructorCache(IDictionary<Type, IJsonWriterInstructor> instructorCache)
         {
+            instructorCache.MustNotBeNull(nameof(instructorCache));
+
             _instructorCache = instructorCache;
             return this;
         }
@@ -217,9 +226,12 @@
         /// <typeparam name="T">The type of the writer instructor that should be configured.</typeparam>
         /// <param name="configureInstructor">The delegate that configures the actual instructor.</param>
         /// <returns>The builder for method chaining.</returns>
+        /// <exception cref="ArgumentNullException">Thrown when <paramref name="configureInstructor"/> is null.</exception>
         public JsonSerializerBuilder ConfigureInstructor<T>(Action<T> configureInstructor)
             where T : IJsonWriterInstructor
         {
+            configureInstructor.MustNotBeNull(nameof(configureInstructor));
+
             configureInstructor(WriterInstructors.OfType<T>().First());
             return this;
         }
@@ -230,9 +242,12 @@
         /// <typeparam name="T">The type of the formatter that should be configured.</typeparam>
         /// <param name="configureFormatter">The delegate that configures the actual formatter instance.</param>
         /// <returns>The builder for method chaining.</returns>
+        /// <exception cref="ArgumentNullException">Thrown when <paramref name="configureFormatter"/> is null.</exception>
         public JsonSerializerBuilder ConfigurePrimitiveTypeFormatter<T>(Action<T> configureFormatter)
             where T : IPrimitiveTypeFormatter
         {
+            configureFormatter.MustNotBeNull(nameof(configureFormatter));
+
             configureFormatter(_primitiveTypeFormattersMapping.Values
                                                               .OfType<T>()
                                                               .First());
@@ -249,8 +264,11 @@
         /// <typeparam name="T">The type that should be configured for serialization.</typeparam>
         /// <param name="configureRule">The delegate that configures the serialization rule.</param>
         /// <returns>The builder for method chaining.</returns>
+        /// <exception cref="ArgumentNullException">Thrown when <paramref name="configureRule"/> is null.</exception>
         public JsonSerializerBuilder WithRuleFor<T>(Action<Rule<T>> configureRule)
         {
+            configureRule.MustNotBeNull(nameof(configureRule));
+
             var newRule = new Rule<T>(_typeAnalyzer);
             configureRule(newRule);

@@ -270,8 +288,11 @@
         /// </summary>
         /// <param name="metadataInstructor">The new metadata instructor.</param>
         /// <returns>The builder for method chaining.</returns>
+        /// <exception cref="ArgumentNullException">Thrown when <paramref name="metadataInstructor"/> is null.</exception>
         public JsonSerializerBuilder WithObjectMetadataInstructor(IObjectMetadataInstructor metadataInstructor)
         {
+            metadataInstructor.MustNotBeNull(nameof(metadataInstructor));
+
             _metadataInstructor = metadataInstructor;

             foreach (var instructor in WriterInstructors.OfType<ISetObjectMetadataInstructor>())


Sync Identity UI default layout with the templates layout

--- src/UI/Areas/Identity/Pages/V4/_Layout.cshtml
+++ src/UI/Areas/Identity/Pages/V4/_Layout.cshtml
@@ -23,37 +23,41 @@

-            @Environment.ApplicationName
-            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
-                    aria-expanded="false" aria-label="Toggle navigation">
-
-            </button>
-

-                @{
-                    var result = Engine.FindView(ViewContext, "_LoginPartial", isMainPage: false);
-                }
-                @if (result.Success)
-                {
-                    await Html.RenderPartialAsync("_LoginPartial");
-                }
-                else
-                {
-                    throw new InvalidOperationException("The default Identity UI layout requires a partial view '_LoginPartial' " +
-                        "usually located at '/Pages/_LoginPartial' or at '/Views/Shared/_LoginPartial' to work. Based on your configuration " +
-                        $"we have looked at it in the following locations: {System.Environment.NewLine}{string.Join(System.Environment.NewLine, result.SearchedLocations)}.");
-                }
+

+                @Environment.ApplicationName
+                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
+                        aria-expanded="false" aria-label="Toggle navigation">
+
+                </button>
+

+                    @{
+                        var result = Engine.FindView(ViewContext, "_LoginPartial", isMainPage: false);
+                    }
+                    @if (result.Success)
+                    {
+                        await Html.RenderPartialAsync("_LoginPartial");
+                    }
+                    else
+                    {
+                        throw new InvalidOperationException("The default Identity UI layout requires a partial view '_LoginPartial' " +
+                            "usually located at '/Pages/_LoginPartial' or at '/Views/Shared/_LoginPartial' to work. Based on your configuration " +
+                            $"we have looked at it in the following locations: {System.Environment.NewLine}{string.Join(System.Environment.NewLine, result.SearchedLocations)}.");
+                    }
+

-

+

         <partial name="_CookieConsentPartial" optional />

             @RenderBody()

+

         © @DateTime.Now.Year - @Environment.ApplicationName - Privacy
+

     <environment include="Development">


Added null checks

Added null checks

--- Test2d.UI.Wpf/Windows/MainWindow.xaml.cs
+++ Test2d.UI.Wpf/Windows/MainWindow.xaml.cs
@@ -180,7 +180,7 @@
         private void OnSave()
         {
             var context = DataContext as EditorContext;
-            if (context == null)
+            if (context == null || context.Editor.Project == null)
                 return;

             if (!string.IsNullOrEmpty(context.Editor.ProjectPath))
@@ -199,7 +199,7 @@
         private void OnSaveAs()
         {
             var context = DataContext as EditorContext;
-            if (context == null)
+            if (context == null || context.Editor.Project == null)
                 return;

             var dlg = new SaveFileDialog()


allow the caching to be skipped dynamically (rather than purely declaratively) by something that happens in the course of the action by checking again whether to SkipByCustom at the end of the action filter.

--- DevTrends.MvcDonutCaching/DonutOutputCacheAttribute.cs
+++ DevTrends.MvcDonutCaching/DonutOutputCacheAttribute.cs
@@ -149,13 +149,9 @@
         /// <param name="filterContext">The filter context.</param>
         public override void OnActionExecuting(ActionExecutingContext filterContext)
         {
-            if (SkipByCustom != null)
-            {
-                var skipByCustomDelegate =
-                    filterContext.HttpContext.Application[HttpApplicationExtensions.SkipByCustomApplicationStateKey] as
-                        Func<HttpContextBase, string, bool>;
-                if (skipByCustomDelegate != null && skipByCustomDelegate(filterContext.HttpContext, SkipByCustom))
-                    return;
+            if (SkipBecauseOfCustom(filterContext))
+            {
+                return;
             }

             CacheSettings = BuildCacheSettings();
@@ -235,11 +231,29 @@
                     DonutHoleFiller.RemoveDonutHoleWrappers(cacheItem.Content, filterContext, CacheSettings.Options)
                 );

+                if (SkipBecauseOfCustom(filterContext))
+                {
+                    return; //offer second chance to skip by custom in case something has changed in the course of the action (e.g. setting a flag to choose to skip)
+                }
+
                 if (CacheSettings.IsServerCachingEnabled && filterContext.HttpContext.Response.StatusCode == 200)
                 {
                     OutputCacheManager.AddItem(cacheKey, cacheItem, DateTime.UtcNow.AddSeconds(CacheSettings.Duration));
                 }
             });
+        }
+
+        private bool SkipBecauseOfCustom(ActionExecutingContext filterContext)
+        {
+            if (SkipByCustom != null)
+            {
+                var skipByCustomDelegate =
+                    filterContext.HttpContext.Application[HttpApplicationExtensions.SkipByCustomApplicationStateKey] as
+                        Func<HttpContextBase, string, bool>;
+                if (skipByCustomDelegate != null && skipByCustomDelegate(filterContext.HttpContext, SkipByCustom))
+                    return true;
+            }
+            return false;
         }

         /// <summary>


Ensure correct icon for file types in search results

(cherry picked from commit e9eecb2031bc50f58d1d971ae58f2b12aad38ff8)

--- src/Umbraco.Web/Search/UmbracoTreeSearcher.cs
+++ src/Umbraco.Web/Search/UmbracoTreeSearcher.cs
@@ -301,19 +301,7 @@
         /// <param name="results"></param>
         /// <returns></returns>
         private IEnumerable<SearchResultItem> MediaFromSearchResults(IEnumerable<SearchResult> results)
-        {
-            var mapped = Mapper.Map<IEnumerable<SearchResultItem>>(results).ToArray();
-            //add additional data
-            foreach (var m in mapped)
-            {
-                //if no icon could be mapped, it will be set to document, so change it to picture
-                if (m.Icon == "icon-document")
-                {
-                    m.Icon = "icon-picture";
-                }
-            }
-            return mapped;
-        }
+            => Mapper.Map<IEnumerable<SearchResultItem>>(results).ToArray();

         /// <summary>
         /// Returns a collection of entities for content based on search results


added maxed property

added maxed property

--- TCC.Core/Data/StatTracker.cs
+++ TCC.Core/Data/StatTracker.cs
@@ -15,9 +15,11 @@

                 NotifyPropertyChanged("Val");
                 NotifyPropertyChanged("Factor");
+                Maxed = Val == Max;
+                NotifyPropertyChanged(nameof(Maxed));
             }
         }
-
+        public bool Maxed { get; set; }
         private int max = 1;
         public int Max
         {
@@ -32,13 +34,7 @@
             }
         }

-        public double Factor
-        {
-            get
-            {
-                return (double)val / max;
-            }
-        }
+        public double Factor => (double)val / max;

         private bool status = false;
         public bool Status