Fix a test failure

Fix a test failure

--- src/Compilers/CSharp/Test/Semantic/Semantics/PatternSwitchTests.cs
+++ src/Compilers/CSharp/Test/Semantic/Semantics/PatternSwitchTests.cs
@@ -1048,7 +1048,8 @@
             var comp = CompileAndVerify(compilation, expectedOutput: expectedOutput);
         }

-        [Fact]
+        [ConditionalFact(typeof(IsEnglishLocal))]
+        [WorkItem(25846, "https://github.com/dotnet/roslyn/issues/25846")]
         public void DuplicateDouble()
         {
             var source =
@@ -1155,33 +1156,32 @@
         }
     }
 }";
-            var provider = EnsureEnglishUICulture.PreferredOrNull;
             var compilation = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugExe);
             compilation.VerifyDiagnostics(
                 // (13,13): error CS0152: The switch statement contains multiple cases with the label value '1.01'
                 //             case 1.01: // duplicate
-                Diagnostic(ErrorCode.ERR_DuplicateCaseLabel, "case 1.01:").WithArguments(1.01.ToString(provider)).WithLocation(13, 13),
+                Diagnostic(ErrorCode.ERR_DuplicateCaseLabel, "case 1.01:").WithArguments(1.01.ToString()).WithLocation(13, 13),
                 // (34,13): error CS0152: The switch statement contains multiple cases with the label value '0'
                 //             case -0.0: // duplicate
-                Diagnostic(ErrorCode.ERR_DuplicateCaseLabel, "case -0.0:").WithArguments((-0.0).ToString(provider)).WithLocation(34, 13),
+                Diagnostic(ErrorCode.ERR_DuplicateCaseLabel, "case -0.0:").WithArguments((-0.0).ToString()).WithLocation(34, 13),
                 // (35,13): error CS0152: The switch statement contains multiple cases with the label value 'NaN'
                 //             case -double.NaN: // duplicate
-                Diagnostic(ErrorCode.ERR_DuplicateCaseLabel, "case -double.NaN:").WithArguments((-double.NaN).ToString(provider)).WithLocation(35, 13),
+                Diagnostic(ErrorCode.ERR_DuplicateCaseLabel, "case -double.NaN:").WithArguments((-double.NaN).ToString()).WithLocation(35, 13),
                 // (46,13): error CS0152: The switch statement contains multiple cases with the label value '1.01'
                 //             case 1.01f: // duplicate
-                Diagnostic(ErrorCode.ERR_DuplicateCaseLabel, "case 1.01f:").WithArguments(1.01f.ToString(provider)).WithLocation(46, 13),
+                Diagnostic(ErrorCode.ERR_DuplicateCaseLabel, "case 1.01f:").WithArguments(1.01f.ToString()).WithLocation(46, 13),
                 // (67,13): error CS0152: The switch statement contains multiple cases with the label value '0'
                 //             case -0.0f: // duplicate
-                Diagnostic(ErrorCode.ERR_DuplicateCaseLabel, "case -0.0f:").WithArguments((-0.0f).ToString(provider)).WithLocation(67, 13),
+                Diagnostic(ErrorCode.ERR_DuplicateCaseLabel, "case -0.0f:").WithArguments((-0.0f).ToString()).WithLocation(67, 13),
                 // (68,13): error CS0152: The switch statement contains multiple cases with the label value 'NaN'
                 //             case -float.NaN: // duplicate
-                Diagnostic(ErrorCode.ERR_DuplicateCaseLabel, "case -float.NaN:").WithArguments((-float.NaN).ToString(provider)).WithLocation(68, 13),
+                Diagnostic(ErrorCode.ERR_DuplicateCaseLabel, "case -float.NaN:").WithArguments((-float.NaN).ToString()).WithLocation(68, 13),
                 // (78,13): error CS0152: The switch statement contains multiple cases with the label value '1.01'
                 //             case 1.01m: // duplicate
-                Diagnostic(ErrorCode.ERR_DuplicateCaseLabel, "case 1.01m:").WithArguments(1.01m.ToString(provider)).WithLocation(78, 13),
+                Diagnostic(ErrorCode.ERR_DuplicateCaseLabel, "case 1.01m:").WithArguments(1.01m.ToString()).WithLocation(78, 13),
                 // (99,13): error CS0152: The switch statement contains multiple cases with the label value '0.0'
                 //             case -0.0m: // duplicate
-                Diagnostic(ErrorCode.ERR_DuplicateCaseLabel, "case -0.0m:").WithArguments((-0.0m).ToString(provider)).WithLocation(99, 13)
+                Diagnostic(ErrorCode.ERR_DuplicateCaseLabel, "case -0.0m:").WithArguments((-0.0m).ToString()).WithLocation(99, 13)
                 );
         }


Document the meaning of the 'long' values where TimeSpan is no longer used

--- src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalyzerExecutor.cs
+++ src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalyzerExecutor.cs
@@ -43,6 +43,9 @@
         private readonly Func<DiagnosticAnalyzer, bool> _shouldSkipAnalysisOnGeneratedCode;
         private readonly Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> _shouldSuppressGeneratedCodeDiagnostic;
         private readonly Func<SyntaxTree, TextSpan, bool> _isGeneratedCodeLocation;
+        /// <summary>
+        /// The values in this map convert to <see cref="TimeSpan"/> using <see cref="TimeSpan.FromTicks(long)"/>.
+        /// </summary>
         private readonly ConcurrentDictionary<DiagnosticAnalyzer, StrongBox<long>> _analyzerExecutionTimeMapOpt;
         private readonly CompilationAnalysisValueProviderFactory _compilationAnalysisValueProviderFactory;
         private readonly CancellationToken _cancellationToken;


Fix exception tests to match CoreCLR change (#38727)

--- src/System.Data.Common/tests/System/Data/Common/DbConnectionStringBuilderTest.cs
+++ src/System.Data.Common/tests/System/Data/Common/DbConnectionStringBuilderTest.cs
@@ -99,7 +99,7 @@
                     Assert.Equal(typeof(ArgumentException), ex.GetType());
                     Assert.Null(ex.InnerException);
                     Assert.NotNull(ex.Message);
-                    Assert.True(ex.Message.IndexOf("'" + keyword + "'") == -1);
+                    Assert.Contains(keyword, ex.Message);
                     Assert.Equal(keyword, ex.ParamName);
                 }
             }
@@ -302,7 +302,7 @@
                     Assert.Equal(typeof(ArgumentException), ex.GetType());
                     Assert.Null(ex.InnerException);
                     Assert.NotNull(ex.Message);
-                    Assert.True(ex.Message.IndexOf("'" + keyword + "'") == -1);
+                    Assert.Contains(keyword, ex.Message);
                     Assert.Equal(keyword, ex.ParamName);
                 }


