Added GetVisibleLocation for Greenshot [release]

--- src/Dapplo.Windows/Desktop/InteropWindowExtensions.cs
+++ src/Dapplo.Windows/Desktop/InteropWindowExtensions.cs
@@ -39,6 +39,7 @@
 using Dapplo.Windows.User32.Enums;
 using Dapplo.Windows.User32.Structs;
 using System.Drawing.Imaging;
+using System.Linq;
 using Dapplo.Log;
 using Dapplo.Windows.Extensions;

@@ -599,6 +600,56 @@
             User32Api.SetWindowPos(interopWindow.Handle, IntPtr.Zero, location.X, location.Y, 0, 0, WindowPos.SWP_NOSIZE | WindowPos.SWP_SHOWWINDOW | WindowPos.SWP_NOACTIVATE | WindowPos.SWP_NOZORDER);
             interopWindow.Info = null;
             return interopWindow;
+        }
+
+        /// <summary>
+        ///     Get a location where this window would be visible
+        ///     * if none is found return false, formLocation = the original location
+        ///     * if something is found, return true and formLocation = new location
+        /// </summary>
+        /// <param name="interopWindow">IInteropWindow, the window to find a location for</param>
+        /// <param name="formLocation">NativePoint with the location where the window will fit</param>
+        /// <returns>true if a location if found, and the formLocation is also set</returns>
+        public static bool GetVisibleLocation(this IInteropWindow interopWindow, out NativePoint formLocation)
+        {
+            bool doesWindowFit = false;
+            var windowRectangle = interopWindow.GetInfo().Bounds;
+            // assume own location
+            formLocation = windowRectangle.Location;
+            var primaryDisplay = User32Api.AllDisplays().First(x => x.IsPrimary);
+            using (var workingArea = new Region(primaryDisplay.Bounds))
+            {
+                // Create a region with the screens working area
+                foreach (var display in User32Api.AllDisplays())
+                {
+                    if (!display.IsPrimary)
+                    {
+                        workingArea.Union(display.Bounds);
+                    }
+                }
+
+                // If the formLocation is not inside the visible area
+                if (!workingArea.AreRectangleCornersVisisble(windowRectangle))
+                {
+                    // If none found we find the biggest screen
+                    foreach (var display in User32Api.AllDisplays())
+                    {
+                        var newWindowRectangle = new Rectangle(display.WorkingArea.Location, windowRectangle.Size);
+                        if (!workingArea.AreRectangleCornersVisisble(newWindowRectangle))
+                        {
+                            continue;
+                        }
+                        formLocation = display.Bounds.Location;
+                        doesWindowFit = true;
+                        break;
+                    }
+                }
+                else
+                {
+                    doesWindowFit = true;
+                }
+            }
+            return doesWindowFit;
         }

         /// <summary>
@@ -663,6 +714,5 @@
                 printWindowBitmap.Dispose();
             }
         }
-
     }
 }


Add IDependencyMap injection for public properties

--- src/Discord.Net.Commands/Utilities/ReflectionUtils.cs
+++ src/Discord.Net.Commands/Utilities/ReflectionUtils.cs
@@ -19,6 +19,7 @@

             var constructor = constructors[0];
             System.Reflection.ParameterInfo[] parameters = constructor.GetParameters();
+            System.Reflection.PropertyInfo[] properties = typeInfo.DeclaredProperties.Where(p => p.CanWrite).ToArray();

             return (map) =>
             {
@@ -40,15 +41,33 @@
                     args[i] = arg;
                 }

+                T obj;
                 try
                 {
-                    return (T)constructor.Invoke(args);
+                    obj = (T)constructor.Invoke(args);
                 }
                 catch (Exception ex)
                 {
                     throw new Exception($"Failed to create \"{typeInfo.FullName}\"", ex);
                 }
+
+                foreach(var property in properties)
+                {
+                    object prop;
+                    if (map == null || !map.TryGet(property.PropertyType, out prop))
+                    {
+                        if (property.PropertyType == typeof(CommandService))
+                            prop = service;
+                        else if (property.PropertyType == typeof(IDependencyMap))
+                            prop = map;
+                        else
+                            throw new InvalidOperationException($"Failed to create \"{typeInfo.FullName}\", dependency \"{property.PropertyType.Name}\" was not found.");
+                    }
+                    property.SetValue(prop, null);
+                }
+                return obj;
             };
         }
+
     }
 }


support multiple topic subscribe.

support multiple topic subscribe.

--- src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs
+++ src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
@@ -51,6 +52,16 @@
             _channel.QueueDeclare(_queueName, exclusive: false);
         }

+        public void Subscribe(IEnumerable<string> topics)
+        {
+            if (topics == null) throw new ArgumentNullException(nameof(topics));
+
+            foreach (var topic in topics)
+            {
+                _channel.QueueBind(_queueName, _exchageName, topic);
+            }
+        }
+
         public void Listening(TimeSpan timeout, CancellationToken cancellationToken)
         {
             var consumer = new EventingBasicConsumer(_channel);
@@ -61,16 +72,6 @@
             {
                 Task.Delay(timeout, cancellationToken).GetAwaiter().GetResult();
             }
-        }
-
-        public void Subscribe(string topic)
-        {
-            _channel.QueueBind(_queueName, _exchageName, topic);
-        }
-
-        public void Subscribe(string topic, int partition)
-        {
-            _channel.QueueBind(_queueName, _exchageName, topic);
         }

         public void Commit()


Fixes index rebuild flow

Fixes index rebuild flow

--- src/Elders.Cronus/EventStore/Index/EventStoreIndex.cs
+++ src/Elders.Cronus/EventStore/Index/EventStoreIndex.cs
@@ -27,19 +27,7 @@
         {
             if (Prepare())
             {
-                while (true)
-                {
-                    var records = indexRecords();
-                    if (records.Any())
-                    {
-                        indexStore.Apend(records);
-                    }
-                    else
-                    {
-                        break;
-                    }
-                }
-
+                indexStore.Apend(indexRecords());
                 Complete();
             }

@@ -48,11 +36,11 @@

         bool Prepare()
         {
-            if (IsBuilding())
+            if (CanBuild())
             {
                 lock (rebuildSync)
                 {
-                    if (IsBuilding())
+                    if (CanBuild())
                     {
                         indexStatus.Save(StateId, IndexStatus.Building);
                         isBuilding = true;
@@ -73,9 +61,9 @@
             return true;
         }

-        bool IsBuilding()
+        bool CanBuild()
         {
-            return isBuilding = isBuilding || indexStatus.Get(StateId).IsBuilding();
+            return isBuilding == false || indexStatus.Get(StateId).IsNotBuilding();
         }

         void Complete()


Adds the ability to override how ProjectionVersions are loaded

--- src/Elders.Cronus/Projections/ProjectionRepository.cs
+++ src/Elders.Cronus/Projections/ProjectionRepository.cs
@@ -177,7 +177,7 @@
             return new ReadResult<IProjectionDefinition>(stream.RestoreFromHistory(projectionType));
         }

-        ProjectionVersions GetProjectionVersions(string projectionName)
+        protected virtual ProjectionVersions GetProjectionVersions(string projectionName)
         {
             if (string.IsNullOrEmpty(projectionName)) throw new ArgumentNullException(nameof(projectionName));


Fix FileOutputWriterTests on non-Windows platforms

All tests would fail because paths are made of / instead of \ on Linux and macOS.

Also the "Confiruation" typo was fixed.

--- XmlSchemaClassGenerator.Tests/FileOutputWriterTests.cs
+++ XmlSchemaClassGenerator.Tests/FileOutputWriterTests.cs
@@ -43,7 +43,8 @@
         [UseCulture("en-US")]
         public void TestDefaultProviderGeneratorPrefix()
         {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "DefaultProviderGeneratorPrefix"));
+            var directory = Path.Combine("output", "FileOutputWriterTests", "DefaultProviderGeneratorPrefix");
+            var outputWriter = new FileWatcherOutputWriter(directory);

             Compiler.Generate(
                 "DefaultProviderGeneratorPrefix",
@@ -57,7 +58,7 @@

             SharedTestFunctions.TestSamples(_output, "DefaultProviderGeneratorPrefix", PrefixPattern);
             Assert.Single(outputWriter.Files);
-            Assert.Equal(@"output\FileOutputWriterTests\DefaultProviderGeneratorPrefix\Generator.Prefix.cs", outputWriter.Files.First());
+            Assert.Equal(Path.Combine(directory, "Generator.Prefix.cs"), outputWriter.Files.First());
         }

         [Fact]
@@ -65,7 +66,8 @@
         [UseCulture("en-US")]
         public void TestEmptyKeyProvider()
         {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "EmptyKeyProvider"));
+            var directory = Path.Combine("output", "FileOutputWriterTests", "EmptyKeyProvider");
+            var outputWriter = new FileWatcherOutputWriter(directory);

             Compiler.Generate(
                 "EmptyKeyProvider",
@@ -82,7 +84,7 @@

             SharedTestFunctions.TestSamples(_output, "EmptyKeyProvider", PrefixPattern);
             Assert.Single(outputWriter.Files);
-            Assert.Equal(@"output\FileOutputWriterTests\EmptyKeyProvider\NamedNamespace.cs", outputWriter.Files.First());
+            Assert.Equal(Path.Combine(directory, "NamedNamespace.cs"), outputWriter.Files.First());
         }

         [Fact]
@@ -90,7 +92,8 @@
         [UseCulture("en-US")]
         public void TestEmptyKeyProviderGeneratorPrefix()
         {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "EmptyKeyProviderGeneratorPrefix"));
+            var directory = Path.Combine("output", "FileOutputWriterTests", "EmptyKeyProviderGeneratorPrefix");
+            var outputWriter = new FileWatcherOutputWriter(directory);

             Compiler.Generate(
                 "EmptyKeyProviderGeneratorPrefix",
@@ -108,32 +111,33 @@

             SharedTestFunctions.TestSamples(_output, "EmptyKeyProviderGeneratorPrefix", PrefixPattern);
             Assert.Single(outputWriter.Files);
-            Assert.Equal(@"output\FileOutputWriterTests\EmptyKeyProviderGeneratorPrefix\NamedNamespace.cs", outputWriter.Files.First());
-        }
-
-        [Fact]
-        [TestPriority(1)]
-        [UseCulture("en-US")]
-        public void TestEmptyKeyProviderGeneratorConfiruationPrefix()
-        {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "EmptyKeyProviderGeneratorConfiruationPrefix"));
-
-            Compiler.Generate(
-                "EmptyKeyProviderGeneratorConfiruationPrefix",
-                PrefixPattern,
-                new Generator
-                {
-                    OutputWriter = outputWriter,
-                    EnableDataBinding = true,
-                    NamespaceProvider = new Dictionary<NamespaceKey, string>
-                    {
-                        { new NamespaceKey(String.Empty), "NamedNamespace" },
-                    }.ToNamespaceProvider(new GeneratorConfiguration { NamespacePrefix = "GeneratorConfiguration.Prefix" }.NamespaceProvider.GenerateNamespace),
-                });
-
-            SharedTestFunctions.TestSamples(_output, "EmptyKeyProviderGeneratorConfiruationPrefix", PrefixPattern);
-            Assert.Single(outputWriter.Files);
-            Assert.Equal(@"output\FileOutputWriterTests\EmptyKeyProviderGeneratorConfiruationPrefix\NamedNamespace.cs", outputWriter.Files.First());
+            Assert.Equal(Path.Combine(directory, "NamedNamespace.cs"), outputWriter.Files.First());
+        }
+
+        [Fact]
+        [TestPriority(1)]
+        [UseCulture("en-US")]
+        public void TestEmptyKeyProviderGeneratorConfigurationPrefix()
+        {
+            var directory = Path.Combine("output", "FileOutputWriterTests", "EmptyKeyProviderGeneratorConfigurationPrefix");
+            var outputWriter = new FileWatcherOutputWriter(directory);
+
+            Compiler.Generate(
+                "EmptyKeyProviderGeneratorConfigurationPrefix",
+                PrefixPattern,
+                new Generator
+                {
+                    OutputWriter = outputWriter,
+                    EnableDataBinding = true,
+                    NamespaceProvider = new Dictionary<NamespaceKey, string>
+                    {
+                        { new NamespaceKey(String.Empty), "NamedNamespace" },
+                    }.ToNamespaceProvider(new GeneratorConfiguration { NamespacePrefix = "GeneratorConfiguration.Prefix" }.NamespaceProvider.GenerateNamespace),
+                });
+
+            SharedTestFunctions.TestSamples(_output, "EmptyKeyProviderGeneratorConfigurationPrefix", PrefixPattern);
+            Assert.Single(outputWriter.Files);
+            Assert.Equal(Path.Combine(directory, "NamedNamespace.cs"), outputWriter.Files.First());
         }

         [Fact]
