Ensure Graylog is running before tests begin

--- test/Gelf.Extensions.Logging.Tests/GraylogFixture.cs
+++ test/Gelf.Extensions.Logging.Tests/GraylogFixture.cs
@@ -5,6 +5,7 @@
 using System.Net.Http;
 using System.Threading;
 using System.Threading.Tasks;
+using Newtonsoft.Json;
 using Xunit;

 namespace Gelf.Extensions.Logging.Tests
@@ -42,12 +43,19 @@

         private Task WaitForGraylogAsync()
         {
+            Console.WriteLine("Waiting for Graylog server...");
+
             return RepeatUntilAsync(async cancellation =>
             {
                 try
                 {
-                    await _httpClient.GetAsync("system/stats", cancellation);
-                    return true;
+                    var system = await _httpClient.GetAsync("system", cancellation);
+                    TimeSpan uptime = DateTime.UtcNow - DateTime.Parse(system.started_at.ToString());
+
+                    Console.WriteLine($"Graylog system details:{Environment.NewLine}{JsonConvert.SerializeObject(system)}");
+                    Console.WriteLine($"Graylog server has been up for {uptime.TotalSeconds} seconds");
+
+                    return system.lifecycle == "running";
                 }
                 catch (HttpRequestException)
                 {
@@ -58,6 +66,8 @@

         private async Task<string> CreateInputAsync()
         {
+            Console.WriteLine("Creating Graylog input");
+
             List<dynamic> existingInputs = (await _httpClient.GetAsync("system/inputs")).inputs;
             var input = existingInputs.SingleOrDefault(i => i.attributes.port == InputPort);
             if (input != null)
@@ -86,8 +96,19 @@

         private Task WaitForInputAsync(string inputId)
         {
-            return RepeatUntilAsync(async cancellation =>
-                await _httpClient.GetAsync($"system/inputstates/{inputId}", cancellation) != null);
+            Console.WriteLine($"Waiting for Graylog input {inputId}...");
+
+            return RepeatUntilAsync(async delegate(CancellationToken cancellation)
+            {
+                var inputState = await _httpClient.GetAsync($"system/inputstates/{inputId}", cancellation);
+
+                if (inputState != null)
+                {
+                    Console.WriteLine($"Graylog input details:{Environment.NewLine}{JsonConvert.SerializeObject(inputState)}");
+                }
+
+                return inputState?.state == "RUNNING";
+            });
         }

         public async Task<List<dynamic>> WaitForMessagesAsync(int count = 1)


Update PostControllerTest to test constructor parameters

--- test/Scissorhands.WebApp.Tests/PostControllerTest.cs
+++ test/Scissorhands.WebApp.Tests/PostControllerTest.cs
@@ -1,4 +1,9 @@
-using Aliencube.Scissorhands.Services;
+using System;
+using System.Net;
+using System.Threading.Tasks;
+
+using Aliencube.Scissorhands.Models;
+using Aliencube.Scissorhands.Services;
 using Aliencube.Scissorhands.ViewModels.Post;
 using Aliencube.Scissorhands.WebApp.Controllers;
 using Aliencube.Scissorhands.WebApp.Tests.Fixtures;
@@ -19,7 +24,9 @@
     public class PostControllerTest : IClassFixture<PostControllerFixture>
     {
         private readonly string _defaultThemeName;
+        private readonly Mock<WebAppSettings> _settings;
         private readonly Mock<IMarkdownService> _markdownService;
+        private readonly Mock<IPublishService> _publishService;
         private readonly PostController _controller;

         ///
@@ -29,8 +36,26 @@
         public PostControllerTest(PostControllerFixture fixture)
         {
             this._defaultThemeName = fixture.DefaultThemeName;
+            this._settings = fixture.WebAppSettings;
             this._markdownService = fixture.MarkdownService;
+            this._publishService = fixture.PublishService;
             this._controller = fixture.Controller;
+        }
+
+        ///
+        /// Tests whether the constructor throws an exception or not.
+        ///
+        [Fact]
+        public void Given_NullParameter_Constructor_ShouldThrow_ArgumentNullException()
+        {
+            Action action1 = () => { var controller = new PostController(null, this._markdownService.Object, this._publishService.Object); };
+            action1.ShouldThrow<ArgumentNullException>();
+
+            Action action2 = () => { var controller = new PostController(this._settings.Object, null, this._publishService.Object); };
+            action2.ShouldThrow<ArgumentNullException>();
+
+            Action action3 = () => { var controller = new PostController(this._settings.Object, this._markdownService.Object, null); };
+            action3.ShouldThrow<ArgumentNullException>();
         }

         ///
@@ -58,13 +83,24 @@
         }

         ///
+        /// Tests whether the action should return <see cref="HttpStatusCodeResult"/> instance or not.
+        ///
+        [Fact]
+        public void Given_NullParameter_Preview_ShouldReturn_BadRequest()
+        {
+            var result = this._controller.Preview(null) as HttpStatusCodeResult;
+            result.Should().NotBeNull();
+            result.StatusCode.Should().Be((int)HttpStatusCode.BadRequest);
+        }
+
+        ///
         /// Tests whether the action should return <see cref="ViewResult"/> instance or not.
         ///
         /// <param name="markdown">String value in Markdown format.</param>
         /// <param name="html">String value in HTML format.</param>
         [Theory]
         [InlineData("**Hello World", "
Joe Bloggs
")]
-        public void Given_Preview_WithModel_ShouldReturn_ViewResult(string markdown, string html)
+        public void Given_Model_Preview_ShouldReturn_ViewResult(string markdown, string html)
         {
             this._markdownService.Setup(p => p.Parse(It.IsAny<string>())).Returns(html);

@@ -80,5 +116,16 @@
             vm.Markdown.Should().Be(markdown);
             vm.Html.Should().Be(html);
         }
+
+        ///
+        /// Tests whether the action should return <see cref="HttpStatusCodeResult"/> instance or not.
+        ///
+        [Fact]
+        public async void Given_NullParameter_Publish_ShouldReturn_BadRequest()
+        {
+            var result = await this._controller.Publish(null).ConfigureAwait(false) as HttpStatusCodeResult;
+            result.Should().NotBeNull();
+            result.StatusCode.Should().Be((int)HttpStatusCode.BadRequest);
+        }
     }
 }


chore: Fix snippets for new PubSub builder

--- tools/Google.Cloud.Docs.Snippets/EmulatorSnippets.cs
+++ tools/Google.Cloud.Docs.Snippets/EmulatorSnippets.cs
@@ -1,4 +1,4 @@
-// Copyright 2021 Google LLC
+// Copyright 2021 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -35,9 +35,11 @@
         {
             // Sample: SubscriberClient
             SubscriptionName subscription = SubscriptionName.FromProjectSubscription("projectId", "subscriptionId");
-            SubscriberClient.ClientCreationSettings clientCreationSettings = new SubscriberClient.ClientCreationSettings()
-                .WithEmulatorDetection(EmulatorDetection.EmulatorOrProduction);
-            SubscriberClient client = SubscriberClient.Create(subscription, clientCreationSettings);
+            SubscriberClient client = new SubscriberClientBuilder
+            {
+                SubscriptionName = subscription,
+                EmulatorDetection = EmulatorDetection.EmulatorOrProduction
+            }.Build();
             // End sample
         }


Fix issue where WPF designer does not show toolbar images at design time.

--- src/VsChromium/Views/ImageSourceFactory.cs
+++ src/VsChromium/Views/ImageSourceFactory.cs
@@ -36,10 +36,20 @@
     }

     private static Uri GetUri(string filePath) {
+      // Note: The VS WPF designer requires an absolute URL for the images
+      // to load properly.
+#if true
+      var uriString = string.Format(
+        "pack://application:,,,/{0};component/{1}",
+        Assembly.GetExecutingAssembly().GetName().Name,
+        filePath);
+      //Logger.Log("GetImage: {0}", uriString);
+      return new Uri(uriString, UriKind.Absolute);
+#else
       var uriString = string.Format("/{0};component/{1}",
         Assembly.GetExecutingAssembly().GetName().Name, filePath);
-      //Logger.Log("GetImage: {0}", uriString);
       return new Uri(uriString, UriKind.Relative);
+#endif
     }
   }
 }


GitHubSync update

GitHubSync update

--- deployment/cake/tasks.cake
+++ deployment/cake/tasks.cake
@@ -340,10 +340,22 @@
         }
     }

+    var buildTestProjects = true;
+
+    if (buildContext.General.IsLocalBuild && buildContext.General.MaximizePerformance)
+    {
+        Information("Local build with maximized performance detected, skipping test project(s) build");
+
+        buildTestProjects = false;
+    }
+
     // Build test projects *after* SonarQube (not part of SQ analysis). Unfortunately, because of this, we cannot yet mark
     // the build as succeeded once we end the SQ session. Therefore, if SQ fails, both the SQ *and* build checks
     // will be marked as failed if SQ fails.
-    BuildTestProjects(buildContext);
+    if (buildTestProjects)
+    {
+        BuildTestProjects(buildContext);
+    }

     await buildContext.SourceControl.MarkBuildAsSucceededAsync("Build");


Null coalesce Stream argument

Null coalesce Stream argument

--- osu.Framework/Graphics/Video/VideoSprite.cs
+++ osu.Framework/Graphics/Video/VideoSprite.cs
@@ -91,9 +91,7 @@

         public VideoSprite([NotNull] Stream stream)
         {
-            if (stream == null) throw new ArgumentNullException(nameof(stream));
-
-            this.stream = stream;
+            this.stream = stream ?? throw new ArgumentNullException(nameof(stream));
         }

         public VideoSprite(string filename)


Reset the ScoreMultiplier to 1

Reset the ScoreMultiplier to 1

--- osu.Game.Rulesets.Osu/Mods/OsuModArrange.cs
+++ osu.Game.Rulesets.Osu/Mods/OsuModArrange.cs
@@ -19,8 +19,8 @@
         public override string ShortenedName => "Arrange";
         public override FontAwesome Icon => FontAwesome.fa_arrows;
         public override ModType Type => ModType.Fun;
-        public override double ScoreMultiplier => 1.05;
         public override string Description => "Everything rotates. EVERYTHING.";
+        public override double ScoreMultiplier => 1;

         public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
         {


[packages,Python,3.5.1] Clarifying the need for the WIN32 preprocessor macro

--- packages/Python-3.5.1/bam/Scripts/Python.cs
+++ packages/Python-3.5.1/bam/Scripts/Python.cs
@@ -26,7 +26,6 @@
                     if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows))
                     {
                         compiler.IncludePaths.AddUnique(this.CreateTokenizedString("$(packagedir)/PC"));
-                        compiler.PreprocessorDefines.Add("WIN32");
                     }
                 });
             if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows))
@@ -436,7 +435,6 @@
                     if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows))
                     {
                         compiler.IncludePaths.AddUnique(this.CreateTokenizedString("$(packagedir)/PC"));
-                        compiler.PreprocessorDefines.Add("WIN32");
                         var winCompiler = settings as C.ICommonCompilerSettingsWin;
                         winCompiler.CharacterSet = C.ECharacterSet.NotSet;
                     }
@@ -457,7 +455,6 @@
                     if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows))
                     {
                         compiler.IncludePaths.AddUnique(this.CreateTokenizedString("$(packagedir)/PC"));
-                        compiler.PreprocessorDefines.Add("WIN32");
                         var winCompiler = settings as C.ICommonCompilerSettingsWin;
                         winCompiler.CharacterSet = C.ECharacterSet.NotSet;
                     }
@@ -501,7 +498,6 @@
                     if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows))
                     {
                         compiler.IncludePaths.AddUnique(this.CreateTokenizedString("$(packagedir)/PC"));
-                        compiler.PreprocessorDefines.Add("WIN32");
                         var winCompiler = settings as C.ICommonCompilerSettingsWin;
                         winCompiler.CharacterSet = C.ECharacterSet.NotSet;
                     }