Correct unit tests for Environment.SetEnvironmentVariable (#25065)

* Correct unit tests for Environment.SetEnvironmentVariable

Any variable and value size is allowed if there is enough memory

Fix #16766

* Add unit test for long variable name

and make the tests Windows-specific

* Make a unit test to run on Windows

* Fix string constructors for x86 environments

* Accept absence of OutOfMemoryException as a valid test result

* Skip tests in NETFX

* Decrease test string size in 32-bit environments

* Catch string constructor failure

It is intermittent and shouldn't fail the test

* RemoteInvoke OutOfMemoryException inducing tests

--- src/System.Runtime.Extensions/tests/System/Environment.SetEnvironmentVariable.cs
+++ src/System.Runtime.Extensions/tests/System/Environment.SetEnvironmentVariable.cs
@@ -3,13 +3,14 @@
 // See the LICENSE file in the project root for more information.

 using System.Collections;
+using System.Diagnostics;
 using System.Runtime.InteropServices;
 using System.Security;
 using Xunit;

 namespace System.Tests
 {
-    public class SetEnvironmentVariable
+    public class SetEnvironmentVariable : RemoteExecutorTestBase
     {
         private const string NullString = "\u0000";

@@ -30,6 +31,116 @@
             AssertExtensions.Throws<ArgumentException>("variable", () => Environment.SetEnvironmentVariable(string.Empty, "test"));
             AssertExtensions.Throws<ArgumentException>("variable", () => Environment.SetEnvironmentVariable(NullString, "test"));
             AssertExtensions.Throws<ArgumentException>("variable", null, () => Environment.SetEnvironmentVariable("Variable=Something", "test"));
+        }
+
+        [Fact]
+        [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, ".NET Framework does not have the fix to allow arbitrary length environment variables.")]
+        public void AllowAnyVariableLengths()
+        {
+            // longer than 32767
+            string longVar = new string('c', 40000);
+            string val = "test";
+
+            try
+            {
+                Environment.SetEnvironmentVariable(longVar, val);
+                Assert.Equal(val, Environment.GetEnvironmentVariable(longVar));
+            }
+            finally
+            {
+                Environment.SetEnvironmentVariable(longVar, null);
+            }
+        }
+
+        [Fact]
+        [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, ".NET Framework does not have the fix to allow arbitrary length environment variables.")]
+        public void AllowAnyVariableValueLengths()
+        {
+            string var = "Test_SetEnvironmentVariable_AllowAnyVariableValueLengths";
+            // longer than 32767
+            string longVal = new string('c', 40000);
+
+            try
+            {
+                Environment.SetEnvironmentVariable(var, longVal);
+                Assert.Equal(longVal, Environment.GetEnvironmentVariable(var));
+            }
+            finally
+            {
+                Environment.SetEnvironmentVariable(var, null);
+            }
+        }
+
+        [Fact]
+        [PlatformSpecific(TestPlatforms.Windows)]
+        [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, ".NET Framework does not have the fix to allow arbitrary length environment variables.")]
+        public void EnvironmentVariableTooLarge_Throws()
+        {
+            RemoteInvoke(() =>
+            {
+                string longVar;
+                string val = "Test_SetEnvironmentVariable_EnvironmentVariableTooLarge_Throws";
+
+                try
+                {
+                    // string slightly less than 2 GiB (1 GiB for x86) so the constructor doesn't fail
+                    var count = (Environment.Is64BitProcess ? 1024 * 1024 * 1024 : 512 * 1024 * 1024) - 64;
+                    longVar = new string('c', count);
+                }
+                catch (OutOfMemoryException)
+                {
+                    // not enough memory to allocate a string at test time
+                    return SuccessExitCode;
+                }
+
+                try
+                {
+                    Environment.SetEnvironmentVariable(longVar, val);
+                    // no exception is ok since we cannot construct an argument long enough to break the function
+                    // in that particular environment
+                }
+                catch (OutOfMemoryException)
+                {
+                    // expected
+                }
+                return SuccessExitCode;
+            }).Dispose();
+        }
+
+        [Fact]
+        [PlatformSpecific(TestPlatforms.Windows)]
+        [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, ".NET Framework does not have the fix to allow arbitrary length environment variables.")]
+        public void EnvironmentVariableValueTooLarge_Throws()
+        {
+            RemoteInvoke(() =>
+            {
+                string var = "Test_SetEnvironmentVariable_EnvironmentVariableValueTooLarge_Throws";
+                string longVal;
+
+                try
+                {
+                    // string slightly less than 2 GiB (1 GiB for x86) so the constructor doesn't fail
+                    var count = (Environment.Is64BitProcess ? 1024 * 1024 * 1024 : 512 * 1024 * 1024) - 64;
+                    longVal = new string('c', count);
+                }
+                catch (OutOfMemoryException)
+                {
+                    // not enough memory to allocate a string at test time
+                    return SuccessExitCode;
+                }
+
+                try
+                {
+                    Environment.SetEnvironmentVariable(var, longVal);
+                    // no exception is ok since we cannot construct an argument long enough to break the function
+                    // in that particular environment
+                }
+                catch (OutOfMemoryException)
+                {
+                    // expected
+                }
+                return SuccessExitCode;
+            }).Dispose();
         }

         private static void ExecuteAgainstTarget(


修复构造函数为protected的问题

修复构造函数为protected的问题

--- src/Wodsoft.ComBoost.AspNetCore.Security/ComBoostAuthenticationSessionHandler.cs
+++ src/Wodsoft.ComBoost.AspNetCore.Security/ComBoostAuthenticationSessionHandler.cs
@@ -19,7 +19,7 @@
         IAuthenticationSignInHandler,
         IAuthenticationSignOutHandler
     {
-        protected ComBoostAuthenticationSessionHandler(IOptionsMonitor<ComBoostAuthenticationOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock) : base(options, logger, encoder, clock)
+        public ComBoostAuthenticationSessionHandler(IOptionsMonitor<ComBoostAuthenticationOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock) : base(options, logger, encoder, clock)
         {
         }


Simplify impl

Simplify impl

--- src/Workspaces/Core/Portable/Storage/SQLite/SQLitePersistentStorage_Threading.cs
+++ src/Workspaces/Core/Portable/Storage/SQLite/SQLitePersistentStorage_Threading.cs
@@ -38,13 +38,13 @@
         // Inner class used so that we can generically create and pool StrongBox<TArg> instances. We
         // use those to provide an allocation-free means of calling
         // <c>Task.Factory.StartNew(func<object>, object, ...)</c>.
-        private static class StrongBoxes<TArg, TResult>
+        private static class Threading<TArg, TResult>
             where TArg : struct
         {
             private static readonly Stack<StrongBox<(Func<TArg, TResult> func, TArg arg)>> _boxes =
                  new Stack<StrongBox<(Func<TArg, TResult> func, TArg arg)>>();

-            public static StrongBox<(Func<TArg, TResult> func, TArg arg)> GetBox()
+            private static StrongBox<(Func<TArg, TResult> func, TArg arg)> GetBox()
             {
                 lock (_boxes)
                 {
@@ -57,7 +57,7 @@
                 }
             }

-            public static void ReturnBox(StrongBox<(Func<TArg, TResult> func, TArg arg)> box)
+            private static void ReturnBox(StrongBox<(Func<TArg, TResult> func, TArg arg)> box)
             {
                 lock (_boxes)
                 {
@@ -65,43 +65,33 @@
                 }
             }

-            public static readonly Func<object, TResult> ReadCallback = b =>
+            private static readonly Func<object, TResult> Callback = b =>
             {
                 var innerBox = (StrongBox<(Func<TArg, TResult> func, TArg arg)>)b;
-                var result = innerBox.Value.func(innerBox.Value.arg);
+                var (func, arg) = innerBox.Value;
                 ReturnBox(innerBox);
-                return result;
+                return func(arg);
             };

-            public static readonly Func<object, TResult> WriteCallback = box =>
+            [PerformanceSensitive("https://github.com/dotnet/roslyn/issues/36114", AllowCaptures = false)]
+            public static Task<TResult> PerformTask(Func<TArg, TResult> func, TArg arg, TaskScheduler scheduler, CancellationToken cancellationToken)
             {
-                var innerBox = (StrongBox<(Func<TArg, TResult> func, TArg arg)>)box;
-                var result = innerBox.Value.func(innerBox.Value.arg);
-                ReturnBox(innerBox);
-                return result;
-            };
+                // Use a pooled strongbox so we don't box the provided arg.
+                var box = GetBox();
+                box.Value = (func, arg);
+
+                return Task.Factory.StartNew(Callback, box, cancellationToken, TaskCreationOptions.None, scheduler);
+            }
         }

-        [PerformanceSensitive("https://github.com/dotnet/roslyn/issues/36114", AllowCaptures = false)]
-        private Task<TResult> PerformReadAsync<TArg, TResult>(Func<TArg, TResult> func, TArg arg, CancellationToken cancellationToken)
-            where TArg : struct
-        {
-            // Use a pooled strongbox so we don't box the provided arg.
-            var box = StrongBoxes<TArg, TResult>.GetBox();
-            box.Value = (func, arg);
+        // Read tasks go to the concurrent-scheduler where they can run concurrently with other read
+        // tasks.
+        private Task<TResult> PerformReadAsync<TArg, TResult>(Func<TArg, TResult> func, TArg arg, CancellationToken cancellationToken) where TArg : struct
+            => Threading<TArg, TResult>.PerformTask(func, arg, _readerWriterLock.ConcurrentScheduler, cancellationToken);

-            return Task.Factory.StartNew(StrongBoxes<TArg, TResult>.ReadCallback, box, cancellationToken, TaskCreationOptions.None, _readerWriterLock.ConcurrentScheduler);
-        }
-
-        [PerformanceSensitive("https://github.com/dotnet/roslyn/issues/36114", AllowCaptures = false)]
-        public Task<bool> PerformWriteAsync<TArg>(Func<TArg, bool> func, TArg arg, CancellationToken cancellationToken)
-            where TArg : struct
-        {
-            // Use a pooled strongbox so we don't box the provided arg.
-            var box = StrongBoxes<TArg, bool>.GetBox();
-            box.Value = (func, arg);
-
-            return Task.Factory.StartNew(StrongBoxes<TArg, bool>.WriteCallback, box, cancellationToken, TaskCreationOptions.None, _readerWriterLock.ExclusiveScheduler);
-        }
+        // Write tasks go to the exclusive-scheduler so they run exclusively of all other threading
+        // tasks we need to do.
+        public Task<bool> PerformWriteAsync<TArg>(Func<TArg, bool> func, TArg arg, CancellationToken cancellationToken) where TArg : struct
+            => Threading<TArg, bool>.PerformTask(func, arg, _readerWriterLock.ExclusiveScheduler, cancellationToken);
     }
 }


Update ProjectEditorViewModel.Editor.cs

Update ProjectEditorViewModel.Editor.cs

--- src/Core2D.Core/ViewModels/Editor/ProjectEditorViewModel.Editor.cs
+++ src/Core2D.Core/ViewModels/Editor/ProjectEditorViewModel.Editor.cs
@@ -261,7 +261,7 @@
         OnLoad(project, string.Empty);
         CanvasPlatform?.ResetZoom?.Invoke();
         CanvasPlatform?.InvalidateControl?.Invoke();
-        NavigateTo("Home");
+        NavigateTo?.Invoke("Home");
     }

     public void OnOpenProject(string path)
@@ -302,7 +302,7 @@
             OnAddRecent(path, project.Name);
             CanvasPlatform?.ResetZoom?.Invoke();
             CanvasPlatform?.InvalidateControl?.Invoke();
-            NavigateTo("Home");
+            NavigateTo?.Invoke("Home");
         }
         catch (Exception ex)
         {
@@ -314,7 +314,7 @@
     {
         Project?.History?.Reset();
         OnUnload();
-        NavigateTo("Dashboard");
+        NavigateTo?.Invoke("Dashboard");
     }

     public void OnSaveProject(string path)
@@ -1419,4 +1419,4 @@
         }
         return false;
     }
-}+}


fix vari get sedi.cs

fix vari get sedi.cs

--- src/backend/SO115App.FakePersistance.ExternalAPI/Servizi/GestioneSedi/GetSedi.cs
+++ src/backend/SO115App.FakePersistance.ExternalAPI/Servizi/GestioneSedi/GetSedi.cs
@@ -48,6 +48,114 @@
             _setSediAlberate = setSediAlberate;
         }

