[DeployUtils/RegistrationHelper] Added Objects to class constants so it would be easier in the futur to use DependencyInjection on it.

--- src/XrmFramework.DeployUtils/RegistrationHelper.cs
+++ src/XrmFramework.DeployUtils/RegistrationHelper.cs
@@ -1,33 +1,25 @@
 // Copyright (c) Christophe Gondouin (CGO Conseils). All rights reserved.
 // Licensed under the MIT License. See License.txt in the project root for license information.

-using Deploy;
-using Microsoft.Crm.Sdk.Messages;
-using Microsoft.Xrm.Sdk;
-using Microsoft.Xrm.Sdk.Messages;
-using Microsoft.Xrm.Sdk.Query;
-using Microsoft.Xrm.Tooling.Connector;
+
 using System;
 using System.Collections.Generic;
-using System.ComponentModel;
 using System.Configuration;
-using System.Diagnostics;
-using System.IO;
 using System.Linq;
-using System.Reflection;
-using System.Windows.Navigation;
 using XrmFramework.Definitions;
 using XrmFramework.DeployUtils.Configuration;
 using XrmFramework.DeployUtils.Context;
 using XrmFramework.DeployUtils.Model;
+using XrmFramework.DeployUtils.Utils;
 using XrmFramework.DeployUtils.Service;
-using XrmFramework.DeployUtils.Utils;

 namespace XrmFramework.DeployUtils
 {
     public static class RegistrationHelper
     {
-        private static ISolutionContext _solutionContext;
+        private static IRegistrationService _registrationService;
+        private static IAssemblyExporter _assemblyExporter;
+        private static IFlatAssemblyContext _flatAssemblyContext;

         public static void RegisterPluginsAndWorkflows<TPlugin>(string projectName)
         {
@@ -41,156 +33,154 @@

             RegistrationService.MaxConnectionTimeout = TimeSpan.FromMinutes(10);

-            var service = new RegistrationService(connectionString);
-
-            service.OrganizationServiceProxy?.EnableProxyTypes();
-
-            _solutionContext = new SolutionContext(service, pluginSolutionUniqueName);
-
-            var assemblyFactory = new AssemblyFactory(_solutionContext);
-
+            _registrationService = new RegistrationService(connectionString);
+
+            _registrationService.OrganizationServiceProxy?.EnableProxyTypes();
+
+            var solutionContext = new SolutionContext(_registrationService, pluginSolutionUniqueName);
+
+            var assemblyImporter = new AssemblyImporter(solutionContext);
+            _assemblyExporter = new AssemblyExporter(solutionContext);
+            var assemblyFactory = new AssemblyFactory(assemblyImporter);

             Console.Write("Fetching Local Assembly...");

             var localAssembly = assemblyFactory.CreateFromLocalAssemblyContext(typeof(TPlugin));
-            Console.WriteLine("\tDone");

             Console.WriteLine("Fetching Registered Assembly...");

-            var registeredAssembly = assemblyFactory.CreateFromRemoteAssemblyContext(service, projectName);
-            Console.WriteLine("\tDone");
+            var registeredAssembly = assemblyFactory.CreateFromRemoteAssemblyContext(_registrationService, projectName);

             Console.Write("Computing Difference...");

             AssemblyDiffFactory.ComputeAssemblyDiff(localAssembly, registeredAssembly);

-            Console.WriteLine("\tDone");
-
-
-            var flatAssembly = assemblyFactory.CreateFlatAssemblyContextFromAssemblyContext(localAssembly);
+
+            _flatAssemblyContext = assemblyFactory.CreateFlatAssemblyContextFromAssemblyContext(localAssembly);

             Console.WriteLine();
             Console.WriteLine("Registering assembly");

-            RegisterAssembly(service, flatAssembly);
+            RegisterAssembly();

             Console.WriteLine();
             Console.WriteLine(@"Registering Plugins");

-            RegisterPluginsV2(service, flatAssembly);
+            RegisterPlugins();

             Console.WriteLine();
             Console.WriteLine(@"Registering Custom Workflow activities");

-            RegisterWorkflowsV2(service, flatAssembly);
+            RegisterWorkflows();

             Console.WriteLine();
             Console.WriteLine(@"Registering Custom Apis");

-            RegisterCustomApisV2(service, flatAssembly);
-        }
-
-        public static void RegisterAssembly(IRegistrationService service, IFlatAssemblyContext assembly)
-        {
-
-            if (assembly.Assembly.RegistrationState == RegistrationState.ToCreate)
+            RegisterCustomApis();
+        }
+
+        public static void RegisterAssembly()
+        {
+
+            if (_flatAssemblyContext.Assembly.RegistrationState == RegistrationState.ToCreate)
             {
                 Console.WriteLine("Creating assembly");

-                assembly.Assembly.Id = service.Create(assembly.Assembly);
-            }
-            else if (assembly.Assembly.RegistrationState == RegistrationState.ToUpdate)
+                _flatAssemblyContext.Assembly.Id = _registrationService.Create(_flatAssemblyContext.Assembly);
+            }
+            else if (_flatAssemblyContext.Assembly.RegistrationState == RegistrationState.ToUpdate)
             {
                 Console.WriteLine();
                 Console.WriteLine(@"Assembly Exists, Cleaning Assembly");

-                CleanAssembly(service, assembly);
+                CleanAssembly();

                 Console.WriteLine("Updating plugin assembly");

-                service.Update(assembly.Assembly);
-            }
-            AddSolutionComponentToSolution(service, _solutionContext.SolutionName, assembly.Assembly.ToEntityReference());
-        }
-
-        public static void CleanAssembly(IRegistrationService service, IFlatAssemblyContext assembly)
+                _registrationService.Update(_flatAssemblyContext.Assembly);
+            }
+            var addSolutionComponentRequest = _assemblyExporter.CreateAddSolutionComponentRequest(_flatAssemblyContext.Assembly.ToEntityReference());
+            if(addSolutionComponentRequest != null)
+            {
+                _registrationService.Execute(addSolutionComponentRequest);
+            }
+        }
+
+        public static void CleanAssembly()
         {
             // Delete

-            DeleteAllComponents(service, assembly.StepImages);
-            DeleteAllComponents(service, assembly.Steps);
-            DeleteAllComponents(service, assembly.Plugins);
-            DeleteAllComponents(service, assembly.CustomApiRequestParameters);
-            DeleteAllComponents(service, assembly.CustomApiResponseProperties);
-            DeleteAllComponents(service, assembly.CustomApis);
-
-
-            var customApisTypeToDelete = assembly.CustomApis
+            DeleteAllComponents(_flatAssemblyContext.StepImages);
+            DeleteAllComponents(_flatAssemblyContext.Steps);
+            DeleteAllComponents(_flatAssemblyContext.Plugins);
+            DeleteAllComponents(_flatAssemblyContext.CustomApiRequestParameters);
+            DeleteAllComponents(_flatAssemblyContext.CustomApiResponseProperties);
+            DeleteAllComponents(_flatAssemblyContext.CustomApis);
+
+
+            var customApisTypeToDelete = _flatAssemblyContext.CustomApis
                     .Where(x => x.RegistrationState == RegistrationState.ToDelete)
                     .Select(x => x.PluginTypeId.Id)
                     .ToList();

-            service.DeleteMany(PluginTypeDefinition.EntityName, customApisTypeToDelete);
-        }
-
-        public static void RegisterPluginsV2(IRegistrationService service, IFlatAssemblyContext context)
-        {
-            CreateAllComponents(service, context.Plugins);
-            CreateAllComponents(service, context.Steps, doAddToSolution: true);
-            CreateAllComponents(service, context.StepImages);
-
-            UpdateAllComponents(service, context.Plugins);
-            UpdateAllComponents(service, context.Steps);
-            UpdateAllComponents(service, context.StepImages);
-        }
-
-        public static void RegisterWorkflowsV2(IRegistrationService service, IFlatAssemblyContext context)
-        {
-            CreateAllComponents(service, context.Workflows);
-
-            UpdateAllComponents(service, context.Workflows);
-        }
-
-        public static void RegisterCustomApisV2(IRegistrationService service, IFlatAssemblyContext context)
-        {
-            var customApisTypeToCreate = context.CustomApis
+            _registrationService.DeleteMany(PluginTypeDefinition.EntityName, customApisTypeToDelete);
+        }
+
+        public static void RegisterPlugins()
+        {
+            CreateAllComponents(_flatAssemblyContext.Plugins);
+            CreateAllComponents(_flatAssemblyContext.Steps, doAddToSolution: true);
+            CreateAllComponents(_flatAssemblyContext.StepImages);
+
+            UpdateAllComponents(_flatAssemblyContext.Plugins);
+            UpdateAllComponents(_flatAssemblyContext.Steps);
+            UpdateAllComponents(_flatAssemblyContext.StepImages);
+        }
+
+        public static void RegisterWorkflows()
+        {
+            CreateAllComponents(_flatAssemblyContext.Workflows);
+
+            UpdateAllComponents(_flatAssemblyContext.Workflows);
+        }
+
+        public static void RegisterCustomApis()
+        {
+            var customApisTypeToCreate = _flatAssemblyContext.CustomApis
                     .Where(x => x.RegistrationState == RegistrationState.ToCreate)
                     .ToList();
             foreach(var customApi in customApisTypeToCreate)
             {
-                var customApiPluginType = customApi.ToPluginType(context.Assembly.Id);
-                var id = service.Create(customApiPluginType);
-                customApi.PluginTypeId = new EntityReference(PluginTypeDefinition.EntityName, id);
-            }
-
-            CreateAllComponents(service, context.CustomApis, true, true);
-            CreateAllComponents(service, context.CustomApiRequestParameters, true, true);
-            CreateAllComponents(service, context.CustomApiResponseProperties, true, true);
-
-            UpdateAllComponents(service, context.CustomApis);
-            UpdateAllComponents(service, context.CustomApiRequestParameters);
-            UpdateAllComponents(service, context.CustomApiResponseProperties);
-        }
-
-        private static void UpdateAllComponents<T>(IRegistrationService service,
-                                                   IEnumerable<T> components) where T : ISolutionComponent
+                var customApiPluginType = _assemblyExporter.ToRegisterPluginType(_flatAssemblyContext.Assembly.Id, customApi.FullName);
+                var id = _registrationService.Create(customApiPluginType);
+                customApi.PluginTypeId.Id = id;
+            }
+
+            CreateAllComponents(_flatAssemblyContext.CustomApis, true, true);
+            CreateAllComponents(_flatAssemblyContext.CustomApiRequestParameters, true, true);
+            CreateAllComponents(_flatAssemblyContext.CustomApiResponseProperties, true, true);
+
+            UpdateAllComponents(_flatAssemblyContext.CustomApis);
+            UpdateAllComponents(_flatAssemblyContext.CustomApiRequestParameters);
+            UpdateAllComponents(_flatAssemblyContext.CustomApiResponseProperties);
+        }
+
+        private static void UpdateAllComponents<T>(IEnumerable<T> components) where T : ISolutionComponent
         {
             var updateComponents = components
                 .Where(x => x.RegistrationState == RegistrationState.ToUpdate)
                 .ToList();
             foreach (var component in updateComponents)
             {
-                var registeringComponent = component.ToRegisterComponent(_solutionContext);
-
-                service.Update(registeringComponent);
-            }
-        }
-
-        public static void CreateAllComponents<T>(IRegistrationService service,
-                                                  IEnumerable<T> components,
+                var registeringComponent = _assemblyExporter.ToRegisterComponent(component);
+                _registrationService.Update(registeringComponent);
+            }
+        }
+
+        private static void CreateAllComponents<T>(IEnumerable<T> components,
                                                   bool doAddToSolution = false,
                                                   bool doFetchCode = false) where T : ISolutionComponent
         {
@@ -199,44 +189,33 @@
                 .ToList();

             if (!createComponents.Any()) return;
-            int? entityTypeCode = doFetchCode ? service?.GetIntEntityTypeCode(createComponents.FirstOrDefault()?.EntityTypeName) : null;
+            int? entityTypeCode = doFetchCode ? _registrationService?.GetIntEntityTypeCode(createComponents.FirstOrDefault()?.EntityTypeName) : null;
             foreach (var component in createComponents)
             {
-                var registeringComponent = component.ToRegisterComponent(_solutionContext);
-                component.Id = service.Create(registeringComponent);
+                var registeringComponent = _assemblyExporter.ToRegisterComponent(component);
+                component.Id = _registrationService.Create(registeringComponent);
                 registeringComponent.Id = component.Id;
                 if (doAddToSolution)
                 {
-                    AddSolutionComponentToSolution(service, _solutionContext.SolutionName, registeringComponent.ToEntityReference(), entityTypeCode);
+                    var addSolutionComponentRequest = _assemblyExporter.CreateAddSolutionComponentRequest(registeringComponent.ToEntityReference(), entityTypeCode);
+                    if (addSolutionComponentRequest != null)
+                    {
+                        _registrationService.Execute(addSolutionComponentRequest);
+                    }
                 }
             }
         }