@@ -141,7 +145,8 @@
         [UseCulture("en-US")]
         public void TestEmptyKeyProviderBothPrefixes()
         {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "EmptyKeyProviderBothPrefixes"));
+            var directory = Path.Combine("output", "FileOutputWriterTests", "EmptyKeyProviderBothPrefixes");
+            var outputWriter = new FileWatcherOutputWriter(directory);

             Compiler.Generate(
                 "EmptyKeyProviderBothPrefixes",
@@ -159,7 +164,7 @@

             SharedTestFunctions.TestSamples(_output, "EmptyKeyProviderBothPrefixes", PrefixPattern);
             Assert.Single(outputWriter.Files);
-            Assert.Equal(@"output\FileOutputWriterTests\EmptyKeyProviderBothPrefixes\NamedNamespace.cs", outputWriter.Files.First());
+            Assert.Equal(Path.Combine(directory, "NamedNamespace.cs"), outputWriter.Files.First());
         }

         [Fact]
@@ -167,7 +172,8 @@
         [UseCulture("en-US")]
         public void TestFullKeyProvider()
         {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "FullKeyProvider"));
+            var directory = Path.Combine("output", "FileOutputWriterTests", "FullKeyProvider");
+            var outputWriter = new FileWatcherOutputWriter(directory);

             Compiler.Generate(
                 "FullKeyProvider",
@@ -184,7 +190,7 @@

             SharedTestFunctions.TestSamples(_output, "FullKeyProvider", PrefixPattern);
             Assert.Single(outputWriter.Files);
-            Assert.Equal(@"output\FileOutputWriterTests\FullKeyProvider\NamedNamespace.cs", outputWriter.Files.First());
+            Assert.Equal(Path.Combine(directory, "NamedNamespace.cs"), outputWriter.Files.First());
         }

         [Fact]
@@ -192,7 +198,8 @@
         [UseCulture("en-US")]
         public void TestFullKeyProviderGeneratorPrefix()
         {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "FullKeyProviderGeneratorPrefix"));
+            var directory = Path.Combine("output", "FileOutputWriterTests", "FullKeyProviderGeneratorPrefix");
+            var outputWriter = new FileWatcherOutputWriter(directory);

             Compiler.Generate(
                 "FullKeyProviderGeneratorPrefix",
@@ -210,32 +217,33 @@

             SharedTestFunctions.TestSamples(_output, "FullKeyProviderGeneratorPrefix", PrefixPattern);
             Assert.Single(outputWriter.Files);
-            Assert.Equal(@"output\FileOutputWriterTests\FullKeyProviderGeneratorPrefix\NamedNamespace.cs", outputWriter.Files.First());
-        }
-
-        [Fact]
-        [TestPriority(1)]
-        [UseCulture("en-US")]
-        public void TestFullKeyProviderGeneratorConfiruationPrefix()
-        {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "FullKeyProviderGeneratorConfiruationPrefix"));
-
-            Compiler.Generate(
-                "FullKeyProviderGeneratorConfiruationPrefix",
-                PrefixPattern,
-                new Generator
-                {
-                    OutputWriter = outputWriter,
-                    EnableDataBinding = true,
-                    NamespaceProvider = new Dictionary<NamespaceKey, string>
-                    {
-                        { new NamespaceKey("http://tempuri.org/PurchaseOrderSchema.xsd"), "NamedNamespace" },
-                    }.ToNamespaceProvider(new GeneratorConfiguration { NamespacePrefix = "GeneratorConfiguration.Prefix" }.NamespaceProvider.GenerateNamespace),
-                });
-
-            SharedTestFunctions.TestSamples(_output, "FullKeyProviderGeneratorConfiruationPrefix", PrefixPattern);
-            Assert.Single(outputWriter.Files);
-            Assert.Equal(@"output\FileOutputWriterTests\FullKeyProviderGeneratorConfiruationPrefix\NamedNamespace.cs", outputWriter.Files.First());
+            Assert.Equal(Path.Combine(directory, "NamedNamespace.cs"), outputWriter.Files.First());
+        }
+
+        [Fact]
+        [TestPriority(1)]
+        [UseCulture("en-US")]
+        public void TestFullKeyProviderGeneratorConfigurationPrefix()
+        {
+            var directory = Path.Combine("output", "FileOutputWriterTests", "FullKeyProviderGeneratorConfigurationPrefix");
+            var outputWriter = new FileWatcherOutputWriter(directory);
+
+            Compiler.Generate(
+                "FullKeyProviderGeneratorConfigurationPrefix",
+                PrefixPattern,
+                new Generator
+                {
+                    OutputWriter = outputWriter,
+                    EnableDataBinding = true,
+                    NamespaceProvider = new Dictionary<NamespaceKey, string>
+                    {
+                        { new NamespaceKey("http://tempuri.org/PurchaseOrderSchema.xsd"), "NamedNamespace" },
+                    }.ToNamespaceProvider(new GeneratorConfiguration { NamespacePrefix = "GeneratorConfiguration.Prefix" }.NamespaceProvider.GenerateNamespace),
+                });
+
+            SharedTestFunctions.TestSamples(_output, "FullKeyProviderGeneratorConfigurationPrefix", PrefixPattern);
+            Assert.Single(outputWriter.Files);
+            Assert.Equal(Path.Combine(directory, "NamedNamespace.cs"), outputWriter.Files.First());
         }

         [Fact]
@@ -243,7 +251,8 @@
         [UseCulture("en-US")]
         public void TestFullKeyProviderBothPrefixes()
         {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "FullKeyProviderBothPrefixes"));
+            var directory = Path.Combine("output", "FileOutputWriterTests", "FullKeyProviderBothPrefixes");
+            var outputWriter = new FileWatcherOutputWriter(directory);

             Compiler.Generate(
                 "FullKeyProviderBothPrefixes",
@@ -261,7 +270,7 @@

             SharedTestFunctions.TestSamples(_output, "FullKeyProviderBothPrefixes", PrefixPattern);
             Assert.Single(outputWriter.Files);
-            Assert.Equal(@"output\FileOutputWriterTests\FullKeyProviderBothPrefixes\NamedNamespace.cs", outputWriter.Files.First());
+            Assert.Equal(Path.Combine(directory, "NamedNamespace.cs"), outputWriter.Files.First());
         }

         [Fact]
@@ -269,7 +278,8 @@
         [UseCulture("en-US")]
         public void TestSeparateDefaultProvider_ThrowsArgumentException()
         {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "SeparateDefaultProvider"));
+            var directory = Path.Combine("output", "FileOutputWriterTests", "SeparateDefaultProvider");
+            var outputWriter = new FileWatcherOutputWriter(directory);

             void Action() => Compiler.Generate(
                 "SeparateDefaultProvider",
@@ -290,7 +300,8 @@
         [UseCulture("en-US")]
         public void TestSeparateDefaultProviderGeneratorPrefix()
         {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "SeparateDefaultProviderGeneratorPrefix"));
+            var directory = Path.Combine("output", "FileOutputWriterTests", "SeparateDefaultProviderGeneratorPrefix");
+            var outputWriter = new FileWatcherOutputWriter(directory);

             Compiler.Generate(
                 "SeparateDefaultProviderGeneratorPrefix",
@@ -305,7 +316,7 @@

             SharedTestFunctions.TestSamples(_output, "SeparateDefaultProviderGeneratorPrefix", PrefixPattern);
             Assert.Equal(2, outputWriter.Files.Count());
-            Assert.Equal(@"output\FileOutputWriterTests\SeparateDefaultProviderGeneratorPrefix\Generator.Prefix\PurchaseOrderType.cs", outputWriter.Files.First());
+            Assert.Equal(Path.Combine(directory, "Generator.Prefix", "PurchaseOrderType.cs"), outputWriter.Files.First());
         }

         [Fact]
@@ -313,7 +324,8 @@
         [UseCulture("en-US")]
         public void TestSeparateEmptyKeyProvider()
         {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "SeparateEmptyKeyProvider"));
+            var directory = Path.Combine("output", "FileOutputWriterTests", "SeparateEmptyKeyProvider");
+            var outputWriter = new FileWatcherOutputWriter(directory);

             Compiler.Generate(
                 "SeparateEmptyKeyProvider",
@@ -331,7 +343,7 @@

             SharedTestFunctions.TestSamples(_output, "SeparateEmptyKeyProvider", PrefixPattern);
             Assert.Equal(2, outputWriter.Files.Count());
-            Assert.Equal(@"output\FileOutputWriterTests\SeparateEmptyKeyProvider\NamedNamespace\PurchaseOrderType.cs", outputWriter.Files.First());
+            Assert.Equal(Path.Combine(directory, "NamedNamespace", "PurchaseOrderType.cs"), outputWriter.Files.First());
         }

         [Fact]
@@ -339,7 +351,8 @@
         [UseCulture("en-US")]
         public void TestSeparateEmptyKeyProviderGeneratorPrefix()
         {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "SeparateEmptyKeyProviderGeneratorPrefix"));
+            var directory = Path.Combine("output", "FileOutputWriterTests", "SeparateEmptyKeyProviderGeneratorPrefix");
+            var outputWriter = new FileWatcherOutputWriter(directory);

             Compiler.Generate(
                 "SeparateEmptyKeyProviderGeneratorPrefix",
@@ -358,33 +371,34 @@

             SharedTestFunctions.TestSamples(_output, "SeparateEmptyKeyProviderGeneratorPrefix", PrefixPattern);
             Assert.Equal(2, outputWriter.Files.Count());
-            Assert.Equal(@"output\FileOutputWriterTests\SeparateEmptyKeyProviderGeneratorPrefix\NamedNamespace\PurchaseOrderType.cs", outputWriter.Files.First());
-        }
-
-        [Fact]
-        [TestPriority(1)]
-        [UseCulture("en-US")]
-        public void TestSeparateEmptyKeyProviderGeneratorConfiruationPrefix()
-        {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "SeparateEmptyKeyProviderGeneratorConfiruationPrefix"));
-
-            Compiler.Generate(
-                "SeparateEmptyKeyProviderGeneratorConfiruationPrefix",
-                PrefixPattern,
-                new Generator
-                {
-                    OutputWriter = outputWriter,
-                    EnableDataBinding = true,
-                    SeparateClasses = true,
-                    NamespaceProvider = new Dictionary<NamespaceKey, string>
-                    {
-                        { new NamespaceKey(String.Empty), "NamedNamespace" },
-                    }.ToNamespaceProvider(new GeneratorConfiguration { NamespacePrefix = "GeneratorConfiguration.Prefix" }.NamespaceProvider.GenerateNamespace),
-                });
-
-            SharedTestFunctions.TestSamples(_output, "SeparateEmptyKeyProviderGeneratorConfiruationPrefix", PrefixPattern);
-            Assert.Equal(2, outputWriter.Files.Count());
-            Assert.Equal(@"output\FileOutputWriterTests\SeparateEmptyKeyProviderGeneratorConfiruationPrefix\NamedNamespace\PurchaseOrderType.cs", outputWriter.Files.First());
+            Assert.Equal(Path.Combine(directory, "NamedNamespace", "PurchaseOrderType.cs"), outputWriter.Files.First());
+        }
+
+        [Fact]
+        [TestPriority(1)]
+        [UseCulture("en-US")]
+        public void TestSeparateEmptyKeyProviderGeneratorConfigurationPrefix()
+        {
+            var directory = Path.Combine("output", "FileOutputWriterTests", "SeparateEmptyKeyProviderGeneratorConfigurationPrefix");
+            var outputWriter = new FileWatcherOutputWriter(directory);
+
+            Compiler.Generate(
+                "SeparateEmptyKeyProviderGeneratorConfigurationPrefix",
+                PrefixPattern,
+                new Generator
+                {
+                    OutputWriter = outputWriter,
+                    EnableDataBinding = true,
+                    SeparateClasses = true,
+                    NamespaceProvider = new Dictionary<NamespaceKey, string>
+                    {
+                        { new NamespaceKey(String.Empty), "NamedNamespace" },
+                    }.ToNamespaceProvider(new GeneratorConfiguration { NamespacePrefix = "GeneratorConfiguration.Prefix" }.NamespaceProvider.GenerateNamespace),
+                });
+
+            SharedTestFunctions.TestSamples(_output, "SeparateEmptyKeyProviderGeneratorConfigurationPrefix", PrefixPattern);
+            Assert.Equal(2, outputWriter.Files.Count());
+            Assert.Equal(Path.Combine(directory, "NamedNamespace", "PurchaseOrderType.cs"), outputWriter.Files.First());
         }

         [Fact]