@@ -651,7 +647,6 @@
                     if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows))
                     {
                         compiler.IncludePaths.AddUnique(this.CreateTokenizedString("$(packagedir)/PC"));
-                        compiler.PreprocessorDefines.Add("WIN32");
                         var winCompiler = settings as C.ICommonCompilerSettingsWin;
                         winCompiler.CharacterSet = C.ECharacterSet.NotSet;
                     }
@@ -684,7 +679,6 @@
                     if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows))
                     {
                         compiler.IncludePaths.AddUnique(this.CreateTokenizedString("$(packagedir)/PC"));
-                        compiler.PreprocessorDefines.Add("WIN32");
                         var winCompiler = settings as C.ICommonCompilerSettingsWin;
                         winCompiler.CharacterSet = C.ECharacterSet.NotSet;
                     }
@@ -694,7 +688,12 @@
             if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows))
             {
                 var pcSource = this.CreateCSourceContainer("$(packagedir)/PC/dl_nt.c");
-                pcSource.AddFiles("$(packagedir)/PC/config.c");
+                var pcConfig = pcSource.AddFiles("$(packagedir)/PC/config.c");
+                pcConfig[0].PrivatePatch(settings =>
+                    {
+                        var compiler = settings as C.ICommonCompilerSettings;
+                        compiler.PreprocessorDefines.Add("WIN32"); // required to register two extension modules
+                    });
                 //pcSource.AddFiles("$(packagedir)/PC/frozen_dllmain.c");
                 pcSource.AddFiles("$(packagedir)/PC/getpathp.c");
                 pcSource.AddFiles("$(packagedir)/PC/winreg.c");
@@ -707,7 +706,6 @@
                         }
                         compiler.PreprocessorDefines.Add("Py_BUILD_CORE");
                         compiler.PreprocessorDefines.Add("Py_ENABLE_SHARED");
-                        compiler.PreprocessorDefines.Add("WIN32");
                         compiler.IncludePaths.AddUnique(this.CreateTokenizedString("$(packagedir)/Include"));
                         var winCompiler = settings as C.ICommonCompilerSettingsWin;
                         winCompiler.CharacterSet = C.ECharacterSet.NotSet;
@@ -834,7 +832,6 @@
                 if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows))
                 {
                     compiler.IncludePaths.AddUnique(this.CreateTokenizedString("$(packagedir)/PC"));
-                    compiler.PreprocessorDefines.Add("WIN32");
                     var winCompiler = settings as C.ICommonCompilerSettingsWin;
                     winCompiler.CharacterSet = C.ECharacterSet.NotSet;
                 }


Update WorkflowRegistry.cs

Update WorkflowRegistry.cs

Changed registry collection to a thread safe collection.

--- src/WorkflowCore/Services/WorkflowRegistry.cs
+++ src/WorkflowCore/Services/WorkflowRegistry.cs
@@ -1,4 +1,5 @@
-using System;
+using System;
+using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.Linq;
 using Microsoft.Extensions.DependencyInjection;
@@ -10,7 +11,7 @@
     public class WorkflowRegistry : IWorkflowRegistry
     {
         private readonly IServiceProvider _serviceProvider;
-        private readonly List<Tuple<string, int, WorkflowDefinition>> _registry = new List<Tuple<string, int, WorkflowDefinition>>();
+        private readonly BlockingCollection<Tuple<string, int, WorkflowDefinition>> _registry = new BlockingCollection<Tuple<string, int, WorkflowDefinition>>();

         public WorkflowRegistry(IServiceProvider serviceProvider)
         {
@@ -35,10 +36,10 @@

         public void DeregisterWorkflow(string workflowId, int version)
         {
-            var definition = _registry.Find(x => x.Item1 == workflowId && x.Item2 == version);
+            var definition = _registry.FirstOrDefault(x => x.Item1 == workflowId && x.Item2 == version);
             if (definition != null)
             {
-                _registry.Remove(definition);
+                _registry.TryTake(out definition);
             }
         }

@@ -81,7 +82,7 @@

         public bool IsRegistered(string workflowId, int version)
         {
-            var definition = _registry.Find(x => x.Item1 == workflowId && x.Item2 == version);
+            var definition = _registry.FirstOrDefault(x => x.Item1 == workflowId && x.Item2 == version);
             return (definition != null);
         }


Remocao de linha desnecessária

Remocao de linha desnecessária

--- Assets/Scripts/Mini_Ganancia/MovimentaZoiudoScript.cs
+++ Assets/Scripts/Mini_Ganancia/MovimentaZoiudoScript.cs
@@ -91,13 +91,11 @@
         if (Random.Range(0, 100) > 50)
         {
             rotacao = Random.Range(45, 270);
-            Debug.Log(rotacao);
             return rotacao;
         }
         else
         {
             rotacao = Random.Range(-45, -270);
-            Debug.Log(rotacao);
             return rotacao;
         }


minor html bug fix

minor html bug fix

--- BForms.Docs/Areas/Demo/Views/Grid/Toolbar/_New.cshtml
+++ BForms.Docs/Areas/Demo/Views/Grid/Toolbar/_New.cshtml
@@ -16,7 +16,7 @@

-
 m.LastName)">>
+
 m.LastName)">
                     @Html.BsLabelFor(m => m.LastName)

                         @Html.BsInputFor(m => m.LastName)
@@ -24,7 +24,6 @@

 m.Jobs)">
-  >
                     @Html.BsLabelFor(m => m.Jobs)

                         @Html.BsSelectFor(m => m.Jobs)


Reintroduced fix for low privilege users

--- Core/OfficeDevPnP.Core/Extensions/TenantExtensions.cs
+++ Core/OfficeDevPnP.Core/Extensions/TenantExtensions.cs
@@ -1293,19 +1293,33 @@
         /// <returns>An enumerated type that can be: No, Yes, Recycled</returns>
         public static SiteExistence SiteExistsAnywhere(this Tenant tenant, string siteFullUrl)
         {
+            var userIsTenantAdmin = TenantExtensions.IsCurrentUserTenantAdmin((ClientContext)tenant.Context);
+
             try
             {
-                //Get the site name
-                var properties = tenant.GetSitePropertiesByUrl(siteFullUrl, false);
-                tenant.Context.Load(properties);
-                tenant.Context.ExecuteQueryRetry();
+                // CHANGED: Modified in order to support non privilege users
+                if (userIsTenantAdmin)
+                {
+                    // Get the site name
+                    var properties = tenant.GetSitePropertiesByUrl(siteFullUrl, false);
+                    tenant.Context.Load(properties);
+                    tenant.Context.ExecuteQueryRetry();
+                }
+                else
+                {
+                    // Get the site context for the current user
+                    var siteContext = tenant.Context.Clone(siteFullUrl);
+                    var site = siteContext.Site;
+                    siteContext.Load(site);
+                    siteContext.ExecuteQueryRetry();
+                }

                 // Will cause an exception if site URL is not there. Not optimal, but the way it works.
                 return SiteExistence.Yes;
             }
             catch (Exception ex)
             {
-                if (IsCannotGetSiteException(ex) || IsUnableToAccessSiteException(ex))
+                if (userIsTenantAdmin && (IsCannotGetSiteException(ex) || IsUnableToAccessSiteException(ex)))
                 {
                     if (IsUnableToAccessSiteException(ex))
                     {
@@ -1334,18 +1348,17 @@
                         return SiteExistence.No;
                     }
                 }
-#if ONPREMISES
-                else if (IsFileNotFoundException(ex))
+                else if (IsNotFoundException(ex))
                 {
                     return SiteExistence.No;
                 }
-#endif
                 else
                 {
                     return SiteExistence.Yes;
                 }
             }
         }
+

         /// <summary>
         /// Checks if a sub site exists


model generator re-run

model generator re-run

--- Dapper.FastCrud.Tests/Models/ModelGeneratorConfig1.cs
+++ Dapper.FastCrud.Tests/Models/ModelGeneratorConfig1.cs
@@ -6,7 +6,7 @@
 //
 //     Connection String Name: `EntityGeneration`
 //     Provider:               `System.Data.SqlClient`
-//     Connection String:      `Data Source=(LocalDb)\MSSQLLocalDb;AttachDbFilename=D:\Code\Tests\Dapper.FastCRUD-src\Dapper.FastCRUD.Tests\App_Data\\EntityGenDatabase.mdf;Initial Catalog=EntityGenDatabase;Integrated Security=True`
+//     Connection String:      `Data Source=(LocalDb)\MSSQLLocalDb;AttachDbFilename=D:\_Projects\Dapper.FastCRUD\Dapper.FastCrud.Tests\App_Data\\EntityGenDatabase.mdf;Initial Catalog=EntityGenDatabase;Integrated Security=True`
 //     Include Views:          `True`

 namespace Dapper.FastCrud.Tests.Models
@@ -47,7 +47,6 @@
 	public partial class Workstation
 	{
 		[Key]
-        [Column(Order = 1)]
 		[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
 	    public virtual long WorkstationId { get; set; }
 	    public virtual string Name { get; set; }


Fixed actually reporting the error code for REST calls

--- Duplicati/Server/WebServer/RESTMethods/RequestInfo.cs
+++ Duplicati/Server/WebServer/RESTMethods/RequestInfo.cs
@@ -34,7 +34,7 @@

         public void ReportServerError(string message, System.Net.HttpStatusCode code = System.Net.HttpStatusCode.InternalServerError)
         {
-            Response.Status = System.Net.HttpStatusCode.InternalServerError;
+            Response.Status = code;
             Response.Reason = message;

             BodyWriter.WriteJsonObject(new { Error = message });


Virtualized CRUD methods

Virtualized CRUD methods

--- Caelan.Frameworks.BIZ/Classes/BaseCRUDRepository.cs
+++ Caelan.Frameworks.BIZ/Classes/BaseCRUDRepository.cs
@@ -1,26 +1,42 @@
 using System;
+using System.Linq;
 using Caelan.Frameworks.BIZ.Interfaces;
 using Caelan.Frameworks.DAL.Interfaces;

 namespace Caelan.Frameworks.BIZ.Classes
 {
-    public abstract class BaseCRUDRepository<TEntity, TDTO, TKey> : BaseRepository<TEntity, TDTO, TKey>, IInsertRepository<TDTO>, IUpdateRepository<TDTO>, IDeleteRepository<TDTO>
-        where TEntity : class, IEntity<TKey>, new()
-        where TDTO : class, IDTO<TKey>, new()
-        where TKey : IEquatable<TKey>
-    {
-        protected BaseCRUDRepository(BaseUnitOfWork manager)
-            : base(manager)
-        {
-        }
+	public abstract class BaseCRUDRepository<TEntity, TDTO, TKey> : BaseRepository<TEntity, TDTO, TKey>, IInsertRepository<TDTO>, IUpdateRepository<TDTO>, IDeleteRepository<TDTO>
+		where TEntity : class, IEntity<TKey>, new()
+		where TDTO : class, IDTO<TKey>, new()
+		where TKey : IEquatable<TKey>
+	{
+		protected BaseCRUDRepository(BaseUnitOfWork manager)
+			: base(manager)
+		{
+		}

-        public abstract void Insert(TDTO dto);
-        public abstract void Update(TDTO dto);
-        public abstract void Delete(TDTO dto);
+		public virtual void Insert(TDTO dto)
+		{
+			All().Add(EntityBuilder().Build(dto));
+		}

-        public virtual void Delete(TKey id)
-        {
-            Delete(Single(id));
-        }
-    }
+		public virtual void Update(TDTO dto)
+		{
+			var entity = All().FirstOrDefault(t => t.ID.Equals(dto.ID));
+
+			EntityBuilder().Build(dto, ref entity);
+		}
+
+		public virtual void Delete(TDTO dto)
+		{
+			var entity = All().FirstOrDefault(t => t.ID.Equals(dto.ID));
+
+			All().Remove(entity);
+		}
+
+		public virtual void Delete(TKey id)
+		{
+			Delete(Single(id));
+		}
+	}
 }


Reduced GC allocs

Reduced GC allocs

--- Client/Systems/VesselProtoSys/VesselProtoRefresh.cs
+++ Client/Systems/VesselProtoSys/VesselProtoRefresh.cs
@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Globalization;
 using System.Reflection;
 using UniLinq;

@@ -73,8 +74,25 @@
             vessel.protoVessel.persistent = vessel.isPersistent;
             vessel.protoVessel.vesselRef.protoVessel = vessel.protoVessel;

-            vessel.protoVessel.actionGroups.ClearData();
-            vessel.protoVessel.vesselRef.ActionGroups.Save(vessel.protoVessel.actionGroups);
+            if (vessel.protoVessel.vesselRef.ActionGroups.groups.Count != vessel.protoVessel.actionGroups.CountValues)
+            {
+                vessel.protoVessel.actionGroups.ClearData();
+                vessel.protoVessel.vesselRef.ActionGroups.Save(vessel.protoVessel.actionGroups);
+            }
+            else
+            {
+                for (var i = 0; i < vessel.protoVessel.vesselRef.ActionGroups.groups.Count; i++)
+                {
+                    var currentVal = vessel.protoVessel.vesselRef.ActionGroups.groups[i].ToString();
+                    var protoVal = vessel.protoVessel.actionGroups.values[i].value;
+
+                    if (currentVal != protoVal)
+                    {
+                        vessel.protoVessel.actionGroups.values[i].value = string.Concat(vessel.protoVessel.vesselRef.ActionGroups.groups[i].ToString(), ", ",
+                            vessel.protoVessel.vesselRef.ActionGroups.cooldownTimes[i].ToString(CultureInfo.InvariantCulture));
+                    }
+                }
+            }
         }

         private static void RefreshPartModules(Vessel vessel)
@@ -92,7 +110,7 @@
                         var field = module.Fields[k];
                         var nodeValue = GetConfigNodeVal(field.name, module.snapshot.moduleValues);

-                        if (nodeValue?.value != null && field.GetStringValue(field.host, false) != nodeValue.value)
+                        if (nodeValue?.value != null)
                         {
                             nodeValue.value = field.GetStringValue(field.host, false);
                         }


Replaced default load balancing suspend mode back to Suspend from Graceful.

--- ConDep.Dsl/SemanticModel/Sequence/RemoteSequence.cs
+++ ConDep.Dsl/SemanticModel/Sequence/RemoteSequence.cs
@@ -153,7 +153,7 @@
             var serversToBringOffline = servers.Skip(numberOfServers);
             foreach (var server in serversToBringOffline)
             {
-                loadBalancer.BringOffline(server.Name, server.LoadBalancerFarm, LoadBalancerSuspendMethod.Graceful, status);
+                loadBalancer.BringOffline(server.Name, server.LoadBalancerFarm, LoadBalancerSuspendMethod.Suspend, status);
             }
         }

@@ -168,7 +168,7 @@
                 {
                     Logger.Info(string.Format("Taking server [{0}] offline in load balancer.", server.Name));
                     loadBalancer.BringOffline(server.Name, server.LoadBalancerFarm,
-                                                LoadBalancerSuspendMethod.Graceful, status);
+                                                LoadBalancerSuspendMethod.Suspend, status);
                 }

                 ExecuteOnServer(server, status, options);