-        private static void DeleteAllComponents<T>(IRegistrationService service,
-                                                   IEnumerable<T> components) where T : ISolutionComponent
+        private static void DeleteAllComponents<T>(IEnumerable<T> components) where T : ISolutionComponent
         {
             var deleteComponents = components
                 .Where(x => x.RegistrationState == RegistrationState.ToDelete)
                 .ToList();
             foreach (var component in deleteComponents)
             {
-                service.Delete(component.EntityTypeName, component.Id);
-            }
-        }
-
-
-        private static void AddSolutionComponentToSolution(IRegistrationService service, string solutionUniqueName, EntityReference objectRef, int? objectTypeCode = null)
-        {
-            if (GetRegisteredSolutionComponent(objectRef) == null)
-            {
-                service.AddSolutionComponentToSolution(solutionUniqueName, objectRef, objectTypeCode);
-            }
-        }
-        private static SolutionComponent GetRegisteredSolutionComponent(EntityReference objectRef)
-        {
-            return _solutionContext.Components.FirstOrDefault(c => c.ObjectId.Equals(objectRef.Id));
-        }
-
+                _registrationService.Delete(component.EntityTypeName, component.Id);
+            }
+        }

         public static void ParseSolutionSettings(string projectName, out string pluginSolutionUniqueName, out string connectionString)
         {
@@ -258,239 +237,5 @@

             connectionString = ConfigurationManager.ConnectionStrings[xrmFrameworkConfigSection.SelectedConnection].ConnectionString;
         }
-
-
-        public static void RegisterPlugins(IRegistrationService service, IAssemblyContext assembly)
-        {
-            foreach (var plugin in assembly.Plugins)
-            {
-                Console.WriteLine($@"  - {plugin.FullName}");
-                switch (plugin.RegistrationState)
-                {
-                    case RegistrationState.Ignore:
-                        foreach (var step in plugin.Steps)
-                        {
-                            RegisterStep(service, step);
-                        }
-                        break;
-                    case RegistrationState.ToCreate:
-                        var registeringPluginType = AssemblyBridge.ToRegisterPluginType(plugin);
-                        plugin.Id = service.Create(registeringPluginType);
-                        foreach (var step in plugin.Steps)
-                        {
-                            step.ParentId = plugin.Id;
-                            RegisterStep(service, step);
-                        }
-                        break;
-                    case RegistrationState.ToDelete:
-                        foreach (var step in plugin.Steps)
-                        {
-                            RegisterStep(service, step);
-                        }
-                        break;
-                }
-            }
-        }
-
-        public static void RegisterStep(IRegistrationService service, Step step)
-        {
-            switch (step.RegistrationState)
-            {
-                case RegistrationState.Ignore:
-                    RegisterStepImage(service, step.PreImage);
-                    RegisterStepImage(service, step.PostImage);
-                    break;
-                case RegistrationState.ToCreate:
-                    Console.WriteLine($"\t\t Creating {step.Stage} {step.Message} of {step.EntityTypeName} ({step.MethodsDisplayName})");
-
-                    step.Id = service.Create(AssemblyBridge.ToRegisterStep(step, _solutionContext));
-                    step.PreImage.ParentId = step.Id;
-                    step.PostImage.ParentId = step.Id;
-
-                    RegisterStepImage(service, step.PreImage);
-                    RegisterStepImage(service, step.PostImage);
-
-                    AddSolutionComponentToSolution(service, _solutionContext.SolutionName,
-                                   new EntityReference(SdkMessageProcessingStepDefinition.EntityName, step.Id));
-                    break;
-                case RegistrationState.ToUpdate:
-                    Console.WriteLine($"\t\t Updating {step.Stage} {step.Message} of {step.EntityTypeName} ({step.MethodsDisplayName})");
-                    service.Update(AssemblyBridge.ToRegisterStep(step, _solutionContext));
-
-                    RegisterStepImage(service, step.PreImage);
-                    RegisterStepImage(service, step.PostImage);
-
-                    break;
-                case RegistrationState.ToDelete:
-                    break;
-            }
-        }
-
-        public static void RegisterStepImage(IRegistrationService service, StepImage image)
-        {
-            switch (image.RegistrationState)
-            {
-                case RegistrationState.Ignore:
-                    return;
-                case RegistrationState.ToCreate:
-                    image.Id = service.Create(AssemblyBridge.ToRegisterImage(image));
-                    break;
-                case RegistrationState.ToUpdate:
-                    service.Update(AssemblyBridge.ToRegisterImage(image));
-                    break;
-                default:
-                    return;
-            }
-        }
-
-        public static void RegisterWorkflows(IRegistrationService service, IAssemblyContext localAssembly, IAssemblyContext registeredAssembly)
-        {
-            var registeredPlugins = registeredAssembly.Plugins;
-            foreach (var customWf in localAssembly.Plugins.Where(p => p.IsWorkflow))
-            {
-                var registeredPluginType = registeredPlugins.FirstOrDefault(p => p.FullName == customWf.FullName);
-
-                Console.WriteLine($@"  - {customWf.FullName}");
-
-                var registeringPluginType = AssemblyBridge.ToRegisterCustomWorkflowType(registeredAssembly.Assembly.Id, customWf.FullName, customWf.DisplayName);
-
-                if (registeredPluginType == null)
-                {
-                    registeredPluginType.Id = service.Create(registeringPluginType);
-                }
-                if (registeredPluginType.FullName != customWf.DisplayName)
-                {
-                    service.Update(registeringPluginType);
-                }
-            }
-        }
-
-        public static void RegisterCustomApis(IRegistrationService service, IAssemblyContext localAssembly, IAssemblyContext registeredAssembly)
-        {
-            var customApiEntityTypeCode = service.GetIntEntityTypeCode(CustomApiDefinition.EntityName);
-            var customApiParameterEntityTypeCode = service.GetIntEntityTypeCode(CustomApiRequestParameterDefinition.EntityName);
-            var customApiResponseEntityTypeCode = service.GetIntEntityTypeCode(CustomApiResponsePropertyDefinition.EntityName);
-
-            var registeredPluginTypes = registeredAssembly.Plugins;
-            var registeredCustomApis = registeredAssembly.CustomApis;
-
-            foreach (var customApi in localAssembly.CustomApis)
-            {
-                Console.WriteLine($@"  - {customApi.FullName}");
-
-                var registeredPluginType = registeredPluginTypes.FirstOrDefault(p => p.FullName == customApi.FullName);
-                var registeringPlugin = AssemblyBridge.ToRegisterPluginType(registeredAssembly.Assembly.Id, customApi.FullName);
-
-                if (registeredPluginType == null)
-                {
-                    registeredPluginType.Id = service.Create(registeringPlugin);
-                }
-
-                customApi.PluginTypeId = new EntityReference(PluginTypeDefinition.EntityName, registeredPluginType.Id);
-
-                var existingCustomApi = registeredCustomApis.FirstOrDefault(c => c.UniqueName == customApi.UniqueName);
-
-                if (existingCustomApi == null)
-                {
-                    existingCustomApi = customApi;
-                    existingCustomApi.Id = service.Create(customApi);
-                    customApi.Id = existingCustomApi.Id;
-                }
-                else
-                {
-                    customApi.Id = existingCustomApi.Id;
-                    service.Update(customApi);
-                }
-
-                foreach (var customApiRequestParameter in customApi.InArguments)
-                {
-                    UpdateCustomApiComponent(service, existingCustomApi, customApiRequestParameter);
-
-                    AddSolutionComponentToSolution(service, _solutionContext.SolutionName, customApiRequestParameter.ToEntityReference(), customApiParameterEntityTypeCode);
-                }
-
-                foreach (var customApiResponseProperty in customApi.OutArguments)
-                {
-                    UpdateCustomApiComponent(service, existingCustomApi, customApiResponseProperty);
-
-                    AddSolutionComponentToSolution(service, _solutionContext.SolutionName, customApiResponseProperty.ToEntityReference(), customApiResponseEntityTypeCode);
-                }
-
-                AddSolutionComponentToSolution(service, _solutionContext.SolutionName, customApi.ToEntityReference(), customApiEntityTypeCode);
-            }
-        }
-
-        private static void UpdateCustomApiComponent<T>(IRegistrationService service, CustomApi existingCustomApi,
-                                             T customApiComponent)
-    where T : Entity, ICustomApiComponent
-        {
-            ICustomApiComponent existingComponent = existingCustomApi.InArguments.FirstOrDefault(p => p.UniqueName == customApiComponent.UniqueName);
-
-            if (existingComponent == null)
-            {
-                existingComponent = existingCustomApi.OutArguments.FirstOrDefault(p => p.UniqueName == customApiComponent.UniqueName);
-            }
-
-            customApiComponent.CustomApiId = new EntityReference(CustomApiDefinition.EntityName, existingCustomApi.Id);
-
-            if (existingComponent == null)
-            {
-                customApiComponent.Id = service.Create(customApiComponent);
-            }
-            else
-            {
-                customApiComponent.Id = existingComponent.Id;
-                service.Update(customApiComponent);
-            }
-        }
-
-
-        public static void UpdateStepImages(IRegistrationService service, Step convertedStep, Step registeredStep, PluginImageType imageType)
-        {
-            StepImage image;
-
-            bool doRegisterImage;
-            switch (imageType)
-            {
-                case PluginImageType.PostImage:
-                    doRegisterImage = convertedStep.PostImage.IsUsed && convertedStep.Message != Messages.Delete.ToString();
-                    image = convertedStep.PostImage;
-                    break;
-
-                case PluginImageType.PreImage:
-                    doRegisterImage = convertedStep.PreImage.IsUsed;
-                    image = convertedStep.PreImage;
-                    break;
-
-                default:
-                    throw new InvalidEnumArgumentException("Unknown Enum");
-            }
-
-            if (doRegisterImage)
-            {
-
-                var registeringImage = AssemblyBridge.ToRegisterImage(image); ;
-                if ((imageType == PluginImageType.PreImage && registeredStep.PreImage.IsUsed == false)
-                  || (imageType == PluginImageType.PostImage && registeredStep.PostImage.IsUsed == false))
-                {
-                    registeringImage.Id = service.Create(registeringImage);
-                }
-                else if (registeredStep.PostImage.JoinedAttributes != convertedStep.PostImage.JoinedAttributes)
-                {
-                    registeringImage.Attributes1 = convertedStep.PostImage.JoinedAttributes;
-                    service.Update(registeringImage);
-                }
-            }
-            else if ((imageType == PluginImageType.PreImage && registeredStep.PreImage.IsUsed == true))
-            {
-                service.Delete(SdkMessageProcessingStepImageDefinition.EntityName, registeredStep.PreImage.Id);
-            }
-            else if ((imageType == PluginImageType.PostImage && registeredStep.PostImage.IsUsed == true))
-            {
-                service.Delete(SdkMessageProcessingStepImageDefinition.EntityName, registeredStep.PostImage.Id);
-
-            }
-        }
-
     }
 }