@@ -392,7 +406,8 @@
         [UseCulture("en-US")]
         public void TestSeparateEmptyKeyProviderBothPrefixes()
         {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "SeparateEmptyKeyProviderBothPrefixes"));
+            var directory = Path.Combine("output", "FileOutputWriterTests", "SeparateEmptyKeyProviderBothPrefixes");
+            var outputWriter = new FileWatcherOutputWriter(directory);

             Compiler.Generate(
                 "SeparateEmptyKeyProviderBothPrefixes",
@@ -411,7 +426,7 @@

             SharedTestFunctions.TestSamples(_output, "SeparateEmptyKeyProviderBothPrefixes", PrefixPattern);
             Assert.Equal(2, outputWriter.Files.Count());
-            Assert.Equal(@"output\FileOutputWriterTests\SeparateEmptyKeyProviderBothPrefixes\NamedNamespace\PurchaseOrderType.cs", outputWriter.Files.First());
+            Assert.Equal(Path.Combine(directory, "NamedNamespace", "PurchaseOrderType.cs"), outputWriter.Files.First());
         }

         [Fact]
@@ -419,7 +434,8 @@
         [UseCulture("en-US")]
         public void TestSeparateFullKeyProvider()
         {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "SeparateFullKeyProvider"));
+            var directory = Path.Combine("output", "FileOutputWriterTests", "SeparateFullKeyProvider");
+            var outputWriter = new FileWatcherOutputWriter(directory);

             Compiler.Generate(
                 "SeparateFullKeyProvider",
@@ -437,7 +453,7 @@

             SharedTestFunctions.TestSamples(_output, "SeparateFullKeyProvider", PrefixPattern);
             Assert.Equal(2, outputWriter.Files.Count());
-            Assert.Equal(@"output\FileOutputWriterTests\SeparateFullKeyProvider\NamedNamespace\PurchaseOrderType.cs", outputWriter.Files.First());
+            Assert.Equal(Path.Combine(directory, "NamedNamespace", "PurchaseOrderType.cs"), outputWriter.Files.First());
         }

         [Fact]
@@ -445,7 +461,8 @@
         [UseCulture("en-US")]
         public void TestSeparateFullKeyProviderGeneratorPrefix()
         {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "SeparateFullKeyProviderGeneratorPrefix"));
+            var directory = Path.Combine("output", "FileOutputWriterTests", "SeparateFullKeyProviderGeneratorPrefix");
+            var outputWriter = new FileWatcherOutputWriter(directory);

             Compiler.Generate(
                 "SeparateFullKeyProviderGeneratorPrefix",
@@ -464,33 +481,34 @@

             SharedTestFunctions.TestSamples(_output, "SeparateFullKeyProviderGeneratorPrefix", PrefixPattern);
             Assert.Equal(2, outputWriter.Files.Count());
-            Assert.Equal(@"output\FileOutputWriterTests\SeparateFullKeyProviderGeneratorPrefix\NamedNamespace\PurchaseOrderType.cs", outputWriter.Files.First());
-        }
-
-        [Fact]
-        [TestPriority(1)]
-        [UseCulture("en-US")]
-        public void TestSeparateFullKeyProviderGeneratorConfiruationPrefix()
-        {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "SeparateFullKeyProviderGeneratorConfiruationPrefix"));
-
-            Compiler.Generate(
-                "SeparateFullKeyProviderGeneratorConfiruationPrefix",
-                PrefixPattern,
-                new Generator
-                {
-                    OutputWriter = outputWriter,
-                    EnableDataBinding = true,
-                    SeparateClasses = true,
-                    NamespaceProvider = new Dictionary<NamespaceKey, string>
-                    {
-                        { new NamespaceKey("http://tempuri.org/PurchaseOrderSchema.xsd"), "NamedNamespace" },
-                    }.ToNamespaceProvider(new GeneratorConfiguration { NamespacePrefix = "GeneratorConfiguration.Prefix" }.NamespaceProvider.GenerateNamespace),
-                });
-
-            SharedTestFunctions.TestSamples(_output, "SeparateFullKeyProviderGeneratorConfiruationPrefix", PrefixPattern);
-            Assert.Equal(2, outputWriter.Files.Count());
-            Assert.Equal(@"output\FileOutputWriterTests\SeparateFullKeyProviderGeneratorConfiruationPrefix\NamedNamespace\PurchaseOrderType.cs", outputWriter.Files.First());
+            Assert.Equal(Path.Combine(directory, "NamedNamespace", "PurchaseOrderType.cs"), outputWriter.Files.First());
+        }
+
+        [Fact]
+        [TestPriority(1)]
+        [UseCulture("en-US")]
+        public void TestSeparateFullKeyProviderGeneratorConfigurationPrefix()
+        {
+            var directory = Path.Combine("output", "FileOutputWriterTests", "SeparateFullKeyProviderGeneratorConfigurationPrefix");
+            var outputWriter = new FileWatcherOutputWriter(directory);
+
+            Compiler.Generate(
+                "SeparateFullKeyProviderGeneratorConfigurationPrefix",
+                PrefixPattern,
+                new Generator
+                {
+                    OutputWriter = outputWriter,
+                    EnableDataBinding = true,
+                    SeparateClasses = true,
+                    NamespaceProvider = new Dictionary<NamespaceKey, string>
+                    {
+                        { new NamespaceKey("http://tempuri.org/PurchaseOrderSchema.xsd"), "NamedNamespace" },
+                    }.ToNamespaceProvider(new GeneratorConfiguration { NamespacePrefix = "GeneratorConfiguration.Prefix" }.NamespaceProvider.GenerateNamespace),
+                });
+
+            SharedTestFunctions.TestSamples(_output, "SeparateFullKeyProviderGeneratorConfigurationPrefix", PrefixPattern);
+            Assert.Equal(2, outputWriter.Files.Count());
+            Assert.Equal(Path.Combine(directory, "NamedNamespace", "PurchaseOrderType.cs"), outputWriter.Files.First());
         }

         [Fact]
@@ -498,7 +516,8 @@
         [UseCulture("en-US")]
         public void TestSeparateFullKeyProviderBothPrefixes()
         {
-            var outputWriter = new FileWatcherOutputWriter(Path.Combine("output", "FileOutputWriterTests", "SeparateFullKeyProviderBothPrefixes"));
+            var directory = Path.Combine("output", "FileOutputWriterTests", "SeparateFullKeyProviderBothPrefixes");
+            var outputWriter = new FileWatcherOutputWriter(directory);

             Compiler.Generate(
                 "SeparateFullKeyProviderBothPrefixes",
@@ -517,7 +536,7 @@

             SharedTestFunctions.TestSamples(_output, "SeparateFullKeyProviderBothPrefixes", PrefixPattern);
             Assert.Equal(2, outputWriter.Files.Count());
-            Assert.Equal(@"output\FileOutputWriterTests\SeparateFullKeyProviderBothPrefixes\NamedNamespace\PurchaseOrderType.cs", outputWriter.Files.First());
+            Assert.Equal(Path.Combine(directory, "NamedNamespace", "PurchaseOrderType.cs"), outputWriter.Files.First());
         }
     }
 }


Don't add screen stack to input queue

Don't add screen stack to input queue

--- osu.Framework/Screens/ScreenStack.cs
+++ osu.Framework/Screens/ScreenStack.cs
@@ -308,14 +308,10 @@

         internal override bool BuildNonPositionalInputQueue(List<Drawable> queue, bool allowBlocking = true)
         {
-            // Avoids the use of CompositeDrawable.BuildNonPositionalInputQueue as any number of screens may be alive while loading/suspending.
-            // This method otherwise matches the implementation of Drawable.BuildNonPositionalInputQueue.
+            // Avoids the use of CompositeDrawable.BuildNonPositionalInputQueue as only the current screen should be allowed to handle input.
             if (!PropagateNonPositionalInputSubTree)
                 return false;

-            if (HandleNonPositionalInput)
-                queue.Add(this);
-
             CurrentScreen?.AsDrawable().BuildNonPositionalInputQueue(queue, allowBlocking);

             return true;
@@ -323,13 +319,9 @@

         internal override bool BuildPositionalInputQueue(Vector2 screenSpacePos, List<Drawable> queue)
         {
-            // Avoids the use of CompositeDrawable.BuildPositionalInputQueue as any number of screens may be alive while loading/suspending.
-            // This method otherwise matches the implementation of Drawable.BuildPositionalInputQueue.
+            // Avoids the use of CompositeDrawable.BuildPositionalInputQueue as only the current screen should be allowed to handle input.
             if (!PropagatePositionalInputSubTree)
                 return false;
-
-            if (HandlePositionalInput && ReceivePositionalInputAt(screenSpacePos))
-                queue.Add(this);

             CurrentScreen?.AsDrawable().BuildPositionalInputQueue(screenSpacePos, queue);


Minor implementation changes.

Minor implementation changes.

--- osu.Game/Overlays/MusicController.cs
+++ osu.Game/Overlays/MusicController.cs
@@ -180,7 +180,6 @@
             }

             beatmapSource = osuGame?.Beatmap ?? new Bindable<WorkingBeatmap>();
-            beatmapSource.ValueChanged += workingChanged;
             playList = database.GetAllWithChildren<BeatmapSetInfo>();

             backgroundSprite = getScaledSprite(fallbackTexture = game.Textures.Get(@"Backgrounds/bg4"));
@@ -189,6 +188,7 @@

         protected override void LoadComplete()
         {
+            beatmapSource.ValueChanged += workingChanged;
             workingChanged();
             base.LoadComplete();
         }
@@ -201,7 +201,7 @@
             progress.UpdatePosition((float)(current.Track.CurrentTime / current.Track.Length));
             playButton.Icon = current.Track.IsRunning ? FontAwesome.pause : FontAwesome.play_circle_o;

-            if (current.Track.HasCompleted) next();
+            if (current.Track.HasCompleted && !current.Track.Looping) next();
         }

         private void workingChanged(object sender = null, EventArgs e = null)
@@ -273,19 +273,14 @@
                 newBackground.Position = new Vector2(400, 0);
                 newBackground.MoveToX(0, 500, EasingTypes.OutCubic);
                 backgroundSprite.MoveToX(-400, 500, EasingTypes.OutCubic);
-                backgroundSprite.Expire();
             }
             else if (isNext == false)
             {
                 newBackground.Position = new Vector2(-400, 0);
                 newBackground.MoveToX(0, 500, EasingTypes.OutCubic);
                 backgroundSprite.MoveToX(400, 500, EasingTypes.OutCubic);
-                backgroundSprite.Expire();
-            }
-            else
-            {
-                backgroundSprite.Expire();
-            }
+            }
+            backgroundSprite.Expire();

             backgroundSprite = newBackground;
         }