+        public async Task<UnitaOperativa> ListaSediAlberata()
+        {
+            UnitaOperativa ListaSediAlberate = null;
+
+            if (!_memoryCache.TryGetValue("ListaSediAlberate", out ListaSediAlberate))
+            {
+                //OTTENGO TUTTE LE SEDI, PER OGNI LIVELLO
+                try
+                {
+                    var lstRegionali = GetDirezioniRegionali().Result;
+
+                    var lstProvinciali = GetDirezioniProvinciali().Result;
+
+                    //Le coordinate sono fisse perchè il CON prende tutta italia
+                    var con = GetInfoSede("00").Result;
+                    con.coordinate = "42.28313392189123,11.682171591796926";
+
+                    //CREO L'ALNERATURA DELLE SEDI PARTENDO DAL CON
+                    var result = new UnitaOperativa(con.Id, con.Descrizione, con.Coordinate);
+
+                    return await Task.Run(() => Parallel.ForEach(lstRegionali, regionale => //REGIONI
+                    {
+                        var info = GetInfoSede(regionale.id).Result;
+                        var unita = new UnitaOperativa(regionale.id, regionale.descrizione, new Coordinate(Convert.ToDouble(info.coordinate.Split(',')[0].ToString()), Convert.ToDouble(info.coordinate.Split(',')[1].ToString())));
+
+                        lock (result) { result.AddFiglio(unita); }
+                    })).ContinueWith(res => Parallel.ForEach(lstProvinciali, provinciale => //PROVINCE
+                    {
+                        var info = GetInfoSede(provinciale.id);
+
+                        var lstComunali = new ConcurrentBag<UnitaOperativa>();
+
+                        Parallel.ForEach(GetFigli(provinciale.id).Result, comune => //COMUNI
+                        {
+                            if (comune.coordinate.Trim().Length > 0)
+                            {
+                                try
+                                {
+                                    var unita = new UnitaOperativa(comune.id, comune.descrizione, new Coordinate(Convert.ToDouble(comune.coordinate.Split(',')[0].ToString()), Convert.ToDouble(comune.coordinate.Split(',')[1].ToString())));
+                                    if (!unita.Nome.Contains("CENTRALE")) { lstComunali.Add(unita); }
+                                }
+                                catch
+                                {
+                                    if (comune.coordinate.Contains("°"))
+                                    {
+                                        comune.coordinate = comune.DmsToDdString(comune.coordinate);
+                                        var unita = new UnitaOperativa(comune.id, comune.descrizione, new Coordinate(Convert.ToDouble(comune.coordinate.Split(',')[0].ToString()), Convert.ToDouble(comune.coordinate.Split(',')[1].ToString())));
+                                        if (!unita.Nome.Contains("CENTRALE")) { lstComunali.Add(unita); }
+                                    }
+                                }
+                            }
+                            else
+                            {
+                                var unita = new UnitaOperativa(comune.id, comune.descrizione, new Coordinate(0, 0));
+                                if (!unita.Nome.Contains("CENTRALE")) { lstComunali.Add(unita); }
+                            }
+                        });
+
+                        //lock (lstComunali) { lstComunali.RemoveAll(c => c.Nome.Contains("CENTRALE")); }
+
+                        var unitaComunali = new UnitaOperativa($"{provinciale.id}.1000", provinciale.descrizione);
+
+                        if (info.Result != null && info.Result.coordinate.Trim().Length > 0)
+                        {
+                            string[] coordinate = info.Result.coordinate.Split(',');
+
+                            unitaComunali = new UnitaOperativa($"{provinciale.id}.1000", provinciale.descrizione, new Coordinate(Convert.ToDouble(coordinate[0].ToString()), Convert.ToDouble(coordinate[1].ToString())));
+                        }
+
+                        foreach (var c in lstComunali)
+                            unitaComunali.AddFiglio(c);
+
+                        result.Figli.FirstOrDefault(r => r.Codice.Equals(info.Result.IdSedePadre))?.AddFiglio(unitaComunali);
+
+                    })).ContinueWith(res =>
+                    {
+                        ListaSediAlberate = result;
+                        var cacheEntryOptions = new MemoryCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromHours(10));
+                        _memoryCache.Set("ListaSediAlberate", ListaSediAlberate, cacheEntryOptions);
+
+                        _setSediAlberate.Set(result);
+
+                        return result;
+                    });
+                }
+                catch (Exception e)
+                {
+                    var sedi = _getAllSediAlberate.GetSediAlberate();
+
+                    if (sedi != null)
+                    {
+                        var cacheEntryOptionsBk = new MemoryCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromHours(10));
+                        _memoryCache.Set("ListaSediAlberate", sedi, cacheEntryOptionsBk);
+                        return sedi;
+                    }
+                    else
+                        throw new Exception("Errore costruzione alberatura sedi di servizio.");
+                }
+            }
+            else
+            {
+                if (ListaSediAlberate == null)
+                    _memoryCache.Remove("ListaSediAlberate");
+
+                return ListaSediAlberate;
+            }
+        }
+
         public async Task<List<SedeUC>> GetDirezioniProvinciali(string codSede = null)
         {
             //var cacheEntryOptions = new MemoryCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromHours(6));
@@ -58,22 +166,22 @@

             //if (!_memoryCache.TryGetValue("GetComandiProvinciali-" + codSede, out result))
             //{
-                if (codSede != null)
-                {
-                    var url = new Uri(baseurl + "/GetComandiProvinciali" + "?codSede=" + codSede);
-                    _serviceDirezioni.SetCache(url.AbsoluteUri);
-                    result = await _serviceDirezioni.GetAsync(url);
-                    //_memoryCache.Set("GetComandiProvinciali-" + codSede, result, cacheEntryOptions);
-                }
-                else
-                {
-                    var url = new Uri(baseurl + "/GetComandiProvinciali");
-                    _serviceDirezioni.SetCache(url.AbsoluteUri);
-                    result = await _serviceDirezioni.GetAsync(url);
-                    //_memoryCache.Set("GetComandiProvinciali-" + codSede, result, cacheEntryOptions);
-                }
-
-                return result;
+            if (codSede != null)
+            {
+                var url = new Uri(baseurl + "/GetComandiProvinciali" + "?codSede=" + codSede);
+                _serviceDirezioni.SetCache(url.AbsoluteUri);
+                result = await _serviceDirezioni.GetAsync(url);
+                //_memoryCache.Set("GetComandiProvinciali-" + codSede, result, cacheEntryOptions);
+            }
+            else
+            {
+                var url = new Uri(baseurl + "/GetComandiProvinciali");
+                _serviceDirezioni.SetCache(url.AbsoluteUri);
+                result = await _serviceDirezioni.GetAsync(url);
+                //_memoryCache.Set("GetComandiProvinciali-" + codSede, result, cacheEntryOptions);
+            }
+
+            return result;
             //}
             //else
             //    return result;
@@ -87,14 +195,14 @@

             //if (!_memoryCache.TryGetValue("GetDirezioniRegionali-" + codSede, out lstSediRegionali))
             //{
-                var baseurl = URLProvvisorio; // _config.GetSection("UrlExternalApi").GetValue<string>("InfoSedeApiUtenteComune");
-                var url = new Uri(baseurl + "/GetDirezioniRegionali" + "?codSede=" + codSede);
-
-                _serviceDirezioni.SetCache(url.AbsoluteUri);
-
-                lstSediRegionali = await _serviceDirezioni.GetAsync(url);
-                //_memoryCache.Set("GetDirezioniRegionali-" + codSede, lstSediRegionali, cacheEntryOptions);
-                return lstSediRegionali;
+            var baseurl = URLProvvisorio; // _config.GetSection("UrlExternalApi").GetValue<string>("InfoSedeApiUtenteComune");
+            var url = new Uri(baseurl + "/GetDirezioniRegionali" + "?codSede=" + codSede);
+
+            _serviceDirezioni.SetCache(url.AbsoluteUri);
+
+            lstSediRegionali = await _serviceDirezioni.GetAsync(url);
+            //_memoryCache.Set("GetDirezioniRegionali-" + codSede, lstSediRegionali, cacheEntryOptions);
+            return lstSediRegionali;
             //}
             //else
             //    return lstSediRegionali;
@@ -109,15 +217,15 @@

             //if (!_memoryCache.TryGetValue("GetChildSede-" + codSede, out lstFigli))
             //{
-                var baseurl = URLProvvisorio; // _config.GetSection("UrlExternalApi").GetValue<string>("InfoSedeApiUtenteComune");
-                var url = new Uri(baseurl + "/GetChildSede" + "?codSede=" + codSede);
-
-                _serviceDirezioni.SetCache(url.AbsoluteUri);
-
-                lstFigli = await _serviceDirezioni.GetAsync(url);
-                //_memoryCache.Set("GetChildSede-" + codSede, lstFigli, cacheEntryOptions);
-
-                return lstFigli.Where(f => f.tipologiaDistaccamento.codice != "14" && f.tipologiaDistaccamento.codice != "9").ToList();
+            var baseurl = URLProvvisorio; // _config.GetSection("UrlExternalApi").GetValue<string>("InfoSedeApiUtenteComune");
+            var url = new Uri(baseurl + "/GetChildSede" + "?codSede=" + codSede);
+
+            _serviceDirezioni.SetCache(url.AbsoluteUri);
+
+            lstFigli = await _serviceDirezioni.GetAsync(url);
+            //_memoryCache.Set("GetChildSede-" + codSede, lstFigli, cacheEntryOptions);
+
+            return lstFigli.Where(f => f.tipologiaDistaccamento.codice != "14" && f.tipologiaDistaccamento.codice != "9").ToList();
             //}
             //else
             //    return lstFigli;
@@ -132,28 +240,28 @@

             //if (!_memoryCache.TryGetValue("GetInfoSede-" + codSede, out sede))
             //{
-                //try
-                //{
-                    var baseurl = URLProvvisorio; // _config.GetSection("UrlExternalApi").GetValue<string>("InfoSedeApiUtenteComune");
-                    var url = new Uri(baseurl + "/GetInfoSede" + "?codSede=" + codSede);
-
-                    _serviceSedi.SetCache(url.AbsoluteUri);
-
-                    sede = _serviceSedi.GetAsync(url).Result;
-
-                    if (sede == null)
-                        sede = get(codSede);
-
-                    //_memoryCache.Set("GetInfoSede-" + codSede, sede, cacheEntryOptions);
-                    return sede;
-
-                //}
-                //catch (Exception)
-                //{
-                //    sede = get(codSede);
-                //    _memoryCache.Set("GetInfoSede-" + codSede, sede, cacheEntryOptions);
-                //    return sede;
-                //}
+            //try
+            //{
+            var baseurl = URLProvvisorio; // _config.GetSection("UrlExternalApi").GetValue<string>("InfoSedeApiUtenteComune");
+            var url = new Uri(baseurl + "/GetInfoSede" + "?codSede=" + codSede);
+
+            _serviceSedi.SetCache(url.AbsoluteUri);
+
+            sede = _serviceSedi.GetAsync(url).Result;
+
+            if (sede == null)
+                sede = get(codSede);
+
+            //_memoryCache.Set("GetInfoSede-" + codSede, sede, cacheEntryOptions);
+            return sede;
+
+            //}
+            //catch (Exception)
+            //{
+            //    sede = get(codSede);
+            //    _memoryCache.Set("GetInfoSede-" + codSede, sede, cacheEntryOptions);
+            //    return sede;
+            //}
             //}
             //else
             //{
@@ -279,146 +387,7 @@
                 }))));
             }

-            //result.AddRange(lstSedi.Figli.First().Figli.Select(f => new Sede()
-            //{
-            //    Codice = f.Codice,
-            //    Descrizione = f.Nome,
-            //    Coordinate = f.Coordinate,
-            //    Indirizzo = null
-            //}));
-
-            //result.AddRange(lstSedi.Figli.First().Figli.ToList().SelectMany(f => f.Figli.Select(ff => new Sede()
-            //{
-            //    Codice = ff.Codice,
-            //    Descrizione = ff.Nome,
-            //    Coordinate = ff.Coordinate,
-            //    Indirizzo = null
-            //})));
-
-            //result.AddRange(lstSedi.Figli.First().Figli.ToList().SelectMany(f => f.Figli.SelectMany(ff => ff.Figli.Select(fff => new Sede()
-            //{
-            //    Codice = fff.Codice,
-            //    Descrizione = fff.Nome,
-            //    Coordinate = fff.Coordinate,
-            //    Indirizzo = null
-            //}))));
-
             return result.Distinct().ToList();