Add tests

Add tests

--- src/Yarhl.UnitTests/FileSystem/NodeFactoryTests.cs
+++ src/Yarhl.UnitTests/FileSystem/NodeFactoryTests.cs
@@ -22,6 +22,7 @@
     using System;
     using System.IO;
     using System.Linq;
+    using System.Text.RegularExpressions;
     using NUnit.Framework;
     using Yarhl.FileSystem;
     using Yarhl.IO;
@@ -310,7 +311,7 @@
             Directory.CreateDirectory(tempDir);

             Assert.Throws<ArgumentNullException>(() =>
-                NodeFactory.FromDirectory(tempDir, null));
+                NodeFactory.FromDirectory(tempDir, "*", null));

             Directory.Delete(tempDir, true);
         }
@@ -635,5 +636,96 @@
             File.SetAttributes(tempFile, FileAttributes.Normal);
             File.Delete(tempFile);
         }
+
+        // Advanced filter
+        [Test]
+        public void CreateFromDirectoryAdvancedFilterAndEmptyPath()
+        {
+            Assert.That(
+                () => NodeFactory.FromDirectory(null, _ => true),
+                Throws.ArgumentNullException);
+            Assert.That(
+                () => NodeFactory.FromDirectory(string.Empty, _ => true),
+                Throws.ArgumentNullException);
+        }
+
+        [Test]
+        public void CreateFromDirectoryAdvancedFilterWithFinalSlash()
+        {
+            string tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
+            Directory.CreateDirectory(tempDir);
+
+            string tempFile1 = Path.Combine(tempDir, Path.GetRandomFileName());
+            File.Create(tempFile1).Dispose();
+
+            Node node = NodeFactory.FromDirectory(tempDir + Path.DirectorySeparatorChar, _ => true);
+            Assert.AreEqual(Path.GetFileName(tempDir), node.Name);
+            Assert.IsTrue(node.IsContainer);
+            Assert.AreEqual(1, node.Children.Count);
+            Assert.IsTrue(node.Children.Any(n => n.Name == Path.GetFileName(tempFile1)));
+
+            node.Dispose();
+            Directory.Delete(tempDir, true);
+        }
+
+        [Test]
+        public void CreateFromDirectoryWithFilesAndAdvancedFilter()
+        {
+            string tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
+            Directory.CreateDirectory(tempDir);
+
+            string tempFile1 = Path.Combine(tempDir, "file1.bin");
+            File.Create(tempFile1).Dispose();
+            string tempFile2 = Path.Combine(tempDir, "arch2.bin");
+            File.Create(tempFile2).Dispose();
+            string tempFile3 = Path.Combine(tempDir, "file3.txt");
+            File.Create(tempFile3).Dispose();
+
+            Node node = NodeFactory.FromDirectory(tempDir, x => Regex.IsMatch(x, @"file\d\.(txt|bin)$"));
+            Assert.AreEqual(Path.GetFileName(tempDir), node.Name);
+            Assert.AreEqual(2, node.Children.Count);
+            Assert.IsTrue(node.Children.Any(n => n.Name == Path.GetFileName(tempFile1)));
+            Assert.IsTrue(node.Children.Any(n => n.Name == Path.GetFileName(tempFile3)));
+            node.Dispose();
+
+            node = NodeFactory.FromDirectory(tempDir, x => x.EndsWith(".bin"));
+            Assert.AreEqual(Path.GetFileName(tempDir), node.Name);
+            Assert.AreEqual(2, node.Children.Count);
+            Assert.IsTrue(node.Children.Any(n => n.Name == Path.GetFileName(tempFile1)));
+            Assert.IsTrue(node.Children.Any(n => n.Name == Path.GetFileName(tempFile2)));
+
+            node.Dispose();
+            Directory.Delete(tempDir, true);
+        }
+
+        [Test]
+        public void CreateFromDirectoryWithFilesAndNameAndAdvancedFilter()
+        {
+            string tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
+            Directory.CreateDirectory(tempDir);
+
+            string tempFile1 = Path.Combine(tempDir, "file1.bin");
+            File.Create(tempFile1).Dispose();
+            string tempFile2 = Path.Combine(tempDir, "arch2.bin");
+            File.Create(tempFile2).Dispose();
+            string tempFile3 = Path.Combine(tempDir, "file3.txt");
+            File.Create(tempFile3).Dispose();
+
+            Node node = NodeFactory.FromDirectory(tempDir, x => Regex.IsMatch(x, @"file\d\.(txt|bin)$"), "MyDir");
+            Assert.AreEqual("MyDir", node.Name);
+            Assert.AreEqual(2, node.Children.Count);
+            Assert.IsTrue(node.Children.Any(n => n.Name == Path.GetFileName(tempFile1)));
+            Assert.IsTrue(node.Children.Any(n => n.Name == Path.GetFileName(tempFile3)));
+            node.Dispose();
+
+            node = NodeFactory.FromDirectory(tempDir, x => x.EndsWith(".bin"), "MyDir");
+            Assert.AreEqual("MyDir", node.Name);
+            Assert.AreEqual(2, node.Children.Count);
+            Assert.IsTrue(node.Children.Any(n => n.Name == Path.GetFileName(tempFile1)));
+            Assert.IsTrue(node.Children.Any(n => n.Name == Path.GetFileName(tempFile2)));
+
+            node.Dispose();
+            Directory.Delete(tempDir, true);
+        }
     }
 }


ShipParameterViewのParameterValueの型をstringに

--- Miotsukushi/View/CommonParts/ShipParameterView.xaml.cs
+++ Miotsukushi/View/CommonParts/ShipParameterView.xaml.cs
@@ -35,15 +35,15 @@
             }
         }

-        public static readonly DependencyProperty ParameterValueProperty = DependencyProperty.Register("ParameterValue", typeof(int), typeof(ShipParameterView));
+        public static readonly DependencyProperty ParameterValueProperty = DependencyProperty.Register("ParameterValue", typeof(string), typeof(ShipParameterView));

         [Description("パラメータの値"), Category("みおつくし")]
         [BindableAttribute(true)]
-        public int ParameterValue
+        public string ParameterValue
         {
             get
             {
-                return (int)GetValue(ParameterValueProperty);
+                return (string)GetValue(ParameterValueProperty);
             }
             set
             {


Update OBBadge.cs

Update OBBadge.cs

Added missing comments

--- Scripts/Badges/OBBadge.cs
+++ Scripts/Badges/OBBadge.cs
@@ -75,10 +75,20 @@
 		Debug.Log ("Badge Recieved = " + badge.ToString ());
 	}

+	/**
+	 * public get_badge() return this badges JSONNode data
+	 * Params: Void
+	 * Returns: JSONNode: The badge data
+	 */
 	public JSONNode get_badge() {
 		return badge;
 	}

+	/**
+	 * public get_texture() get the texture image of this badge
+	 * Params: Void
+	 * Returns: Texture: The badge image
+	 */
 	public Texture get_texture() {
 		return prvTexture;
 	}


Attach content hide on a choice message

Attach content hide on a choice message

--- Diplomata/Editor/Windows/TalkableMessagesEditor.cs
+++ Diplomata/Editor/Windows/TalkableMessagesEditor.cs
@@ -82,7 +82,7 @@
     {
       TalkableMessagesEditor window =
         (TalkableMessagesEditor) GetWindow(typeof(TalkableMessagesEditor), false, "Messages", true);
-      window.minSize = new Vector2(1100, 300);
+      window.minSize = new Vector2(370, 300);

       TalkableMessagesEditor.state = state;

@@ -700,47 +700,53 @@
               EditorGUILayout.Separator();

               #region Attached Content
-
-              foreach (var attachedContent in currentMessage.attachedContent)
-              {
-                var currentAttachedContent =
-                  DictionariesHelper.ContainsKey(attachedContent.content, options.currentLanguage);
-
-                if (currentAttachedContent == null)
+              if (!currentMessage.isAChoice)
+              {
+                if (currentMessage.attachedContent == null)
+                  currentMessage.attachedContent = new AttachedContent[0];
+
+                foreach (var attachedContent in currentMessage.attachedContent)
                 {
-                  attachedContent.content = ArrayHelper.Add(attachedContent.content,
-                    new LanguageDictionary(options.currentLanguage, "[ Message content here ]"));
-                  currentAttachedContent =
+                  var currentAttachedContent =
                     DictionariesHelper.ContainsKey(attachedContent.content, options.currentLanguage);
+
+                  if (currentAttachedContent == null)
+                  {
+                    attachedContent.content = ArrayHelper.Add(attachedContent.content,
+                      new LanguageDictionary(options.currentLanguage, "[ Message content here ]"));
+                    currentAttachedContent =
+                      DictionariesHelper.ContainsKey(attachedContent.content, options.currentLanguage);
+                  }
+
+                  GUIHelper.textContent.text = currentAttachedContent.value;
+                  height = textAreaStyle.CalcHeight(GUIHelper.textContent, context.columnWidth);
+
+                  EditorGUILayout.BeginHorizontal(GUILayout.Height(height));
+                  currentAttachedContent.value = EditorGUILayout.TextArea(currentAttachedContent.value, textAreaStyle,
+                    GUILayout.Width(context.columnWidth - 30), GUILayout.Height(height));
+                  if (GUILayout.Button("X", GUILayout.Width(20), GUILayout.Height(GUIHelper.BUTTON_HEIGHT_SMALL)))
+                  {
+                    if (EditorUtility.DisplayDialog("Are you sure?",
+                      "Do you really want to delete?\nThis content will be lost forever.", "Yes", "No"))
+                    {
+                      currentMessage.attachedContent =
+                        ArrayHelper.Remove(currentMessage.attachedContent, attachedContent);
+                    }
+                  }
+
+                  EditorGUILayout.EndHorizontal();
+
+                  EditorGUILayout.Separator();
                 }

-                GUIHelper.textContent.text = currentAttachedContent.value;
-                height = textAreaStyle.CalcHeight(GUIHelper.textContent, context.columnWidth);
-
-                EditorGUILayout.BeginHorizontal(GUILayout.Height(height));
-                currentAttachedContent.value = EditorGUILayout.TextArea(currentAttachedContent.value, textAreaStyle,
-                  GUILayout.Width(context.columnWidth - 30), GUILayout.Height(height));
-                if (GUILayout.Button("X", GUILayout.Width(20), GUILayout.Height(GUIHelper.BUTTON_HEIGHT_SMALL)))
+                // Attach content button.
+                if (GUILayout.Button("Attach content", GUILayout.Width(context.columnWidth),
+                  GUILayout.Height(GUIHelper.BUTTON_HEIGHT_SMALL)))
                 {
-                  if (EditorUtility.DisplayDialog("Are you sure?",
-                    "Do you really want to delete?\nThis content will be lost forever.", "Yes", "No"))
-                  {
-                    currentMessage.attachedContent =
-                      ArrayHelper.Remove(currentMessage.attachedContent, attachedContent);
-                  }
+                  currentMessage.attachedContent =
+                    ArrayHelper.Add(currentMessage.attachedContent, new AttachedContent());
                 }
-
-                EditorGUILayout.EndHorizontal();
-
-                EditorGUILayout.Separator();
-              }
-
-              if (GUILayout.Button("Attach content", GUILayout.Width(context.columnWidth),
-                GUILayout.Height(GUIHelper.BUTTON_HEIGHT_SMALL)))
-              {
-                currentMessage.attachedContent = ArrayHelper.Add(currentMessage.attachedContent, new AttachedContent());
-              }
-
+              }
               #endregion
             }

@@ -2408,4 +2414,4 @@
       }
     }
   }