LockBox on task dictionary

LockBox on task dictionary

--- src/Gallio/Gallio.UI/ProgressMonitoring/TaskRunner.cs
+++ src/Gallio/Gallio.UI/ProgressMonitoring/TaskRunner.cs
@@ -28,7 +28,7 @@
         private readonly ITaskQueue taskQueue;
         private readonly IEventAggregator eventAggregator;
         private readonly IUnhandledExceptionPolicy unhandledExceptionPolicy;
-        private readonly IDictionary<string, ThreadTask> currentWorkerTasks;
+        private readonly LockBox<IDictionary<string, ThreadTask>> currentWorkerTasks;

         ///<summary>
         /// Ctor.
@@ -42,13 +42,13 @@
             this.taskQueue = taskQueue;
             this.eventAggregator = eventAggregator;
             this.unhandledExceptionPolicy = unhandledExceptionPolicy;
-            currentWorkerTasks = new Dictionary<string, ThreadTask>();
+            currentWorkerTasks = new LockBox<IDictionary<string, ThreadTask>>(new Dictionary<string, ThreadTask>());
         }

         /// <inheritdoc />
         public void RunTask(string queueId)
         {
-            if (currentWorkerTasks.ContainsKey(queueId))
+            if (currentWorkerTasks.Read(tasks => tasks.ContainsKey(queueId)))
                 return;

             var command = taskQueue.GetNextTask(queueId);
@@ -68,7 +68,7 @@
                 command.Execute(progressMonitor);
             });

-            currentWorkerTasks.Add(queueId, workerTask);
+            currentWorkerTasks.Write(tasks => tasks.Add(queueId, workerTask));

             workerTask.Terminated += delegate
             {
@@ -85,10 +85,7 @@
                 ProcessFailure(workerTask.Result.Exception, queueId);
             }

-            lock (this)
-            {
-                currentWorkerTasks.Remove(queueId);
-            }
+            currentWorkerTasks.Write(tasks => tasks.Remove(queueId));

             eventAggregator.Send(this, new TaskCompleted(queueId));


Factor the saving of original vtables pointers to its method.

--- src/Generator/Generators/CSharp/CSharpTextTemplate.cs
+++ src/Generator/Generators/CSharp/CSharpTextTemplate.cs
@@ -1324,9 +1324,33 @@
             PopBlock(NewLineKind.BeforeNextBlock);
         }

+        private void GenerateSaveOriginalVTables(Class @class)
+        {
+            WriteLine("void SaveOriginalVTables(global::System.IntPtr instance)");
+            WriteStartBraceIndent();
+
+            WriteLine("var native = (Internal*)instance.ToPointer();");
+            NewLine();
+
+            WriteLine("if (__OriginalVTables == null)");
+            WriteStartBraceIndent();
+
+            if (Options.IsMicrosoftAbi)
+                SaveOriginalVTablePointersMS(@class);
+            else
+                SaveOriginalVTablePointersItanium();
+
+            WriteCloseBraceIndent();
+
+            WriteCloseBraceIndent();
+            NewLine();
+        }
+
         private void GenerateVTableClassSetup(Class @class, string dictionary,
             IList<VTableComponent> entries, IList<VTableComponent> wrappedEntries)
         {
+            GenerateSaveOriginalVTables(@class);
+
             WriteLine("void SetupVTables(global::System.IntPtr instance)");
             WriteStartBraceIndent();

@@ -1345,20 +1369,7 @@
             NewLine();

             // Save the original vftable pointers.
-            WriteLine("if (__OriginalVTables == null)");
-            WriteStartBraceIndent();
-
-            switch (Driver.Options.Abi)
-            {
-                case CppAbi.Microsoft:
-                    SaveOriginalVTablePointersMS(@class);
-                    break;
-                case CppAbi.Itanium:
-                case CppAbi.ARM:
-                    SaveOriginalVTablePointersItanium();
-                    break;
-            }
-            WriteCloseBraceIndent();
+            WriteLine("SaveOriginalVTables(instance);");
             NewLine();

             // Get the _Thunks


Remove unused method GenerateValueTypeConstructorCall.

--- src/Generator/Generators/CSharp/CSharpTextTemplate.cs
+++ src/Generator/Generators/CSharp/CSharpTextTemplate.cs
@@ -945,69 +945,6 @@
             WriteLine(");");
         }

-        private void GenerateValueTypeConstructorCall(Method method, Class @class)
-        {
-            var names = new List<string>();
-
-            foreach (var param in method.Parameters)
-            {
-                var ctx = new CSharpMarshalContext(Driver)
-                {
-                    Parameter = param,
-                    ArgName = param.Name,
-                };
-
-                var marshal = new CSharpMarshalManagedToNativePrinter(ctx);
-                param.Visit(marshal);
-
-                if (!string.IsNullOrWhiteSpace(marshal.Context.SupportBefore))
-                    Write(marshal.Context.SupportBefore);
-
-                names.Add(marshal.Context.Return);
-            }
-
-            WriteLine("var {0} = new {1}.Internal();", GeneratedIdentifier("instance"),
-                @class.QualifiedName);
-
-            GenerateInternalFunctionCall(method, @class);
-
-            GenerateValueTypeConstructorCallFields(@class);
-        }
-
-        private void GenerateValueTypeConstructorCallFields(Class @class)
-        {
-            foreach (var @base in @class.Bases)
-            {
-                if (!@base.IsClass || @base.Class.Ignore)
-                    continue;
-
-                var baseClass = @base.Class;
-                GenerateValueTypeConstructorCallFields(baseClass);
-            }
-
-            foreach (var field in @class.Fields)
-            {
-                if (CheckIgnoreField(@class, field)) continue;
-
-                var nativeField = string.Format("*({0}*) (&{1} + {2})",
-                    field.Type, GeneratedIdentifier("instance"), field.OffsetInBytes);
-
-                var ctx = new CSharpMarshalContext(Driver)
-                {
-                    ReturnVarName = nativeField,
-                    ReturnType = field.QualifiedType
-                };
-
-                var marshal = new CSharpMarshalNativeToManagedPrinter(ctx);
-                field.Visit(marshal);
-
-                if (!string.IsNullOrWhiteSpace(marshal.Context.SupportBefore))
-                    Write(marshal.Context.SupportBefore);
-
-                WriteLine("this.{0} = {1};", field.Name, marshal.Context.Return);
-            }
-        }
-
         public void GenerateInternalFunctionCall(Function function, Class @class,
             List<Parameter> parameters = null)
         {


Bugfix: #8 Can't add tag to created tasks

--- src/HabitRPG.QuickToDo/Repositories/TodoRepository.cs
+++ src/HabitRPG.QuickToDo/Repositories/TodoRepository.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using System.Threading.Tasks;
 using HabitRPG.Client;
 using HabitRPG.Client.Model;
@@ -24,7 +25,9 @@
       var todo = new Todo
       {
         Id = Guid.NewGuid().ToString(),
-        Text = todoTaskText
+        Text = todoTaskText,
+        Tags = new Dictionary<Guid, bool>(),
+        //Priority = Difficulty.Easy
       };

       var response = await _habitRpgClient.CreateTask(todo);


Base Implementation. CSVConsole

Base Implementation. CSVConsole

--- TexttoCSV/Program.cs
+++ TexttoCSV/Program.cs
@@ -95,12 +95,6 @@
                             delim = "\t";
                             Console.WriteLine("Using tab as separator..");
                         }
-                        else if (args[3] == "spaces")
-                        {
-                            delim = "  ";
-                            Console.WriteLine("Using spaces(default) separator..");
-                        }
-
                         else
                         {
                             delim = args[3];
@@ -110,28 +104,14 @@
                     else
                         Console.WriteLine("Using spaces as separator..");

-                    int threshold = 0;
-                    if (args.Length > 4)
-                    {
-                        if (!int.TryParse(args[4], out threshold))
-                        {
-                            Console.WriteLine("Invalid threshold specification.");
-
-                        }
-                        else
-                        {
-                            Console.WriteLine(String.Format("Threshold value {0} set. Be advised this number should be less than or equal to 1.", args[4]));
-                        }
-                    }
-
-                    ProcessFile(path, output, headerLines, dataFormatInt, primaryKey, new string[] { delim }, threshold);
+                    ProcessFile(path, output, headerLines, dataFormatInt, primaryKey, new string[] { delim });
                 }
             }

             Console.WriteLine(String.Format("Successfully converted files to .csv at {0}", output));
         }

-        public static void ProcessFile(string input, string output, int numHeaderLines, int dataFormat, int primaryKey, string[] delim, int threshold)
+        public static void ProcessFile(string input, string output, int numHeaderLines, int dataFormat, int primaryKey, string[] delim)
         {
             Console.WriteLine(String.Format("Processing {0}..", input));
             //read line
@@ -144,11 +124,12 @@
                 string newLine = ""; //output line
                 string headerLine = ""; //output headerline
                 bool completed = false;
-                int lineIndex = 0;
+                long lineIndex = 0;
                 long writtenBytes = 0;
                 string line;

                 ArrayList headerList = new ArrayList();
+                ArrayList greatestHeaderWordList = new ArrayList();

                 while (!completed)
                 {
@@ -204,21 +185,22 @@

                                             //int addCount2 = totalNullCount % 2 == 1 ? totalNullCount / 2 + 1 : totalNullCount / 2;
                                             //int addCount1 = totalNullCount / 2;
-                                            int addCount2 = 0 + threshold; //behind the word
-                                            int addCount1 = totalNullCount - threshold; //spaces
+                                            //int addCount2 = 0;
+                                            //int addCount1 = totalNullCount;

                                             if (arrayIndex - 1 >= 0)
                                             {
-                                                lineCountList[arrayIndex - 1] = (int)lineCountList[arrayIndex - 1] + addCount1;
-                                                lineCountList.Add(totalCharCount + addCount2);
+                                                lineCountList[arrayIndex - 1] = (int)lineCountList[arrayIndex - 1] + totalNullCount;
+                                                lineCountList.Add(totalCharCount);// + addCount2);
                                             }
                                             else
                                                 lineCountList.Add(totalCharCount + totalNullCount);

-                                            totalNullCount = 0;
+

                                             //Always a "delimiter" missing from calculations when splitting.\. in between split thing.
-                                            totalNullCount += 2;
+                                            //totalNullCount += 2;
+                                            totalNullCount = 2;
                                             totalCharCount += 2;

                                             arrayIndex++;
@@ -261,8 +243,29 @@
                                                 i = lineCountList.Count - 1;
                                             }

+
+                                            //Adjusting alignment
+                                            //Check if left aligned
+
+                                            if (i > 0)
+                                            {
+                                                string str = s.Trim();
+                                                int compare2 = totalCharCount - s.Length;
+                                                int compare1 = (int)lineCountList[i - 1];
+                                                if ((compare1 - compare2) > 1)
+                                                {
+                                                    int difference = (str.Length - ((string)greatestHeaderWordList[i]).Length) + 1;
+                                                    if (difference > 1)
+                                                    {
+                                                        lineCountList[i - 1] = (int)lineCountList[i - 1] - (difference) / 2;
+                                                        //lineCountList[i] = (int)lineCountList[i] + difference/2; Because there's plenty                of space already.
+                                                        greatestHeaderWordList[i] = str;
+                                                    }
+                                                }
+                                            }
+
                                             headerList[i] = string.Format("{0} {1}",
-                                            (string)headerList[i], s.Trim().Replace(',', ' ').Replace('"', ' '));
+                                                (string)headerList[i], s.Trim().Replace(',', ' ').Replace('"', ' '));

                                             totalCharCount += 2;
                                         }