@@ -259,4 +259,4 @@

         }
     }
-}+}


Not used parameters

Not used parameters

--- Core/System/Diagnostics/Contracts/Contract.net35.cs
+++ Core/System/Diagnostics/Contracts/Contract.net35.cs
@@ -171,6 +171,7 @@
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
         public static void EnsuresOnThrow<TException>(bool condition) where TException : Exception
         {
+            GC.KeepAlive(condition);
             AssertMustUseRewriter(ContractFailureKind.PostconditionOnException, "EnsuresOnThrow");
         }

@@ -190,6 +191,8 @@
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
         public static void EnsuresOnThrow<TException>(bool condition, string userMessage) where TException : Exception
         {
+            GC.KeepAlive(condition);
+            GC.KeepAlive(userMessage);
             AssertMustUseRewriter(ContractFailureKind.PostconditionOnException, "EnsuresOnThrow");
         }

@@ -341,6 +344,7 @@
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
         public static void Invariant(bool condition)
         {
+            GC.KeepAlive(condition);
             AssertMustUseRewriter(ContractFailureKind.Invariant, "Invariant");
         }

@@ -359,6 +363,8 @@
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
         public static void Invariant(bool condition, string userMessage)
         {
+            GC.KeepAlive(condition);
+            GC.KeepAlive(userMessage);
             AssertMustUseRewriter(ContractFailureKind.Invariant, "Invariant");
         }

@@ -375,6 +381,7 @@
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
         public static T OldValue<T>(T value)
         {
+            GC.KeepAlive(value);
             return default(T);
         }

@@ -392,6 +399,7 @@
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
         public static void Requires(bool condition)
         {
+            GC.KeepAlive(condition);
             AssertMustUseRewriter(ContractFailureKind.Precondition, "Requires");
         }

@@ -410,6 +418,8 @@
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
         public static void Requires(bool condition, string userMessage)
         {
+            GC.KeepAlive(condition);
+            GC.KeepAlive(userMessage);
             AssertMustUseRewriter(ContractFailureKind.Precondition, "Requires");
         }

@@ -426,6 +436,7 @@
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
         public static void Requires<TException>(bool condition) where TException : Exception
         {
+            GC.KeepAlive(condition);
             AssertMustUseRewriter(ContractFailureKind.Precondition, "Requires<TException>");
         }

@@ -443,6 +454,8 @@
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
         public static void Requires<TException>(bool condition, string userMessage) where TException : Exception
         {
+            GC.KeepAlive(condition);
+            GC.KeepAlive(userMessage);
             AssertMustUseRewriter(ContractFailureKind.Precondition, "Requires<TException>");
         }


Part 2 of the exposed variable fix - variables are only set if the SEtsValue is true when creating instances.

--- GumRuntime/InstanceSaveExtensionMethods.GumRuntime.cs
+++ GumRuntime/InstanceSaveExtensionMethods.GumRuntime.cs
@@ -34,7 +34,7 @@

-                foreach (var variable in state.Variables.Where(item => item.SourceObject == instanceSave.Name))
+                foreach (var variable in state.Variables.Where(item => item.SetsValue && item.SourceObject == instanceSave.Name))
                 {
                     string propertyOnInstance = variable.Name.Substring(variable.Name.LastIndexOf('.') + 1);


Small improvement to headerutilities

Small improvement to headerutilities

--- Heine.Mvc.ActionFilters/Extensions/HeaderUtilities.cs
+++ Heine.Mvc.ActionFilters/Extensions/HeaderUtilities.cs
@@ -16,7 +16,7 @@
                     if (string.IsNullOrWhiteSpace(headerValue)) return headerValue;
                     if (!headerValue.Contains(' ')) return headerValue.ReplaceEnd('*', 2f / 3f);
                     var headerValueParts = headerValue.Split(new[] { ' ' }, 2);
-                    return $"{headerValueParts.First()} {new string('*', headerValueParts.Last().Length)}";
+                    return $"{headerValueParts.First()} {new string('*', headerValueParts.Last().Length < 10 ? headerValueParts.Last().Length : 10)}{(headerValueParts.Last().Length > 10 ? "..." : string.Empty)}";
                 }
             }
         };


remove categories

remove categories

--- tests/Test.ADAL.NET.Unit/UnitTests.cs
+++ tests/Test.ADAL.NET.Unit/UnitTests.cs
@@ -51,7 +51,6 @@

         [TestMethod]
         [Description("Positive Test for UrlEncoding")]