-}+}


Add support for the Locale and VatRegulation properties in the OrganizationResponse class

--- Mollie.Api/Models/Organization/OrganizationResponse.cs
+++ Mollie.Api/Models/Organization/OrganizationResponse.cs
@@ -18,6 +18,11 @@
         public string Name { get; set; }

         /// <summary>
+        /// The preferred locale of the merchant which has been set in Mollie Dashboard.
+        /// </summary>
+        public string Locale { get; set; }
+
+        /// <summary>
         /// The address of the organization.
         /// </summary>
         public AddressObject Address { get; set; }
@@ -33,6 +38,11 @@
         public string VatNumber { get; set; }

         /// <summary>
+        /// The organization’s VAT regulation, if based in the European Union. Either shifted (VAT is shifted) or dutch (Dutch VAT rate).
+        /// </summary>
+        public string VatRegulation { get; set; }
+
+        /// <summary>
         /// An object with several URL objects relevant to the organization. Every URL object will contain an href and a type field.
         /// </summary>
         [JsonProperty("_links")]


Add tests

Add tests

--- osu.Framework.Tests/Visual/Input/TestSceneKeyBindingContainer.cs
+++ osu.Framework.Tests/Visual/Input/TestSceneKeyBindingContainer.cs
@@ -5,13 +5,16 @@
 using System.Collections.Generic;
 using NUnit.Framework;
 using osu.Framework.Graphics;
+using osu.Framework.Graphics.UserInterface;
 using osu.Framework.Input.Bindings;
 using osu.Framework.Testing;
+using osuTK;
+using osuTK.Input;

 namespace osu.Framework.Tests.Visual.Input
 {
     [HeadlessTest]
-    public class TestSceneKeyBindingContainer : FrameworkTestScene
+    public class TestSceneKeyBindingContainer : ManualInputManagerTestScene
     {
         [Test]
         public void TestTriggerWithNoKeyBindings()
@@ -26,23 +29,104 @@
                 pressedReceived = false;
                 releasedReceived = false;

-                Clear();
-
-                Add(keyBindingContainer = new TestKeyBindingContainer
+                Child = keyBindingContainer = new TestKeyBindingContainer
                 {
                     Child = new TestKeyBindingReceptor
                     {
                         Pressed = _ => pressedReceived = true,
                         Released = _ => releasedReceived = true
                     }
-                });
+                };
             });

-            AddStep("trigger press", () => keyBindingContainer.TriggerPressed(TestAction.Action1));
+            AddStep("trigger press", () => keyBindingContainer.TriggerPressed(TestAction.ActionA));
             AddAssert("press received", () => pressedReceived);

-            AddStep("trigger release", () => keyBindingContainer.TriggerReleased(TestAction.Action1));
+            AddStep("trigger release", () => keyBindingContainer.TriggerReleased(TestAction.ActionA));
             AddAssert("release received", () => releasedReceived);
+        }
+
+        [Test]
+        public void TestPressKeyBeforeKeyBindingContainerAdded()
+        {
+            List<TestAction> pressedActions = new List<TestAction>();
+            List<TestAction> releasedActions = new List<TestAction>();
+
+            AddStep("press key B", () => InputManager.PressKey(Key.B));
+
+            AddStep("add container", () =>
+            {
+                pressedActions.Clear();
+                releasedActions.Clear();
+
+                Child = new TestKeyBindingContainer
+                {
+                    Child = new TestKeyBindingReceptor
+                    {
+                        Pressed = a => pressedActions.Add(a),
+                        Released = a => releasedActions.Add(a)
+                    }
+                };
+            });
+
+            AddStep("press key A", () => InputManager.PressKey(Key.A));
+            AddAssert("only one action triggered", () => pressedActions.Count == 1);
+            AddAssert("ActionA triggered", () => pressedActions[0] == TestAction.ActionA);
+            AddAssert("no actions released", () => releasedActions.Count == 0);
+
+            AddStep("release key A", () => InputManager.ReleaseKey(Key.A));
+            AddAssert("only one action triggered", () => pressedActions.Count == 1);
+            AddAssert("only one action released", () => releasedActions.Count == 1);
+            AddAssert("ActionA released", () => releasedActions[0] == TestAction.ActionA);
+        }
+
+        [Test]
+        public void TestKeyHandledByOtherDrawableDoesNotTrigger()
+        {
+            List<TestAction> pressedActions = new List<TestAction>();
+            List<TestAction> releasedActions = new List<TestAction>();
+
+            TextBox textBox = null;
+
+            AddStep("add children", () =>
+            {
+                pressedActions.Clear();
+                releasedActions.Clear();
+
+                Child = new TestKeyBindingContainer
+                {
+                    Children = new Drawable[]
+                    {
+                        textBox = new BasicTextBox
+                        {
+                            Anchor = Anchor.Centre,
+                            Origin = Anchor.Centre,
+                            Size = new Vector2(200, 30)
+                        },
+                        new TestKeyBindingReceptor
+                        {
+                            Pressed = a => pressedActions.Add(a),
+                            Released = a => releasedActions.Add(a)
+                        }
+                    }
+                };
+            });
+
+            AddStep("focus textbox and move mouse away", () =>
+            {
+                InputManager.MoveMouseTo(textBox);
+                InputManager.Click(MouseButton.Left);
+                InputManager.MoveMouseTo(textBox, new Vector2(0, 100));
+            });
+
+            AddStep("press enter", () => InputManager.PressKey(Key.Enter));
+            AddStep("press mouse button", () => InputManager.PressButton(MouseButton.Left));
+
+            AddStep("release enter", () => InputManager.ReleaseKey(Key.Enter));
+            AddStep("release mouse button", () => InputManager.ReleaseButton(MouseButton.Left));
+
+            AddAssert("no pressed actions", () => pressedActions.Count == 0);
+            AddAssert("no released actions", () => releasedActions.Count == 0);
         }

         private class TestKeyBindingReceptor : Drawable, IKeyBindingHandler<TestAction>
@@ -69,12 +153,19 @@

         private class TestKeyBindingContainer : KeyBindingContainer<TestAction>
         {
-            public override IEnumerable<IKeyBinding> DefaultKeyBindings => null;
+            public override IEnumerable<IKeyBinding> DefaultKeyBindings => new IKeyBinding[]
+            {
+                new KeyBinding(InputKey.A, TestAction.ActionA),
+                new KeyBinding(new KeyCombination(InputKey.A, InputKey.B), TestAction.ActionAB),
+                new KeyBinding(InputKey.Enter, TestAction.ActionEnter),
+            };
         }

         private enum TestAction
         {
-            Action1
+            ActionA,
+            ActionAB,
+            ActionEnter
         }
     }
 }


Remove tests for Base16 class

Remove tests for Base16 class

--- tests/Formatting/Base16Tests.cs
+++ tests/Formatting/Base16Tests.cs
@@ -1,108 +0,0 @@
-using System;
-using System.Text;
-using NSec.Cryptography.Formatting;
-using Xunit;
-
-namespace NSec.Tests.Formatting
-{
-    public static class Base16Tests
-    {
-        [Theory]
-        [InlineData("", "")]
-        [InlineData("f", "66")]
-        [InlineData("fo", "666F")]
-        [InlineData("foo", "666F6F")]
-        [InlineData("foob", "666F6F62")]
-        [InlineData("fooba", "666F6F6261")]
-        [InlineData("foobar", "666F6F626172")]
-        public static void Encode(string input, string expected)
-        {
-            var bytes = Encoding.UTF8.GetBytes(input);
-            var base16 = new char[Base16.GetEncodedLength(bytes.Length)];
-            Base16.Encode(bytes, base16);
-            Assert.Equal(expected, new string(base16));
-        }
-
-        [Theory]
-        [InlineData("", "")]
-        [InlineData("f", "66")]
-        [InlineData("fo", "666F")]
-        [InlineData("foo", "666F6F")]
-        [InlineData("foob", "666F6F62")]
-        [InlineData("fooba", "666F6F6261")]
-        [InlineData("foobar", "666F6F626172")]
-        public static void EncodeString(string input, string expected)
-        {
-            var bytes = Encoding.UTF8.GetBytes(input);
-            Assert.Equal(expected, Base16.Encode(bytes));
-        }
-
-        [Theory]
-        [InlineData("", "")]
-        [InlineData("66", "f")]
-        [InlineData("666F", "fo")]
-        [InlineData("666F6F", "foo")]
-        [InlineData("666F6F62", "foob")]
-        [InlineData("666F6F6261", "fooba")]
-        [InlineData("666F6F626172", "foobar")]
-        [InlineData("666f", "fo")]
-        [InlineData("666f6f", "foo")]
-        [InlineData("666f6f62", "foob")]
-        [InlineData("666f6f6261", "fooba")]
-        [InlineData("666f6f626172", "foobar")]
-        public static void Decode(string input, string expected)
-        {
-            var bytes = Encoding.UTF8.GetBytes(expected);
-            var base16 = input.ToCharArray();
-            Assert.True(Base16.TryGetDecodedLength(base16, out var length));
-            var actual = new byte[length];
-            Assert.True(Base16.TryDecode(base16, actual));
-            Assert.Equal(bytes, actual);
-        }
-
-        [Theory]
-        [InlineData("", "")]
-        [InlineData("66", "f")]
-        [InlineData("666F", "fo")]
-        [InlineData("666F6F", "foo")]
-        [InlineData("666F6F62", "foob")]
-        [InlineData("666F6F6261", "fooba")]
-        [InlineData("666F6F626172", "foobar")]
-        public static void DecodeString(string input, string expected)
-        {
-            var bytes = Encoding.UTF8.GetBytes(expected);
-            Assert.Equal(bytes, Base16.Decode(input));
-        }
-
-        [Theory]
-        [InlineData("6")]
-        [InlineData("666")]
-        [InlineData("666F6")]
-        [InlineData("666F6F6")]
-        public static void DecodeInvalidLength(string input)
-        {
-            var base16 = input.ToCharArray();
-            Assert.False(Base16.TryGetDecodedLength(base16, out var length));
-            Assert.Equal(0, length);
-        }
-
-        [Theory]
-        [InlineData(0)]
-        [InlineData(1)]
-        public static void DecodeInvalidChars(int pos)
-        {
-            var base16 = "00".ToCharArray();
-            for (var i = 0; i < 65536; i++)
-            {
-                if (i >= '0' && i <= '9' ||
-                    i >= 'A' && i <= 'F' ||
-                    i >= 'a' && i <= 'f')
-                    continue;
-                base16[pos] = (char)i;
-                Assert.True(Base16.TryGetDecodedLength(base16, out var length));
-                var actual = new byte[length];
-                Assert.False(Base16.TryDecode(base16, actual));
-            }
-        }
-    }
-}


Fixing another typo

Fixing another typo