@@ -314,7 +317,7 @@

                                     if (dataList.Count != headerList.Count)
                                     {
-                                        Console.WriteLine("ERROR: Parsed data columns not equal to header columns. Modifications to data made. ");
+                                        Console.WriteLine(String.Format("ERROR: Line {0} Misaligned Column. See \\helpfiles to manually fix. Continuing.. ", lineIndex));

                                         while (dataList.Count < headerList.Count)
                                         {
@@ -370,11 +373,20 @@
                                 #endregion

                                 #region postprocess
-                                if (lineIndex < numHeaderLines)
+                                if (lineIndex < numHeaderLines - 1)
                                 {
+                                    if (lineIndex == 0)
+                                    {
+                                        //Perform Deep copy
+                                        foreach (string e in headerList)
+                                        {
+                                            greatestHeaderWordList.Add(e);
+                                        }
+                                    }
+
                                     lineIndex++;
                                 }
-                                else if (lineIndex == numHeaderLines)
+                                else if (lineIndex == numHeaderLines - 1)
                                 {
                                     //For SAS format, must eliminate duplicates in header as well as
                                     // truncate to 32 character.
@@ -425,7 +437,7 @@

                                     lineIndex++;
                                 }
-                                else if (lineIndex > numHeaderLines)
+                                else if (lineIndex > numHeaderLines - 1)
                                 {
                                     //write comma seperated line.
                                     if (dataFormat == 1 ||
@@ -458,6 +470,7 @@
                                     }

                                     dataList = new ArrayList();
+                                    lineIndex++;
                                 }
                                 #endregion


A couple more setvalue tests.

A couple more setvalue tests.

--- src/Mango/Mango.Tests/Mango.Server/HttpHeadersTest.cs
+++ src/Mango/Mango.Tests/Mango.Server/HttpHeadersTest.cs
@@ -190,5 +190,42 @@
 			Assert.AreEqual ("Foo-Bar-", HttpHeaders.NormalizeName ("foo-BAR-"));
 			Assert.AreEqual ("Foo-Bar-", HttpHeaders.NormalizeName ("Foo-BaR-"));
 		}
+
+		[Test]
+		public void TestSetValue ()
+		{
+			HttpHeaders headers = new HttpHeaders ();
+
+			headers.SetHeader ("Foo", "Bar");
+			Assert.AreEqual ("Bar", headers ["Foo"], "a1");
+
+			// Keys should get normalized
+			headers.SetHeader ("foo", "bar");
+			Assert.AreEqual ("bar", headers ["foo"], "a2");
+			Assert.AreEqual ("bar", headers ["Foo"], "a3");
+		}
+
+		[Test]
+		public void TestSetValueNullRemovesKey ()
+		{
+			string dummy = null;
+			HttpHeaders headers = new HttpHeaders ();
+
+			headers.SetHeader ("Foo", "Bar");
+			Assert.AreEqual ("Bar", headers ["Foo"], "a1");
+
+			headers.SetHeader ("Foo", null);
+			Assert.IsFalse (headers.TryGetValue ("Foo", out dummy), "a2");
+			Assert.AreEqual (0, headers.Count, "a3");
+		}
+
+		[Test]
+		public void TestSetContentLength ()
+		{
+			HttpHeaders headers = new HttpHeaders ();
+
+			headers.SetContentLength ("100");
+			Assert.AreEqual (100, headers.ContentLength, "a1");
+		}
 	}
 }


Monero auth fix

Monero auth fix

--- src/MiningForce/Blockchain/Monero/MoneroJobManager.cs
+++ src/MiningForce/Blockchain/Monero/MoneroJobManager.cs
@@ -46,7 +46,7 @@
         {
             Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(address), $"{nameof(address)} must not be empty");

-	        var response = await daemon.ExecuteCmdAnyAsync<SplitIntegratedAddressResponse>(
+	        var response = await walletDaemon.ExecuteCmdAnyAsync<SplitIntegratedAddressResponse>(
 				MWC.SplitIntegratedAddress, new { split_integrated_address = address });

 	        return response.Error == null && !string.IsNullOrEmpty(response.Response.StandardAddress);


alpha sort some lines

alpha sort some lines

--- src/OpenInApp.Common/Helpers/ActualPathToExeHelper.cs
+++ src/OpenInApp.Common/Helpers/ActualPathToExeHelper.cs
@@ -20,7 +20,6 @@
             switch (keyToExecutableEnum)
             {
                 //gregtt emacs, not found message says cannot find file ""
-                //gregtt sort alpha
                 case KeyToExecutableEnum.AltovaXMLSpy:
                     actualPathToExeDto.SecondaryFilePathSegment = @"Altova\XMLSpy2016";
                     actualPathToExeDto.SecondaryFilePathSegmentHasMultipleYearNumberVersions = true;
@@ -101,6 +100,17 @@
 				        #endregion
 	         		};
                     break;
+                case KeyToExecutableEnum.ChromeCanary:
+                    actualPathToExeDto.SecondaryFilePathSegment = @"Google\Chrome SxS\Application";
+                    actualPathToExeDto.InitialFolderType = InitialFolderType.LocalApplicationData;
+                    break;
+                case KeyToExecutableEnum.Emacs:
+                    actualPathToExeDto.SecondaryFilePathSegment = null;
+                    actualPathToExeDto.InitialFolderType = InitialFolderType.None;
+                    break;
+                case KeyToExecutableEnum.FirefoxDeveloperEdition:
+                    actualPathToExeDto.SecondaryFilePathSegment = "Firefox Developer Edition";
+                    break;
                 case KeyToExecutableEnum.Gimp:
                     actualPathToExeDto.SecondaryFilePathSegment = @"GIMP 2\bin";
                     actualPathToExeDto.DefaultTypicalFileExtensions = new List<string>
@@ -153,78 +163,6 @@
                     actualPathToExeDto.SecondaryFilePathSegment = @"Markdown Monster";
                     actualPathToExeDto.DefaultTypicalFileExtensions = new List<string> { "md" };
                     break;
-                case KeyToExecutableEnum.VS2012:
-                    actualPathToExeDto.ExecutableFileToBrowseFor = "devenv.exe";
-                    actualPathToExeDto.SecondaryFilePathSegment = @"Microsoft Visual Studio 11.0\Common7\IDE";
-                    actualPathToExeDto.UseShellExecute = false;
-                    break;
-                case KeyToExecutableEnum.VS2013:
-                    actualPathToExeDto.ExecutableFileToBrowseFor = "devenv.exe";
-                    actualPathToExeDto.SecondaryFilePathSegment = @"Microsoft Visual Studio 12.0\Common7\IDE";
-                    actualPathToExeDto.UseShellExecute = false;
-                    break;
-                case KeyToExecutableEnum.VS2015:
-                    actualPathToExeDto.ExecutableFileToBrowseFor = "devenv.exe";
-                    actualPathToExeDto.SecondaryFilePathSegment = @"Microsoft Visual Studio 14.0\Common7\IDE";
-                    actualPathToExeDto.UseShellExecute = false;
-                    break;
-                case KeyToExecutableEnum.VS2017Community:
-                    actualPathToExeDto.ExecutableFileToBrowseFor = "devenv.exe";
-                    actualPathToExeDto.SecondaryFilePathSegment = @"Microsoft Visual Studio\2017\Community\Common7\IDE";
-                    actualPathToExeDto.UseShellExecute = false;
-                    break;
-                case KeyToExecutableEnum.VS2017Enterprise:
-                    actualPathToExeDto.ExecutableFileToBrowseFor = "devenv.exe";
-                    actualPathToExeDto.SecondaryFilePathSegment = @"Microsoft Visual Studio\2017\Enterprise\Common7\IDE";
-                    actualPathToExeDto.UseShellExecute = false;
-                    break;
-                case KeyToExecutableEnum.VS2017Professional:
-                    actualPathToExeDto.ExecutableFileToBrowseFor = "devenv.exe";
-                    actualPathToExeDto.SecondaryFilePathSegment = @"Microsoft Visual Studio\2017\Professional\Common7\IDE";
-                    actualPathToExeDto.UseShellExecute = false;
-                    break;
-                case KeyToExecutableEnum.Opera:
-                    actualPathToExeDto.SecondaryFilePathSegment = @"Opera";
-                    break;
-                case KeyToExecutableEnum.PaintDotNet:
-                    actualPathToExeDto.SecondaryFilePathSegment = @"Paint.NET";
-                    actualPathToExeDto.DefaultTypicalFileExtensions = new List<string>
-                    {
-                        #region Extensions
-                        //Source(s): http://www.getpaint.net/doc/latest/
-                        "BMP",
-                        "DDS",
-                        "GIF",
-                        "JPEG",
-                        "JPG",
-                        "PDN",
-                        "PNG",
-                        "TGA",
-                        "TIFF",
-	                    #endregion
-                    };
-                    break;
-                case KeyToExecutableEnum.XamarinStudio:
-                    actualPathToExeDto.SecondaryFilePathSegment = @"Xamarin Studio\bin";
-                    break;
-                case KeyToExecutableEnum.FirefoxDeveloperEdition:
-                    actualPathToExeDto.SecondaryFilePathSegment = "Firefox Developer Edition";
-                    break;
-                case KeyToExecutableEnum.OperaDeveloperEdition:
-                    actualPathToExeDto.SecondaryFilePathSegment = @"Opera developer";
-                    break;
-                case KeyToExecutableEnum.ChromeCanary:
-                    actualPathToExeDto.SecondaryFilePathSegment = @"Google\Chrome SxS\Application";
-                    actualPathToExeDto.InitialFolderType = InitialFolderType.LocalApplicationData;
-                    break;
-                case KeyToExecutableEnum.Vivaldi:
-                    actualPathToExeDto.SecondaryFilePathSegment = @"Vivaldi\Application";
-                    actualPathToExeDto.InitialFolderType = InitialFolderType.LocalApplicationData;
-                    break;
-                case KeyToExecutableEnum.Emacs:
-                    actualPathToExeDto.SecondaryFilePathSegment = null;
-                    actualPathToExeDto.InitialFolderType = InitialFolderType.None;
-                    break;
                 case KeyToExecutableEnum.MSPaint:
                     actualPathToExeDto.SecondaryFilePathSegment = "system32";
                     actualPathToExeDto.InitialFolderType = InitialFolderType.Windows;
@@ -246,6 +184,67 @@
                         #endregion
                     };
                     break;