-        }
-
-        public async Task<UnitaOperativa> ListaSediAlberata()
-        {
-            UnitaOperativa ListaSediAlberate = null;
-
-            if (!_memoryCache.TryGetValue("ListaSediAlberate", out ListaSediAlberate))
-            {
-                //OTTENGO TUTTE LE SEDI, PER OGNI LIVELLO
-                try
-                {
-                    var lstRegionali = GetDirezioniRegionali().Result;
-
-                    var lstProvinciali = GetDirezioniProvinciali().Result;
-
-                    //Le coordinate sono fisse perchè il CON prende tutta italia
-                    var con = GetInfoSede("00").Result;
-                    con.coordinate = "42.28313392189123,11.682171591796926";
-
-                    //CREO L'ALNERATURA DELLE SEDI PARTENDO DAL CON
-                    var result = new UnitaOperativa(con.Id, con.Descrizione, con.Coordinate);
-
-                    //REGIONI
-                    await Task.Run(() => Parallel.ForEach(lstRegionali, regionale =>
-                    {
-                        var info = GetInfoSede(regionale.id).Result;
-                        var unita = new UnitaOperativa(regionale.id, regionale.descrizione, new Coordinate(Convert.ToDouble(info.coordinate.Split(',')[0].ToString()), Convert.ToDouble(info.coordinate.Split(',')[1].ToString())));
-
-                        lock ("unita") { result.AddFiglio(unita); }
-                    })).ContinueWith(res => Parallel.ForEach(lstProvinciali, provinciale =>
-                    {
-                        var info = GetInfoSede(provinciale.id).Result;
-
-                        var listaComuni = GetFigli(provinciale.id).Result;
-
-                        var lstComunali = new List<UnitaOperativa>();
-
-                        //COMUNI
-                        Parallel.ForEach(listaComuni, comune =>
-                        {
-                            if (comune.coordinate.Trim().Length > 0)
-                            {
-                                try
-                                {
-                                    var unita = new UnitaOperativa(comune.id, comune.descrizione, new Coordinate(Convert.ToDouble(comune.coordinate.Split(',')[0].ToString()), Convert.ToDouble(comune.coordinate.Split(',')[1].ToString())));
-                                    lock ("comune") { lstComunali.Add(unita); }
-                                }
-                                catch
-                                {
-                                    if (comune.coordinate.Contains("°"))
-                                    {
-                                        comune.coordinate = comune.DmsToDdString(comune.coordinate);
-                                        var unita = new UnitaOperativa(comune.id, comune.descrizione, new Coordinate(Convert.ToDouble(comune.coordinate.Split(',')[0].ToString()), Convert.ToDouble(comune.coordinate.Split(',')[1].ToString())));
-                                        lock ("comune") { lstComunali.Add(unita); }
-                                    }
-                                }
-                            }
-                            else
-                            {
-                                var unita = new UnitaOperativa(comune.id, comune.descrizione, new Coordinate(0, 0));
-                                lock ("comune") { lstComunali.Add(unita); }
-                            }
-                        });
-
-                        var centrale = lstComunali.FirstOrDefault(c => c.Nome.ToLower().Contains("centrale") || c.Codice.Split('.')[1].Equals("1000"));
-
-                        if (centrale != null)
-                        {
-                            lock ("comune") { lstComunali.Remove(centrale); }
-
-                            try
-                            {
-                                if (info.coordinate.Trim().Length > 0)
-                                {
-                                    var unitaComunali = new UnitaOperativa(centrale.Codice, provinciale.descrizione, new Coordinate(Convert.ToDouble(info.coordinate.Split(',')[0].ToString()), Convert.ToDouble(info.coordinate.Split(',')[1].ToString())));
-
-                                    lock ("comune") { lstComunali.ForEach(c => unitaComunali.AddFiglio(c)); }
-
-                                    lock ("unita") { result.Figli.FirstOrDefault(r => r.Codice?.Equals(info.IdSedePadre) ?? false)?.AddFiglio(unitaComunali); }
-                                }
-                            }
-                            catch (Exception e)
-                            {
-                            }
-                        }
-                    }));
-
-                    ListaSediAlberate = result;
-                    var cacheEntryOptions = new MemoryCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromHours(10));
-                    _memoryCache.Set("ListaSediAlberate", ListaSediAlberate, cacheEntryOptions);
-
-                    _setSediAlberate.Set(result);
-                    return result;
-                }
-                catch (Exception e)
-                {
-                    var sedi = _getAllSediAlberate.GetSediAlberate();
-
-                    if (sedi != null)
-                    {
-                        var cacheEntryOptionsBk = new MemoryCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromHours(10));
-                        _memoryCache.Set("ListaSediAlberate", sedi, cacheEntryOptionsBk);
-                        return sedi;
-                    }
-                    else
-                        throw new Exception("Errore costruzione alberatura sedi di servizio.");
-                }
-            }
-            else
-            {
-                if (ListaSediAlberate == null)
-                    _memoryCache.Remove("ListaSediAlberate");
-
-                return ListaSediAlberate;
-            }
         }

         public List<Distaccamento> GetListaDistaccamenti(List<PinNodo> listaPin = null)
@@ -489,6 +458,25 @@
             return listaSediMarker.ToList();
         }

+        Coordinate IGetCoordinateByCodSede.Get(string codiceSede)
+        {
+            return GetInfoSede(codiceSede).Result.Coordinate;
+        }
+
+        string[] IGetStringCoordinateByCodSede.Get(string codiceSede)
+        {
+            var result = GetInfoSede(codiceSede).Result;
+
+            if (result == null)
+                return null;
+
+            if (result.coordinate == null || result.coordinate.Length > 0)
+                return GetInfoSede(codiceSede).Result.coordinate.Split(',');
+            else
+                return null;
+        }
+
+
         private static string GetTipoSede(Sede sede)
         {
             if (sede.Codice.Contains(".1000"))
@@ -506,23 +494,5 @@
                     return "Comando";
             }
         }
-
-        Coordinate IGetCoordinateByCodSede.Get(string codiceSede)
-        {
-            return GetInfoSede(codiceSede).Result.Coordinate;
-        }
-
-        string[] IGetStringCoordinateByCodSede.Get(string codiceSede)
-        {
-            var result = GetInfoSede(codiceSede).Result;
-
-            if (result == null)
-                return null;
-
-            if (result.coordinate == null || result.coordinate.Length > 0)
-                return GetInfoSede(codiceSede).Result.coordinate.Split(',');
-            else
-                return null;
-        }
     }
 }


Fixed IndexOutOfRange exception in latency calc if sample size only 1

--- RemotePeer.cs
+++ RemotePeer.cs
@@ -101,15 +101,15 @@
                 }
                 runningRTTTotal = rtt * roundTripTimes.Length;
                 Latency = rtt / 2;
-                roundTripTimesIndex++;
                 hasUpdateLatencyBeenCalled = true;
-                return;
-            }
-
-            runningRTTTotal -= roundTripTimes[roundTripTimesIndex]; // subtract oldest RTT from running total
-            roundTripTimes[roundTripTimesIndex] = rtt;              // replace oldest RTT in sample with new RTT
-            runningRTTTotal += rtt;                                 // add new RTT to running total
-            Latency = runningRTTTotal / (roundTripTimes.Length * 2);// re-calc average one-way latency
+            }
+            else
+            {
+                runningRTTTotal -= roundTripTimes[roundTripTimesIndex]; // subtract oldest RTT from running total
+                roundTripTimes[roundTripTimesIndex] = rtt;              // replace oldest RTT in sample with new RTT
+                runningRTTTotal += rtt;                                 // add new RTT to running total
+                Latency = runningRTTTotal / (roundTripTimes.Length * 2);// re-calc average one-way latency
+            }

             // increment index for next time this is called
             roundTripTimesIndex++;


Fixed tabbing in Time Entry edit view (win), closes #519

--- src/ui/windows/TogglDesktop/TogglDesktop/TimeEntryEditViewController.Designer.cs
+++ src/ui/windows/TogglDesktop/TogglDesktop/TimeEntryEditViewController.Designer.cs
@@ -62,11 +62,13 @@
             this.textBoxProjectName = new System.Windows.Forms.TextBox();
             this.labelClient = new System.Windows.Forms.Label();
             this.labelProjectName = new System.Windows.Forms.Label();
+            this.dateTagPanel = new System.Windows.Forms.Panel();
             this.statusStripLastUpdate.SuspendLayout();
             this.buttonsPanel.SuspendLayout();
             this.panelBottom.SuspendLayout();
             this.panelStartEndTime.SuspendLayout();
             this.panelAddProject.SuspendLayout();
+            this.dateTagPanel.SuspendLayout();
             this.SuspendLayout();
             //
             // label1
@@ -90,7 +92,7 @@
             this.comboBoxDescription.Location = new System.Drawing.Point(110, 10);
             this.comboBoxDescription.Name = "comboBoxDescription";
             this.comboBoxDescription.Size = new System.Drawing.Size(192, 23);
-            this.comboBoxDescription.TabIndex = 1;
+            this.comboBoxDescription.TabIndex = 0;
             this.comboBoxDescription.SelectedIndexChanged += new System.EventHandler(this.comboBoxDescription_SelectedIndexChanged);
             this.comboBoxDescription.Leave += new System.EventHandler(this.comboBoxDescription_Leave);
             //
@@ -115,7 +117,7 @@
             this.comboBoxProject.Location = new System.Drawing.Point(110, 37);
             this.comboBoxProject.Name = "comboBoxProject";
             this.comboBoxProject.Size = new System.Drawing.Size(192, 23);
-            this.comboBoxProject.TabIndex = 3;
+            this.comboBoxProject.TabIndex = 1;
             this.comboBoxProject.SelectedIndexChanged += new System.EventHandler(this.comboBoxProject_SelectedIndexChanged);
             this.comboBoxProject.Leave += new System.EventHandler(this.comboBoxProject_Leave);
             //
@@ -127,7 +129,7 @@
             this.linkAddProject.Location = new System.Drawing.Point(210, 61);
             this.linkAddProject.Name = "linkAddProject";
             this.linkAddProject.Size = new System.Drawing.Size(94, 15);
-            this.linkAddProject.TabIndex = 4;
+            this.linkAddProject.TabIndex = 2;
             this.linkAddProject.TabStop = true;
             this.linkAddProject.Text = "Add new project";
             this.linkAddProject.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkAddProject_LinkClicked);
@@ -148,7 +150,7 @@
             this.textBoxDuration.Location = new System.Drawing.Point(110, 5);
             this.textBoxDuration.Name = "textBoxDuration";
             this.textBoxDuration.Size = new System.Drawing.Size(140, 24);
-            this.textBoxDuration.TabIndex = 6;
+            this.textBoxDuration.TabIndex = 4;
             this.textBoxDuration.Leave += new System.EventHandler(this.textBoxDuration_Leave);
             //
             // label4
@@ -167,7 +169,7 @@
             this.textBoxStartTime.Location = new System.Drawing.Point(110, 5);
             this.textBoxStartTime.Name = "textBoxStartTime";
             this.textBoxStartTime.Size = new System.Drawing.Size(60, 24);
-            this.textBoxStartTime.TabIndex = 8;
+            this.textBoxStartTime.TabIndex = 6;
             this.textBoxStartTime.Leave += new System.EventHandler(this.textBoxStartTime_Leave);
             //
             // label5
@@ -185,7 +187,7 @@
             this.textBoxEndTime.Location = new System.Drawing.Point(190, 5);
             this.textBoxEndTime.Name = "textBoxEndTime";
             this.textBoxEndTime.Size = new System.Drawing.Size(60, 24);
-            this.textBoxEndTime.TabIndex = 10;
+            this.textBoxEndTime.TabIndex = 7;
             this.textBoxEndTime.Leave += new System.EventHandler(this.textBoxEndTime_Leave);
             //
             // label6
@@ -193,7 +195,7 @@
             this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("Lucida Sans Unicode", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(186)));
-            this.label6.Location = new System.Drawing.Point(17, 63);
+            this.label6.Location = new System.Drawing.Point(15, 8);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(34, 15);
             this.label6.TabIndex = 11;
@@ -203,10 +205,10 @@
             //
             this.dateTimePickerStartDate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
             this.dateTimePickerStartDate.Font = new System.Drawing.Font("Lucida Sans Unicode", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(186)));
-            this.dateTimePickerStartDate.Location = new System.Drawing.Point(110, 60);
+            this.dateTimePickerStartDate.Location = new System.Drawing.Point(110, 5);
             this.dateTimePickerStartDate.Name = "dateTimePickerStartDate";
             this.dateTimePickerStartDate.Size = new System.Drawing.Size(140, 24);
-            this.dateTimePickerStartDate.TabIndex = 12;
+            this.dateTimePickerStartDate.TabIndex = 9;
             this.dateTimePickerStartDate.Leave += new System.EventHandler(this.dateTimePickerStartDate_Leave);
             //
             // label7
@@ -214,7 +216,7 @@
             this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
             this.label7.AutoSize = true;
             this.label7.Font = new System.Drawing.Font("Lucida Sans Unicode", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(186)));
-            this.label7.Location = new System.Drawing.Point(17, 88);
+            this.label7.Location = new System.Drawing.Point(15, 38);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(36, 15);
             this.label7.TabIndex = 13;
@@ -256,7 +258,7 @@
             this.buttonContinue.Location = new System.Drawing.Point(230, 3);
             this.buttonContinue.Name = "buttonContinue";
             this.buttonContinue.Size = new System.Drawing.Size(75, 23);