--- Framework.Core/System/Threading/LazyInitializer.cs
+++ Framework.Core/System/Threading/LazyInitializer.cs
@@ -57,7 +57,7 @@

         public static T EnsureInitialized<T>(ref T target, ref bool initialized, ref object syncLock, Func<T> valueFactory)
         {
-            // MICROSOFT doens't do a null check for valueFactory
+            // MICROSOFT doesn't do a null check for valueFactory
             if (syncLock == null)
             {
                 Interlocked.CompareExchange(ref syncLock, new object(), null);


added integration test for event payloads

--- Octokit.Tests.Integration/Clients/EventsClientTests.cs
+++ Octokit.Tests.Integration/Clients/EventsClientTests.cs
@@ -1,4 +1,7 @@
-using System.Threading.Tasks;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
 using Xunit;

 namespace Octokit.Tests.Integration.Clients
@@ -13,7 +16,83 @@
                 var github = Helper.GetAuthenticatedClient();
                 var events = await github.Activity.Events.GetUserPerformed("shiftkey");
                 Assert.NotEmpty(events);
-            }
+            }
+        }
+
+        public class EventPayloads
+        {
+            readonly IEnumerable<Activity> _events;
+            public EventPayloads()
+            {
+                var github = Helper.GetAuthenticatedClient();
+                _events = github.Activity.Events.GetUserPerformed("shiftkey").Result;
+            }
+
+            [Fact]
+            public void AllEventsHavePayloads()
+            {
+                Assert.True(_events.All(e => e.Payload != null));
+            }
+
+            [Fact]
+            public void IssueCommentPayloadEventDeserializesCorrectly()
+            {
+                var commentEvent = _events.FirstOrDefault(e => e.Id == "2628548686");
+                Assert.NotNull(commentEvent);
+                Assert.Equal("IssueCommentEvent", commentEvent.Type);
+                var commentPayload = commentEvent.Payload as IssueCommentPayload;
+                Assert.NotNull(commentPayload);
+                Assert.Equal("created", commentPayload.Action);
+                Assert.NotNull(commentPayload.Comment);
+                Assert.Equal("@joshvera just going to give this a once-over to ensure it matches up with our other conventions before merging", commentPayload.Comment.Body);
+                Assert.NotNull(commentPayload.Issue);
+                Assert.Equal(742, commentPayload.Issue.Number);
+            }
+
+            [Fact]
+            public void PushEventPayloadDeserializesCorrectly()
+            {
+                var pushEvent = _events.FirstOrDefault(e => e.Id == "2628858765");
+                Assert.NotNull(pushEvent);
+                Assert.Equal("PushEvent", pushEvent.Type);
+                var pushPayload = pushEvent.Payload as PushEventPayload;
+                Assert.NotNull(pushPayload);
+                Assert.NotNull(pushPayload.Commits);
+                Assert.Equal(1, pushPayload.Commits.Count);
+                Assert.Equal("3cdcba0ccbea0e6d13ae94249fbb294d71648321", pushPayload.Commits.FirstOrDefault().Sha);
+                Assert.Equal("3cdcba0ccbea0e6d13ae94249fbb294d71648321", pushPayload.Head);
+                Assert.Equal("refs/heads/release-candidate", pushPayload.Ref);
+                Assert.Equal(1, pushPayload.Size);
+            }
+
+            [Fact]
+            public void PREventPayloadDeserializesCorrectly()
+            {
+                var prEvent = _events.FirstOrDefault(e => e.Id == "2628718313");
+                Assert.NotNull(prEvent);
+                Assert.Equal("PullRequestEvent", prEvent.Type);
+                var prPayload = prEvent.Payload as PullRequestEventPayload;
+                Assert.NotNull(prPayload);
+                Assert.Equal("opened", prPayload.Action);
+                Assert.Equal(743, prPayload.Number);
+                Assert.NotNull(prPayload.PullRequest);
+                Assert.Equal(743, prPayload.PullRequest.Number);
+            }
+
+            [Fact]
+            public void PRReviewCommentEventPayloadDeserializesCorrectly()
+            {
+                var prrcEvent = _events.First(e => e.Id == "2623246246");
+                Assert.NotNull(prrcEvent);
+                Assert.Equal("PullRequestReviewCommentEvent", prrcEvent.Type);
+                var prrcPayload = prrcEvent.Payload as PullRequestCommentPayload;
+                Assert.NotNull(prrcPayload);
+                Assert.Equal("created", prrcPayload.Action);
+                Assert.NotNull(prrcPayload.Comment);
+                Assert.Equal("Suuuuuuuuure :P", prrcPayload.Comment.Body);
+                Assert.NotNull(prrcPayload.PullRequest);
+                Assert.Equal(737, prrcPayload.PullRequest.Number);
+            }
         }
     }
 }


sigh. fried brain.

sigh. fried brain.

--- OpenSim/Services/HypergridService/GatekeeperService.cs
+++ OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -284,7 +284,7 @@
             }

             if (userURL == m_ExternalName)
-                m_UserAgentService.VerifyAgent(aCircuit.SecureSessionID, aCircuit.ServiceSessionID);
+                m_UserAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID);
             else
             {
                 Object[] args = new Object[] { userURL };


refactor formatting the post message

refactor formatting the post message

--- OutlookMatters/ContextMenu/MailItemContextMenuEntry.cs
+++ OutlookMatters/ContextMenu/MailItemContextMenuEntry.cs
@@ -71,11 +71,7 @@
         {
             var settings = _settingsLoadService.Load();
             var channelId = settings.ChannelId;
-            var mail = _explorer.QuerySelectedMailData();
-            var message = ":email: From: " + mail.SenderName + "\n";
-            message += ":email: Subject: " + mail.Subject + "\n";
-            message += mail.Body;
-
+            var message = FormatMessage();
             try
             {
                 _session.CreatePost(channelId, message);
@@ -94,10 +90,7 @@
         {
             var settings = _settingsLoadService.Load();
             var channelId = settings.ChannelId;
-            var mail = _explorer.QuerySelectedMailData();
-            var message = ":email: From: " + mail.SenderName + "\n";
-            message += ":email: Subject: " + mail.Subject + "\n";
-            message += mail.Body;
+            var message = FormatMessage();
             try
             {
                 var rootId = _rootPostIdProvider.Get();
@@ -114,6 +107,15 @@
             {
                 _errorDisplay.Display(exception);
             }
+        }
+
+        private string FormatMessage()
+        {
+            var mail = _explorer.QuerySelectedMailData();
+            var message = ":email: From: " + mail.SenderName + "\n";
+            message += ":email: Subject: " + mail.Subject + "\n";
+            message += mail.Body;
+            return message;
         }

         private static string GetResourceText(string resourceName)


Added documentation to the SharpRaven.Data.Module class

--- SharpRaven/Data/Module.cs
+++ SharpRaven/Data/Module.cs
@@ -1,8 +1,24 @@
 namespace SharpRaven.Data
 {
+    /// <summary>
+    /// A module or library that might be in use and thus could relevant for debugging purposes.
+    /// </summary>
     public class Module
     {
+        /// <summary>
+        /// Gets or sets the name of the module (or library).
+        /// </summary>
+        /// <value>
+        /// The name of the module (or library).
+        /// </value>
         public string Name { get; set; }
+
+        /// <summary>
+        /// Gets or sets the version of the module (or library).
+        /// </summary>
+        /// <value>
+        /// The version of the module (or library).
+        /// </value>
         public string Version { get; set; }
     }
 }


Fix: Crash if skins/songs folder couldn't be found in web server

--- plugins/WebSocketDataSender/WebSocketDataGetter.cs
+++ plugins/WebSocketDataSender/WebSocketDataGetter.cs
@@ -16,6 +16,7 @@
 using Newtonsoft.Json;
 using StreamCompanion.Common;
 using StreamCompanionTypes.DataTypes;
+using StreamCompanionTypes.Enums;
 using StreamCompanionTypes.Interfaces;
 using StreamCompanionTypes.Interfaces.Consumers;
 using StreamCompanionTypes.Interfaces.Services;
@@ -74,12 +75,12 @@

             var modules = new List<(string Description, IWebModule Module)>
             {
-                ("WebSocket stream of output patterns", new WebSocketOutputPatternsEndpoint("/outputPatterns", true, OutputPatterns)),
+                ("WebSocket stream of output patterns, with can be changed at any point by sending message with serialized JArray, containing case sensitive output pattern names", new WebSocketOutputPatternsEndpoint("/outputPatterns", true, OutputPatterns)),
                 ("WebSocket stream of requested tokens, with can be changed at any point by sending message with serialized JArray, containing case sensitive token names", new WebSocketTokenEndpoint("/tokens", true, Tokens.AllTokens)),
                 ("All tokens in form of json objects, prefer usage of one of the websocket endpoints above", new ActionModule("/json",HttpVerbs.Get,SendAllTokens)),
                 ("Current beatmap background image, use \"width\" and/or \"height\" query parameters to resize image while keeping its aspect ratio. Set \"crop\" query parameter to true to return image with exact size provided", new ActionModule("/backgroundImage",HttpVerbs.Get,SendCurrentBeatmapImage)),
-                ("View into user osu! Songs folder",new FileModule("/songs/", new FileSystemProvider(settings.GetFullSongsLocation(), false)).WithDirectoryLister(DirectoryLister.Html)),
-                ("View into user osu! Skins folder",new FileModule("/skins/", new FileSystemProvider(settings.GetFullSkinsLocation(), false)).WithDirectoryLister(DirectoryLister.Html)),
+                ("View into user osu! Songs folder", CreateSongsModule()),
+                ("View into user osu! Skins folder", CreateSkinsModule()),
                 ("List of available overlays (folder names)", new ActionModule("/overlayList",HttpVerbs.Get,ListOverlays)),
                 ("All StreamCompanion settings", new ActionModule("/settings",HttpVerbs.Get,GetSettings)),
             };
@@ -197,6 +198,36 @@
             }
         }

+        private IWebModule CreateSongsModule()
+        {
+            var songsLocation = _settings.GetFullSongsLocation();
+            var errorMessage = $"Couldn't find songs folder at \"{songsLocation}\", /songs/ web endpoint has been disabled";
+            return CreateFolderModule(songsLocation, "/songs/", errorMessage);
+        }
+
+        private IWebModule CreateSkinsModule()
+        {
+            var skinsLocation = _settings.GetFullSkinsLocation();
+            var errorMessage = $"Couldn't find skins folder at \"{skinsLocation}\", /skins/ web endpoint has been disabled";
+            return CreateFolderModule(skinsLocation, "/skins/", errorMessage);
+        }
+
+        private IWebModule CreateFolderModule(string location, string baseRoute, string missingFolderErrorMessage)
+        {
+            IWebModule module = null;
+            if (!Directory.Exists(location))
+            {
+                _logger.Log(missingFolderErrorMessage, LogLevel.Warning);
+                module = new ActionModule(baseRoute, HttpVerbs.Any, c =>
+                {
+                    c.Response.StatusCode = 500;
+                    return c.SendStringAsync(missingFolderErrorMessage, "text", Encoding.UTF8);
+                });
+            }
+
+            return module ?? new FileModule(baseRoute, new FileSystemProvider(location, false)).WithDirectoryLister(DirectoryLister.Html);
+        }
+
         public void Dispose()
         {
             _server?.Dispose();


Add test coverage for filter handling in classic style

--- osu.Game.Tests/Visual/UserInterface/TestSceneModColumn.cs
+++ osu.Game.Tests/Visual/UserInterface/TestSceneModColumn.cs
@@ -226,6 +226,11 @@

             AddStep("press J", () => InputManager.Key(Key.J));
             AddAssert("no change", () => this.ChildrenOfType<ModPanel>().Single(panel => panel.Active.Value).Mod.Acronym == "NC");
+
+            AddStep("filter everything but NC", () => setFilter(mod => mod.Acronym == "NC"));
+
+            AddStep("press A", () => InputManager.Key(Key.A));
+            AddAssert("no change", () => this.ChildrenOfType<ModPanel>().Single(panel => panel.Active.Value).Mod.Acronym == "NC");
         }

         [Test]
@@ -272,6 +277,11 @@
             AddAssert("NC panel selected", () => this.ChildrenOfType<ModPanel>().Single(panel => panel.Mod.Acronym == "NC").Active.Value);

             AddStep("press J", () => InputManager.Key(Key.J));
+            AddAssert("no change", () => this.ChildrenOfType<ModPanel>().Count(panel => panel.Active.Value) == 2);
+
+            AddStep("filter everything but NC", () => setFilter(mod => mod.Acronym == "NC"));
+
+            AddStep("press A", () => InputManager.Key(Key.A));
             AddAssert("no change", () => this.ChildrenOfType<ModPanel>().Count(panel => panel.Active.Value) == 2);
         }


use predefined SamplerState

use predefined SamplerState

--- cocos2d/textures/CCTexture2D.cs
+++ cocos2d/textures/CCTexture2D.cs
@@ -175,19 +175,35 @@
         {
             var saveState = m_samplerState;

-            if (m_bAntialiased)
-            {
+            if (m_bAntialiased && m_samplerState.Filter != TextureFilter.Linear)
+            {
+                if (m_samplerState == SamplerState.PointClamp)
+                {
+                    m_samplerState = SamplerState.LinearClamp;
+                    return;
+                }
+
                 m_samplerState = new SamplerState
                 {
                     Filter = TextureFilter.Linear
                 };
             }
-            else
-            {
+            else if (!m_bAntialiased && m_samplerState.Filter != TextureFilter.Point)
+            {
+                if (m_samplerState == SamplerState.LinearClamp)
+                {
+                    m_samplerState = SamplerState.PointClamp;
+                    return;
+                }
+
                 m_samplerState = new SamplerState
                 {
                     Filter = TextureFilter.Point
                 };
+            }
+            else
+            {
+                return;
             }

             m_samplerState.AddressU = saveState.AddressU;


Expect correct output for windows builds

--- source/Calamari.Tests/Fixtures/Deployment/DeployPackageFixture.cs
+++ source/Calamari.Tests/Fixtures/Deployment/DeployPackageFixture.cs
@@ -252,7 +252,15 @@

                         result.AssertZero();
                         var extracted = result.GetOutputForLineContaining("Extracting package to: ");
-                        result.AssertOutput("Extracted 9 files");
+                        if (CalamariEnvironment.IsRunningOnNix)
+                        {
+                            result.AssertOutput("Extracted 9 files");
+                        }
+                        else
+                        {
+                            result.AssertOutput("Extracted 8 files");
+                        }
+
                         lock (extractionDirectories)
                         {
                             if (!extractionDirectories.Contains(extracted))


Added settter method in indexer in the EntityCache to allow not only getting an entity out based in the key, but to also allow setting the an entity at a given key.

--- source/trunk/Windows/Figlut.Server.Toolkit.45/Data/EntityCache.cs
+++ source/trunk/Windows/Figlut.Server.Toolkit.45/Data/EntityCache.cs
@@ -126,6 +126,10 @@
                     return _entities[id];
                 }
                 return null;
+            }
+            set
+            {
+                _entities[id] = value;
             }
         }


fixed bug in remove

fixed bug in remove

--- data-structures-csharp/data-structures-csharp/Heap/Heap.cs
+++ data-structures-csharp/data-structures-csharp/Heap/Heap.cs
@@ -163,7 +163,7 @@
                 lastNode.Parent.Left = null;
             }
             SwapData(root, lastNode);
-            Heapify(root);
+            root = Heapify(root);
             Count--;
             return lastNode.Value;
         }