+                case KeyToExecutableEnum.Opera:
+                    actualPathToExeDto.SecondaryFilePathSegment = @"Opera";
+                    break;
+                case KeyToExecutableEnum.OperaDeveloperEdition:
+                    actualPathToExeDto.SecondaryFilePathSegment = @"Opera developer";
+                    break;
+                case KeyToExecutableEnum.PaintDotNet:
+                    actualPathToExeDto.SecondaryFilePathSegment = @"Paint.NET";
+                    actualPathToExeDto.DefaultTypicalFileExtensions = new List<string>
+                    {
+                        #region Extensions
+                        //Source(s): http://www.getpaint.net/doc/latest/
+                        "BMP",
+                        "DDS",
+                        "GIF",
+                        "JPEG",
+                        "JPG",
+                        "PDN",
+                        "PNG",
+                        "TGA",
+                        "TIFF",
+	                    #endregion
+                    };
+                    break;
+                case KeyToExecutableEnum.Vivaldi:
+                    actualPathToExeDto.SecondaryFilePathSegment = @"Vivaldi\Application";
+                    actualPathToExeDto.InitialFolderType = InitialFolderType.LocalApplicationData;
+                    break;
+                case KeyToExecutableEnum.VS2012:
+                    actualPathToExeDto.ExecutableFileToBrowseFor = "devenv.exe";
+                    actualPathToExeDto.SecondaryFilePathSegment = @"Microsoft Visual Studio 11.0\Common7\IDE";
+                    actualPathToExeDto.UseShellExecute = false;
+                    break;
+                case KeyToExecutableEnum.VS2013:
+                    actualPathToExeDto.ExecutableFileToBrowseFor = "devenv.exe";
+                    actualPathToExeDto.SecondaryFilePathSegment = @"Microsoft Visual Studio 12.0\Common7\IDE";
+                    actualPathToExeDto.UseShellExecute = false;
+                    break;
+                case KeyToExecutableEnum.VS2015:
+                    actualPathToExeDto.ExecutableFileToBrowseFor = "devenv.exe";
+                    actualPathToExeDto.SecondaryFilePathSegment = @"Microsoft Visual Studio 14.0\Common7\IDE";
+                    actualPathToExeDto.UseShellExecute = false;
+                    break;
+                case KeyToExecutableEnum.VS2017Community:
+                    actualPathToExeDto.ExecutableFileToBrowseFor = "devenv.exe";
+                    actualPathToExeDto.SecondaryFilePathSegment = @"Microsoft Visual Studio\2017\Community\Common7\IDE";
+                    actualPathToExeDto.UseShellExecute = false;
+                    break;
+                case KeyToExecutableEnum.VS2017Enterprise:
+                    actualPathToExeDto.ExecutableFileToBrowseFor = "devenv.exe";
+                    actualPathToExeDto.SecondaryFilePathSegment = @"Microsoft Visual Studio\2017\Enterprise\Common7\IDE";
+                    actualPathToExeDto.UseShellExecute = false;
+                    break;
+                case KeyToExecutableEnum.VS2017Professional:
+                    actualPathToExeDto.ExecutableFileToBrowseFor = "devenv.exe";
+                    actualPathToExeDto.SecondaryFilePathSegment = @"Microsoft Visual Studio\2017\Professional\Common7\IDE";
+                    actualPathToExeDto.UseShellExecute = false;
+                    break;
+                case KeyToExecutableEnum.XamarinStudio:
+                    actualPathToExeDto.SecondaryFilePathSegment = @"Xamarin Studio\bin";
+                    break;
                 default:
                     actualPathToExeDto.SecondaryFilePathSegment = null;
                     actualPathToExeDto.InitialFolderType = InitialFolderType.None;


Updated ChatColors to include formatting

--- Craft.Net.Data/ChatColors.cs
+++ Craft.Net.Data/ChatColors.cs
@@ -23,5 +23,11 @@
         public const string Pink = "§d";
         public const string Yellow = "§e";
         public const string White = "§f";
+        public const string Gibberish = "§k";
+        public const string Bold = "§l";
+        public const string Strikethrough = "§m";
+        public const string Underline = "§n";
+        public const string Italic = "§o";
+        public const string Plain = "§r";
     }
 }


don't use mixed mode for local debuging

don't use mixed mode for local debuging

--- src/SFA.DAS.Commitments.Api/App_Start/Startup.Auth.cs
+++ src/SFA.DAS.Commitments.Api/App_Start/Startup.Auth.cs
@@ -8,6 +8,7 @@
     {
         public void ConfigureAuth(IAppBuilder app)
         {
+#if !DEBUG
             app.UseMixedModeAuthentication(new MixedModeAuthenticationOptions
             {
                 ValidIssuers = ConfigurationManager.AppSettings["ApiIssuers"].Split(' '),
@@ -15,7 +16,7 @@
                 ApiTokenSecret = ConfigurationManager.AppSettings["ApiTokenSecret"],
                 MetadataEndpoint = ConfigurationManager.AppSettings["MetadataEndpoint"]
             });
+#endif
         }
     }
-
 }


added ArgumentException to be thrown is a user attempts to create a stump where the name already exists

--- src/main/dot-net/Stumps.Engine/Proxy/ProxyStumps.cs
+++ src/main/dot-net/Stumps.Engine/Proxy/ProxyStumps.cs
@@ -39,7 +39,7 @@
             var stump = stumpList.Find(s => s.StumpName == contract.StumpName);
             if (stump != null)
             {
-                //TODO: write DuplicateStumpException
+                throw new ArgumentException("Stump name already exists.  Stump names but me unique.");
             }

             if ( contract == null ) {


ЧтениеТекста: xml-doc.

ЧтениеТекста: xml-doc.

--- src/ScriptEngine.HostedScript/Library/TextReadImpl.cs
+++ src/ScriptEngine.HostedScript/Library/TextReadImpl.cs
@@ -12,6 +12,9 @@

 namespace ScriptEngine.HostedScript.Library
 {
+    /// <summary>
+    /// Предназначен для последовательного чтения файлов, в том числе большого размера.
+    /// </summary>
     [ContextClass("ЧтениеТекста", "TextReader")]
     public class TextReadImpl : AutoContext<TextReadImpl>, IDisposable
     {
@@ -24,6 +27,14 @@
             AnalyzeDefaultLineFeed = true;
         }

+        /// <summary>
+        /// Открывает текстовый файл для чтения. Ранее открытый файл закрывается.
+        /// </summary>
+        /// <param name="path">Путь к файлу</param>
+        /// <param name="encoding">Кодировка</param>
+        /// <param name="lineDelimiter">Раздедитель строк</param>
+        /// <param name="eolDelimiter">Разделитель строк в файле</param>
+        /// <param name="monopoly">Открывать монопольно</param>
         [ContextMethod("Открыть", "Open")]
         public void Open(string path, IValue encoding = null, string lineDelimiter = "\n", string eolDelimiter = null,
             bool? monopoly = null)
@@ -55,6 +66,11 @@
             return _reader.Read ();
         }

+        /// <summary>
+        /// Считывает строку указанной длины или до конца файла.
+        /// </summary>
+        /// <param name="size">Размер строки. Если не задан, текст считывается до конца файла</param>
+        /// <returns>Строка - считанная строка, Неопределено - в файле больше нет данных</returns>
         [ContextMethod("Прочитать", "Read")]
         public IValue ReadAll(int size = 0)
         {
@@ -76,6 +92,12 @@
             return ValueFactory.Create(sb.ToString());
         }

+        /// <summary>
+        /// Считывает очередную строку текстового файла.
+        /// </summary>
+        /// <param name="overridenLineDelimiter">Подстрока, считающаяся концом строки. Переопределяет РазделительСтрок,
+        /// переданный в конструктор или в метод Открыть</param>
+        /// <returns>Строка - в случае успешного чтения, Неопределено - больше нет данных</returns>
         [ContextMethod("ПрочитатьСтроку", "ReadLine")]
         public IValue ReadLine(string overridenLineDelimiter = null)
         {
@@ -88,6 +110,9 @@
             return ValueFactory.Create(l);
         }

+        /// <summary>
+        /// Закрывает открытый текстовый файл. Если файл был открыт монопольно, то после закрытия он становится доступен.
+        /// </summary>
         [ContextMethod("Закрыть", "Close")]
         public void Close()
         {
@@ -102,6 +127,11 @@
             }
         }

+        /// <summary>
+        /// Открывает текстовый файл для чтения.
+        /// </summary>
+        /// <param name="path">Строка. Путь к файлу</param>
+        /// <returns>ЧтениеТекста</returns>
         [ScriptConstructor(Name = "По имени файла без кодировки")]
         public static IRuntimeContextInstance Constructor (IValue path)
         {
@@ -111,6 +141,15 @@
             return reader;
         }

+        /// <summary>
+        /// Открывает текстовый файл для чтения. Работает аналогично методу Открыть.
+        /// </summary>
+        /// <param name="path">Путь к файлу</param>
+        /// <param name="encoding">Кодировка файла</param>
+        /// <param name="lineDelimiter">Разделитель строк</param>
+        /// <param name="eolDelimiter">Разделитель строк в файле</param>
+        /// <param name="monopoly">Открывать файл монопольно</param>
+        /// <returns>ЧтениеТекста</returns>
         [ScriptConstructor(Name = "По имени файла")]
         public static IRuntimeContextInstance Constructor(IValue path, IValue encoding = null,
             IValue lineDelimiter = null, IValue eolDelimiter = null, IValue monopoly = null)
@@ -127,6 +166,10 @@
             return reader;
         }

+        /// <summary>
+        /// Создаёт неинициализированный объект. Для инициализации необходимо открыть файл методом Открыть.
+        /// </summary>
+        /// <returns>ЧтениеТекста</returns>
         [ScriptConstructor(Name = "Формирование неинициализированного объекта")]
         public static IRuntimeContextInstance Constructor()
         {


Added "TryParseBoolean" method overload to the "StringUtils" class

The class already has a "TryParseBoolean" method that attempts to convert a string into a bool. While this is sufficient in a lot of cases, the new method overload attempt to convert a string into a nullable bool.

See #30

--- src/Skybrud.Essentials/Strings/StringUtils.Boolean.cs
+++ src/Skybrud.Essentials/Strings/StringUtils.Boolean.cs
@@ -82,6 +82,38 @@

         }

+        /// <summary>
+        /// Tries to convert the specified string representation of a logical value to its <see cref="bool"/> equivalent.
+        /// </summary>
+        /// <param name="value">A string containing the value to convert.</param>
+        /// <param name="result">When this method returns, if the conversion succeeded, contains the parsed boolean value. If the conversion failed, contains <c>null</c>.</param>
+        /// <returns><c>true</c> if value was converted successfully; otherwise, <c>false</c>.</returns>
+        public static bool TryParseBoolean(string value, out bool? result) {
+
+            switch (value?.ToLower()) {
+
+                case "true":
+                case "1":
+                case "t":
+                case "on":
+                    result = true;
+                    return true;
+
+                case "false":
+                case "0":
+                case "f":
+                case "off":
+                    result = false;
+                    return true;
+
+                default:
+                    result = null;
+                    return false;
+
+            }
+
+        }
+
     }

 }


Implement the MoveImagesAsync method.

Implement the MoveImagesAsync method.

--- src/SmugMugModel.v2/Types/Album/Album/Album.manual.cs
+++ src/SmugMugModel.v2/Types/Album/Album/Album.manual.cs
@@ -84,10 +84,20 @@
             return await album____images(AlbumKey);
         }

-        public async Task RequiresPost_Fixup_album____moveimages()
+        public async Task MoveImagesAsync(IEnumerable<ImageEntity> images, bool moveAsync)
         {
-            // /album/(*)!
-            await album____moveimages(string.Empty);
+            // Create the list of ImageUris to use.
+            string imageUris = string.Join(",", images.Select(img => img.Uri));
+
+            var postProperties = new List<KeyValuePair<string, object>>();
+            postProperties.Add(new KeyValuePair<string, object>("MoveUris", imageUris));
+            postProperties.Add(new KeyValuePair<string, object>("Async", moveAsync));
+
+            var payload = JsonHelpers.GetPayloadAsJson(postProperties);
+
+            // /album/(*)!moveimages
+            string requestUri = string.Format("{0}{1}!moveimages", SmugMug.v2.Constants.Addresses.SmugMug, Uri);
+            await PostRequestAsync(requestUri, payload);
         }

         public async Task<ImageEntity[]> GetPopularMediaAsync()


Fix async methods

Fix async methods

--- src/TM.Data.Update/TrainingCatalogChangesProcessor.cs
+++ src/TM.Data.Update/TrainingCatalogChangesProcessor.cs
@@ -35,7 +35,7 @@
       /// <paramref name="existingCategories"/> or
       /// <paramref name="changesDetector"/> is <see langword="null" />.</exception>
       /// <exception cref="ChangesProcessorException"></exception>