-            this.buttonContinue.TabIndex = 2;
+            this.buttonContinue.TabIndex = 11;
             this.buttonContinue.Text = "Continue";
             this.buttonContinue.UseVisualStyleBackColor = true;
             this.buttonContinue.Click += new System.EventHandler(this.buttonContinue_Click);
@@ -267,7 +269,7 @@
             this.buttonDelete.Location = new System.Drawing.Point(95, 3);
             this.buttonDelete.Name = "buttonDelete";
             this.buttonDelete.Size = new System.Drawing.Size(75, 23);
-            this.buttonDelete.TabIndex = 1;
+            this.buttonDelete.TabIndex = 10;
             this.buttonDelete.Text = "Delete";
             this.buttonDelete.UseVisualStyleBackColor = true;
             this.buttonDelete.Click += new System.EventHandler(this.buttonDelete_Click);
@@ -278,7 +280,7 @@
             this.buttonDone.Location = new System.Drawing.Point(10, 3);
             this.buttonDone.Name = "buttonDone";
             this.buttonDone.Size = new System.Drawing.Size(75, 23);
-            this.buttonDone.TabIndex = 0;
+            this.buttonDone.TabIndex = 9;
             this.buttonDone.Text = "Done";
             this.buttonDone.UseVisualStyleBackColor = true;
             this.buttonDone.Click += new System.EventHandler(this.buttonDone_Click);
@@ -288,10 +290,10 @@
             this.checkBoxBillable.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
             this.checkBoxBillable.AutoSize = true;
             this.checkBoxBillable.Font = new System.Drawing.Font("Lucida Sans Unicode", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(186)));
-            this.checkBoxBillable.Location = new System.Drawing.Point(110, 155);
+            this.checkBoxBillable.Location = new System.Drawing.Point(96, 105);
             this.checkBoxBillable.Name = "checkBoxBillable";
             this.checkBoxBillable.Size = new System.Drawing.Size(63, 19);
-            this.checkBoxBillable.TabIndex = 14;
+            this.checkBoxBillable.TabIndex = 8;
             this.checkBoxBillable.Text = "Billable";
             this.checkBoxBillable.UseVisualStyleBackColor = true;
             this.checkBoxBillable.CheckedChanged += new System.EventHandler(this.checkBoxBillable_CheckedChanged);
@@ -303,10 +305,10 @@
             this.checkedListBoxTags.CheckOnClick = true;
             this.checkedListBoxTags.Font = new System.Drawing.Font("Lucida Sans Unicode", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(186)));
             this.checkedListBoxTags.FormattingEnabled = true;
-            this.checkedListBoxTags.Location = new System.Drawing.Point(110, 89);
+            this.checkedListBoxTags.Location = new System.Drawing.Point(110, 35);
             this.checkedListBoxTags.Name = "checkedListBoxTags";
             this.checkedListBoxTags.Size = new System.Drawing.Size(192, 61);
-            this.checkedListBoxTags.TabIndex = 13;
+            this.checkedListBoxTags.TabIndex = 10;
             this.checkedListBoxTags.Leave += new System.EventHandler(this.checkedListBoxTags_Leave);
             //
             // timerRunningDuration
@@ -319,18 +321,15 @@
             //
             this.panelBottom.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
             | System.Windows.Forms.AnchorStyles.Right)));
+            this.panelBottom.Controls.Add(this.dateTagPanel);
             this.panelBottom.Controls.Add(this.panelStartEndTime);
             this.panelBottom.Controls.Add(this.label3);
-            this.panelBottom.Controls.Add(this.checkedListBoxTags);
             this.panelBottom.Controls.Add(this.textBoxDuration);
-            this.panelBottom.Controls.Add(this.checkBoxBillable);
-            this.panelBottom.Controls.Add(this.label7);
-            this.panelBottom.Controls.Add(this.dateTimePickerStartDate);
-            this.panelBottom.Controls.Add(this.label6);
             this.panelBottom.Location = new System.Drawing.Point(0, 77);
             this.panelBottom.Name = "panelBottom";
-            this.panelBottom.Size = new System.Drawing.Size(317, 175);
-            this.panelBottom.TabIndex = 17;
+            this.panelBottom.Size = new System.Drawing.Size(317, 156);
+            this.panelBottom.TabIndex = 3;
+            this.panelBottom.TabStop = true;
             //
             // panelStartEndTime
             //
@@ -341,7 +340,8 @@
             this.panelStartEndTime.Location = new System.Drawing.Point(0, 26);
             this.panelStartEndTime.Name = "panelStartEndTime";
             this.panelStartEndTime.Size = new System.Drawing.Size(317, 30);
-            this.panelStartEndTime.TabIndex = 15;
+            this.panelStartEndTime.TabIndex = 5;
+            this.panelStartEndTime.TabStop = true;
             //
             // panelAddProject
             //
@@ -382,6 +382,7 @@
             this.comboBoxWorkspace.Name = "comboBoxWorkspace";
             this.comboBoxWorkspace.Size = new System.Drawing.Size(192, 23);
             this.comboBoxWorkspace.TabIndex = 5;
+            this.comboBoxWorkspace.TabStop = false;
             this.comboBoxWorkspace.Visible = false;
             //
             // comboBoxClient
@@ -394,6 +395,7 @@
             this.comboBoxClient.Name = "comboBoxClient";
             this.comboBoxClient.Size = new System.Drawing.Size(192, 23);
             this.comboBoxClient.TabIndex = 4;
+            this.comboBoxClient.TabStop = false;
             //
             // checkBoxPublic
             //
@@ -403,6 +405,7 @@
             this.checkBoxPublic.Name = "checkBoxPublic";
             this.checkBoxPublic.Size = new System.Drawing.Size(201, 19);
             this.checkBoxPublic.TabIndex = 3;
+            this.checkBoxPublic.TabStop = false;
             this.checkBoxPublic.Text = "Public (visible to the whole team)";
             this.checkBoxPublic.UseVisualStyleBackColor = true;
             //
@@ -415,6 +418,7 @@
             this.textBoxProjectName.Name = "textBoxProjectName";
             this.textBoxProjectName.Size = new System.Drawing.Size(192, 24);
             this.textBoxProjectName.TabIndex = 2;
+            this.textBoxProjectName.TabStop = false;
             //
             // labelClient
             //
@@ -436,6 +440,21 @@
             this.labelProjectName.Size = new System.Drawing.Size(80, 15);
             this.labelProjectName.TabIndex = 0;
             this.labelProjectName.Text = "Project name:";
+            //
+            // dateTagPanel
+            //
+            this.dateTagPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.dateTagPanel.Controls.Add(this.checkedListBoxTags);
+            this.dateTagPanel.Controls.Add(this.label6);
+            this.dateTagPanel.Controls.Add(this.dateTimePickerStartDate);
+            this.dateTagPanel.Controls.Add(this.label7);
+            this.dateTagPanel.Controls.Add(this.checkBoxBillable);
+            this.dateTagPanel.Location = new System.Drawing.Point(0, 56);
+            this.dateTagPanel.Name = "dateTagPanel";
+            this.dateTagPanel.Size = new System.Drawing.Size(317, 100);
+            this.dateTagPanel.TabIndex = 8;
+            this.dateTagPanel.TabStop = true;
             //
             // TimeEntryEditViewController
             //
@@ -462,6 +481,8 @@
             this.panelStartEndTime.PerformLayout();
             this.panelAddProject.ResumeLayout(false);
             this.panelAddProject.PerformLayout();
+            this.dateTagPanel.ResumeLayout(false);
+            this.dateTagPanel.PerformLayout();
             this.ResumeLayout(false);
             this.PerformLayout();

@@ -501,6 +522,7 @@
         private System.Windows.Forms.TextBox textBoxProjectName;
         private System.Windows.Forms.Label labelClient;
         private System.Windows.Forms.Label labelProjectName;
-        private System.Windows.Forms.Panel panelStartEndTime;
+        private System.Windows.Forms.Panel panelStartEndTime;
+        private System.Windows.Forms.Panel dateTagPanel;
     }
 }


ScriptEnvironment.Default laziness is redundant

--- src/Dotnet.Script.DependencyModel/Environment/ScriptEnvironment.cs
+++ src/Dotnet.Script.DependencyModel/Environment/ScriptEnvironment.cs
@@ -8,7 +8,7 @@
 {
     public class ScriptEnvironment
     {
-        private static readonly Lazy<ScriptEnvironment> _default = new Lazy<ScriptEnvironment>(() => new ScriptEnvironment());
+        public static readonly ScriptEnvironment Default = new ScriptEnvironment();

         private readonly Lazy<string> _targetFramework;

@@ -21,8 +21,6 @@
         private readonly Lazy<bool> _isWindows;

         private readonly Lazy<string> _nuGetStoreFolder;
-
-        public static ScriptEnvironment Default => _default.Value;

         private ScriptEnvironment()
         {


Removes commented out code

Removes commented out code

--- src/ExplicitlyImpl.AspNetCore.Mvc.FluentEndpoints.Core/Endpoint.cs
+++ src/ExplicitlyImpl.AspNetCore.Mvc.FluentEndpoints.Core/Endpoint.cs
@@ -128,82 +128,6 @@
         }
     }

-    //public class EndpointUsing
-    //{
-    //    public Type Type { get; set; }
-    //}
-
-    //public enum EndpointDefinitionParameterKind
-    //{
-    //    Url,
-    //    Body
-    //}
-
-    //public class EndpointDefinitionParameter
-    //{
-    //    public EndpointDefinitionParameterKind Kind { get; set; }
-
-    //    public Type Type { get; set; }
-
-    //    public string Name { get; set; }
-
-    //    public string Description { get; set; }
-
-    //    public EndpointDefinitionParameter(EndpointDefinitionParameterKind kind, Type type, string name = null, string description = null)
-    //    {
-    //        Kind = kind;
-    //        Type = type;
-    //        Name = name;
-    //        Description = description;
-    //    }
-    //}
-
-    //public class UsingEntity
-    //{
-
-    //}
-
-    //public class UsingEntity<T> : UsingEntity
-    //{
-
-    //}
-
-    //public class ServiceInjection<T> : UsingEntity<T>
-    //{
-
-    //}
-
-    //public class ModelBinder<T> : UsingEntity<T>
-    //{
-    //}
-
-    //public static class Inject
-    //{
-    //    public static ServiceInjection<T> Service<T>()
-    //    {
-    //        return new ServiceInjection<T>();
-    //    }
-    //}
-
-    //public static class Bind
-    //{
-    //    public static ModelBinder<T> UrlParameter<T>(string name = null)
-    //    {
-    //        return new ModelBinder<T>();
-    //    }
-
-    //    public static ModelBinder<T> QueryStringParameter<T>(string name)
-    //    {
-    //        return new ModelBinder<T>();
-    //    }
-
-    //    public static ModelBinder<T> BodyParameter<T>(string name = null)
-    //    {
-    //        return new ModelBinder<T>();
-    //    }
-    //}
-
-
     public class EndpointBase
     {
         public readonly EndpointDefinition EndpointDefinition;
@@ -260,21 +184,6 @@
                 Name = name
             });
         }