-        [TestCategory("AdalDotNetUnit")]
         public void UrlEncodingTest()
         {
             TestUrlEncoding(null);
@@ -102,7 +101,6 @@

         [TestMethod]
         [Description("Test for AuthenticationParameters.CreateFromResponseAuthenticateHeader")]
-        [TestCategory("AdalDotNetUnit")]
         public void AuthenticationParametersTest()
         {
             RunAuthenticationParametersPositive("Bearer authorization_uri=abc, resource_id=de", "abc", "de");
@@ -129,7 +127,6 @@

         [TestMethod]
         [Description("Test for ParseKeyValueList method in EncodingHelper")]
-        [TestCategory("AdalDotNetUnit")]
         public void ParseKeyValueListTest()
         {
             RunParseKeyValueList(null, 0);
@@ -154,7 +151,6 @@

         [TestMethod]
         [Description("Test for SplitWithQuotes method in EncodingHelper")]
-        [TestCategory("AdalDotNetUnit")]
         public void SplitWithQuotesTest()
         {
             RunSplitWithQuotes(null, 0);
@@ -175,7 +171,6 @@

         [TestMethod]
         [Description("Test for CreateSha256Hash method in PlatformSpecificHelper")]
-        [TestCategory("AdalDotNetUnit")]
         public void CreateSha256HashTest()
         {
             CommonUnitTests.CreateSha256HashTest();
@@ -183,7 +178,6 @@

         [TestMethod]
         [Description("Test for ADAL Id")]
-        [TestCategory("AdalDotNetUnit")]
         public void AdalIdTest()
         {
             CommonUnitTests.AdalIdTest();
@@ -191,7 +185,6 @@

         [TestMethod]
         [Description("Test for Id Token Parsing")]
-        [TestCategory("AdalDotNetUnit")]
         public void IdTokenParsingPasswordClaimsTest()
         {
             TokenResponse tr = CreateTokenResponse();
@@ -203,7 +196,6 @@

         [TestMethod]
         [Description("Test for Id Token Parsing")]
-        [TestCategory("AdalDotNetUnit")]
         public void IdTokenParsingNoPasswordClaimsTest()
         {
             TokenResponse tr = CreateTokenResponse();
@@ -227,7 +219,6 @@
         }

         [TestMethod]
-        [TestCategory("AdalDotNetUnit")]
         [Description("Test to verify CryptographyHelper.SignWithCertificate")]
         public void SignWithCertificateTest()
         {
@@ -246,24 +237,6 @@
                 Assert.IsNotNull(signature);
             }
         }
-
-        [TestMethod]
-        [TestCategory("AdalDotNetUnit")]
-        public Task TimeoutTest()
-        {
-                try
-                {
-                    return null;
-                }
-                catch (HttpRequestWrapperException ex)
-                {
-                    Assert.IsTrue(ex.InnerException is TaskCanceledException);
-                    var serviceException = new AdalServiceException(AdalError.Unknown, ex);
-                    Assert.AreEqual(serviceException.StatusCode, (int)HttpStatusCode.RequestTimeout);
-                }
-
-            return null;
-        }

         private static void RunAuthenticationParametersPositive(string authenticateHeader, string expectedAuthority, string excepectedResource)
         {


We should dispose cert stores

We should dispose cert stores

--- ITCC.HTTP.SslConfigUtil.Core/CertificateController.cs
+++ ITCC.HTTP.SslConfigUtil.Core/CertificateController.cs
@@ -30,21 +30,28 @@
     {
         internal static IEnumerable<CertificateView> GetCertificates()
         {
-            var personalCertStote = new X509Store(StoreName.My, StoreLocation.LocalMachine);
-            personalCertStote.Open(OpenFlags.ReadOnly);
-            return personalCertStote.Certificates.Cast<X509Certificate2>().Where(certificate => certificate.Verify() && certificate.IsValid()).Select(CertificateView.FromCert).ToList();
+            using (var personalCertStote = new X509Store(StoreName.My, StoreLocation.LocalMachine))
+            {
+                personalCertStote.Open(OpenFlags.ReadOnly);
+                return personalCertStote.Certificates
+                    .Cast<X509Certificate2>()
+                    .Where(certificate => certificate.Verify() && certificate.IsValid())
+                    .Select(CertificateView.FromCert)
+                    .ToList();
+            }
         }
         internal static FindCertificateStatus TryFindBySubjectName(string subjectName, out X509Certificate2 certificate)
         {
             try
             {
-                var personalCertStote = new X509Store(StoreName.My, StoreLocation.LocalMachine);
-                personalCertStote.Open(OpenFlags.ReadWrite);
-                var result = personalCertStote.Certificates.Find(X509FindType.FindBySubjectName, subjectName, true);
-                var succeed = result.Count > 0;
-                certificate = succeed ? result[0] : null;
-                return succeed ? FindCertificateStatus.Found : FindCertificateStatus.NotFound;
-
+                using (var personalCertStote = new X509Store(StoreName.My, StoreLocation.LocalMachine))
+                {
+                    personalCertStote.Open(OpenFlags.ReadWrite);
+                    var result = personalCertStote.Certificates.Find(X509FindType.FindBySubjectName, subjectName, true);
+                    var succeed = result.Count > 0;
+                    certificate = succeed ? result[0] : null;
+                    return succeed ? FindCertificateStatus.Found : FindCertificateStatus.NotFound;
+                }
             }
             catch (CryptographicException cryptographicException)
             {
@@ -57,13 +64,14 @@
         {
             try
             {
-                var personalCertStote = new X509Store(StoreName.My, StoreLocation.LocalMachine);
-                personalCertStote.Open(OpenFlags.ReadWrite);
-                var result = personalCertStote.Certificates.Find(X509FindType.FindByThumbprint, thumbtrint, true);
-                var succeed = result.Count > 0;
-                certificate = succeed ? result[0] : null;
-                return succeed ? FindCertificateStatus.Found : FindCertificateStatus.NotFound;
-
+                using (var personalCertStote = new X509Store(StoreName.My, StoreLocation.LocalMachine))
+                {
+                    personalCertStote.Open(OpenFlags.ReadWrite);
+                    var result = personalCertStote.Certificates.Find(X509FindType.FindByThumbprint, thumbtrint, true);
+                    var succeed = result.Count > 0;
+                    certificate = succeed ? result[0] : null;
+                    return succeed ? FindCertificateStatus.Found : FindCertificateStatus.NotFound;
+                }
             }
             catch (CryptographicException cryptographicException)
             {


clean

clean

--- Demos/CSharpGL.Demos/12Billboard/Form12Billboard.cs
+++ Demos/CSharpGL.Demos/12Billboard/Form12Billboard.cs
@@ -51,7 +51,11 @@
                 this.labelRenderer.Render(arg);
             }
             {
-                UIRenderersDraw(arg);
+                UIRoot uiRoot = this.uiRoot;
+                if (uiRoot != null)
+                {
+                    uiRoot.Render(arg);
+                }
             }

             // Cross cursor shows where the mouse is.
@@ -66,23 +70,7 @@
         private const float crossCursorSize = 40.0f;

         private Point offset = new Point(13, 11);
-        private void UIRenderersDraw(RenderEventArg arg)
-        {
-            UIRoot uiRoot = this.uiRoot;
-            if (uiRoot != null)
-            {
-                uiRoot.Render(arg);
-            }
-        }
-        //void glCanvas1_MouseWheel(object sender, MouseEventArgs e)
-        //{
-        //    ICamera camera = this.camera;
-        //    if (camera != null)
-        //    {
-        //        camera.MouseWheel(e.Delta);
-        //    }
-        //}
-
+
         private void glCanvas1_Resize(object sender, EventArgs e)
         {
             if (camera != null)
@@ -92,7 +80,6 @@

             this.uiRoot.Size = this.glCanvas1.Size;
         }
-

         private void glCanvas1_KeyPress(object sender, KeyPressEventArgs e)
         {


Fix Backfire APIOvserver.OnResponseReceived

--- ElectronicObserver/Backfire/Observer/APIObserver.cs
+++ ElectronicObserver/Backfire/Observer/APIObserver.cs
@@ -143,7 +143,7 @@
             }
         }

-        public void OnResponseReceived(string shortpath, Dictionary<string, string> parsedData)
+        public void OnResponseReceived(string shortpath, dynamic parsedData)
         {
             try
             {


Added Type 10 defender to ship renaming table

--- EliteDangerous/EliteDangerous/JournalFieldNaming.cs
+++ EliteDangerous/EliteDangerous/JournalFieldNaming.cs
@@ -109,6 +109,7 @@
                 { "type6",                      "Type 6 Transporter" },
                 { "type7",                      "Type 7 Transporter" },
                 { "type9",                      "Type 9 Heavy" },
+                { "type9_military",             "Type 10 Defender" },
                 { "viper",                      "Viper Mk. III" },
                 { "viper_mkiv",                 "Viper Mk. IV" },
                 { "vulture",                    "Vulture" },


Use different control identifiers for create button based on state

--- EndlessClient/ControlSets/IntermediateControlSet.cs
+++ EndlessClient/ControlSets/IntermediateControlSet.cs
@@ -54,7 +54,10 @@
 		{
 			switch (control)
 			{
-				case GameControlIdentifier.CreateAccountButton: return _btnCreate;
+				case GameControlIdentifier.CreateAccountButton:
+					return GameState == GameStates.CreateAccount ? _btnCreate : null;
+				case GameControlIdentifier.CreateCharacterButton:
+					return GameState == GameStates.LoggedIn ? _btnCreate : null;
 				case GameControlIdentifier.PersonDisplay2: return _person2Picture;
 				default: return base.FindComponentByControlIdentifier(control);
 			}


correct usage comments

correct usage comments

--- Gimela.Toolkit.CommandLines.Rename/RenameOptions.cs
+++ Gimela.Toolkit.CommandLines.Rename/RenameOptions.cs
@@ -129,7 +129,7 @@

 	rename.exe -e '.chundong.' -d 'C:\Logs' -o '.good.' -x 'bin,obj' -f -r
 	Search all files in directory 'C:\Logs', match the pattern '.chundong.',
-	and rename the files and folders repalce '.chundong.' to '.good.'.
+	and rename the files and folders replace '.chundong.' to '.good.'.

 AUTHOR


Update test to deal with new code optimizer.

--- LINQToTTree/LINQToTTreeLib.Tests/CPPTranslatorTest.cs
+++ LINQToTTree/LINQToTTreeLib.Tests/CPPTranslatorTest.cs
@@ -175,12 +175,13 @@
             var vInt2 = DeclarableParameter.CreateDeclarableParameterExpression(typeof(int));
             vInt2.SetInitialValue("5");
             innerBlock.Add(vInt2);
+            innerBlock.Add(new StatementSimpleStatement("fork = dork"));
             code.Add(innerBlock);

             var r = TranslateGeneratedCode(target, code);

             var st = (r["QueryFunctionBlocks"] as IEnumerable<IEnumerable<string>>).First().ToArray();
-            Assert.AreEqual(5, st.Length, "incorrect number of statements");
+            Assert.AreEqual(6, st.Length, "incorrect number of statements");
             Assert.AreEqual("int " + vInt2.RawValue + "=5;", st[2].Trim(), "incorrect initalization");
         }


Wrong name for field in Mono

Wrong name for field in Mono

--- source/icu.net/Collation/Collator.cs
+++ source/icu.net/Collation/Collator.cs
@@ -107,7 +107,7 @@

 		private static void SetInternalOriginalStringField(SortKey sortKey, string originalString) {
 			string propertyName = "SortKey.OriginalString";
-			string monoInternalFieldName = "str";
+			string monoInternalFieldName = "source";
 			string netInternalFieldName = "m_String";
 			SetInternalFieldForPublicProperty(sortKey,
 											  propertyName,


Auto select on single component

Auto select on single component

--- unity/Assets/Scripts/QuestEditor/QuestEditorData.cs
+++ unity/Assets/Scripts/QuestEditor/QuestEditorData.cs
@@ -562,6 +562,7 @@
         UIWindowSelectionListTraits select = new UIWindowSelectionListTraits(SelectComponent, CommonStringKeys.SELECT_ITEM);

         int count = 0;
+        string last = "";
         foreach (RaycastResult hit in raycastResults)
         {
             foreach (KeyValuePair<string, BoardComponent> kv in boardItems)
@@ -569,11 +570,13 @@
                 if (kv.Value.unityObject == hit.gameObject)
                 {
                     count++;
+                    last = kv.Key;
                     select.AddItem(kv.Key);
                     break;
                 }
             }
         }
-        if (count > 0) select.Draw();
+        if (count == 1) SelectComponent(last);
+        if (count > 1) select.Draw();
     }
 }


mainline: made the protocol passed from config has higher priority

git-svn-id: 6d1cac2d86fac78d43d5e0dd3566a1010e844f91@59536 81fbe566-5dc4-48c1-bdea-7421811ca204

--- mainline/SocketServiceCore/AppServer.cs
+++ mainline/SocketServiceCore/AppServer.cs
@@ -111,7 +111,6 @@
         {
             Config = config;
             m_ConsoleBaseAddress = consoleBaseAddress;
-            Protocol = protocol;

             if (!SetupLocalEndpoint(config))
             {
@@ -119,6 +118,11 @@
                 return false;
             }

+            //The protocol passed from config has higher priority
+            if (protocol != null)
+                Protocol = protocol;
+
+            //If there is no defined protocol, use CommandLineProtocol as default
             if (Protocol == null)
                 Protocol = new CommandLineProtocol();


Fixed Bug with nesting Detection in Interval

--- MarsTimeModule.Test/MarsTimeModule.Common/Interval.cs
+++ MarsTimeModule.Test/MarsTimeModule.Common/Interval.cs
@@ -25,9 +25,11 @@

         public IntervalRelation Comapre(Interval intervalToCompare)
         {
+            Func<Interval, Interval, bool> isNested = (start, end) => (start._startMoment <= end._startMoment && start._endMoment >= end._endMoment);
+
             if (intervalToCompare._endMoment < _startMoment || _endMoment < intervalToCompare._startMoment) return IntervalRelation.Disjoint;
             if (intervalToCompare._endMoment <= _startMoment || _endMoment <= intervalToCompare._startMoment) return IntervalRelation.Touch;
-            if (_startMoment <= intervalToCompare._startMoment && _endMoment >= intervalToCompare._endMoment) return IntervalRelation.Nested;
+            if (isNested(this, intervalToCompare) || isNested(intervalToCompare, this)) return IntervalRelation.Nested;

             return IntervalRelation.Overlap;
         }


Simplifying test

Simplifying test

--- MbCacheTest/Logic/Concurrency/RecursiveMethodsTest.cs
+++ MbCacheTest/Logic/Concurrency/RecursiveMethodsTest.cs
@@ -30,16 +30,10 @@

 			var tasks = new List<Task>();

-			1000.Times(x =>
+			500.Times(x =>
 			{
 				tasks.Add(Task.Factory.StartNew(() =>
 				{
-					instance1.Ref(x);
-					instance2.Foo(x);
-				}));
-				tasks.Add(Task.Factory.StartNew(() =>
-				{
-					instance2.Foo(x);
 					instance1.Ref(x);
 				}));
 			});


Fix clear queue on iOS

Fix clear queue on iOS

--- MediaManager/Platforms/Apple/AppleMediaManagerBase.cs
+++ MediaManager/Platforms/Apple/AppleMediaManagerBase.cs
@@ -1,5 +1,8 @@
 using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
 using AVFoundation;
+using MediaManager.Library;
 using MediaManager.Media;
 using MediaManager.Notifications;
 using MediaManager.Platforms.Apple.Media;
@@ -116,5 +119,13 @@
                     Player.Rate = value;
             }
         }
+
+        public override Task<IMediaItem> PrepareQueueForPlayback(IEnumerable<IMediaItem> mediaItems)
+        {
+            if (ClearQueueOnPlay)
+                Queue.CurrentIndex = 0;
+
+            return base.PrepareQueueForPlayback(mediaItems);
+        }
     }
 }


Update AsymmetricAlgorithmExtensions.cs

Update AsymmetricAlgorithmExtensions.cs

Try catching TypeLoadExceptions

--- MimeKit/Cryptography/AsymmetricAlgorithmExtensions.cs
+++ MimeKit/Cryptography/AsymmetricAlgorithmExtensions.cs
@@ -41,10 +41,6 @@
 	/// </remarks>
 	public static class AsymmetricAlgorithmExtensions
 	{
-#if NET46 || NET47 || NET48
-		static readonly bool IsMonoRuntime = Type.GetType ("Mono.Runtime") != null;
-#endif
-
 		static void GetAsymmetricKeyParameters (DSA dsa, bool publicOnly, out AsymmetricKeyParameter pub, out AsymmetricKeyParameter key)
 		{
 			var dp = dsa.ExportParameters (!publicOnly);
@@ -171,13 +167,19 @@
 				return GetAsymmetricKeyParameter (dsaKey);

 #if NET46 || NET47 || NET48
-			if (!IsMonoRuntime && key is RSACng rsaCng)
-				return GetAsymmetricKeyParameter (rsaCng);
+			try {
+				if (key is RSACng rsaCng)
+					return GetAsymmetricKeyParameter (rsaCng);
+			} catch (TypeLoadException) {
+			}
 #endif

 #if NET47 || NET48
-			if (!IsMonoRuntime && key is DSACng dsaCng)
-				return GetAsymmetricKeyParameter (dsaCng);
+			try {
+				if (key is DSACng dsaCng)
+					return GetAsymmetricKeyParameter (dsaCng);
+			} catch (TypeLoadException) {
+			}
 #endif

 			// TODO: support ECDiffieHellman and ECDsa?
@@ -215,13 +217,19 @@
 				return GetAsymmetricCipherKeyPair (dsaKey);

 #if NET46 || NET47 || NET48
-			if (!IsMonoRuntime && key is RSACng rsaCng)
-				return GetAsymmetricCipherKeyPair (rsaCng);
+			try {
+				if (key is RSACng rsaCng)
+					return GetAsymmetricCipherKeyPair (rsaCng);
+			} catch (TypeLoadException) {
+			}
 #endif

 #if NET47 || NET48
-			if (!IsMonoRuntime && key is DSACng dsaCng)
-				return GetAsymmetricCipherKeyPair (dsaCng);
+			try {
+				if (key is DSACng dsaCng)
+					return GetAsymmetricCipherKeyPair (dsaCng);
+			} catch (TypeLoadException) {
+			}
 #endif

 			// TODO: support ECDiffieHellman and ECDsa?


Fix unique path (mfa) for real this time

--- MonoDroid/Xamarin.Mobile/Media/MediaPickerActivity.cs
+++ MonoDroid/Xamarin.Mobile/Media/MediaPickerActivity.cs
@@ -184,14 +184,14 @@
 		{
 			string ext = Path.GetExtension (name);
 			if (ext == String.Empty)
-				ext = ((this.isPhoto) ? "jpg" : "mp4");
+				ext = ((this.isPhoto) ? ".jpg" : ".mp4");

 			name = Path.GetFileNameWithoutExtension (name);

-			string nname = name + "." + ext;
+			string nname = name + ext;
 			int i = 1;
 			while (File.Exists (Path.Combine (folder, nname)))
-				nname = name + "_" + (i++) + "." + ext;
+				nname = name + "_" + (i++) + ext;

 			return Path.Combine (folder, nname);
 		}


[AD] Fix taking photos on Xperia devices

It seems that the Xperia default camera app respects EXTRA_OUTPUT, but
still provides the path back to you anyway unlike some other apps that
respect EXTRA_OUTPUT.

--- MonoDroid/Xamarin.Mobile/Media/MediaPickerActivity.cs
+++ MonoDroid/Xamarin.Mobile/Media/MediaPickerActivity.cs
@@ -158,7 +158,7 @@

 				// Not all camera apps respect EXTRA_OUTPUT, some will instead
 				// return a content or file uri from data.
-				if (data != null) {
+				if (data != null && !data.Equals (path)) {
 					originalPath = data.ToString();
 					string currentPath = path.Path;
 					pathFuture = TryMoveFileAsync (context, data, path, isPhoto).ContinueWith (t =>


Added a first stab at a config repository true up from the arcology and AWS, also converted remaining bootstrapper usages of Its.Log to Naos.Logging.

--- Naos.Deployment.Console/NaosDeploymentBootstrapper.cs
+++ Naos.Deployment.Console/NaosDeploymentBootstrapper.cs
@@ -18,34 +18,33 @@
     using System.Linq;
     using System.Management.Automation;
     using System.Security.Cryptography.X509Certificates;
+    using System.Text;
     using System.Xml.Serialization;
-
-    using Its.Log.Instrumentation;

     using Naos.AWS.Core;
     using Naos.AWS.Domain;
-	using Naos.Configuration.Domain;
+    using Naos.Configuration.Domain;
     using Naos.Deployment.ComputingManagement;
     using Naos.Deployment.Core;
     using Naos.Deployment.Core.CertificateManagement;
     using Naos.Deployment.Domain;
     using Naos.Deployment.Tracking;
-	using Naos.MachineManagement.Domain;
-	using Naos.MachineManagement.Factory;
+    using Naos.Logging.Domain;
+    using Naos.MachineManagement.Domain;
+    using Naos.MachineManagement.Factory;
     using Naos.Packaging.Domain;
     using Naos.Packaging.NuGet;
     using Naos.Recipes.RunWithRetry;
+
+    using OBeautifulCode.Assertion.Recipes;
+    using OBeautifulCode.Representation.System;
+    using OBeautifulCode.Security.Recipes;
     using OBeautifulCode.Serialization;
     using OBeautifulCode.Serialization.Json;

-    using OBeautifulCode.Security.Recipes;
-    using OBeautifulCode.Assertion.Recipes;
-
     using Spritely.Redo;

     using static System.FormattableString;
-    using System.Text;
-    using OBeautifulCode.Representation.System;

     /// <summary>
     /// Bootstrapper for deployment logic to bridge commands from command line and various components to create an end to end solution.
@@ -546,17 +545,17 @@
         {
             void Connect(ITrackComputingInfrastructure tracker, IManageComputingInfrastructure manager)
             {
-                using (var activity = Log.Enter(() => new { Name = instanceName }))
-                {
-                    activity.Trace("Starting");
+                using (var activity = Log.With(() => new { Name = instanceName }))
+                {
+                    activity.Write(() => "Starting");
                     var instance = Run.TaskUntilCompletion(manager.GetInstanceDescriptionAsync(environment, instanceName));
                     instance.AsArg(Invariant($"FailedToFindInstanceByName-{instanceName}")).Must().NotBeNull();
-                    activity.Trace(Invariant($"Found instance: {instance.Id}"));
+                    activity.Write(() => Invariant($"Found instance: {instance.Id}"));

                     var privateKey =
                         Run.TaskUntilCompletion(tracker.GetPrivateKeyOfInstanceByIdAsync(environment, instance.Id));
                     privateKey.AsArg(Invariant($"FailedToFindPrivateKeyByInstanceId-{instance.Id}")).Must().NotBeNull();
-                    activity.Trace(Invariant($"Found key for password decryption."));
+                    activity.Write(() => Invariant($"Found key for password decryption."));

                     var address = instance.PrivateIpAddress;
                     var dnsStrategies = instance.DeployedPackages.Values
@@ -578,7 +577,7 @@
                     var password =
                         Run.TaskUntilCompletion(manager.GetAdministratorPasswordForInstanceAsync(instance, privateKey));
                     password.AsArg(Invariant($"FailedToGetPasswordFor-{instance.Id}")).Must().NotBeNullNorWhiteSpace();
-                    activity.Trace(Invariant($"Found password."));
+                    activity.Write(() => Invariant($"Found password."));

                     // Help from: https://stackoverflow.com/questions/11296819/run-mstsc-exe-with-specified-username-and-password
                     using (var cmdKeyInitProcess = new Process
@@ -608,7 +607,7 @@
                             throw new ApplicationFailedException(cmdKeyInitFailedMessage);
                         }

-                        activity.Trace(Invariant($"Stored credentials temporarily stored using CMDKEY."));
+                        activity.Write(() => Invariant($"Stored credentials temporarily stored using CMDKEY."));
                     }

 					var rdpArgs = shouldConnectInFullScreen ? Invariant($"/f /v {address}") : Invariant($"/v {address}");
@@ -617,7 +616,7 @@
                     rdpProcess.StartInfo.Arguments = rdpArgs;
                     rdpProcess.Start().AsArg(Invariant($"{nameof(rdpProcess)}.{nameof(rdpProcess.Start)}-must-return-true"))
                         .Must().BeTrue();
-                    activity.Trace(Invariant($"Started MSTSC (Microsoft Terminal Services Client)."));
+                    activity.Write(() => Invariant($"Started MSTSC (Microsoft Terminal Services Client)."));

                     System.Threading.Thread.Sleep(TimeSpan
                         .FromSeconds(5)); // dirty way to make sure that MSTSC launches before cleaning the credentials...
@@ -650,10 +649,10 @@
                             throw new ApplicationFailedException(cmdKeyCleanupFailedMessage);
                         }

-                        activity.Trace(Invariant($"Removed credentials temporarily stored using CMDKEY."));
+                        activity.Write(() => Invariant($"Removed credentials temporarily stored using CMDKEY."));
                     }

-                    activity.Trace("Done - check for spawned window.");
+                    activity.Write(() => "Done - check for spawned window.");
                 }
             }

@@ -680,11 +679,11 @@
                 var instance = Run.TaskUntilCompletion(manager.GetInstanceDescriptionAsync(environment, instanceName));
                 instance.AsArg(Invariant($"FailedToFindInstanceByName-{instanceName}")).Must().NotBeNull();

-                using (var activity = Log.Enter(() => new { instance.Name, instance.Id }))
-                {
-                    activity.Trace("Starting");
+                using (var activity = Log.With(() => new { instance.Name, instance.Id }))
+                {
+                    activity.Write(() => "Starting");
                     Run.TaskUntilCompletion(manager.TurnOnInstanceAsync(instance.Id, instance.Location));
-                    activity.Trace("Running");
+                    activity.Write(() => "Running");
                 }
             }

@@ -713,11 +712,11 @@
                 var instance = Run.TaskUntilCompletion(manager.GetInstanceDescriptionAsync(environment, instanceName));
                 instance.AsArg(Invariant($"FailedToFindInstanceByName-{instanceName}")).Must().NotBeNull();

-                using (var activity = Log.Enter(() => new { instance.Name, instance.Id }))
-                {
-                    activity.Trace("Stopping");
+                using (var activity = Log.With(() => new { instance.Name, instance.Id }))
+                {
+                    activity.Write(() => "Stopping");
                     Run.TaskUntilCompletion(manager.TurnOffInstanceAsync(instance.Id, instance.Location, force));
-                    activity.Trace("Stopped");
+                    activity.Write(() => "Stopped");
                 }
             }

@@ -746,13 +745,13 @@
                 var instance = Run.TaskUntilCompletion(manager.GetInstanceDescriptionAsync(environment, instanceName));
                 instance.AsArg(Invariant($"FailedToFindInstanceByName-{instanceName}")).Must().NotBeNull();

-                using (var activity = Log.Enter(() => new { instance.Name, instance.Id }))
-                {
-                    activity.Trace("Stopping");
+                using (var activity = Log.With(() => new { instance.Name, instance.Id }))
+                {
+                    activity.Write(() => "Stopping");
                     Run.TaskUntilCompletion(manager.TurnOffInstanceAsync(instance.Id, instance.Location, force));
-                    activity.Trace("Restarting");
+                    activity.Write(() => "Restarting");
                     Run.TaskUntilCompletion(manager.TurnOnInstanceAsync(instance.Id, instance.Location));
-                    activity.Trace("Running");
+                    activity.Write(() => "Running");
                 }
             }

@@ -781,6 +780,252 @@
                 using (var computingManager = GetComputingManager(environmentType, computingInfrastructureManagerSettings, infrastructureTracker, credentials))
                 {
                     action(infrastructureTracker, computingManager);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Verifies the configuration repository.
+        /// </summary>
+        /// <param name="credentialsJson">The credentials json.</param>
+        /// <param name="infrastructureTrackerJson">The infrastructure tracker json.</param>
+        /// <param name="environment">The environment.</param>
+        /// <param name="environmentType">Type of the environment.</param>
+        /// <param name="configRepositoryPath">The configuration repository path.</param>
+        /// <param name="nonPackageDeployments">The non package deployments.</param>
+        /// <param name="adjustPackageIdToDeploymentConfigDirectoryName">Function to take the package identifier and return the deployment configuration directory name.</param>
+        /// <param name="shouldIncludeByDecisionAgainstName">Function to take the instance name (short name) and determine if it should be included in the run.</param>
+        public static void VerifyConfigurationRepository(
+            string credentialsJson,
+            string infrastructureTrackerJson,
+            string environment,
+            EnvironmentType environmentType,
+            string configRepositoryPath,
+            IReadOnlyCollection<Tuple<string, DeploymentConfiguration>> nonPackageDeployments = null,
+            Func<string, string> adjustPackageIdToDeploymentConfigDirectoryName = null,
+            Func<string, bool> shouldIncludeByDecisionAgainstName = null)
+        {
+            if (!Directory.Exists(configRepositoryPath))
+            {
+                throw new DirectoryNotFoundException(Invariant($"Could not find configuration repository directory specified: '{configRepositoryPath}'."));
+            }
+
+            nonPackageDeployments = nonPackageDeployments ?? new Tuple<string, DeploymentConfiguration>[0];
+            adjustPackageIdToDeploymentConfigDirectoryName = adjustPackageIdToDeploymentConfigDirectoryName ?? (_ => _);
+            shouldIncludeByDecisionAgainstName = shouldIncludeByDecisionAgainstName ?? (_ => true);
+
+            var serializer = new ObcJsonSerializer(typeof(NaosDeploymentCoreJsonSerializationConfiguration).ToJsonSerializationConfigurationType());
+            var infrastructureTrackerConfiguration =
+                (InfrastructureTrackerConfigurationBase)serializer.Deserialize(
+                    infrastructureTrackerJson,
+                    typeof(InfrastructureTrackerConfigurationBase));
+            var credentials = (CredentialContainer)serializer.Deserialize(credentialsJson, typeof(CredentialContainer));
+            var infrastructureManagerSettings = Config.Get<ComputingInfrastructureManagerSettings>(NaosDeploymentCoreJsonSerializationConfiguration.NaosDeploymentCoreJsonSerializerRepresentation);
+            var computingInfrastructureManagerSettings = Config.Get<ComputingInfrastructureManagerSettings>(NaosDeploymentCoreJsonSerializationConfiguration.NaosDeploymentCoreJsonSerializerRepresentation);
+
+            var nonPackageId = "NonPackageDeployment";
+
+            using (var infrastructureTracker = InfrastructureTrackerFactory.Create(infrastructureTrackerConfiguration))
+            {
+                var allInstances = Run.TaskUntilCompletion(infrastructureTracker.GetAllInstanceDescriptionsAsync(environment));
+                var instancesFilteredByName = allInstances.Where(_ => shouldIncludeByDecisionAgainstName(_.ComputerName)).ToList();
+                var instancesToEvaluate = instancesFilteredByName.Select(
+                    _ =>
+                    {
+                        var nonPackageDeployment = nonPackageDeployments.SingleOrDefault(__ => __.Item1 == _.ComputerName);
+                        var packageId = nonPackageDeployment != null
+                            ? nonPackageId + Guid.NewGuid().ToString().ToUpperInvariant()
+                            : _.DeployedPackages
+                               .Where(__ => !infrastructureManagerSettings.PackageIdsToIgnoreDuringTerminationSearch.Contains(__.Key))
+                               .Select(__ => __.Key)
+                               .SingleOrDefault();
+
+                        _.SystemSpecificDetails.TryGetValue(nameof(OperatingSystem), out var operatingSystemText);
+                        WindowsSku? windowsSku = null;
+                        if (operatingSystemText?.StartsWith(nameof(WindowsSku)) ?? false)
+                        {
+                            var treated = operatingSystemText.Replace(nameof(WindowsSku) + "-", string.Empty);
+                            windowsSku = (WindowsSku)Enum.Parse(typeof(WindowsSku), treated);
+                        }
+                        else if (nonPackageDeployment != null && (nonPackageDeployment.Item2?.InstanceType?.OperatingSystem is OperatingSystemDescriptionWindows windowsOperatingSystem))
+                        {
+                            windowsSku = windowsOperatingSystem.Sku;
+                        }
+
+                        var hadWindowsSku = windowsSku != null;
+                        var result = new
+                        {
+                            InstanceName = _.ComputerName,
+                            OriginalAbstractInstanceType = nonPackageDeployment?.Item2?.InstanceType,
+                            AbstractInstanceType = new InstanceType(),
+                            PackageId = packageId,
+                            OperatingSystemFromArcology = hadWindowsSku ? new OperatingSystemDescriptionWindows { Sku = (WindowsSku)windowsSku } : new OperatingSystemDescriptionWindows(),
+                            OperatingSystemFromAws = new OperatingSystemDescriptionWindows(),
+                        };
+
+                        return result;
+                    }).ToList();
+
+                using (var computingManager = GetComputingManager(environmentType, computingInfrastructureManagerSettings, infrastructureTracker, credentials))
+                {
+                    foreach (var instanceToEvaluate in instancesToEvaluate)
+                    {
+                        var description = Run.TaskUntilCompletion(
+                            computingManager.GetInstanceDescriptionAsync(environment, instanceToEvaluate.InstanceName));
+                        var systemSpecificInstanceType = description.SystemSpecificDetails["instanceType"];
+                        instanceToEvaluate.AbstractInstanceType.SpecificInstanceTypeSystemId = systemSpecificInstanceType;
+
+                        description.SystemSpecificDetails.TryGetValue(nameof(OperatingSystem), out var operatingSystemText);
+                        if (operatingSystemText?.StartsWith(nameof(WindowsSku)) ?? false)
+                        {
+                            var treated = operatingSystemText.Replace(nameof(WindowsSku) + "-", string.Empty);
+                            var windowsSku = (WindowsSku)Enum.Parse(typeof(WindowsSku), treated);
+                            instanceToEvaluate.OperatingSystemFromAws.Sku = (WindowsSku)windowsSku;
+                        }
+                    }
+                }
+
+                var configs = Directory.GetDirectories(configRepositoryPath, "*.Deployment")
+                                       .Select(
+                                            _ => new
+                                            {
+                                                RootPath = _,
+                                                DirectoryName = new DirectoryInfo(_).Name,
+                                                DeploymentConfigPath = Path.Combine(
+                                                         _,
+                                                         Invariant($".config/{environment}/DeploymentConfigurationWithStrategies.json"))
+                                            })
+                                       .ToList();
+
+                var deduplicatedInstancesToEvaluate = instancesToEvaluate.GroupBy(_ => _.PackageId).Select(
+                    _ =>
+                    {
+                        if (_.Count() > 1)
+                        {
+                            string instanceType = null;
+                            foreach (var item in _)
+                            {
+                                if (instanceType == null)
+                                {
+                                    instanceType = item.AbstractInstanceType.SpecificInstanceTypeSystemId;
+                                }
+                                else
+                                {
+                                    if (item.AbstractInstanceType.SpecificInstanceTypeSystemId != instanceType)
+                                    {
+                                        Console.WriteLine(Invariant($"Instance '{item.InstanceName}' has a type '{item.AbstractInstanceType.SpecificInstanceTypeSystemId}' but '{instanceType}' was expected."));
+                                    }
+                                }
+                            }
+
+                            return _.First();
+                        }
+                        else
+                        {
+                            return _.Single();
+                        }
+                    }).ToList();
+
+                var patchedAbstractInstanceTypeInstancesToEvaluate = deduplicatedInstancesToEvaluate.Select(
+                    _ =>
+                    {
+                        IReadOnlyCollection<AwsInstanceType> abstractInstanceTypes;
+                        var windowsSkuArcology = _.OperatingSystemFromArcology.Sku;
+                        var windowsSkuAws = _.OperatingSystemFromAws.Sku;
+                        if (windowsSkuArcology != windowsSkuAws
+                         && windowsSkuArcology != WindowsSku.DoesNotMatter
+                         && windowsSkuAws != WindowsSku.DoesNotMatter)
+                        {
+                            Console.WriteLine(Invariant($"Unexpected that {_.InstanceName} has a {nameof(WindowsSku)} of '{windowsSkuArcology}' in Arcology but '{windowsSkuAws}' in AWS Tags."));
+                        }
+
+                        WindowsSku windowsSku;
+                        if (windowsSkuArcology == WindowsSku.DoesNotMatter)
+                        {
+                            windowsSku = windowsSkuAws;
+                        }
+                        else
+                        {
+                            windowsSku = windowsSkuArcology;
+                        }
+
+                        if (windowsSku == WindowsSku.Base || windowsSku == WindowsSku.DoesNotMatter)
+                        {
+                            abstractInstanceTypes = computingInfrastructureManagerSettings.AwsInstanceTypes;
+                        }
+                        else if (windowsSku == WindowsSku.SqlWeb)
+                        {
+                            abstractInstanceTypes = computingInfrastructureManagerSettings.AwsInstanceTypesForSqlWeb;
+                        }
+                        else if (windowsSku == WindowsSku.SqlStandard)
+                        {
+                            abstractInstanceTypes = computingInfrastructureManagerSettings.AwsInstanceTypesForSqlStandard;
+                        }
+                        else
+                        {
+                            throw new NotSupportedException("This should not have been reached for " + _.InstanceName);
+                        }
+
+                        var matchingAbstractInstanceType = abstractInstanceTypes.SingleOrDefault(
+                            __ => __.AwsInstanceTypeDescriptor == _.AbstractInstanceType.SpecificInstanceTypeSystemId);
+
+                        if (matchingAbstractInstanceType != null)
+                        {
+                            _.AbstractInstanceType.VirtualCores = matchingAbstractInstanceType.VirtualCores;
+                            _.AbstractInstanceType.RamInGb = matchingAbstractInstanceType.RamInGb;
+                        }
+
+                        return _;
+                    }).ToList();
+
+                foreach (var instanceToEvaluate in patchedAbstractInstanceTypeInstancesToEvaluate)
+                {
+                    if (instanceToEvaluate.PackageId?.StartsWith(nonPackageId) ?? false)
+                    {
+                        if (instanceToEvaluate.OriginalAbstractInstanceType.SpecificInstanceTypeSystemId
+                         != instanceToEvaluate.AbstractInstanceType.SpecificInstanceTypeSystemId
+                         && !(instanceToEvaluate.OriginalAbstractInstanceType.VirtualCores
+                           == instanceToEvaluate.AbstractInstanceType.VirtualCores
+                           && instanceToEvaluate.OriginalAbstractInstanceType.RamInGb
+                           == instanceToEvaluate.AbstractInstanceType.RamInGb))
+                        {
+                            Console.WriteLine(Invariant($"FINISH WRITING NON PACKAGE ID CHECK AGAINST THINGY - {instanceToEvaluate.InstanceName}"));
+                        }
+                    }
+                    else if (instanceToEvaluate.PackageId == null)
+                    {
+                        Console.WriteLine(Invariant($"! {instanceToEvaluate.InstanceName} did not have a package id."));
+                    }
+                    else
+                    {
+                        var configDirectoryName = adjustPackageIdToDeploymentConfigDirectoryName(instanceToEvaluate.PackageId);
+                        var config = configs.SingleOrDefault(_ => _.DirectoryName == configDirectoryName);
+
+                        if (config == null)
+                        {
+                            Console.WriteLine(Invariant($"! No config found {instanceToEvaluate.PackageId} on {instanceToEvaluate.InstanceName} expected to find: {configDirectoryName}"));
+                        }
+                        else
+                        {
+                            if (!File.Exists(config.DeploymentConfigPath))
+                            {
+                                Console.WriteLine(Invariant($"! Expected to find file '{config.DeploymentConfigPath}' but it did not exist."));
+                            }
+                            else
+                            {
+                                var configFileContents = File.ReadAllText(config.DeploymentConfigPath);
+                                var configFileObject = serializer.Deserialize<DeploymentConfigurationWithStrategies>(configFileContents);
+                                if (configFileObject.InstanceType.SpecificInstanceTypeSystemId != instanceToEvaluate.AbstractInstanceType.SpecificInstanceTypeSystemId)
+                                {
+                                    if (configFileObject.InstanceType.VirtualCores != instanceToEvaluate.AbstractInstanceType.VirtualCores
+                                     && configFileObject.InstanceType.RamInGb != instanceToEvaluate.AbstractInstanceType.RamInGb)
+                                    {
+                                        Console.WriteLine(Invariant($"! Expected {config.DeploymentConfigPath} to have an instance type of {instanceToEvaluate.AbstractInstanceType} but found {configFileObject.InstanceType}"));
+                                    }
+                                }
+                            }
+                        }
+                    }
                 }
             }
         }
@@ -873,9 +1118,8 @@
                         Using.LinearBackOff(TimeSpan.FromSeconds(5))
                             .WithMaxRetries(3)
                             .WithReporter(_ =>
-                                Log.Write(new LogEntry(
-                                    Invariant($"Retrying delete deployment working directory {unzipDirPath} due to error."),
-                                    _)))
+                                Log.Write(() => _,
+                                    Invariant($"Retrying delete deployment working directory {unzipDirPath} due to error.")))
                             .Run(() => Directory.Delete(unzipDirPath, true))
                             .Now();
                     }
@@ -883,8 +1127,8 @@
                     Using.LinearBackOff(TimeSpan.FromSeconds(5))
                         .WithMaxRetries(3)
                         .WithReporter(_ =>
-                            Log.Write(new LogEntry(
-                                Invariant($"Retrying create deployment working directory {unzipDirPath} due to error."), _)))
+                            Log.Write(() => _,
+                                Invariant($"Retrying create deployment working directory {unzipDirPath} due to error.")))
                         .Run(() => Directory.CreateDirectory(unzipDirPath))
                         .Now();


Added missing comment.

Added missing comment.

--- Naos.MessageBus.Hangfire.Harness/MessageDispatcher.cs
+++ Naos.MessageBus.Hangfire.Harness/MessageDispatcher.cs
@@ -41,6 +41,7 @@
             methodInfo.Invoke(handler, new object[] { message });
         }

+        /// <inheritdoc />
         public void Dispatch(Envelope envelope)
         {
             var message = (IMessage)Serializer.Deserialize(envelope.MessageType, envelope.MessageAsJson);


Actually sending the reload event

Actually sending the reload event

--- classes/lib/PodWatcher.cs
+++ classes/lib/PodWatcher.cs
@@ -46,6 +46,7 @@
             //Restart the watchers and reload the content
             StopWatchers();
             StartWatcher();
+            SocketServer.SendReloadEvent();
         }

         [PermissionSet(SecurityAction.Demand, Name = "FullTrust")]


correct Refactoring mistake

correct Refactoring mistake

--- raspberry-uc-system/RaspberryUserControlSystem/TestmachineFrontend/MainWindowPartialClasses/DetectTab.cs
+++ raspberry-uc-system/RaspberryUserControlSystem/TestmachineFrontend/MainWindowPartialClasses/DetectTab.cs
@@ -87,7 +87,7 @@

         private void HI_OFF_Click(object sender, RoutedEventArgs e)
         {
-               sendRequest(new Request("TurnOffHI", 0));
+               sendRequest(new Request("TurnOnHI", 0));
         }

         private void sendVoltageValue_Click(object sender, RoutedEventArgs e)


Changed Params

Changed Params

--- OctoAwesome/OctoAwesome.Basics/SnowBlockDefinition.cs
+++ OctoAwesome/OctoAwesome.Basics/SnowBlockDefinition.cs
@@ -40,10 +40,10 @@
         {
             return new PhysicalProperties()
             {
-                Density = 2f,
-                FractureToughness = 0.3f,
+                Density = 1.5f,
+                FractureToughness = 0.2f,
                 Granularity = 0.9f,
-                Hardness = 0.1f
+                Hardness = 0.05f
             };
         }


uncomment and skip this test

uncomment and skip this test

--- Octokit.Tests.Integration/Clients/TeamsClientTests.cs
+++ Octokit.Tests.Integration/Clients/TeamsClientTests.cs
@@ -59,9 +59,7 @@
             team = github.Organization.Team.GetAll(Helper.Organization).Result.First();
         }

-        //TODO: seems like a bug in Github: it's actually returning the membership information!
-        //Maybe because it's a public organization?
-        //[OrganizationTest]
+        [OrganizationTest(Skip="actually returning the membership information! Maybe because it's a public organization?")]
         public async Task FailsWhenNotAuthenticated()
         {
             var github = Helper.GetAnonymousClient();


Tweak the wording of ConfigurationDefinition documentation

--- OpenIIoT.SDK/Configuration/ConfigurationDefinition.cs
+++ OpenIIoT.SDK/Configuration/ConfigurationDefinition.cs
@@ -50,9 +50,9 @@
     /// </summary>
     /// <remarks>
     ///     <para>
-    ///         The configuration is comprised of two strings, a form and a schema, and a Type representing the model. The strings
-    ///         are intended to contain json data; the form containing a json representation of an HTML form, and the schema
-    ///         containing a logical schema to be used as the basis of the form.
+    ///         The configuration is comprised of two strings, a form and a schema, a Type representing the model, and a default
+    ///         value for the model. The strings are intended to contain json data; the form containing a json representation of an
+    ///         HTML form, and the schema containing a logical schema to be used as the basis of the form.
     ///     </para>
     ///     <para>
     ///         When the configuration is edited (or a new instance created), the form and schema are used to generate an HTML form


Issue 43 - incorrect ! in front of expression

--- src/LibLog/LibLog.cs
+++ src/LibLog/LibLog.cs
@@ -1883,7 +1883,7 @@
         /// <returns></returns>
         public static Func<string> SimulateStructuredLogging(Func<string> messageBuilder, object[] formatParameters)
         {
-            if(formatParameters == null || !formatParameters.Length == 0)
+            if (formatParameters == null || formatParameters.Length == 0)
             {
                 return messageBuilder;
             }


Improve documentation of Same/NotSame methods about using Null/NotNull methods to match for null references

--- src/Library/Match.cs
+++ src/Library/Match.cs
@@ -100,6 +100,7 @@
         /// </returns>
         /// <exception cref="ArgumentNullException">
         /// <paramref name="reference"/> is <c>null</c>.
+        /// When matching an instance to be a <c>null</c> reference use <see cref="Null{T}"/> instead.
         /// </exception>
         public static Match<T> Same<T>(T reference)
             where T : class
@@ -126,6 +127,7 @@
         /// </returns>
         /// <exception cref="ArgumentNullException">
         /// <paramref name="reference"/> is <c>null</c>.
+        /// When matching an instance to not be a <c>null</c> reference use <see cref="NotNull{T}"/> instead.
         /// </exception>
         public static Match<T> NotSame<T>(T reference)
             where T : class


Enable debugging for all packets by default.

--- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -456,7 +456,7 @@
         public LLClientView(Scene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse sessionInfo,
             UUID agentId, UUID sessionId, uint circuitCode)
         {
-//            DebugPacketLevel = 1;
+            DebugPacketLevel = 256;

             CloseSyncLock = new Object();


Changed error message for garbage comment filter


Partialy fixed a bug with collisions in BulletXPlugin.

--- OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
+++ OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
@@ -69,8 +69,6 @@
 using XnaDevRu.BulletX.Dynamics;
 using AxiomQuaternion = Axiom.Math.Quaternion;
 using BoxShape=XnaDevRu.BulletX.BoxShape;
-//Specific References for BulletXPlugin
-
 #endregion

 namespace OpenSim.Region.Physics.BulletXPlugin
@@ -734,7 +732,7 @@
                 return rigidBody;
             }
         }
-        public MonoXnaCompactMaths.Vector3 RigidBodyPosition
+        public Vector3 RigidBodyPosition
         {
             get { return this.rigidBody.CenterOfMassPosition; }
         }
@@ -804,7 +802,7 @@
         }
         internal protected void Translate(PhysicsVector _newPos)
         {
-            MonoXnaCompactMaths.Vector3 _translation;
+            Vector3 _translation;
             _translation = BulletXMaths.PhysicsVectorToXnaVector3(_newPos) - rigidBody.CenterOfMassPosition;
             rigidBody.Translate(_translation);
         }
@@ -814,7 +812,7 @@
         }
         internal protected void Speed(PhysicsVector _newSpeed)
         {
-            MonoXnaCompactMaths.Vector3 _speed;
+            Vector3 _speed;
             _speed = BulletXMaths.PhysicsVectorToXnaVector3(_newSpeed);
             rigidBody.LinearVelocity = _speed;
         }
@@ -824,7 +822,7 @@
         }
         internal protected void ReOrient(AxiomQuaternion _newOrient)
         {
-            MonoXnaCompactMaths.Quaternion _newOrientation;
+            Quaternion _newOrientation;
             _newOrientation = BulletXMaths.AxiomQuaternionToXnaQuaternion(_newOrient);
             Matrix _comTransform = rigidBody.CenterOfMassTransform;
             BulletXMaths.SetRotation(ref _comTransform, _newOrientation);
@@ -1033,6 +1031,9 @@
             if (rotation.Norm == 0f) rotation = AxiomQuaternion.Identity;

             _position = pos;
+            //ZZZ
+            _physical = false;
+            //zzz
             if (_physical) _velocity = velocity;
             else _velocity = new PhysicsVector();
             _size = size;
@@ -1041,32 +1042,7 @@

             _parent_scene = parent_scene;

-            //For RigidBody Constructor. The next values might change
-            float _linearDamping = 0.0f;
-            float _angularDamping = 0.0f;
-            float _friction = 0.5f;
-            float _restitution = 0.0f;
-            Matrix _startTransform = Matrix.Identity;
-            Matrix _centerOfMassOffset = Matrix.Identity;
-            lock (BulletXScene.BulletXLock)
-            {
-                _startTransform.Translation = BulletXMaths.PhysicsVectorToXnaVector3(pos);
-                //For now all prims are boxes
-                CollisionShape _collisionShape = new BoxShape(BulletXMaths.PhysicsVectorToXnaVector3(_size)/2.0f);
-                DefaultMotionState _motionState = new DefaultMotionState(_startTransform, _centerOfMassOffset);
-                Vector3 _localInertia = new Vector3();
-                if (_physical) _collisionShape.CalculateLocalInertia(Mass, out _localInertia); //Always when mass > 0
-                rigidBody =
-                    new RigidBody(Mass, _motionState, _collisionShape, _localInertia, _linearDamping, _angularDamping,
-                                  _friction, _restitution);
-                //rigidBody.ActivationState = ActivationState.DisableDeactivation;
-                //It's seems that there are a bug with rigidBody constructor and its CenterOfMassPosition
-                Vector3 _vDebugTranslation;
-                _vDebugTranslation = _startTransform.Translation - rigidBody.CenterOfMassPosition;
-                rigidBody.Translate(_vDebugTranslation);
-                //---
-                parent_scene.ddWorld.AddRigidBody(rigidBody);
-            }
+            CreateRigidBody(parent_scene, pos, size);
         }

         public override PhysicsVector Position
@@ -1108,7 +1084,10 @@
             get
             {
                 //For now all prims are boxes
-                return (_physical ? 1 : 0) * _density * _size.X * _size.Y * _size.Z;
+                //ZZZ
+                return _density * _size.X * _size.Y * _size.Z;
+                //return (_physical ? 1 : 0) * _density * _size.X * _size.Y * _size.Z;
+                //zzz
             }
         }
         public Boolean Physical
@@ -1210,7 +1189,7 @@
             //For RigidBody Constructor. The next values might change
             float _linearDamping = 0.0f;
             float _angularDamping = 0.0f;
-            float _friction = 0.5f;
+            float _friction = 1.0f;
             float _restitution = 0.0f;
             Matrix _startTransform = Matrix.Identity;
             Matrix _centerOfMassOffset = Matrix.Identity;
@@ -1220,12 +1199,15 @@
                 //For now all prims are boxes
                 CollisionShape _collisionShape = new XnaDevRu.BulletX.BoxShape(BulletXMaths.PhysicsVectorToXnaVector3(size) / 2.0f);
                 DefaultMotionState _motionState = new DefaultMotionState(_startTransform, _centerOfMassOffset);
-                MonoXnaCompactMaths.Vector3 _localInertia = new MonoXnaCompactMaths.Vector3();
-                if (_physical) _collisionShape.CalculateLocalInertia(Mass, out _localInertia); //Always when mass > 0
+                Vector3 _localInertia = new Vector3();
+                //ZZZ
+                if (Mass > 0) _collisionShape.CalculateLocalInertia(Mass, out _localInertia); //Always when mass > 0
+                //if (_physical) _collisionShape.CalculateLocalInertia(Mass, out _localInertia); //Always when mass > 0
+                //zzz
                 rigidBody = new RigidBody(Mass, _motionState, _collisionShape, _localInertia, _linearDamping, _angularDamping, _friction, _restitution);
                 //rigidBody.ActivationState = ActivationState.DisableDeactivation;
                 //It's seems that there are a bug with rigidBody constructor and its CenterOfMassPosition
-                MonoXnaCompactMaths.Vector3 _vDebugTranslation;
+                Vector3 _vDebugTranslation;
                 _vDebugTranslation = _startTransform.Translation - rigidBody.CenterOfMassPosition;
                 rigidBody.Translate(_vDebugTranslation);
                 //---


完善 GenerateScheme 接口

完善 GenerateScheme 接口

--- src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs
+++ src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/AdvancedAPIs/WxApp/WxAppApi.cs
@@ -670,7 +670,7 @@
                 var data = new
                 {
                     jump_wxa = jumpWxa,
-                    is_expire = isExpire,
+                    is_expire = isExpire.Value ? "true" : "false",
                     expire_time = expireTime.HasValue ? Senparc.CO2NET.Helpers.DateTimeHelper.GetUnixDateTime(expireTime.Value) : (long?)null
                 };

@@ -1283,7 +1283,7 @@
                 var data = new
                 {
                     jump_wxa = jumpWxa,
-                    is_expire = isExpire,
+                    is_expire = isExpire.Value ? "true" : "false",
                     expire_time = expireTime.HasValue ? Senparc.CO2NET.Helpers.DateTimeHelper.GetUnixDateTime(expireTime.Value) : (long?)null
                 };


Use current TravelingAgent if the login failure reason is "Logins Disabled" to fix NullReferenceException, allowing agent to login to fallback region when logins are disabled by "StartDisabled = true" or when logins are disabled by RegionReady

--- OpenSim/Services/HypergridService/UserAgentService.cs
+++ OpenSim/Services/HypergridService/UserAgentService.cs
@@ -197,8 +197,11 @@
                     agentCircuit.firstname, agentCircuit.lastname, region.ServerURI, reason);

                 // restore the old travel info
-                lock (m_TravelingAgents)
-                    m_TravelingAgents[agentCircuit.SessionID] = old;
+                if(reason != "Logins Disabled")
+                {
+                    lock (m_TravelingAgents)
+                        m_TravelingAgents[agentCircuit.SessionID] = old;
+                }

                 return false;
             }


[WIP] Tidy up.

[WIP] Tidy up.

--- Pinta.Gui.Widgets/Widgets/Canvas/NewCanvasRenderer.cs
+++ Pinta.Gui.Widgets/Widgets/Canvas/NewCanvasRenderer.cs
@@ -8,9 +8,9 @@
 /////////////////////////////////////////////////////////////////////////////////

 using System;
+using System.Collections.Generic;
 using Gdk;
 using Pinta.Core;
-using System.Collections.Generic;

 namespace Pinta.Gui.Widgets
 {
@@ -46,16 +46,16 @@
 			generated = false;
 		}

-		public void Render (List<Layer> layers, Cairo.ImageSurface dst, Gdk.Point offset, bool checker)
+		public void Render (List<Layer> layers, Cairo.ImageSurface dst, Gdk.Point offset)
 		{
 			dst.Flush ();

 			if (scale_factor.Ratio == 1)
-				RenderOneToOne (layers, dst, offset, checker);
+				RenderOneToOne (layers, dst, offset);
 			else if (scale_factor.Ratio < 1)
-				RenderZoomIn (layers, dst, offset, checker);
+				RenderZoomIn (layers, dst, offset);
 			else
-				RenderZoomOut (layers, dst, offset, destination_size, checker);
+				RenderZoomOut (layers, dst, offset, destination_size);

 			dst.MarkDirty ();
 		}
@@ -136,9 +136,10 @@
 		}

 		#region Algorithms ported from PDN
-		private unsafe void RenderOneToOne (List<Layer> layers, Cairo.ImageSurface dst, Gdk.Point offset, bool checker)
-		{
-			checker = true;
+		private unsafe void RenderOneToOne (List<Layer> layers, Cairo.ImageSurface dst, Gdk.Point offset)
+		{
+			// The first layer should be blended with the transparent checkerboard
+			var checker = true;

 			for (int i = 0; i < layers.Count; i++) {
 				var layer = layers[i];
@@ -209,9 +210,10 @@
 			}
 		}

-		private unsafe void RenderZoomIn (List<Layer> layers, Cairo.ImageSurface dst, Gdk.Point offset, bool checker)
-		{
-			checker = true;
+		private unsafe void RenderZoomIn (List<Layer> layers, Cairo.ImageSurface dst, Gdk.Point offset)
+		{
+			// The first layer should be blended with the transparent checkerboard
+			var checker = true;

 			for (int i = 0; i < layers.Count; i++) {
 				var layer = layers[i];
@@ -286,9 +288,10 @@
 			}
 		}

-		private unsafe void RenderZoomOut (List<Layer> layers, Cairo.ImageSurface dst, Gdk.Point offset, Gdk.Size destinationSize, bool checker)
-		{
-			checker = true;
+		private unsafe void RenderZoomOut (List<Layer> layers, Cairo.ImageSurface dst, Gdk.Point offset, Gdk.Size destinationSize)
+		{
+			// The first layer should be blended with the transparent checkerboard
+			var checker = true;

 			for (int i = 0; i < layers.Count; i++) {
 				var layer = layers[i];


(GH-784) Update ReportGenerator reference from 4.8.5 to 4.8.6

--- Cake.Recipe/Content/toolsettings.cake
+++ Cake.Recipe/Content/toolsettings.cake
@@ -54,7 +54,7 @@
         string nunitTool = "#tool nuget:?package=NUnit.ConsoleRunner&version=3.12.0",
         string nugetTool = "#tool nuget:?package=NuGet.CommandLine&version=5.8.1",
         string openCoverTool = "#tool nuget:?package=OpenCover&version=4.7.922",
-        string reportGeneratorTool = "#tool nuget:?package=ReportGenerator&version=4.8.5",
+        string reportGeneratorTool = "#tool nuget:?package=ReportGenerator&version=4.8.6",
         string reportUnitTool = "#tool nuget:?package=ReportUnit&version=1.2.1",
         string codecovGlobalTool = "#tool dotnet:?package=Codecov.Tool&version=1.13.0",
         string coverallsGlobalTool = "#tool dotnet:?package=coveralls.net&version=1.0.0",


reuse httpclient

reuse httpclient

--- Producer/Producer.Functions/AuthUserConfigProvider.cs
+++ Producer/Producer.Functions/AuthUserConfigProvider.cs
@@ -17,6 +17,9 @@
 {
 	public static class AuthUserConfigProvider
 	{
+		static HttpClient _httpClient;
+		static HttpClient httpClient => _httpClient ?? (_httpClient = new HttpClient ());
+
 		[Authorize]
 		[FunctionName ("GetUserConfig")]
 		public static async Task<HttpResponseMessage> GetUserConfig ([HttpTrigger (AuthorizationLevel.Anonymous, "get", Route = "user/config")]HttpRequestMessage req, TraceWriter log)
@@ -31,24 +34,21 @@

 					log.Info ($"userId = {userId}");

-					using (var client = new HttpClient ())
+					httpClient.ConfigureClientForUserDetails (identity, req);
+
+					try
 					{
-						client.ConfigureClientForUserDetails (identity, req);
+						var me = await httpClient.GetStringAsync (".auth/me");

-						try
-						{
-							var me = await client.GetStringAsync (".auth/me");
+						// TODO: Check for provider
+						var googleUser = JsonConvert.DeserializeObject<GoogleAuthUser> (me.Trim (new Char [] { '[', ']' }));

-							// TODO: Check for provider
-							var googleUser = JsonConvert.DeserializeObject<GoogleAuthUser> (me.Trim (new Char [] { '[', ']' }));
-
-							return req.CreateResponse (System.Net.HttpStatusCode.OK, googleUser.GetAuthUserConfig (userId));
-						}
-						catch (Exception ex)
-						{
-							log.Error ("Could not get user details", ex);
-							throw;
-						}
+						return req.CreateResponse (System.Net.HttpStatusCode.OK, googleUser.GetAuthUserConfig (userId));
+					}
+					catch (Exception ex)
+					{
+						log.Error ("Could not get user details", ex);
+						throw;
 					}
 				}
 			}


refactor and replace anonymous type with struct

--- Projects/CsProjArrange/CsProjArrange/CsProjArrange.cs
+++ Projects/CsProjArrange/CsProjArrange/CsProjArrange.cs
@@ -275,7 +275,7 @@
                 input.Root.Elements()
                      .GroupBy(
                          x =>
-                         new
+                         new CombineGroups
                          {
                              Name = x.Name.Namespace.ToString() + ":" + x.Name.LocalName,
                              Attributes =
@@ -283,8 +283,8 @@
                                  x.Attributes()
                                   .Select(y => y.Name.Namespace.ToString() + ":" + y.Name.LocalName + ":" + y.Value)),
                          }
-                    )
-                ;
+                    );
+
             foreach (var elementGroup in combineGroups)
             {
                 if (options.HasFlag(ArrangeOptions.CombineRootElements))
@@ -350,5 +350,10 @@
             }
         }

+        internal struct CombineGroups
+        {
+            public string Name;
+            public string Attributes;
+        }
     }
 }


Fix: NRE in PartialMethodParameterNameMismatchAnalyzer when code has syntax errors in partial method declaration.

--- RefactoringEssentials/CSharp/Diagnostics/Synced/CodeQuality/PartialMethodParameterNameMismatchAnalyzer.cs
+++ RefactoringEssentials/CSharp/Diagnostics/Synced/CodeQuality/PartialMethodParameterNameMismatchAnalyzer.cs
@@ -42,7 +42,7 @@
                 return;

             var symbol = nodeContext.SemanticModel.GetDeclaredSymbol(node) as IMethodSymbol;
-            if (symbol == null)
+            if ((symbol == null) || (symbol.PartialDefinitionPart == null))
                 return;
             for (int i = 0; i < symbol.PartialDefinitionPart.Parameters.Length && i < node.ParameterList.Parameters.Count; i++) {
                 if (symbol.PartialDefinitionPart.Parameters[i].Name != node.ParameterList.Parameters[i].Identifier.ValueText) {


不允许ApiException.Code为0。

--- src/cmstar.WebApi/ApiException.cs
+++ src/cmstar.WebApi/ApiException.cs
@@ -12,7 +12,7 @@
         /// </summary>
         /// <param name="code">描述此异常的状态码。</param>
         public ApiException(int code)
-            : this(code, "There is an error during the API invocation.")
+            : this(code, "There is an error during the invocation.")
         {
         }

@@ -22,9 +22,8 @@
         /// <param name="code">描述此异常的状态码。</param>
         /// <param name="message">描述此异常的消息。</param>
         public ApiException(int code, string message)
-            : base(message)
+            : this(code, message, null)
         {
-            Code = code;
         }

         /// <summary>
@@ -36,6 +35,9 @@
         public ApiException(int code, string message, Exception innerException)
             : base(message, innerException)
         {
+            if (code == 0)
+                throw new ArgumentException("The error code can not be zero.", "code");
+
             Code = code;
         }


small bugfix

small bugfix


Added an initializer from int for UInt3264.