-      public Task<ChangesResult<Category, TCategoryParseModel>> GetCategoriesChangesAsync(
+      public async Task<ChangesResult<Category, TCategoryParseModel>> GetCategoriesChangesAsync(
          int trainingProviderId,
          IEnumerable<Category> existingCategories,
          IChangesDetector<Category, TCategoryParseModel> changesDetector)
@@ -52,10 +52,10 @@
             var processingCategoriesContainer = UpdateParseResult.CategoriesParseResult.CategoryContainer.Values
                .ToDictionary(x => x, x => x, UrlNameNaturalKeyEqualityComparer<IUrlNameNaturalKey>.Instance);

-            var task = GetChangesAsync(trainingProviderId, existingCategories, processingCategoriesContainer,
+            var changesResult = await GetChangesAsync(trainingProviderId, existingCategories, processingCategoriesContainer,
                changesDetector, MapToCategoryAsync, (dbe, pme) => pme.Id = dbe.Id);

-            return task;
+            return changesResult;
          }
          catch (Exception ex)
          {
@@ -68,7 +68,7 @@
       /// <paramref name="existingCourses"/> or
       /// <paramref name="changesDetector"/> is <see langword="null" />.</exception>
       /// <exception cref="ChangesProcessorException"></exception>
-      public Task<ChangesResult<Course, TCourseParseModel>> GetCoursesChangesAsync(
+      public async Task<ChangesResult<Course, TCourseParseModel>> GetCoursesChangesAsync(
          int trainingProviderId,
          IEnumerable<Course> existingCourses,
          IChangesDetector<Course, TCourseParseModel> changesDetector)
@@ -85,10 +85,10 @@
             var processingCoursesContainer = UpdateParseResult.CoursesParseResult.CourseContainer.Values
                .ToDictionary(x => x, x => x, UrlNameNaturalKeyEqualityComparer<IUrlNameNaturalKey>.Instance);

-            var task = GetChangesAsync(trainingProviderId, existingCourses, processingCoursesContainer, changesDetector,
+            var changesResult = await GetChangesAsync(trainingProviderId, existingCourses, processingCoursesContainer, changesDetector,
                MapToCourseAsync, (dbe, pme) => pme.Id = dbe.Id);

-            return task;
+            return changesResult;
          }
          catch (Exception ex)
          {
@@ -101,7 +101,7 @@
       /// <paramref name="existingAuthors"/> or
       /// <paramref name="changesDetector"/> is <see langword="null" />.</exception>
       /// <exception cref="ChangesProcessorException"></exception>
-      public Task<ChangesResult<TrainingProviderAuthor, TAuthorParseModel>> GetAuthorsChangesAsync(
+      public async Task<ChangesResult<TrainingProviderAuthor, TAuthorParseModel>> GetAuthorsChangesAsync(
          int trainingProviderId,
          IEnumerable<TrainingProviderAuthor> existingAuthors,
          IChangesDetector<TrainingProviderAuthor, TAuthorParseModel> changesDetector)
@@ -119,10 +119,10 @@
                .Values
                .ToDictionary(x => x, x => x, UrlNameNaturalKeyEqualityComparer<IUrlNameNaturalKey>.Instance);

-            var task = GetChangesAsync(trainingProviderId, existingAuthors, processingAuthorsContainer, changesDetector,
+            var changesResult = await GetChangesAsync(trainingProviderId, existingAuthors, processingAuthorsContainer, changesDetector,
                MapToAuthorAsync, (dbe, pme) => pme.Id = dbe.AuthorId);

-            return task;
+            return changesResult;
          }
          catch (Exception ex)
          {


Removed awaiting for the channel listener tasks

--- src/Takenet.MessagingHub.Client/MessagingHubClient.cs
+++ src/Takenet.MessagingHub.Client/MessagingHubClient.cs
@@ -151,11 +151,13 @@
                 if (_channelListener != null)
                 {
                     _channelListener.Stop();
-                    await Task.WhenAll(
-                        _channelListener.CommandListenerTask,
-                        _channelListener.MessageListenerTask,
-                        _channelListener.NotificationListenerTask)
-                        .ConfigureAwait(false);
+
+                    // TODO: Signal to the listener to stop consuming the envelopes.
+                    //await Task.WhenAll(
+                    //    _channelListener.CommandListenerTask,
+                    //    _channelListener.MessageListenerTask,
+                    //    _channelListener.NotificationListenerTask)
+                    //    .ConfigureAwait(false);

                     _channelListener.DisposeIfDisposable();
                 }
@@ -189,7 +191,7 @@
             _channelListener = new ChannelListener(
                 handler.HandleAsync,
                 handler.HandleAsync,
-                c => TaskUtil.TrueCompletedTask);
+                c => TaskUtil.FalseCompletedTask);
             _channelListener.Start(_onDemandClientChannel);
         }
     }


comments

comments

--- src/Umbraco.Core/Services/Implement/ContentService.cs
+++ src/Umbraco.Core/Services/Implement/ContentService.cs
@@ -1392,7 +1392,7 @@
                             .ToList();

                         if (pendingCultures.Count == 0)
-                            continue; //shouldn't happen but no point in continuing if there's nothing there
+                            continue; //shouldn't happen but no point in processing this document if there's nothing there

                         var saveEventArgs = new ContentSavingEventArgs(d, evtMsgs);
                         if (scope.Events.DispatchCancelable(Saving, this, saveEventArgs, nameof(Saving)))
@@ -1453,7 +1453,7 @@
                             .ToList();

                         if (pendingCultures.Count == 0)
-                            continue; //shouldn't happen but no point in continuing if there's nothing there
+                            continue; //shouldn't happen but no point in processing this document if there's nothing there

                         var saveEventArgs = new ContentSavingEventArgs(d, evtMsgs);
                         if (scope.Events.DispatchCancelable(Saving, this, saveEventArgs, nameof(Saving)))
@@ -1479,7 +1479,7 @@
                                     d.Id, culture, string.Join(",", invalidProperties.Select(x => x.Alias)));

                             publishing &= tryPublish; //set the culture to be published
-                            if (!publishing) continue; // no point continuing
+                            if (!publishing) continue; // move to next document
                         }

                         PublishResult result;


ContentService should remain public for now

--- src/Umbraco.Core/Services/Implement/ContentService.cs
+++ src/Umbraco.Core/Services/Implement/ContentService.cs
@@ -19,7 +19,7 @@
     /// <summary>
     /// Implements the content service.
     /// </summary>
-    internal class ContentService : RepositoryService, IContentService
+    public class ContentService : RepositoryService, IContentService
     {
         private readonly IDocumentRepository _documentRepository;
         private readonly IEntityRepository _entityRepository;


Remove Console.ReadKey() from the UnitTest program

This stops it from hanging on the Travis build

--- UnitTests/Program.cs
+++ UnitTests/Program.cs
@@ -61,7 +61,6 @@
 			}

 			Console.WriteLine("Done");
-			Console.ReadKey();
 		}

 		/// <summary>


Refactor : each arm drawing is its own method.

--- gtksharp_clock/Program.cs
+++ gtksharp_clock/Program.cs
@@ -144,6 +144,26 @@
 		}

+		private void drawHoursArm(double current_hours)
+		{
+			int[] coords = this.getArmEndCoords(current_hours, 12.0, 130);
+			this.GdkWindow.DrawLine(this.Style.BaseGC(StateType.Normal), 300, 300, 300 + coords[0], 300 + coords[1]);
+		}
+
+		private void drawMinutesArm(double current_minutes)
+		{
+
+			int[] coords = this.getArmEndCoords(current_minutes, 60.0, 200);
+			this.GdkWindow.DrawLine(this.Style.BaseGC(StateType.Normal), 300, 300, 300 + coords[0], 300 + coords[1]);
+		}
+
+		private void drawSecondsArm(double current_seconds)
+		{
+			int[] coords = this.getArmEndCoords(current_seconds, 60.0, 200);
+			this.GdkWindow.DrawLine(this.Style.BaseGC(StateType.Normal), 300, 300, 300 + coords[0], 300 + coords[1]);
+		}
+
+
 		public void drawArms()
 		{

@@ -155,14 +175,9 @@
 			gc.RgbFgColor = colors.blue;
 			gc.SetLineAttributes(3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);

-			int[] coords = this.getArmEndCoords(now.Second + now.Millisecond / 1000, 60.0, 300);
-			this.GdkWindow.DrawLine(this.Style.BaseGC(StateType.Normal), 300, 300, 300 + coords[0], 300 + coords[1]);
-
-			coords = this.getArmEndCoords(now.Minute + now.Second / 60.0, 60.0, 200);
-			this.GdkWindow.DrawLine(this.Style.BaseGC(StateType.Normal), 300, 300, 300 + coords[0], 300 + coords[1]);
-
-			coords = this.getArmEndCoords(now.Hour + now.Minute / 60.0, 12.0, 130);
-			this.GdkWindow.DrawLine(this.Style.BaseGC(StateType.Normal), 300, 300, 300 + coords[0], 300 + coords[1]);
+			this.drawHoursArm(now.Hour + now.Minute / 60.0);
+			this.drawMinutesArm(now.Minute + now.Second / 60.0);
+			this.drawSecondsArm(now.Second + now.Millisecond / 1000);

 		}
 	}


[Kinesis] Use AwsException

[Kinesis] Use AwsException

--- src/Amazon.Kinesis.Firehose/KinesisFirehoseClient.cs
+++ src/Amazon.Kinesis.Firehose/KinesisFirehoseClient.cs
@@ -1,6 +1,8 @@
 using System.Net.Http;
 using System.Text.Json;
 using System.Text.Json.Serialization;
+
+using Amazon.Exceptions;

 namespace Amazon.Kinesis.Firehose;

@@ -66,9 +68,7 @@
     {
         var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false);

-        // var result = JsonObject.Parse(responseText);
-
-        throw new Exception(responseText);
+        throw new AwsException(responseText, response.StatusCode);
     }

     private static readonly JsonSerializerOptions jso = new () {


fix copy-paste error in test

fix copy-paste error in test

--- src/Afluistic.Tests/Commands/AddAccountTypeTests.cs
+++ src/Afluistic.Tests/Commands/AddAccountTypeTests.cs
@@ -154,11 +154,11 @@
                 public void Should_write_its_usage_information_to_the_TextWriter()
                 {
                     var writer = new StringWriter();
-                    var command = IoC.Get<Init>();
+                    var command = IoC.Get<AddAccountType>();
                     command.WriteUsage(writer);
                     var output = writer.ToString();
                     output.ShouldContain(String.Join(" ", command.GetCommandWords()));
-                    Regex.IsMatch(output, Init.UsageMessageText.MessageTextToRegex()).ShouldBeTrue();
+                    Regex.IsMatch(output, AddAccountType.UsageMessageText.MessageTextToRegex()).ShouldBeTrue();
                 }
             }
         }


Removed extra call to RegistrationsFor during instance decoration.

--- src/Autofac/Features/Decorators/InstanceDecorator.cs
+++ src/Autofac/Features/Decorators/InstanceDecorator.cs
@@ -47,24 +47,20 @@

                 var registry = context.ComponentRegistry;
                 var decoratorService = new DecoratorService(serviceWithType.ServiceType);
-                var decoratorRegistrations = registry.RegistrationsFor(decoratorService).ToList();
+                var deocratorRegistrations = registry.RegistrationsFor(decoratorService).ToList();

-                if (decoratorRegistrations.Count <= 0) continue;
+                if (deocratorRegistrations.Count == 0) return instance;

-                var resolveParameters = parameters as Parameter[] ?? parameters.ToArray();
-
-                var decorators = registry.RegistrationsFor(decoratorService)
+                var decorators = deocratorRegistrations
                     .OrderBy(r => r.GetRegistrationOrder())
                     .Select(r => new
                     {
                         Registration = r,
                         Service = r.Services.OfType<DecoratorService>().FirstOrDefault()
-                    })
-                    .ToList();
-
-                if (decorators.Count == 0) return instance;
+                    });

                 var serviceType = serviceWithType.ServiceType;
+                var resolveParameters = parameters as Parameter[] ?? parameters.ToArray();

                 var decoratorContext = DecoratorContext.Create(instance.GetType(), serviceType, instance);


Update docblock to clearify method action

--- src/Arkivverket.Arkade/Core/ArkadeProcessingArea.cs
+++ src/Arkivverket.Arkade/Core/ArkadeProcessingArea.cs
@@ -19,10 +19,11 @@
         public static DirectoryInfo LogsDirectory;

         /// <summary>
-        /// Establish processing directory for Arkade.
-        /// Throws IOException on non-existing paths.
+        /// Establish processing area for Arkade in the given location.
+        /// Throws ArgumentException on invalid location.
         /// </summary>