Fix exception thrown in SettingsService.OAuthToken

--- Ion10/Services/SettingsServices/SettingsService.cs
+++ Ion10/Services/SettingsServices/SettingsService.cs
@@ -1,6 +1,9 @@
 using System;
+using System.Collections.Generic;
 using System.Collections.Immutable;
+using System.Diagnostics;
 using System.IO;
+using System.Linq;
 using System.Threading;
 using System.Threading.Tasks;
 using Windows.Security.Credentials;
@@ -45,15 +48,15 @@
         public string OAuthToken {
             get {
                 var vault = new PasswordVault();
-                var token = vault.FindAllByResource("OAuthToken");
+                var token = vault.RetrieveAll().Where(t => t.Resource == "OAuthToken").ToImmutableList();
                 if(token.Count == 0) {
                     return null;
                 }
-                return token[0].Password;
+                return vault.Retrieve(token[0].Resource, token[0].UserName).Password;
             }
             set {
                 var vault = new PasswordVault();
-                var tokens = vault.FindAllByResource("OAuthToken");
+                var tokens = vault.RetrieveAll().Where(t => t.Resource == "OAuthToken").ToImmutableList();
                 if(tokens.Count != 0) {
                     foreach(var token in tokens) {
                         vault.Remove(token);


testing

testing

--- King.Azure.Integration.Test/Data/ContainerTests.cs
+++ King.Azure.Integration.Test/Data/ContainerTests.cs
@@ -14,7 +14,7 @@
     public class ContainerTests
     {
         private readonly string ConnectionString = "UseDevelopmentStorage=true;";
-        private const string ContainerName = "testing";
+        private readonly string ContainerName = 'a' + Guid.NewGuid().ToString().Replace("-", "");

         #region Helper
         private class Helper


bug fix

bug fix

--- Presentation.Web/Controllers/DriveReportsController.cs
+++ Presentation.Web/Controllers/DriveReportsController.cs
@@ -15,6 +15,7 @@
 using Ninject;
 using System.Collections.Generic;
 using Newtonsoft.Json;
+using OS2Indberetning.Models;

 namespace OS2Indberetning.Controllers
 {
@@ -110,6 +111,7 @@

                 result.Add(new EksportModel
                 {
+
                     DriveDateTimestamp = repo.DriveDateTimestamp,
                     CreatedDateTimestamp = repo.CreatedDateTimestamp,
                     OrgUnit = employee.Id.ToString(),


Fixed missing device container

Fixed missing device container

--- Project-Aurora/Project-Aurora/Devices/DeviceManager.cs
+++ Project-Aurora/Project-Aurora/Devices/DeviceManager.cs
@@ -104,6 +104,7 @@
             devices.Add(new DeviceContainer(new Devices.SteelSeries.SteelSeriesDevice()));   // SteelSeries Device
             devices.Add(new DeviceContainer(new Devices.SteelSeriesHID.SteelSeriesHIDDevice()));   // SteelSeriesHID Device
             devices.Add(new DeviceContainer(new Devices.Wooting.WootingDevice()));           // Wooting Device
+            devices.Add(new DeviceContainer(new Devices.Dualshock.DualshockDevice()));       //DualShock 4 Device

             string devices_scripts_path = System.IO.Path.Combine(Global.ExecutingDirectory, "Scripts", "Devices");


Fix line feed code

Fix line feed code

--- Project/uwpmm/uwpmm.Windows/Pages/PlaybackPage.xaml.cs
+++ Project/uwpmm/uwpmm.Windows/Pages/PlaybackPage.xaml.cs
@@ -208,12 +208,12 @@
             MovieStreamHelper.INSTANCE.StreamClosed += MovieStreamHelper_StreamClosed;
             MovieStreamHelper.INSTANCE.StatusChanged += MovieStream_StatusChanged;

-            /*
-            var param = e.Parameter as string;
-            if (param == AUTO_JUMP_TO_DLNA_FLAG)
-            {
-                MoveToRemotePivot();
-            }
+            /*
+            var param = e.Parameter as string;
+            if (param == AUTO_JUMP_TO_DLNA_FLAG)
+            {
+                MoveToRemotePivot();
+            }
              * */
             OnRemotePivotDisplayed();
         }
@@ -267,14 +267,14 @@

         private HttpClient HttpClient = new HttpClient();

-        /*
-        private void MoveToRemotePivot()
-        {
-            if (!PivotRoot.IsLocked)
-            {
-                PivotRoot.SelectedIndex = 1;
-            }
-        }
+        /*
+        private void MoveToRemotePivot()
+        {
+            if (!PivotRoot.IsLocked)
+            {
+                PivotRoot.SelectedIndex = 1;
+            }
+        }
          * */

         void NetworkObserver_DevicesCleared(object sender, EventArgs e)
@@ -409,59 +409,59 @@
                 switch (InnerState)
                 {
                     case ViewerState.Selecting:
-                        /*
-                        BottomAppBar = CommandBarManager.Clear()
-                            .Icon(AppBarItem.Ok)
-                            .CreateNew(0.5);
+                        /*
+                        BottomAppBar = CommandBarManager.Clear()
+                            .Icon(AppBarItem.Ok)
+                            .CreateNew(0.5);
                          * */
                         break;
                     case ViewerState.Single:
-                        /*
-                        UpdateRemoteSelectionMode(SelectivityFactor.None);
-                        {
-                            var tmp = CommandBarManager.Clear()
-                                .NoIcon(AppBarItem.AppSetting);
-                            if (UpnpDevice != null || TargetDevice != null)
-                            {
-                                tmp.Icon(AppBarItem.Refresh);
-                            }
-                            if ((LocalGridSource != null && LocalGridSource.Count != 0) || (RemoteGridSource != null && RemoteGridSource.Count != 0))
-                            {
-                                tmp.Icon(AppBarItem.DeleteMultiple);
-                            }
-                            if (RemoteGridSource != null && RemoteGridSource.Count != 0)
-                            {
-                                tmp.Icon(AppBarItem.DownloadMultiple);
-                            }
-                            BottomAppBar = tmp.CreateNew(0.5);
-                        }
+                        /*
+                        UpdateRemoteSelectionMode(SelectivityFactor.None);
+                        {
+                            var tmp = CommandBarManager.Clear()
+                                .NoIcon(AppBarItem.AppSetting);
+                            if (UpnpDevice != null || TargetDevice != null)
+                            {
+                                tmp.Icon(AppBarItem.Refresh);
+                            }
+                            if ((LocalGridSource != null && LocalGridSource.Count != 0) || (RemoteGridSource != null && RemoteGridSource.Count != 0))
+                            {
+                                tmp.Icon(AppBarItem.DeleteMultiple);
+                            }
+                            if (RemoteGridSource != null && RemoteGridSource.Count != 0)
+                            {
+                                tmp.Icon(AppBarItem.DownloadMultiple);
+                            }
+                            BottomAppBar = tmp.CreateNew(0.5);
+                        }
                          * */
                         break;
                     case ViewerState.AppSettings:
-                        /*
-                        BottomAppBar = CommandBarManager.Clear()
-                            .Icon(AppBarItem.Ok)
-                            .CreateNew(0.5);
+                        /*
+                        BottomAppBar = CommandBarManager.Clear()
+                            .Icon(AppBarItem.Ok)
+                            .CreateNew(0.5);
                          * */
                         break;
                     case ViewerState.StillPlayback:
-                        /*
-                        if (PhotoScreen.DetailInfoVisibility == Visibility.Visible)
-                        {
-                            BottomAppBar = CommandBarManager.Clear()
-                                .Icon(AppBarItem.RotateRight)
-                                .Icon(AppBarItem.HideDetailInfo)
-                                .Icon(AppBarItem.RotateLeft)
-                                .CreateNew(0.5);
-                        }
-                        else
-                        {
-                            BottomAppBar = CommandBarManager.Clear()
-                                .Icon(AppBarItem.RotateRight)
-                                .Icon(AppBarItem.ShowDetailInfo)
-                                .Icon(AppBarItem.RotateLeft)
-                                .CreateNew(0.5);
-                        }
+                        /*
+                        if (PhotoScreen.DetailInfoVisibility == Visibility.Visible)
+                        {
+                            BottomAppBar = CommandBarManager.Clear()
+                                .Icon(AppBarItem.RotateRight)
+                                .Icon(AppBarItem.HideDetailInfo)
+                                .Icon(AppBarItem.RotateLeft)
+                                .CreateNew(0.5);
+                        }
+                        else
+                        {
+                            BottomAppBar = CommandBarManager.Clear()
+                                .Icon(AppBarItem.RotateRight)
+                                .Icon(AppBarItem.ShowDetailInfo)
+                                .Icon(AppBarItem.RotateLeft)
+                                .CreateNew(0.5);
+                        }
                          * */
                         break;
                     default:
@@ -471,43 +471,43 @@
             });
         }

-        /*
-        private async Task DefaultPivotLockState()
-        {
-            await Dispatcher.RunAsync(CoreDispatcherPriority.High, () =>
-            {
-                var locked = !ShouldUnlockPivot(TargetDevice, UpnpDevice);
-                if (locked)
-                {
-                    PivotRoot.SelectedIndex = 0;
-                }
-                PivotRoot.IsLocked = locked;
-            });
-        }
+        /*
+        private async Task DefaultPivotLockState()
+        {
+            await Dispatcher.RunAsync(CoreDispatcherPriority.High, () =>
+            {
+                var locked = !ShouldUnlockPivot(TargetDevice, UpnpDevice);
+                if (locked)
+                {
+                    PivotRoot.SelectedIndex = 0;
+                }
+                PivotRoot.IsLocked = locked;
+            });
+        }
          * */

-        /*
-        private static bool ShouldUnlockPivot(TargetDevice device, UpnpDevice upnp)
-        {
-            if (DummyContentsFlag.Enabled)
-            {
-                DebugUtil.Log("Unlock Pivot: Dummy contents mode enabled.");
-                return true;
-            }
-            if (device != null && device.StorageAccessSupported)
-            {
-                DebugUtil.Log("Unlock Pivot: Remote API device available.");
-                return true;
-            }
-            if (upnp != null)
-            {
-                DebugUtil.Log("Unlock Pivot: DLNA device available.");
-                return true;
-            }
-
-            DebugUtil.Log("Lock Pivot: no available target.");
-            return false;
-        }
+        /*
+        private static bool ShouldUnlockPivot(TargetDevice device, UpnpDevice upnp)
+        {
+            if (DummyContentsFlag.Enabled)
+            {
+                DebugUtil.Log("Unlock Pivot: Dummy contents mode enabled.");
+                return true;
+            }
+            if (device != null && device.StorageAccessSupported)
+            {
+                DebugUtil.Log("Unlock Pivot: Remote API device available.");
+                return true;
+            }
+            if (upnp != null)
+            {
+                DebugUtil.Log("Unlock Pivot: DLNA device available.");
+                return true;
+            }
+
+            DebugUtil.Log("Lock Pivot: no available target.");
+            return false;
+        }
          * */

         private bool IsRemoteInitialized = false;
@@ -915,15 +915,15 @@
                 PhotoScreen.Visibility = Visibility.Visible;
                 RemoteGrid.IsEnabled = false;
                 LocalGrid.IsEnabled = false;
-                /*
-                if (PivotRoot.SelectedIndex == 0)
-                {
-                    UpdateInnerState(ViewerState.LocalStillPlayback);
-                }
-                else if (PivotRoot.SelectedIndex == 1)
-                {
-                    UpdateInnerState(ViewerState.RemoteStillPlayback);
-                }
+                /*
+                if (PivotRoot.SelectedIndex == 0)
+                {
+                    UpdateInnerState(ViewerState.LocalStillPlayback);
+                }
+                else if (PivotRoot.SelectedIndex == 1)
+                {
+                    UpdateInnerState(ViewerState.RemoteStillPlayback);
+                }
                  * */
             }
             else
@@ -934,15 +934,15 @@
                 PhotoScreen.Visibility = Visibility.Collapsed;
                 RemoteGrid.IsEnabled = true;
                 LocalGrid.IsEnabled = true;
-                /*
-                if (PivotRoot.SelectedIndex == 0)
-                {
-                    UpdateInnerState(ViewerState.LocalSingle);
-                }
-                else if (PivotRoot.SelectedIndex == 1)
-                {
-                    UpdateInnerState(ViewerState.RemoteSingle);
-                }
+                /*
+                if (PivotRoot.SelectedIndex == 0)
+                {
+                    UpdateInnerState(ViewerState.LocalSingle);
+                }
+                else if (PivotRoot.SelectedIndex == 1)
+                {
+                    UpdateInnerState(ViewerState.RemoteSingle);
+                }
                  * */
             }
         }
@@ -961,21 +961,21 @@

         private bool IsViewingDetail = false;

-        /*
-        private void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-            UpdateRemoteSelectionMode(SelectivityFactor.None);
-            var pivot = sender as Pivot;
-            switch (pivot.SelectedIndex)
-            {
-                case 0:
-                    UpdateInnerState(ViewerState.LocalSingle);
-                    break;
-                case 1:
-                    OnRemotePivotDisplayed();
-                    break;
-            }
-        }
+        /*
+        private void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            UpdateRemoteSelectionMode(SelectivityFactor.None);
+            var pivot = sender as Pivot;
+            switch (pivot.SelectedIndex)
+            {
+                case 0:
+                    UpdateInnerState(ViewerState.LocalSingle);
+                    break;
+                case 1:
+                    OnRemotePivotDisplayed();
+                    break;
+            }
+        }
          * */

         private void OnRemotePivotDisplayed()


add more logging in heart beat service

add more logging in heart beat service

--- src/AsimovDeploy.WinAgent/Framework/Heartbeat/HeartbeatService.cs
+++ src/AsimovDeploy.WinAgent/Framework/Heartbeat/HeartbeatService.cs
@@ -19,7 +19,6 @@
 using System.Text;
 using System.Threading;
 using AsimovDeploy.WinAgent.Framework.Common;
-using AsimovDeploy.WinAgent.Framework.Configuration;
 using AsimovDeploy.WinAgent.Framework.LoadBalancers;
 using AsimovDeploy.WinAgent.Framework.Models;
 using AsimovDeploy.WinAgent.Web.Contracts;
@@ -93,8 +92,8 @@

             HttpPostJsonUpdate(_nodeFrontUri, heartBeat);
         }
-
-	    private static void HttpPostJsonUpdate<T>(Uri uri, T data)
+
+        private static void HttpPostJsonUpdate<T>(Uri uri, T data)
         {
             var webRequest = (HttpWebRequest)WebRequest.Create(uri);
             webRequest.ContentType = "application/json";
@@ -105,12 +104,14 @@

             var parameters = JsonConvert.SerializeObject(data);
             var bytes = Encoding.UTF8.GetBytes(parameters);
+
+            Log.DebugFormat("Sending heartbeat: {0}", parameters);
             try
             {
                 webRequest.ContentLength = bytes.Length;
                 using (var os = webRequest.GetRequestStream())
                 {
-					os.Write(bytes, 0, bytes.Length);
+                    os.Write(bytes, 0, bytes.Length);
                 }
             }
             catch (WebException e)


Fix bug where PropertyChanging and PropertyChanged events were raised on all property set operations, not just those where the value actually changed.

--- cslacs/Csla/Core/BusinessBase.cs
+++ cslacs/Csla/Core/BusinessBase.cs
@@ -2052,7 +2052,6 @@
     {
       if (CanWriteProperty(propertyInfo.Name, throwOnNoAccess))
       {
-        OnPropertyChanging(propertyInfo.Name);
         try
         {
           P oldValue = default(P);
@@ -2076,7 +2075,6 @@
         {
           throw new PropertyLoadException(string.Format(Properties.Resources.PropertyLoadException, propertyInfo.Name, ex.Message));
         }
-        PropertyHasChanged(propertyInfo.Name);
       }
     }

@@ -2099,7 +2097,6 @@
     {
       if (CanWriteProperty(propertyInfo.Name, throwOnNoAccess))
       {
-        OnPropertyChanging(propertyInfo.Name);
         try
         {
           P oldValue = default(P);
@@ -2123,7 +2120,6 @@
         {
           throw new PropertyLoadException(string.Format(Properties.Resources.PropertyLoadException, propertyInfo.Name, ex.Message));
         }
-        PropertyHasChanged(propertyInfo.Name);
       }
     }

@@ -2255,9 +2251,15 @@
             pc.PropertyChanged -= new PropertyChangedEventHandler(Child_PropertyChanged);
           }
           if (markDirty)
+          {
+            OnPropertyChanging(propertyInfo.Name);
             FieldManager.SetFieldData<P>(propertyInfo, newValue);
+            PropertyHasChanged(propertyInfo.Name);
+          }
           else
+          {
             FieldManager.LoadFieldData<P>(propertyInfo, newValue);
+          }
           IEditableBusinessObject child = (IEditableBusinessObject)newValue;
           if (child != null)
           {
@@ -2280,9 +2282,15 @@
             pc.ListChanged -= new ListChangedEventHandler(Child_ListChanged);
           }
           if (markDirty)
+          {
+            OnPropertyChanging(propertyInfo.Name);
             FieldManager.SetFieldData<P>(propertyInfo, newValue);
+            PropertyHasChanged(propertyInfo.Name);
+          }
           else
+          {
             FieldManager.LoadFieldData<P>(propertyInfo, newValue);
+          }
           IEditableCollection child = (IEditableCollection)newValue;
           if (child != null)
           {
@@ -2300,9 +2308,15 @@
         else
         {
           if (markDirty)
+          {
+            OnPropertyChanging(propertyInfo.Name);
             FieldManager.SetFieldData<P>(propertyInfo, newValue);
+            PropertyHasChanged(propertyInfo.Name);
+          }
           else
+          {
             FieldManager.LoadFieldData<P>(propertyInfo, newValue);
+          }
         }
       }
     }


removing not interesting, ignored test

removing not interesting, ignored test

--- MbCacheTest/Events/NoLocksWhenCallingEventsTest.cs
+++ MbCacheTest/Events/NoLocksWhenCallingEventsTest.cs
@@ -51,29 +51,6 @@
 				Assert.Fail("Seems to be calling event listener from within lock");
 		}

-		[Test]
-		[Ignore("Need to get rid of lock InMemoryCache.Delete to fix this")]
-		public void ShouldCallRemoveOutsideLock()
-		{
-			if(Environment.ProcessorCount < 4)
-				Assert.Ignore("Not reliable if too few processors.");
-			var instance = factory.Create<IObjectWithParametersOnCachedMethod>();
-			var tasks = new List<Task>();
-
-			var stopwatch = Stopwatch.StartNew();
-			10.Times(x =>
-			{
-				tasks.Add(Task.Factory.StartNew(() =>
-				{
-					instance.CachedMethod(x);
-					factory.Invalidate();
-				}));
-			});
-			Task.WaitAll(tasks.ToArray());
-			if (stopwatch.Elapsed > TimeSpan.FromMilliseconds(800))
-				Assert.Fail("Seems to be calling event listener from within lock");
-		}
-
 		private class slowEventListener : IEventListener
 		{
 			public void OnCacheHit(CachedItem cachedItem)
@@ -83,7 +60,7 @@

 			public void OnCacheRemoval(CachedItem cachedItem)
 			{
-				Thread.Sleep(100);
+				throw new NotImplementedException();
 			}

 			public void OnCacheMiss(CachedItem cachedItem)


Cleaned usings and Linq

Cleaned usings and Linq

--- Metadata/ConcatStream/ConcatStream/ConcatStream.cs
+++ Metadata/ConcatStream/ConcatStream/ConcatStream.cs
@@ -171,7 +171,7 @@
 		///
 		/// <seealso cref="Flush"/>
 		public override Task FlushAsync(CancellationToken cancellationToken) =>
-			Task.WhenAll(streams.Select(s => s.FlushAsync(cancellationToken)));
+			Task.WhenAll(from stream in streams select stream.FlushAsync(cancellationToken));

 		/// <summary>
 		/// Reads a sequence of bytes from the current stream and advances the


Improved it a little bit

Improved it a little bit

--- MoravecAlbert/ClassRoom_HW/ClassRoom_HW/Program.cs
+++ MoravecAlbert/ClassRoom_HW/ClassRoom_HW/Program.cs
@@ -8,29 +8,31 @@
         static void Main(string[] args)
         {
             List<Subject> subjects = new List<Subject>(2);
-            subjects.Add(new Subject("Mathematics", "MAT")); // How to save all the subjects so I can reuse them instead of instantiating the same ones every time...
-            subjects.Add(new Subject("Physics", "FYZ"));
-
-            Teacher teacher = new Teacher("Marie Kubickova", 0, Person.Sex.Female, subjects);
+            Subject math = new Subject("Mathematics", "MAT");
+            Subject physics = new Subject("Physics", "FYZ");
+            subjects.Add(math);
+            subjects.Add(physics);

             List<Student> students = new List<Student>(30);
-            students.Add(new Student("Albert Moravec", 16, Person.Sex.Male, Student.Fields.InformationTechnologies, Student.Specializations.Programming, new Subject("Mathematics", "MAT"))); // ...as I do here
+            Student am = new Student("Albert Moravec", 16, Person.Genders.Male, Student.Fields.InformationTechnologies, Student.Specializations.Programming, math);
+            students.Add(am);

+            Teacher teacher = new Teacher("Marie Kubickova", 0, Person.Genders.Female, subjects);
             Classroom classroom = new Classroom("C210");
-
             Class classobj = new Class("I2A", teacher, students, classroom);

-            Console.WriteLine($"Teacher is {classobj.Teacher.Name} and classroom is {classobj.Classroom.ID}.");
-            Console.Write($"Student {classobj.Students[0].Name} is ");
-            if (!classobj.Students[0].IsAtLesson) Console.Write("not");
-            Console.WriteLine(" in a lesson.");
+            classobj.StartLesson(math);
+            classobj.DumpInfo();
+            am.LeaveLesson(); //should I access this object through classobj?
+            classobj.DumpInfo();
+
             Console.ReadKey();
         }

         public class Class
         {
             public string Name;
-            public Teacher Teacher;
+            public Teacher Teacher; //this example expects only one teacher per class
             public List<Student> Students;
             public Classroom Classroom;

@@ -42,26 +44,69 @@
                 Classroom = classroom;
             }

-            public void StartLesson()
+            public void DumpInfo()
             {
+                Console.WriteLine($"Class: {Name}\nClass teacher: {Teacher.Name}\nClassroom: {Classroom.Id}");
+                Console.WriteLine($"Students:\n");
+
+                foreach (Student student in Students)
+                {
+                    Console.WriteLine($"Name: {student.Name}\n" +
+                                      $"Age: {student.Age}\n" +
+                                      $"Field: {student.Field}\n" +
+                                      $"Specialization: {student.Specialization}\n" +
+                                      $"Favourite subject: {student.FavouriteSubject.Name}");
+                    if(student.IsInLesson) Console.WriteLine($"Is in lesson: {student.HasLesson.Name}");
+                }
+                Console.WriteLine("------------------------");
+
+            }
+
+            public void AddStudent(Student student)
+            {
+                Students.Add(student);
+            }
+
+            public void AssignTeacher(Teacher teacher)
+            {
+                Teacher = teacher;
+            }
+
+            public void StartLesson(Subject subject)
+            {
+                if (Teacher.IsTeaching || Classroom.IsUsed)
+                    return;
+
                 Teacher.IsTeaching = true;
-                foreach (var student in Students)
+                Classroom.IsUsed = true;
+                foreach (Student student in Students)
                 {
-                    student.IsAtLesson = true;
+                    student.IsInLesson = true;
+                    student.HasLesson = subject;
                 }
-                Classroom.IsUsed = true;
+            }
+
+            public void EndLesson()
+            {
+                Teacher.IsTeaching = false;
+                Classroom.IsUsed = false;
+                foreach (Student student in Students)
+                {
+                    student.IsInLesson = false;
+                    student.HasLesson = null;
+                }
             }
         }

         public class Person
         {
-            public enum Sex { Male, Female };
+            public enum Genders { Male, Female };

             public string Name;
             public int Age;
-            public Sex Gender;
+            public Genders Gender;

-            public Person(string name, int age, Sex gender)
+            public Person(string name, int age, Genders gender)
             {
                 Name = name;
                 Age = age;
@@ -72,11 +117,16 @@
         public class Teacher : Person
         {
             public List<Subject> Subjects;
-            public bool IsTeaching = false;
+            public bool IsTeaching;

-            public Teacher(string name, int age, Sex gender, List<Subject> subjects) : base(name, age, gender)
+            public Teacher(string name, int age, Genders gender, List<Subject> subjects) : base(name, age, gender)
             {
                 Subjects = subjects;
+            }
+
+            public void AddSubject(Subject subject)
+            {
+                Subjects.Add(subject);
             }
         }

@@ -88,13 +138,20 @@
             public Fields Field;
             public Specializations Specialization;
             public Subject FavouriteSubject;
-            public bool IsAtLesson = false;
+            public bool IsInLesson; //possibly unecessary field as we can check against HasLesson (HasLesson != null (?))
+            public Subject HasLesson;

-            public Student(string name, int age, Sex gender, Fields field, Specializations spec, Subject favsub) : base(name, age, gender)
+            public Student(string name, int age, Genders gender, Fields field, Specializations spec, Subject favsub) : base(name, age, gender)
             {
                 Field = field;
                 Specialization = spec;
                 FavouriteSubject = favsub;
+            }
+
+            public void LeaveLesson()
+            {
+                IsInLesson = false;
+                HasLesson = null;
             }
         }

@@ -112,12 +169,12 @@

         public class Classroom
         {
-            public string ID;
-            public bool IsUsed = false;
+            public string Id;
+            public bool IsUsed;

             public Classroom(string id)
             {
-                ID = id;
+                Id = id;
             }
         }
     }


Release v1.5

Release v1.5

--- MouseTester/MouseTester/Properties/AssemblyInfo.cs
+++ MouseTester/MouseTester/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.4.0.0")]
-[assembly: AssemblyFileVersion("1.4.0.0")]
+[assembly: AssemblyVersion("1.5.0.0")]
+[assembly: AssemblyFileVersion("1.5.0.0")]


Added documentation for PackageManifest.

--- OpenIIoT.SDK.Packaging/Manifest/PackageManifest.cs
+++ OpenIIoT.SDK.Packaging/Manifest/PackageManifest.cs
@@ -1,19 +1,19 @@
 /*
       █▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀  ▀  ▀      ▀▀
       █
-      █      ▄▄▄▄███▄▄▄▄
-      █    ▄██▀▀▀███▀▀▀██▄
-      █    ███   ███   ███   ▄█████  ██▄▄▄▄   █     ▄█████    ▄█████   ▄█████     ██
-      █    ███   ███   ███   ██   ██ ██▀▀▀█▄ ██    ██   ▀█   ██   █    ██  ▀  ▀███████▄
-      █    ███   ███   ███   ██   ██ ██   ██ ██▌  ▄██▄▄     ▄██▄▄      ██         ██  ▀
-      █    ███   ███   ███ ▀████████ ██   ██ ██  ▀▀██▀▀    ▀▀██▀▀    ▀███████     ██
-      █    ███   ███   ███   ██   ██ ██   ██ ██    ██        ██   █     ▄  ██     ██
-      █     ▀█   ███   █▀    ██   █▀  █   █  █     ██        ███████  ▄████▀     ▄██▀
+      █      ▄███████▄                                                                 ▄▄▄▄███▄▄▄▄
+      █     ███    ███                                                               ▄██▀▀▀███▀▀▀██▄
+      █     ███    ███   ▄█████   ▄██████    █  █▄     ▄█████     ▄████▄     ▄█████  ███   ███   ███   ▄█████  ██▄▄▄▄   █     ▄█████    ▄█████   ▄█████     ██
+      █     ███    ███   ██   ██ ██    ██   ██ ▄██▀    ██   ██   ██    ▀    ██   █   ███   ███   ███   ██   ██ ██▀▀▀█▄ ██    ██   ▀█   ██   █    ██  ▀  ▀███████▄
+      █   ▀█████████▀    ██   ██ ██    ▀    ██▐█▀      ██   ██  ▄██        ▄██▄▄     ███   ███   ███   ██   ██ ██   ██ ██▌  ▄██▄▄     ▄██▄▄      ██         ██  ▀
+      █     ███        ▀████████ ██    ▄  ▀▀████     ▀████████ ▀▀██ ███▄  ▀▀██▀▀     ███   ███   ███ ▀████████ ██   ██ ██  ▀▀██▀▀    ▀▀██▀▀    ▀███████     ██
+      █     ███          ██   ██ ██    ██   ██ ▀██▄    ██   ██   ██    ██   ██   █   ███   ███   ███   ██   ██ ██   ██ ██    ██        ██   █     ▄  ██     ██
+      █    ▄████▀        ██   █▀ ██████▀    ▀█   ▀█▀   ██   █▀   ██████▀    ███████   ▀█   ███   █▀    ██   █▀  █   █  █     ██        ███████  ▄████▀     ▄██▀
       █
  ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄▄  ▄▄ ▄▄   ▄▄▄▄ ▄▄     ▄▄     ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄
  █████████████████████████████████████████████████████████████ ███████████████ ██  ██ ██   ████ ██     ██     ████████████████ █ █
       ▄
-      █
+      █  A Manifest which describes the contents of a Package file.
       █
       █▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀▀     ▀▀               ▀
       █  The GNU Affero General Public License (GNU AGPL)
@@ -40,45 +40,80 @@
                                                                                ▀▀                            */

 using System.Collections.Generic;
-using System.Collections.ObjectModel;
 using Newtonsoft.Json;

 namespace OpenIIoT.SDK.Packaging.Manifest
 {
+    /// <summary>
+    ///     A Manifest which describes the contents of a Package file.
+    /// </summary>
     public class PackageManifest
     {
         #region Public Properties

+        /// <summary>
+        ///     Gets or sets the checksum of the payload file.
+        /// </summary>
         [JsonProperty(Order = 9)]
         public string Checksum { get; set; }

+        /// <summary>
+        ///     Gets or sets the Package copyright.
+        /// </summary>
         [JsonProperty(Order = 6)]
         public string Copyright { get; set; }

+        /// <summary>
+        ///     Gets or sets the Package description.
+        /// </summary>
         [JsonProperty(Order = 4)]
         public string Description { get; set; }

+        /// <summary>
+        ///     Gets or sets the collection of <see cref="PackageManifestFile"/> instances representing the files in the Package payload.
+        /// </summary>
         [JsonProperty(Order = 11)]
         public IDictionary<PackageManifestFileType, IList<PackageManifestFile>> Files { get; set; }

+        /// <summary>
+        ///     Gets or sets the Package license.
+        /// </summary>
         [JsonProperty(Order = 7)]
         public string License { get; set; }

+        /// <summary>
+        ///     Gets or sets the Package namespace.
+        /// </summary>
         [JsonProperty(Order = 3)]
         public string Namespace { get; set; }

+        /// <summary>
+        ///     Gets or sets the Package publisher.
+        /// </summary>
         [JsonProperty(Order = 5)]
         public string Publisher { get; set; }

+        /// <summary>
+        ///     Gets or sets the Package <see cref="PackageManifestSignature"/>.
+        /// </summary>
         [JsonProperty(Order = 10)]
         public PackageManifestSignature Signature { get; set; }

+        /// <summary>
+        ///     Gets or sets the Package title.
+        /// </summary>
         [JsonProperty(Order = 1)]
         public string Title { get; set; }

+        /// <summary>
+        ///     Gets or sets the Package url.
+        /// </summary>
         [JsonProperty(Order = 8)]
         public string Url { get; set; }

+        /// <summary>
+        ///     Gets or sets the Package version.
+        /// </summary>
         [JsonProperty(Order = 2)]
         public string Version { get; set; }