-
-        //public EndpointWithUsing<TU1> Using<TU1>(UsingEntity<TU1> service1)
-        //{
-        //    return new EndpointWithUsing<TU1>(EndpointDefinition);
-        //}
-
-        //public EndpointWithUsing<TU1, TU2> Using<TU1, TU2>(UsingEntity<TU1> service1, UsingEntity<TU2> service2)
-        //{
-        //    return new EndpointWithUsing<TU1, TU2>(EndpointDefinition);
-        //}
-
-        //public EndpointWithUsing<TU1, TU2, TU3> Using<TU1, TU2, TU3>(UsingEntity<TU1> service1, UsingEntity<TU2> service2, UsingEntity<TU3> service3)
-        //{
-        //    return new EndpointWithUsing<TU1, TU2, TU3>(EndpointDefinition);
-        //}
     }

     public class EndpointWithUsing<TU1> : EndpointBase
@@ -395,146 +304,4 @@
             EndpointDefinition.CurrentOrNewHandler.ReturnType = typeof(TR);
         }
     }
-
-    //public class Endpoint_2P_U<TU, TP1, TP2>
-    //{
-    //    public readonly EndpointDefinition EndpointDefinition;
-
-    //    public Endpoint_2P_U(EndpointDefinition endpointDefinition)
-    //    {
-    //        EndpointDefinition = endpointDefinition;
-    //        EndpointDefinition.HandlerType = typeof(TU);
-    //    }
-
-    //    public Endpoint_2P_U_H_A<TU, TP1, TP2, THr> HandledByAsync<THr>(Func<WebHandlerContext, TU, TP1, TP2, Task<THr>> handlerFuncAsync)
-    //    {
-    //        return new Endpoint_2P_U_H_A<TU, TP1, TP2, THr>(EndpointDefinition, handlerFuncAsync);
-    //    }
-    //}
-
-    //public class Endpoint_U_H<TU, THr>
-    //{
-    //    public readonly EndpointDefinition EndpointDefinition;
-
-    //    public Endpoint_U_H(EndpointDefinition endpointDefinition, Func<WebHandlerContext, TU, THr> handlerFunc)
-    //    {
-    //        EndpointDefinition = endpointDefinition;
-    //        EndpointDefinition.HandlerFunc = handlerFunc;
-    //        EndpointDefinition.HandlerFuncReturnType = typeof(THr);
-    //    }
-
-    //    public EndpointDefinition Returns<TR2>(Func<WebHandlerContext, THr, TR2> returnFunc) where TR2 : IActionResult
-    //    {
-    //        EndpointDefinition.ReturnType = typeof(TR2);
-    //        EndpointDefinition.ReturnFunc = returnFunc;
-
-    //        return EndpointDefinition;
-    //    }
-    //}
-
-    //public class Endpoint_U_H_A<TU, THr>
-    //{
-    //    public readonly EndpointDefinition EndpointDefinition;
-
-    //    public Endpoint_U_H_A(EndpointDefinition endpointDefinition, Func<WebHandlerContext, TU, Task<THr>> handlerFunc)
-    //    {
-    //        EndpointDefinition = endpointDefinition;
-    //        EndpointDefinition.HandlerFunc = handlerFunc;
-    //        EndpointDefinition.HandlerFuncReturnType = typeof(THr);
-    //    }
-
-    //    public Endpoint Returns<TR>(Func<WebHandlerContext, THr, TR> returnFunc) where TR : IActionResult
-    //    {
-    //        EndpointDefinition.ReturnType = typeof(TR);
-    //        EndpointDefinition.ReturnFunc = returnFunc;
-
-    //        return new Endpoint(EndpointDefinition);
-    //    }
-    //}
-
-    //public class Endpoint_U_H_1P_A<TU, TP1, THr>
-    //{
-    //    public readonly EndpointDefinition EndpointDefinition;
-
-    //    public Endpoint_U_H_1P_A(EndpointDefinition endpointDefinition, Func<WebHandlerContext, TU, TP1, Task<THr>> handlerFunc)
-    //    {
-    //        EndpointDefinition = endpointDefinition;
-    //        EndpointDefinition.HandlerFunc = handlerFunc;
-    //        EndpointDefinition.HandlerFuncReturnType = typeof(THr);
-    //    }
-
-    //    public Endpoint Returns<TR>(Func<WebHandlerContext, TP1, THr, TR> returnFunc) where TR : IActionResult
-    //    {
-    //        EndpointDefinition.ReturnType = typeof(TR);
-    //        EndpointDefinition.ReturnFunc = returnFunc;
-
-    //        return new Endpoint(EndpointDefinition);
-    //    }
-    //}
-
-    //public class Endpoint_2P_U_H_A<TU, TP1, TP2, THr>
-    //{
-    //    public readonly EndpointDefinition EndpointDefinition;
-
-    //    public Endpoint_2P_U_H_A(EndpointDefinition endpointDefinition, Func<WebHandlerContext, TU, TP1, TP2, Task<THr>> handlerFunc)
-    //    {
-    //        EndpointDefinition = endpointDefinition;
-    //        EndpointDefinition.HandlerFunc = handlerFunc;
-    //        EndpointDefinition.HandlerFuncReturnType = typeof(THr);
-    //    }
-
-    //    public Endpoint Returns<TR>(Func<WebHandlerContext, TP1, TP2, THr, TR> returnFunc) where TR : IActionResult
-    //    {
-    //        EndpointDefinition.ReturnType = typeof(TR);
-    //        EndpointDefinition.ReturnFunc = returnFunc;
-
-    //        return new Endpoint(EndpointDefinition);
-    //    }
-    //}
-
-    //public class Endpoint_1P_U_H<TU, THr, TP1>
-    //{
-    //    public readonly EndpointDefinition EndpointDefinition;
-
-    //    public Endpoint_1P_U_H(EndpointDefinition endpointDefinition, Func<WebHandlerContext, TU, TP1, THr> handlerFunc)
-    //    {
-    //        EndpointDefinition = endpointDefinition;
-    //        EndpointDefinition.HandlerFunc = handlerFunc;
-    //        EndpointDefinition.HandlerFuncReturnType = typeof(THr);
-    //    }
-
-    //    public Endpoint Returns<TR2>(Func<WebHandlerContext, TP1, THr, TR2> returnFunc) where TR2 : IActionResult
-    //    {
-    //        EndpointDefinition.ReturnType = typeof(TR2);
-    //        EndpointDefinition.ReturnFunc = returnFunc;
-
-    //        return new Endpoint(EndpointDefinition);
-    //    }
-    //}
-
-    //public class WebHandlerContext
-    //{
-    //    public IUserService Service<T>()
-    //    {
-    //        return new UserService();
-    //    }
-    //}
-
-    //public static class EndpointExtensions
-    //{
-    //    public static Endpoint ReturnsJson<TU, THr>(this Endpoint_U_H_A<TU, THr> endpoint, Func<WebHandlerContext, THr, object> transformBeforeEncoding = null)
-    //    {
-    //        return endpoint.Returns((result) => new JsonResult(transformBeforeEncoding != null ? transformBeforeEncoding.Invoke(result) : result));
-    //    }
-
-    //    public static Endpoint ReturnsJson<TU, TP1, THr>(this Endpoint_U_H_1P_A<TU, TP1, THr> endpoint, Func<WebHandlerContext, TP1, THr, object> transformBeforeEncoding = null)
-    //    {
-    //        return endpoint.Returns((p1, result) => new JsonResult(transformBeforeEncoding != null ? transformBeforeEncoding.Invoke(p1, result) : result));
-    //    }
-
-    //    public static Endpoint ReturnsJson<TU, TP1, TP2, THr>(this Endpoint_2P_U_H_A<TU, TP1, TP2, THr> endpoint, Func<WebHandlerContext, TP1, TP2, THr, object> transformBeforeEncoding = null)
-    //    {
-    //        return endpoint.Returns((p1, p2, result) => new JsonResult(transformBeforeEncoding != null ? transformBeforeEncoding.Invoke(p1, p2, result) : result));
-    //    }
-    //}
 }


make readonly.

make readonly.

--- src/Features/CSharp/Portable/UseIndexOrRangeOperator/MemberInfo.cs
+++ src/Features/CSharp/Portable/UseIndexOrRangeOperator/MemberInfo.cs
@@ -2,7 +2,7 @@

 namespace Microsoft.CodeAnalysis.CSharp.UseIndexOrRangeOperator
 {
-    internal struct MemberInfo
+    internal readonly struct MemberInfo
     {
         /// <summary>
         /// The Length/Count property on the type.  Must be public, non-static, no-parameter,


Changed polling time to 2 seconds (default value)

--- src/Jarvis.DocumentStore.JobsHost/Support/JobsHostConfiguration.cs
+++ src/Jarvis.DocumentStore.JobsHost/Support/JobsHostConfiguration.cs
@@ -23,7 +23,7 @@
 			   "true"
 		   ).ToLowerInvariant() == "true";

-			QueueJobsPollInterval = Int32.Parse(GetConfigValue("queues.jobs-poll-interval-ms", "1000"));
+			QueueJobsPollInterval = Int32.Parse(GetConfigValue("queues.jobs-poll-interval-ms", "2000"));
 		}

 		public string GetPathToLibreOffice()


LWDEV-2379: fixed body read

LWDEV-2379: fixed body read

--- src/MarginTrading.Services/Middleware/RequestsLoggingMiddleware.cs
+++ src/MarginTrading.Services/Middleware/RequestsLoggingMiddleware.cs
@@ -39,7 +39,8 @@
                     var originalRequestBody = new MemoryStream();

                     await context.Request.Body.CopyToAsync(reqBodyStream);
-                    await context.Request.Body.CopyToAsync(originalRequestBody);
+                    reqBodyStream.Seek(0, SeekOrigin.Begin);
+                    await reqBodyStream.CopyToAsync(originalRequestBody);
                     reqBodyStream.Seek(0, SeekOrigin.Begin);
                     context.Request.Body = reqBodyStream;


fix the ios avaudioplayer

fix the ios avaudioplayer


filled ReservationDto --> All Dto's has been filled


Clone method added. Changelog extracted

Clone method added. Changelog extracted

Added Clone() method to allow cloning of a whole node tree.

Extracted the changelog into a seperate Changelog.txt file

--- SimpleJSON.cs
+++ SimpleJSON.cs
@@ -8,104 +8,11 @@
  * Written by Bunny83
  * 2012-06-09
  *