-        /// <param name="locationPath">Path to root processing area - must exist!</param>
+        /// <param name="locationPath">Path to an existing and accessible location
+        /// for the processing area (root directory) to be created.</param>
         public static void Establish(string locationPath)
         {
             try


In New Lang Wizard, don't pre-fill country if there are multiple.

--- src/BloomExe/CollectionCreating/LanguageIdControl.cs
+++ src/BloomExe/CollectionCreating/LanguageIdControl.cs
@@ -22,8 +22,16 @@

 			_collectionInfo.Language1Iso639Code = _lookupISOControl.ISOCode;
 			_collectionInfo.Language1Name = _lookupISOControl.LanguageInfo == null ? string.Empty : _lookupISOControl.LanguageInfo.DesiredName;
-			if(_lookupISOControl.LanguageInfo!=null)
+			if (_lookupISOControl.LanguageInfo != null)
+			{
 				_collectionInfo.Country = _lookupISOControl.LanguageInfo.Country;
+
+				//If there are multiple countries, just leave it blank so they can type something in
+				if (_collectionInfo.Country.Contains(","))
+				{
+					_collectionInfo.Country = "";
+				}
+			}

 			_setNextButtonState(this, _lookupISOControl.LanguageInfo != null);


Updated CharacterStats model

Updated CharacterStats model

--- src/Booma.Packet.Game/Block/Models/CharacterStats.cs
+++ src/Booma.Packet.Game/Block/Models/CharacterStats.cs
@@ -5,6 +5,9 @@

 namespace Booma.Proxy
 {
+	/// <summary>
+	/// Structure that represents a character's stats.
+	/// </summary>
 	[WireDataContract]
 	public sealed class CharacterStats
 	{
@@ -16,10 +19,33 @@
 		    uint16_t ata;
 		    uint16_t lck;*/

-		//TODO: Provide a better API for accessing the stats data.
+		/// <summary>
+		/// Internal stats storage array.
+		/// </summary>
 		[KnownSize(7)]
 		[WireMember(1)]
-		public ushort[] Stats { get; internal set; }
+		public ushort[] Stats { get; internal set; } = Array.Empty<ushort>();
+
+		/// <summary>
+		/// Gets the specified <see cref="stat"/> value.
+		/// </summary>
+		/// <param name="stat"></param>
+		/// <returns></returns>
+		public ushort this[CharacterStatType stat] => Stats[(int) stat];
+
+		public CharacterStats(ushort[] stats)
+		{
+			Stats = stats ?? throw new ArgumentNullException(nameof(stats));
+		}
+
+		public CharacterStats(IEnumerable<KeyValuePair<CharacterStatType, ushort>> stats)
+		{
+			//TODO: Constant
+			Stats = new ushort[7];
+
+			foreach (var kvp in stats)
+				Stats[(int) kvp.Key] = kvp.Value;
+		}

 		/// <summary>
 		/// Serializer ctor.


Refactored and fixed getting property.

Refactored and fixed getting property.

--- src/Abp.Web.Api/WebApi/Controllers/Filters/AbpExceptionFilterAttribute.cs
+++ src/Abp.Web.Api/WebApi/Controllers/Filters/AbpExceptionFilterAttribute.cs
@@ -2,6 +2,7 @@
 using System.Net;
 using System.Net.Http;
 using System.Web.Http.Filters;
+using Abp.Collections.Extensions;
 using Abp.Dependency;
 using Abp.Events.Bus;
 using Abp.Events.Bus.Exceptions;
@@ -55,24 +56,24 @@
         private static WrapResultAttribute GetWrapAttributeOrNull(HttpActionExecutedContext context)
         {
             //Try to get for dynamic APIs
-            var dontWrapAttr = context.ActionContext.ActionDescriptor.Properties["__AbpDynamicApiDontWrapResultAttribute"] as WrapResultAttribute;
-            if (dontWrapAttr != null)
+            var wrapAttr = context.ActionContext.ActionDescriptor.Properties.GetOrDefault("__AbpDynamicApiDontWrapResultAttribute") as WrapResultAttribute;
+            if (wrapAttr != null)
             {
-                return dontWrapAttr;
+                return wrapAttr;
             }

             //Get for the action
-            dontWrapAttr = context.ActionContext.ActionDescriptor.GetCustomAttributes<WrapResultAttribute>().FirstOrDefault();
-            if (dontWrapAttr != null)
+            wrapAttr = context.ActionContext.ActionDescriptor.GetCustomAttributes<WrapResultAttribute>().FirstOrDefault();
+            if (wrapAttr != null)
             {
-                return dontWrapAttr;
+                return wrapAttr;
             }

             //Get for the controller
-            dontWrapAttr = context.ActionContext.ControllerContext.ControllerDescriptor.GetCustomAttributes<WrapResultAttribute>().FirstOrDefault();
-            if (dontWrapAttr != null)
+            wrapAttr = context.ActionContext.ControllerContext.ControllerDescriptor.GetCustomAttributes<WrapResultAttribute>().FirstOrDefault();
+            if (wrapAttr != null)
             {
-                return dontWrapAttr;
+                return wrapAttr;
             }

             //Not found


Fix CamlExpression.GetViewFieldsExpression

--- src/Codeless.SharePoint/SharePoint/CamlExpression.cs
+++ src/Codeless.SharePoint/SharePoint/CamlExpression.cs
@@ -22,6 +22,7 @@
   [DebuggerDisplay("{GetDebuggerDisplay(),nq}")]
   public abstract class CamlExpression : Caml {
     private static readonly Hashtable debugBindings = new ReadOnlyHashtable();
+    private static readonly CamlExpression emptyViewFields = new CamlViewFieldsExpression(new CamlViewFieldsFieldRefExpression[0]);

     private sealed class ReadOnlyHashtable : Hashtable {
       public override void Add(object key, object value) {
@@ -188,7 +189,7 @@
         }
         return new CamlViewFieldsExpression(fieldRefs.Select(CamlFieldRefExpression.ConvertToViewFieldsFieldRefExpression));
       }
-      return null;
+      return emptyViewFields;
     }

     /// <summary>
@@ -1532,10 +1533,6 @@
       return String.Empty;
     }

-    public override CamlExpression GetViewFieldsExpression() {
-      return this;
-    }
-
     protected override void Visit(CamlVisitor visitor) { }

     protected override void WriteXml(XmlWriter writer, Hashtable bindings) { }


Use a valid canceled task (#11161)

Use a valid canceled task (#11161)

--- src/Components/Server/src/Circuits/RemoteRenderer.cs
+++ src/Components/Server/src/Circuits/RemoteRenderer.cs
@@ -3,13 +3,11 @@

 using System;
 using System.Collections.Concurrent;
-using System.Collections.Generic;
 using System.IO;
 using System.Linq;
 using System.Text.Encodings.Web;
 using System.Threading;
 using System.Threading.Tasks;
-using MessagePack;
 using Microsoft.AspNetCore.Components.Rendering;
 using Microsoft.AspNetCore.Components.Server.Circuits;
 using Microsoft.AspNetCore.SignalR;
@@ -20,6 +18,8 @@
 {
     internal class RemoteRenderer : HtmlRenderer
     {
+        private static readonly Task CanceledTask = Task.FromCanceled(new CancellationToken(canceled: true));
+
         private readonly IJSRuntime _jsRuntime;
         private readonly CircuitClientProxy _client;
         private readonly RendererRegistry _rendererRegistry;
@@ -114,7 +114,7 @@
             if (_disposing)
             {
                 // We are being disposed, so do no work.
-                return Task.FromCanceled<object>(CancellationToken.None);
+                return CanceledTask;
             }

             // Note that we have to capture the data as a byte[] synchronously here, because


Reduced Channel Expiration to 1 minute.

Reduced Channel Expiration to 1 minute.

--- src/Brokers/RabbitMQ/RestBus.RabbitMQ/ChannelPooling/AmqpChannelPooler.cs
+++ src/Brokers/RabbitMQ/RestBus.RabbitMQ/ChannelPooling/AmqpChannelPooler.cs
@@ -14,7 +14,7 @@
 #if !DISABLE_CHANNELPOOLING

         readonly ConcurrentDictionary<ChannelFlags, ConcurrentQueue<AmqpModelContainer>> _pool = new ConcurrentDictionary<ChannelFlags, ConcurrentQueue<AmqpModelContainer>>();
-        static readonly int MODEL_EXPIRY_TIMESPAN = (int)TimeSpan.FromMinutes(5).TotalMilliseconds;
+        static readonly int MODEL_EXPIRY_TIMESPAN = (int)TimeSpan.FromMinutes(1).TotalMilliseconds;

 #endif


Simplify

Simplify

--- src/Compilers/CSharp/Portable/Parser/LanguageParser_InterpolatedString.cs
+++ src/Compilers/CSharp/Portable/Parser/LanguageParser_InterpolatedString.cs
@@ -44,16 +44,14 @@
                              (originalText[0] == '@' && originalText[1] == '$');

             Debug.Assert(originalToken.Kind == SyntaxKind.InterpolatedStringToken);
+
             var interpolations = ArrayBuilder<Lexer.Interpolation>.GetInstance();
-            SyntaxDiagnosticInfo error;
-            Range closeQuoteRange;
-            using (var tempLexer = new Lexer(Text.SourceText.From(originalText), this.Options, allowPreprocessorDirectives: false))
-            {
-                // compute the positions of the interpolations in the original string literal, and also compute/preserve
-                // lexical errors
-                var info = default(Lexer.TokenInfo);
-                tempLexer.ScanInterpolatedStringLiteralTop(interpolations, isVerbatim, ref info, out error, out closeQuoteRange);
-            }
+            using var tempLexer = new Lexer(SourceText.From(originalText), this.Options, allowPreprocessorDirectives: false);
+
+            // compute the positions of the interpolations in the original string literal, and also compute/preserve
+            // lexical errors
+            var info = default(Lexer.TokenInfo);
+            tempLexer.ScanInterpolatedStringLiteralTop(interpolations, isVerbatim, ref info, out var error, out var closeQuoteRange);

             // Make a token for the open quote $" or $@" or @$"
             var openQuoteRange = new Range(0, isVerbatim ? 3 : 2);
@@ -63,15 +61,7 @@
             var openQuote = SyntaxFactory.Token(
                 originalToken.GetLeadingTrivia(),
                 isVerbatim ? SyntaxKind.InterpolatedVerbatimStringStartToken : SyntaxKind.InterpolatedStringStartToken,
-                openQuoteText,
-                openQuoteText,
-                trailing: null);
-
-            // Make a token for the close quote " (even if it was missing)
-            var closeQuoteText = originalText[closeQuoteRange];
-            var closeQuote = closeQuoteText == ""
-                ? SyntaxFactory.MissingToken(SyntaxKind.InterpolatedStringEndToken).TokenWithTrailingTrivia(originalToken.GetTrailingTrivia())
-                : SyntaxFactory.Token(null, SyntaxKind.InterpolatedStringEndToken, closeQuoteText, closeQuoteText, originalToken.GetTrailingTrivia());
+                openQuoteText, openQuoteText, trailing: null);

             var builder = _pool.Allocate<InterpolatedStringContentSyntax>();
             if (interpolations.Count == 0)
@@ -115,6 +105,13 @@
             }

             interpolations.Free();
+
+            // Make a token for the close quote " (even if it was missing)
+            var closeQuoteText = originalText[closeQuoteRange];
+            var closeQuote = closeQuoteText == ""
+                ? SyntaxFactory.MissingToken(SyntaxKind.InterpolatedStringEndToken).TokenWithTrailingTrivia(originalToken.GetTrailingTrivia())
+                : SyntaxFactory.Token(null, SyntaxKind.InterpolatedStringEndToken, closeQuoteText, closeQuoteText, originalToken.GetTrailingTrivia());
+
             var result = SyntaxFactory.InterpolatedStringExpression(openQuote, builder, closeQuote);
             _pool.Free(builder);
             if (error != null)