- * [2012-06-09 First Version]
- * - provides strongly typed node classes and lists / dictionaries
- * - provides easy access to class members / array items / data values
- * - the parser now properly identifies types. So generating JSON with this framework should work.
- * - only double quotes (") are used for quoting strings.
- * - provides "casting" properties to easily convert to / from those types:
- *   int / float / double / bool
- * - provides a common interface for each node so no explicit casting is required.
- * - the parser tries to avoid errors, but if malformed JSON is parsed the result is more or less undefined
- * - It can serialize/deserialize a node tree into/from an experimental compact binary format. It might
- *   be handy if you want to store things in a file and don't want it to be easily modifiable
- *
- * [2012-12-17 Update]
- * - Added internal JSONLazyCreator class which simplifies the construction of a JSON tree
- *   Now you can simple reference any item that doesn't exist yet and it will return a JSONLazyCreator
- *   The class determines the required type by it's further use, creates the type and removes itself.
- * - Added binary serialization / deserialization.
- * - Added support for BZip2 zipped binary format. Requires the SharpZipLib ( http://www.icsharpcode.net/opensource/sharpziplib/ )
- *   The usage of the SharpZipLib library can be disabled by removing or commenting out the USE_SharpZipLib define at the top
- * - The serializer uses different types when it comes to store the values. Since my data values
- *   are all of type string, the serializer will "try" which format fits best. The order is: int, float, double, bool, string.
- *   It's not the most efficient way but for a moderate amount of data it should work on all platforms.
- *
- * [2017-03-08 Update]
- * - Optimised parsing by using a StringBuilder for token. This prevents performance issues when large
- *   string data fields are contained in the json data.
- * - Finally refactored the badly named JSONClass into JSONObject.
- * - Replaced the old JSONData class by distict typed classes ( JSONString, JSONNumber, JSONBool, JSONNull ) this
- *   allows to propertly convert the node tree back to json without type information loss. The actual value
- *   parsing now happens at parsing time and not when you actually access one of the casting properties.
- *
- * [2017-04-11 Update]
- * - Fixed parsing bug where empty string values have been ignored.
- * - Optimised "ToString" by using a StringBuilder internally. This should heavily improve performance for large files
- * - Changed the overload of "ToString(string aIndent)" to "ToString(int aIndent)"
- *
- * [2017-11-29 Update]
- * - Removed the IEnumerator implementations on JSONArray & JSONObject and replaced it with a common
- *   struct Enumerator in JSONNode that should avoid garbage generation. The enumerator always works
- *   on KeyValuePair<string, JSONNode>, even for JSONArray.
- * - Added two wrapper Enumerators that allows for easy key or value enumeration. A JSONNode now has
- *   a "Keys" and a "Values" enumerable property. Those are also struct enumerators / enumerables
- * - A KeyValuePair<string, JSONNode> can now be implicitly converted into a JSONNode. This allows
- *   a foreach loop over a JSONNode to directly access the values only. Since KeyValuePair as well as
- *   all the Enumerators are structs, no garbage is allocated.
- * - To add Linq support another "LinqEnumerator" is available through the "Linq" property. This
- *   enumerator does implement the generic IEnumerable interface so most Linq extensions can be used
- *   on this enumerable object. This one does allocate memory as it's a wrapper class.
- * - The Escape method now escapes all control characters (# < 32) in strings as uncode characters
- *   (\uXXXX) and if the static bool JSONNode.forceASCII is set to true it will also escape all
- *   characters # > 127. This might be useful if you require an ASCII output. Though keep in mind
- *   when your strings contain many non-ascii characters the strings become much longer (x6) and are
- *   no longer human readable.
- * - The node types JSONObject and JSONArray now have an "Inline" boolean switch which will default to
- *   false. It can be used to serialize this element inline even you serialize with an indented format
- *   This is useful for arrays containing numbers so it doesn't place every number on a new line
- * - Extracted the binary serialization code into a seperate extension file. All classes are now declared
- *   as "partial" so an extension file can even add a new virtual or abstract method / interface to
- *   JSONNode and override it in the concrete type classes. It's of course a hacky approach which is
- *   generally not recommended, but i wanted to keep everything tightly packed.
- * - Added a static CreateOrGet method to the JSONNull class. Since this class is immutable it could
- *   be reused without major problems. If you have a lot null fields in your data it will help reduce
- *   the memory / garbage overhead. I also added a static setting (reuseSameInstance) to JSONNull
- *   (default is true) which will change the behaviour of "CreateOrGet". If you set this to false
- *   CreateOrGet will not reuse the cached instance but instead create a new JSONNull instance each time.
- *   I made the JSONNull constructor private so if you need to create an instance manually use
- *   JSONNull.CreateOrGet()
- *
- * [2018-01-09 Update]
- * - Changed all double.TryParse and double.ToString uses to use the invariant culture to avoid problems
- *   on systems with a culture that uses a comma as decimal point.
- *
- * [2018-01-26 Update]
- * - Added AsLong. Note that a JSONNumber is stored as double and can't represent all long values. However
- *   storing it as string would work.
- * - Added static setting "JSONNode.longAsString" which controls the default type that is used by the
- *   LazyCreator when using AsLong
- *
- * [2018-04-25 Update]
- *  - Added support for parsing single values (JSONBool, JSONString, JSONNumber, JSONNull) as top level value.
- *
- * [2019-02-18 Update]
- *  - Added HasKey(key) and GetValueOrDefault(key, default) to the JSONNode class to provide way to read
- *    values conditionally without creating a LazyCreator
- *
- * [2019-03-25 Update]
- *  - Added static setting "allowLineComments" to the JSONNode class which is true by default. This allows
- *    "//" line comments when parsing json text as long as it's not within quoted text. All text after // up
- *    to the end of the line is completely ignored / skipped. This makes it easier to create human readable
- *    and editable files. Note that stripped comments are not read, processed or preserved in any way. So
- *    this feature is only relevant for human created files.
- *  - Explicitly strip BOM (Byte Order Mark) when parsing to avoid getting it leaked into a single primitive
- *    value. That's a rare case but better safe than sorry.
- *  - Allowing adding the empty string as key
+ * Changelog now external. See Changelog.txt
  *
  * The MIT License (MIT)
  *
- * Copyright (c) 2012-2017 Markus Göbel (Bunny83)
+ * Copyright (c) 2012-2019 Markus Göbel (Bunny83)
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -176,7 +83,8 @@
             }
             public KeyValuePair<string, JSONNode> Current
             {
-                get {
+                get
+                {
                     if (type == Type.Array)
                         return new KeyValuePair<string, JSONNode>(string.Empty, m_Array.Current);
                     else if (type == Type.Object)
@@ -301,6 +209,11 @@
             return aNode;
         }

+        public virtual JSONNode Clone()
+        {
+            return null;
+        }
+
         public virtual IEnumerable<JSONNode> Children
         {
             get
@@ -359,7 +272,7 @@
             get
             {
                 double v = 0.0;
-                if (double.TryParse(Value,NumberStyles.Float, CultureInfo.InvariantCulture, out v))
+                if (double.TryParse(Value, NumberStyles.Float, CultureInfo.InvariantCulture, out v))
                     return v;
                 return 0.0;
             }
@@ -525,7 +438,8 @@
         private static StringBuilder m_EscapeBuilder;
         internal static StringBuilder EscapeBuilder
         {
-            get {
+            get
+            {
                 if (m_EscapeBuilder == null)
                     m_EscapeBuilder = new StringBuilder();
                 return m_EscapeBuilder;
@@ -739,7 +653,7 @@
                         }
                         break;
                     case '/':
-                        if (allowLineComments && !QuoteMode && i + 1 < aJSON.Length && aJSON[i+1] == '/')
+                        if (allowLineComments && !QuoteMode && i + 1 < aJSON.Length && aJSON[i + 1] == '/')
                         {
                             while (++i < aJSON.Length && aJSON[i] != '\n' && aJSON[i] != '\r') ;
                             break;
@@ -838,6 +752,20 @@
             return aNode;
         }

+        public override JSONNode Clone()
+        {
+            var node = new JSONArray();
+            node.m_List.Capacity = m_List.Capacity;
+            foreach(var n in m_List)
+            {
+                if (n != null)
+                    node.Add(n.Clone());
+                else
+                    node.Add(null);
+            }
+            return node;
+        }
+
         public override IEnumerable<JSONNode> Children
         {
             get
@@ -979,6 +907,16 @@
             {
                 return null;
             }
+        }
+
+        public override JSONNode Clone()
+        {
+            var node = new JSONObject();
+            foreach (var n in m_Dict)
+            {
+                node.Add(n.Key, n.Value.Clone());
+            }
+            return node;
         }

         public override bool HasKey(string aKey)
@@ -1056,6 +994,10 @@
         {
             m_Data = aData;
         }
+        public override JSONNode Clone()
+        {
+            return new JSONString(m_Data);
+        }

         internal override void WriteToStringBuilder(StringBuilder aSB, int aIndent, int aIndentInc, JSONTextMode aMode)
         {
@@ -1118,6 +1060,11 @@
         public JSONNumber(string aData)
         {
             Value = aData;
+        }
+
+        public override JSONNode Clone()
+        {
+            return new JSONNumber(m_Data);
         }

         internal override void WriteToStringBuilder(StringBuilder aSB, int aIndent, int aIndentInc, JSONTextMode aMode)
@@ -1187,6 +1134,11 @@
             Value = aData;
         }

+        public override JSONNode Clone()
+        {
+            return new JSONBool(m_Data);
+        }
+
         internal override void WriteToStringBuilder(StringBuilder aSB, int aIndent, int aIndentInc, JSONTextMode aMode)
         {
             aSB.Append((m_Data) ? "true" : "false");
@@ -1231,6 +1183,11 @@
         {
             get { return false; }
             set { }
+        }
+
+        public override JSONNode Clone()
+        {
+            return CreateOrGet();
         }

         public override bool Equals(object obj)


Delete SourceLine.cs

Delete SourceLine.cs

--- SourceLine.cs
+++ SourceLine.cs
@@ -1,449 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2017 Nate Burnett <informedcitizenry@gmail.com>
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Text.RegularExpressions;
-
-namespace Asm6502.Net
-{
-    /// <summary>
-    /// SourceLine class encapsulates a single line of assembly source.
-    /// </summary>
-    public class SourceLine : IEquatable<SourceLine>, ICloneable
-    {
-        #region Exception
-
-        /// <summary>
-        /// An exception class to handle strings not properly closed in quotation marks
-        /// </summary>
-        public class QuoteNotEnclosedException : Exception
-        {
-            public override string Message
-            {
-                get
-                {
-                    return Resources.ErrorStrings.QuoteStringNotEnclosed;
-                }
-            }
-        }
-
-        #endregion
-
-        #region Members
-
-        private bool doNotAssemble_;
-
-        private bool definition_;
-
-        private bool comment_;
-
-        #endregion
-
-        #region Constructors
-
-        /// <summary>
-        /// Constructs a new SourceLine object.
-        /// </summary>
-        /// <param name="filename">The original source filename.</param>
-        /// <param name="linenumber">The original source line number.</param>
-        /// <param name="source">The unprocessed source string.</param>
-        public SourceLine(string filename, int linenumber, string source)
-        {
-            Assembly = new List<byte>();
-            Filename = filename;
-            LineNumber = linenumber;
-            Label = Instruction = Operand = Disassembly = string.Empty;
-            SourceString = source;
-        }
-
-        /// <summary>
-        /// Constructs a new SourceLine object.
-        /// </summary>
-        public SourceLine() :
-            this(string.Empty, 0, string.Empty)
-        {
-
-        }
-
-        #endregion
-
-        #region Methods
-
-        /// <summary>
-        /// Take the token and determine whether it is a label, instruction, or operand
-        /// component of the source.
-        /// </summary>
-        /// <param name="checkReserved">A callback to test if the token is a reserved word,
-        /// and thus is an instruction.</param>
-        /// <param name="checkSymbol">A callback to test if the token is a symbol,
-        /// and thus is a label.</param>
-        /// <param name="token">The token to parse.</param>
-        private void SetLineToken(Func<string, bool> checkReserved, Func<string, bool> checkSymbol, string token)
-        {
-            var trimmed = token.Trim();
-            if (string.IsNullOrEmpty(Instruction) &&
-                (checkReserved(trimmed)))
-                Instruction = trimmed;
-            else if (string.IsNullOrEmpty(Label) && string.IsNullOrEmpty(Instruction) &&
-            (checkSymbol(trimmed) || Regex.IsMatch(trimmed, @"[-\+\*]")))
-                Label = trimmed;
-            else
-                Operand += token;
-        }
-
-        /// <summary>
-        /// Parse the SourceLine's SourceString property into its component line,
-        /// instruction and operand.
-        /// </summary>
-        /// <param name="checkReserved">A callback to determine which part of the source
-        /// is the instruction.</param>
-        /// <param name="checkSymbol">A callback to determinw which part of the source
-        /// is a label.</param>
-        /// <exception cref="SourceLine.QuoteNotEnclosedException">SourceLine.QuoteNotEnclosedException</exception>
-        public void Parse(Func<string, bool> checkReserved, Func<string, bool> checkSymbol)
-        {
-            if (string.IsNullOrWhiteSpace(SourceString)) return;
-
-            bool double_enclosed = false;
-            bool single_enclosed = false;
-            StringBuilder sb = new StringBuilder();
-            string unprocessedTrim = SourceString.Trim();
-            for (int n = 0; n < unprocessedTrim.Length; n++)
-            {
-                string c = unprocessedTrim[n].ToString();
-                if (!single_enclosed && !double_enclosed && c == ";")
-                    break;
-                if (c == "\"" && !single_enclosed)
-                    double_enclosed = !double_enclosed;
-                else if (c == "'" && !double_enclosed)
-                    single_enclosed = !single_enclosed;
-
-                sb.Append(c);
-
-                if (string.IsNullOrWhiteSpace(c.ToString()) && !double_enclosed && !single_enclosed)
-                {
-                    if (string.IsNullOrEmpty(Label) ||
-                        string.IsNullOrEmpty(Instruction) ||
-                        string.IsNullOrEmpty(Operand))
-                    {
-                        SetLineToken(checkReserved, checkSymbol, sb.ToString());
-                        sb.Clear();
-                    }
-                }
-            }
-            if (single_enclosed || double_enclosed)
-            {
-                throw new QuoteNotEnclosedException();
-            }
-            SetLineToken(checkReserved, checkSymbol, sb.ToString());
-            Label = Label.TrimEnd(':');
-            Operand = Operand.Trim();
-        }
-
-        /// <summary>
-        /// Does a comma-separated-value analysis on the SourceLine's operand
-        /// and returns the individual value as a List<string>
-        /// </summary>
-        /// <returns>Returns a List<string> collection of the values.</returns>
-        public List<string> CommaSeparateOperand()
-        {
-            List<string> csv = new List<string>();
-
-            if (string.IsNullOrEmpty(Operand))
-                return csv;
-
-            bool double_enclosed = false;
-            bool single_enclosed = false;
-            bool paren_enclosed = false;
-
-            StringBuilder sb = new StringBuilder();
-
-            for (int i = 0; i < Operand.Length; i++)
-            {
-                char c = Operand[i];
-                if (double_enclosed)
-                {
-                    sb.Append(c);
-                    if (c == '"')
-                    {
-                        double_enclosed = false;
-                        if (i == Operand.Length - 1)
-                            csv.Add(sb.ToString().Trim());
-                    }
-                }
-                else if (single_enclosed)
-                {
-                    sb.Append(c);
-                    if (c == '\'')
-                    {
-                        single_enclosed = false;
-                        if (i == Operand.Length - 1)
-                            csv.Add(sb.ToString().Trim());
-                    }
-                }
-                else if (paren_enclosed)
-                {
-                    if (c == '"' && !single_enclosed)
-                    {
-                        double_enclosed = true;
-                    }
-                    else if (c == '\'' && !double_enclosed)
-                    {
-                        single_enclosed = true;
-                    }
-
-                    sb.Append(c);
-                    if (c == ')' && !double_enclosed && !single_enclosed)
-                    {
-                        paren_enclosed = false;
-                        if (i == Operand.Length - 1)
-                            csv.Add(sb.ToString().Trim());
-                    }
-                }
-                else
-                {
-                    if (c == '"')
-                    {
-                        double_enclosed = true;
-                    }
-                    else if (c == '\'')
-                    {
-                        single_enclosed = true;
-                    }
-                    else if (c == '(')
-                    {
-                        paren_enclosed = true;
-                    }
-                    else if (c == ',')
-                    {
-                        csv.Add(sb.ToString().Trim());
-                        sb.Clear();
-                        continue;
-                    }
-                    sb.Append(c);
-                    if (i == Operand.Length - 1)
-                        csv.Add(sb.ToString().Trim());
-                }
-            }
-            if (Operand.Last().Equals(','))
-                csv.Add(string.Empty);
-            return csv;
-        }
-
-        /// <summary>
-        /// Gets the scope of the SourceLine.
-        /// </summary>
-        /// <param name="excludeNormal">Exclude "Normal" scopes.</param>
-        /// <returns></returns>
-        public string GetScope(bool excludeNormal)
-        {
-            if (!excludeNormal)
-                return Scope;
-            var scope_components = Scope.Split('.').ToList();
-            if (scope_components.Count > 0 && scope_components.Last().EndsWith("@"))
-                scope_components.RemoveAt(scope_components.Count - 1);
-            return string.Join(".", scope_components);
-        }
-
-        /// <summary>
-        /// A unique identifier combination of the source's filename and line number.
-        /// </summary>
-        /// <returns>The identifier string.</returns>
-        public string SourceInfo()
-        {
-            string file = Filename;
-            if (file.Length > 14)
-                file = Filename.Substring(0, 14) + "...";
-            return string.Format("{0, -17}({1})", file, LineNumber);
-        }
-
-        #endregion
-
-        #region Override Methods
-
-        public override string ToString()
-        {
-            string source = string.Empty;
-            if (string.IsNullOrEmpty(SourceString) == false)
-                source = SourceString.Trim();
-            if (source.Length > 10)
-                source = source.Substring(0, 10);
-            return string.Format("Assemble? {0}: ${1:X}:{2} {3} {4} {5} ({6})",
-                                                      (!DoNotAssemble).ToString(),
-                                                      PC,
-                                                      Label,
-                                                      Instruction,
-                                                      Operand,
-                                                      Disassembly,
-                                                      source);
-        }
-
-        public override int GetHashCode()
-        {
-            return LineNumber.GetHashCode() + Filename.GetHashCode() + SourceString.GetHashCode();
-        }
-
-        #endregion
-
-        #region IEquatable
-
-        public bool Equals(SourceLine other)
-        {
-            return (other.LineNumber == this.LineNumber &&
-                    other.Filename == this.Filename &&
-                    other.SourceString == this.SourceString);
-        }
-
-        #endregion
-
-        #region ICloneable
-
-        public object Clone()
-        {
-            SourceLine clone = new SourceLine
-            {
-                LineNumber = this.LineNumber,
-                Filename = this.Filename,
-                Label = this.Label,
-                Operand = this.Operand,
-                Instruction = this.Instruction,
-                SourceString = this.SourceString,
-                Scope = this.Scope,
-                PC = this.PC
-            };
-            return clone;
-        }
-
-        #endregion
-
-        #region Properties
-
-        /// <summary>
-        /// Gets or sets the SourceLine's unique id number.
-        /// </summary>
-        public int Id { get; set; }
-
-        /// <summary>
-        /// Gets or sets the SourceLine's Line number in the original source file.
-        /// </summary>
-        public int LineNumber { get; set; }
-
-        /// <summary>
-        /// Gets or sets the Program Counter of the assembly at the SourceLine.
-        /// </summary>
-        public int PC { get; set; }
-
-        /// <summary>
-        /// Gets or sets the SourceLine's original source filename.
-        /// </summary>
-        public string Filename { get; set; }
-
-        /// <summary>
-        /// Gets or sets the SourceLine scope.
-        /// </summary>
-        public string Scope { get; set; }
-
-        /// <summary>
-        /// Gets or sets the individual assembled bytes.
-        /// </summary>
-        public List<byte> Assembly { get; set; }
-
-        /// <summary>
-        /// Gets or sets the original (unparsed) source string.
-        /// </summary>
-        public string SourceString { get; set; }
-
-        /// <summary>
-        /// Gets or sets the disassembled representation of the source.
-        /// </summary>
-        public string Disassembly { get; set; }
-
-        /// <summary>
-        /// Gets or sets the flag determining whether the SourceLine
-        /// instruction makes it a definition, not a regular directive.
-        /// Setting this flag also sets the flag to determine whether
-        /// the SourceLine is to be assembled. Note that if the
-        /// Comment flag is already set then setting this flag will
-        /// have no effect.
-        /// </summary>
-        public bool IsDefinition
-        {
-            get { return definition_; }
-            set
-            {
-                if (!comment_)
-                {
-                    definition_ = value;
-                    if (definition_)
-                        doNotAssemble_ = definition_;
-                }
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the flag determining whether the SourceLine
-        /// is actually part of a comment block. Setting this flag
-        /// also sets the flag to determine whether the SourceLine
-        /// is to be assembled.
-        /// </summary>
-        public bool IsComment
-        {
-            get { return comment_; }
-            set
-            {
-                comment_ = value;
-                if (comment_)
-                    doNotAssemble_ = comment_;
-            }
-        }
-
-        public bool DoNotAssemble
-        {
-            get { return doNotAssemble_; }
-            set
-            {
-                if (!IsDefinition && !IsComment)
-                    doNotAssemble_ = value;
-            }
-        }
-
-        /// <summary>
-        /// The SourceLine's label/symbol. This can be determined using the Parse method.
-        /// </summary>
-        public string Label { get; set; }
-
-        /// <summary>
-        /// The SourceLine's instruction. This can be determined using the Parse method.
-        /// </summary>
-        public string Instruction { get; set; }
-
-        /// <summary>
-        /// The SourceLine's operand. This can be determined using the Parse method.
-        /// </summary>
-        public string Operand { get; set; }
-
-        #endregion
-    }
-}


Trim null chars at the end of section name. (#11)

Ensure that proper encoding is used.

--- SymbolSort.cs
+++ SymbolSort.cs
@@ -111,7 +111,7 @@
     {
         [FieldOffset(0)]
         [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
-        public char[] ShortName;
+        public byte[] ShortName;
         [FieldOffset(8)]
         public UInt32 VirtualSize;
         [FieldOffset(12)]
@@ -131,7 +131,7 @@
         [FieldOffset(36)]
         public DataSectionFlags Characteristics;

-        public string Name { get { return new string(ShortName); } }
+        public string Name => Encoding.UTF8.GetString(ShortName).TrimEnd('\0');
     }

     // This class is a specialization of IDiaEnumDebugStreamData.


cleanup

cleanup

--- WurmApi/WurmApi/Utility/RepeatableThreadedOperation.cs
+++ WurmApi/WurmApi/Utility/RepeatableThreadedOperation.cs
@@ -41,7 +41,6 @@
                     autoResetEvent.WaitOne();
                     if (exit)
                     {
-                        Trace.WriteLine("exiting");
                         break;
                     }
                     try


Small fix.

Small fix.


Arrumei bug da path finding

Arrumei bug da path finding


Remove double set of address field.

Remove double set of address field.