Fixing that specifying a global zone as an editor shape's placement caused NRE, fixes #4913

E.g. something like this didn't work: Parts_Title_Edit = "/Navigation: 5"

--- src/Orchard/ContentManagement/DefaultContentDisplay.cs
+++ src/Orchard/ContentManagement/DefaultContentDisplay.cs
@@ -76,6 +76,8 @@
             ((IShape)itemShape).Metadata.Alternates.Add(actualShapeType + "__" + content.ContentItem.ContentType);

             var context = new BuildEditorContext(itemShape, content, groupId, _shapeFactory);
+            var workContext = _workContextAccessor.GetContext(_requestContext.HttpContext);
+            context.Layout = workContext.Layout;
             BindPlacement(context, null, stereotype);

             _handlers.Value.Invoke(handler => handler.BuildEditor(context), Logger);
@@ -104,6 +106,7 @@
             ((IShape)itemShape).Metadata.Alternates.Add(actualShapeType + "__" + content.ContentItem.ContentType);

             var context = new UpdateEditorContext(itemShape, content, updater, groupInfoId, _shapeFactory, shapeTable, GetPath());
+            context.Layout = workContext.Layout;
             BindPlacement(context, null, stereotype);

             _handlers.Value.Invoke(handler => handler.UpdateEditor(context), Logger);


- restrict memory load

- restrict memory load

--- src/ReportGenerator.Core/Parser/CoverageReportParser.cs
+++ src/ReportGenerator.Core/Parser/CoverageReportParser.cs
@@ -172,11 +172,15 @@
             return Task.Factory.StartNew(() =>
             {
                 long average = 0;
-                int count = 0;
                 try
                 {
-                    Parallel.ForEach(reportFiles, new ParallelOptions { MaxDegreeOfParallelism = this.numberOfReportsReadOnMemoryInParallel }, reportFile =>
-                    {
+                    foreach (string reportFile in reportFiles)
+                    {
+                        while (collection.Count > this.numberOfReportsReadOnMemoryInParallel)
+                        {
+                            Thread.Sleep(TimeSpan.FromSeconds(1));
+                            Logger.Warn($"Waiting for parser because file content queue already contains {collection.Count} items.");
+                        }
                         if (File.Exists(reportFile))
                         {
                             int number = Interlocked.Increment(ref this.fileParserCount);
@@ -187,8 +191,8 @@
                             stopWatch.Stop();
                             Interlocked.Exchange(ref average, average += stopWatch.ElapsedMilliseconds);
                             Logger.InfoFormat(Resources.FinishedLoadingReport, reportFile, number, reportFiles.Count, stopWatch.ElapsedMilliseconds / 1000d);
-                        }
-                    });
+                        }
+                    }
                 }
                 finally
                 {


Revert "- restrict memory load"

Revert "- restrict memory load"

This reverts commit 50e01ff8554189227ea390c471e78a2bb75fc227.

--- src/ReportGenerator.Core/Parser/CoverageReportParser.cs
+++ src/ReportGenerator.Core/Parser/CoverageReportParser.cs
@@ -172,15 +172,11 @@
             return Task.Factory.StartNew(() =>
             {
                 long average = 0;
+                int count = 0;
                 try
                 {
-                    foreach (string reportFile in reportFiles)
-                    {
-                        while (collection.Count > this.numberOfReportsReadOnMemoryInParallel)
-                        {
-                            Thread.Sleep(TimeSpan.FromSeconds(1));
-                            Logger.Warn($"Waiting for parser because file content queue already contains {collection.Count} items.");
-                        }
+                    Parallel.ForEach(reportFiles, new ParallelOptions { MaxDegreeOfParallelism = this.numberOfReportsReadOnMemoryInParallel }, reportFile =>
+                    {
                         if (File.Exists(reportFile))
                         {
                             int number = Interlocked.Increment(ref this.fileParserCount);
@@ -191,8 +187,8 @@
                             stopWatch.Stop();
                             Interlocked.Exchange(ref average, average += stopWatch.ElapsedMilliseconds);
                             Logger.InfoFormat(Resources.FinishedLoadingReport, reportFile, number, reportFiles.Count, stopWatch.ElapsedMilliseconds / 1000d);
-                        }
-                    }
+                        }
+                    });
                 }
                 finally
                 {


Add explicit support for winmd files

Add explicit support for winmd files

--- src/SignService/SigningTools/SigntoolCodeSignService.cs
+++ src/SignService/SigningTools/SigntoolCodeSignService.cs
@@ -186,7 +186,8 @@
             ".dll",
             ".exe",
             ".sys",
-            ".vxd"
+            ".vxd",
+            ".winmd"
         };

         public bool IsDefault => true;


Issue #194: Updated Autofac.Integration.Web.ContainerProvider to be more open to derive-and-override scenarios. * Methods and properties are virtual. * AmbientRequestLifetime is protected instead of private. * RequestLifetimeConfiguration is a public property with a private setter. * Creation of the actual request lifetime is a protected factory method so derived container providers can change how this works. Particularly helpful in a multitenant scenario.

--- src/Source/Autofac.Integration.Web/ContainerProvider.cs
+++ src/Source/Autofac.Integration.Web/ContainerProvider.cs
@@ -32,9 +32,6 @@
     /// </summary>
     public class ContainerProvider : IContainerProvider
     {
-        readonly IContainer _applicationContainer;
-        readonly Action<ContainerBuilder> _requestLifetimeConfiguration;
-
         /// <summary>
         /// Initializes a new instance of the <see cref="ContainerProvider"/> class.
         /// </summary>
@@ -42,21 +39,22 @@
         public ContainerProvider(IContainer applicationContainer)
         {
             if (applicationContainer == null) throw new ArgumentNullException("applicationContainer");
-            _applicationContainer = applicationContainer;
+            this.ApplicationContainer = applicationContainer;
         }

         /// <summary>
         /// Initializes a new instance of the <see cref="ContainerProvider"/> class.
         /// </summary>
         /// <param name="applicationContainer">The application container.</param>
-        /// <param name="requestLifetimeConfiguration">An action that will be executed when building
+        /// <param name="requestLifetimeConfiguration">
+        /// An action that will be executed when building
         /// the per-request lifetime. The components visible within the request can be
-        /// customised here.</param>
+        /// customized here.
+        /// </param>
         public ContainerProvider(IContainer applicationContainer, Action<ContainerBuilder> requestLifetimeConfiguration)
             : this(applicationContainer)
         {
-            if (requestLifetimeConfiguration == null) throw new ArgumentNullException("requestLifetimeConfiguration");
-            _requestLifetimeConfiguration = requestLifetimeConfiguration;
+            this.RequestLifetimeConfiguration = requestLifetimeConfiguration;
         }

         /// <summary>
@@ -71,33 +69,45 @@
         }

         /// <summary>
-        /// The global, application-wide container.
+        /// Gets the application container.
         /// </summary>
-        /// <value></value>
-        public IContainer ApplicationContainer
-        {
-            get
-            {
-                return _applicationContainer;
-            }
-        }
+        /// <value>
+        /// The application container from which request lifetimes will be spawned.
+        /// </value>
+        public virtual IContainer ApplicationContainer { get; private set; }

         /// <summary>
-        /// The container used to manage components for processing the
-        /// current request.
+        /// Gets the configuration for each request lifetime.
         /// </summary>
-        /// <value></value>
-        public ILifetimeScope RequestLifetime
+        /// <value>
+        /// An <see cref="System.Action{ContainerBuilder}"/> that will be run
+        /// for each request lifetime when it is created. If the value is <see langword="null" />,
+        /// then no request lifetime configuration will be applied.
+        /// </value>
+        public virtual Action<ContainerBuilder> RequestLifetimeConfiguration { get; private set; }
+
+        /// <summary>
+        /// Gets the request lifetime from the request context.
+        /// </summary>
+        /// <value>
+        /// An <see cref="Autofac.ILifetimeScope"/> from which individual requests
+        /// can be resolved.
+        /// </value>
+        /// <remarks>
+        /// <para>
+        /// This property uses the current <see cref="System.Web.HttpContext.Items"/>
+        /// collection and stores the request lifetime in as a named item.
+        /// If there is no request lifetime found in the context, one is created.
+        /// </para>
+        /// </remarks>
+        public virtual ILifetimeScope RequestLifetime
         {
             get
             {
                 var result = AmbientRequestLifetime;
                 if (result == null)
                 {
-                    result = _requestLifetimeConfiguration == null ?
-                        ApplicationContainer.BeginLifetimeScope(WebLifetime.Request) :
-                        ApplicationContainer.BeginLifetimeScope(WebLifetime.Request, _requestLifetimeConfiguration);
-
+                    result = this.CreateRequestLifetime();
                     AmbientRequestLifetime = result;
                 }

@@ -105,7 +115,37 @@
             }
         }

-        static ILifetimeScope AmbientRequestLifetime
+        /// <summary>
+        /// Factory method for creating the request lifetime scope.
+        /// </summary>
+        /// <returns>
+        /// An <see cref="Autofac.ILifetimeScope"/> for resolving request-level dependencies.
+        /// </returns>
+        /// <remarks>
+        /// <para>
+        /// This method is used by the <see cref="Autofac.Integration.Web.ContainerProvider.RequestLifetime"/>
+        /// to generate the request lifetime from the application container.
+        /// </para>
+        /// <para>
+        /// This implementation returns a lifetime scope nested in the application container.
+        /// </para>
+        /// </remarks>
+        protected virtual ILifetimeScope CreateRequestLifetime()
+        {
+            return this.RequestLifetimeConfiguration == null ?
+                        this.ApplicationContainer.BeginLifetimeScope(WebLifetime.Request) :
+                        this.ApplicationContainer.BeginLifetimeScope(WebLifetime.Request, this.RequestLifetimeConfiguration);
+        }
+
+        /// <summary>
+        /// Gets or sets the ambient request lifetime in the current web context.
+        /// </summary>
+        /// <value>
+        /// An <see cref="Autofac.ILifetimeScope"/> that is stored in the current
+        /// <see cref="System.Web.HttpContext.Items"/> collection at a known
+        /// location.
+        /// </value>
+        protected static ILifetimeScope AmbientRequestLifetime
         {
             get
             {


Update to Abp.Zero 0.7.0.0

Update to Abp.Zero 0.7.0.0

Update because arguments change on base constructor

--- sample/ModuleZeroSampleProject.Core/Authorization/RoleStore.cs
+++ sample/ModuleZeroSampleProject.Core/Authorization/RoleStore.cs
@@ -9,14 +9,16 @@
     public class RoleStore : AbpRoleStore<Tenant, Role, User>
     {
         public RoleStore(
-            IRepository<Role> roleRepository,
-            IRepository<UserRole, long> userRoleRepository,
-            IRepository<RolePermissionSetting, long> rolePermissionSettingRepository)
+            IRepository<Role> roleRepository,
+            IRepository<UserRole, long> userRoleRepository,
+            IRepository<RolePermissionSetting, long> rolePermissionSettingRepository,
+            ICacheManager cacheManager)
             : base(
-                roleRepository,
-                userRoleRepository,
-                rolePermissionSettingRepository)
+                roleRepository,
+                userRoleRepository,
+                rolePermissionSettingRepository,
+                cacheManager)
         {
         }
     }
-}+}


Add formatting test for property pattern clause single line

--- src/Workspaces/CSharpTest/Formatting/FormattingTests.cs
+++ src/Workspaces/CSharpTest/Formatting/FormattingTests.cs
@@ -9930,6 +9930,41 @@
         }

         [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
+        [WorkItem(52413, "https://github.com/dotnet/roslyn/issues/52413")]
+        public async Task NewLinesForBraces_PropertyPatternClauses_SingleLine()
+        {
+            var changingOptions = new OptionsCollection(LanguageNames.CSharp)
+            {
+                { NewLinesForBracesInObjectCollectionArrayInitializers, false },
+            };
+            await AssertFormatAsync(
+                @"
+class A
+{
+    public string Name { get; }
+
+    public bool IsFoo(A a)
+    {
+        return a is {
+            Name: ""foo"",
+        };
+    }
+}",
+                @"
+class A
+{
+    public string Name { get; }
+
+    public bool IsFoo(A a)
+    {
+        return a is {
+            Name: ""foo"",
+        };
+    }
+}", changedOptionSet: changingOptions);
+        }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
         public async Task RecordClass()
         {
             await AssertFormatAsync(


Added tests for fix.

Added tests for fix.

--- src/Workspaces/CSharpTest/Formatting/FormattingTests.cs
+++ src/Workspaces/CSharpTest/Formatting/FormattingTests.cs
@@ -8022,5 +8022,12 @@
 }";
             await AssertFormatAsync(code, code);
         }
-    }
-}
+
+        [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
+        [WorkItem(25098, "https://github.com/dotnet/roslyn/issues/25098")]
+        public async Task FormatSingleStructDeclaration()
+        {
+            await Formatter.FormatAsync(SyntaxFactory.StructDeclaration("S"), DefaultWorkspace);
+        }
+}
+}


Accents now works.

Accents now works.

--- source/Cosmos.Build.Builder/BuildTasks/ProcessBuildTaskBase.cs
+++ source/Cosmos.Build.Builder/BuildTasks/ProcessBuildTaskBase.cs
@@ -34,8 +34,8 @@

             processStartInfo.RedirectStandardError = true;
             processStartInfo.RedirectStandardOutput = true;
-            processStartInfo.StandardErrorEncoding = Encoding.UTF8;
-            processStartInfo.StandardOutputEncoding = Encoding.UTF8;
+            processStartInfo.StandardErrorEncoding = Encoding.GetEncoding(858);
+            processStartInfo.StandardOutputEncoding = Encoding.GetEncoding(858);

             process.StartInfo = processStartInfo;
             process.Start();


Fix PropertyPatternClauses SingleLine test

--- src/Workspaces/CSharpTest/Formatting/FormattingTests.cs
+++ src/Workspaces/CSharpTest/Formatting/FormattingTests.cs
@@ -9929,39 +9929,25 @@
 }", changedOptionSet: changingOptions);
         }

-        [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
+        [Theory, CombinatorialData, Trait(Traits.Feature, Traits.Features.Formatting)]
         [WorkItem(52413, "https://github.com/dotnet/roslyn/issues/52413")]
-        public async Task NewLinesForBraces_PropertyPatternClauses_SingleLine()
+        public async Task NewLinesForBraces_PropertyPatternClauses_SingleLine(bool option)
         {
             var changingOptions = new OptionsCollection(LanguageNames.CSharp)
             {
-                { NewLinesForBracesInObjectCollectionArrayInitializers, false },
+                { NewLinesForBracesInObjectCollectionArrayInitializers, option },
             };
-            await AssertFormatAsync(
-                @"
+            var code = @"
 class A
 {
     public string Name { get; }

     public bool IsFoo(A a)
     {
-        return a is {
-            Name: ""foo"",
-        };
-    }
-}",
-                @"
-class A
-{
-    public string Name { get; }
-
-    public bool IsFoo(A a)
-    {
-        return a is {
-            Name: ""foo"",
-        };
-    }
-}", changedOptionSet: changingOptions);
+        return a is { Name: ""foo"" };
+    }
+}";
+            await AssertFormatAsync(code, code, changedOptionSet: changingOptions);
         }

         [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]


Update ShouldBeNullOrWhitespace.cs

Update ShouldBeNullOrWhitespace.cs

--- src/Shouldly.Tests/Strings/ShouldBeNullOrWhitespace.cs
+++ src/Shouldly.Tests/Strings/ShouldBeNullOrWhitespace.cs
@@ -3,25 +3,22 @@
 namespace Shouldly.Tests.Strings
 {
     public class ShouldBeNullOrWhiteSpace
-
     {
-
-    [Fact]
+        [Fact]
         public void StringWithOneLetterShouldFail()
         {
             Verify.ShouldFail(
-            () =>
-"a".ShouldBeNullOrWhiteSpace("Some additional context"),
+                () => "a".ShouldBeNullOrWhiteSpace("Some additional context"),

-errorWithSource:
-@"""a""
+                errorWithSource:
+                @"""a""
     should be null or white space

 Additional Info:
     Some additional context",

-errorWithoutSource:
-@"""a""
+                errorWithoutSource:
+                @"""a""
     should be null or white space

 Additional Info:
@@ -33,18 +30,17 @@
         {
             var oneLetter = "a";
             Verify.ShouldFail(
-            () =>
-oneLetter.ShouldBeNullOrWhiteSpace("Some additional context"),
+                () => oneLetter.ShouldBeNullOrWhiteSpace("Some additional context"),

-errorWithSource:
-@"oneLetter (""a"")
+                errorWithSource:
+                @"oneLetter (""a"")
     should be null or white space

 Additional Info:
     Some additional context",

-errorWithoutSource:
-@"""a""
+                errorWithoutSource:
+                @"""a""
     should be null or white space

 Additional Info:
@@ -54,7 +50,7 @@
         [Fact]
         public void NullShouldPass()
         {
-            ((string)null).ShouldBeNullOrWhiteSpace();
+            ((string) null).ShouldBeNullOrWhiteSpace();
         }

         [Fact]
@@ -69,4 +65,4 @@
             "   ".ShouldBeNullOrWhiteSpace();
         }
     }
-}
+}


Add: !grade! live token (#213)

Add: !grade! live token (#213)

--- plugins/OsuMemoryEventSource/MemoryDataProcessor.cs
+++ plugins/OsuMemoryEventSource/MemoryDataProcessor.cs
@@ -227,6 +227,8 @@
             CreateLiveToken("c100", _rawData.Play.C100, TokenType.Live, "{0}", (ushort)0, playingWatchingResults, () => _rawData.Play.C100);
             CreateLiveToken("c50", _rawData.Play.C50, TokenType.Live, "{0}", (ushort)0, playingWatchingResults, () => _rawData.Play.C50);
             CreateLiveToken("miss", _rawData.Play.CMiss, TokenType.Live, "{0}", (ushort)0, playingWatchingResults, () => _rawData.Play.CMiss);
+            CreateLiveToken("grade", OsuGrade.Null, TokenType.Live, "", OsuGrade.Null, playingWatchingResults,
+                () => CalculateGrade((string) Tokens.AllTokens["gameMode"].Value, Mods, _rawData.Play));
             CreateLiveToken("mapPosition", TimeSpan.Zero, TokenType.Live, "{0:mm\\:ss}", TimeSpan.Zero, OsuStatus.All, () =>
             {
                 if (_rawData.PlayTime != 0)
@@ -419,6 +421,87 @@
                 MapLocation = mapLocation
             };
         }
+
+        private static OsuGrade CalculateGrade(string mode, Mods mods, PlayContainer playContainer)
+        {
+            switch (mode)
+            {
+                case nameof(PlayMode.Osu):
+                case nameof(PlayMode.Taiko):
+                    return CalculateGradeOsuOrTaiko(mods, playContainer.C50, playContainer.C100, playContainer.C300, playContainer.CMiss);
+                case nameof(PlayMode.CatchTheBeat):
+                    return CalculateGradeCatch(mods, playContainer.Acc);
+                case nameof(PlayMode.OsuMania):
+                    return CalculateGradeMania(mods, playContainer.Acc);
+                default: return OsuGrade.Null;
+            }
+        }
+
+        private static OsuGrade CalculateGradeOsuOrTaiko(Mods mods, ushort c50, ushort c100, ushort c300, ushort cMiss)
+        {
+            var totalHits = c50 + c100 + c300 + cMiss;
+            // if 100% acc or if nothing has happened yet (osu assumes 100% acc then as well)
+            if (c300 == totalHits || totalHits == 0)
+            {
+                // 100% acc, with Hidden or FlashLight its a Silver SS, otherwise SS
+                return (mods & (Mods.Hd | Mods.Fl)) > 0 ? OsuGrade.SSH : OsuGrade.SS;
+            }
+
+            var ratio300 = (float)c300 / totalHits;
+            var ratio50 = (float)c50 / totalHits;
+
+            if (ratio300 > 0.9 && ratio50 <= 0.01 && cMiss == 0)
+            {
+                // with Hidden or FlashLight its a Silver S, otherwise S
+                return (mods & (Mods.Hd | Mods.Fl)) > 0 ? OsuGrade.SH : OsuGrade.S;
+            }
+
+            if ((ratio300 > 0.8 && cMiss == 0) || ratio300 > 0.9) return OsuGrade.A;
+            if ((ratio300 > 0.7 && cMiss == 0) || ratio300 > 0.8) return OsuGrade.B;
+            if (ratio300 > 0.6 && cMiss == 0) return OsuGrade.C;
+            return OsuGrade.D;
+        }
+
+        private static OsuGrade CalculateGradeCatch(Mods mods, double acc)
+        {
+            if (Math.Abs(acc - 100) < double.Epsilon)
+            {
+                // 100% acc, with Hidden or FlashLight its a Silver SS, otherwise SS
+                return (mods & (Mods.Hd | Mods.Fl)) > 0 ? OsuGrade.SSH : OsuGrade.SS;
+            }
+
+            if (acc > 98)
+            {
+                // with Hidden or FlashLight its a Silver S, otherwise S
+                return (mods & (Mods.Hd | Mods.Fl)) > 0 ? OsuGrade.SH : OsuGrade.S;
+            }
+
+            if (acc > 94) return OsuGrade.A;
+            if (acc > 90) return OsuGrade.B;
+            if (acc > 85) return OsuGrade.C;
+            return OsuGrade.D;
+        }
+
+        private static OsuGrade CalculateGradeMania(Mods mods, double acc)
+        {
+            if (Math.Abs(acc - 100) < double.Epsilon)
+            {
+                // 100% acc, with Hidden, FlashLight or FadeIn its a Silver SS, otherwise SS
+                return (mods & (Mods.Hd | Mods.Fl | Mods.Fi)) > 0 ? OsuGrade.SSH : OsuGrade.SS;
+            }
+
+            if (acc > 95)
+            {
+                // with Hidden, FlashLight or FadeIn its a Silver S, otherwise S
+                return (mods & (Mods.Hd | Mods.Fl | Mods.Fi)) > 0 ? OsuGrade.SH : OsuGrade.S;
+            }
+
+            if (acc > 90) return OsuGrade.A;
+            if (acc > 80) return OsuGrade.B;
+            if (acc > 70) return OsuGrade.C;
+            return OsuGrade.D;
+        }
+
         public void Dispose()
         {
             cancellationTokenSource.Cancel();


updated host version to 0.0.0.0

updated host version to 0.0.0.0

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


Enabled button sounds (#2)

Enabled button sounds (#2)

--- src/SkyModChirpyMaid/SkyModChirpyMaid/ChirpyMaidMod.cs
+++ src/SkyModChirpyMaid/SkyModChirpyMaid/ChirpyMaidMod.cs
@@ -63,6 +63,9 @@
             button.focusedTextColor = new Color32(255, 255, 255, 255);
             button.pressedTextColor = new Color32(30, 30, 44, 255);

+            // Enable sounds.
+            button.playAudioEvents = true;
+
             // Place the button.
             button.transformPosition = new Vector3(-1.65f, 0.97f);


Expanded comment.

Expanded comment.

--- src/SqlStreamStore.MsSql/MsSqlStreamStoreV3Settings.cs
+++ src/SqlStreamStore.MsSql/MsSqlStreamStoreV3Settings.cs
@@ -73,7 +73,7 @@
         /// <summary>
         ///     Disables stream and message deletion tracking. Will increase
         ///     performance, however subscribers won't know if a stream or a
-        ///     message has been deleted.
+        ///     message has been deleted. This can be modified at runtime.
         /// </summary>
         public bool DisableDeletionTracking { get; set; }
     }


Added Reverse Transfer

Added Reverse Transfer

--- src/Stripe/Services/Transfers/StripeTransferService.cs
+++ src/Stripe/Services/Transfers/StripeTransferService.cs
@@ -48,6 +48,16 @@
             return Mapper<StripeTransfer>.MapFromJson(response);
         }

+        public virtual StripeTransferReversal Reverse(string transferId)
+        {
+            var url = string.Format("{0}/{1}/reversals", Urls.Transfers, transferId);
+            url = this.ApplyAllParameters(null, url, false);
+
+            var response = Requestor.PostString(url, ApiKey);
+
+            return Mapper<StripeTransferReversal>.MapFromJson(response);
+        }
+
         public virtual IEnumerable<StripeTransfer> List(StripeTransferListOptions listOptions = null)
         {
             var url = Urls.Transfers;


Hide checkbox if no valid items in a configuration

--- src/Unicorn/ControlPanel/Controls/ConfigurationInfo.cs
+++ src/Unicorn/ControlPanel/Controls/ConfigurationInfo.cs
@@ -29,7 +29,7 @@
 				", configurationHasSerializedItems ? string.Empty:" colspan=\"2\"");

 			writer.Write(@"
-					" : ">", _configuration.Name));
+					" : ">", _configuration.Name));

 			if(!string.IsNullOrWhiteSpace(_configuration.Description))
 				writer.Write(@"


Fix for bug introduced with predicate components that would break if there were XML comments in a predicate configuration

--- src/Unicorn/Predicates/SerializationPresetPredicate.cs
+++ src/Unicorn/Predicates/SerializationPresetPredicate.cs
@@ -145,8 +145,9 @@
 			if (_predicatePresetHandler != null)
 			{
 				var predicatePresetElements = configuration.ChildNodes
+					.Cast<XmlNode>()
+					.Where(node => node.Name == "preset")
 					.Cast<XmlElement>()
-					.Where(node => node.Name == "preset")
 					.ToList();

 				foreach (var element in predicatePresetElements)


Displaying image from resource doesn't work

--- source/Playnite/ImageSourceManager.cs
+++ source/Playnite/ImageSourceManager.cs
@@ -8,6 +8,7 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows;
 using System.Windows.Media.Imaging;

 namespace Playnite
@@ -185,7 +186,57 @@
                         imagePath = source.Replace("resources:", "pack://application:,,,");
                     }

-                    var imageData = BitmapExtensions.BitmapFromFile(imagePath, loadProperties);
+                    var streamInfo = Application.GetResourceStream(new Uri(imagePath));
+                    using (var stream = streamInfo.Stream)
+                    {
+                        var imageData = BitmapExtensions.BitmapFromStream(stream, loadProperties);
+                        if (imageData != null)
+                        {
+                            if (cached)
+                            {
+                                Cache.TryAdd(source, imageData, imageData.GetSizeInMemory(),
+                                    new Dictionary<string, object>
+                                    {
+                                    { btmpPropsFld, loadProperties }
+                                    });
+                            }
+
+                            return imageData;
+                        }
+                    }
+                }
+                catch (Exception e) when (!PlayniteEnvironment.ThrowAllErrors)
+                {
+                    logger.Error(e, "Failed to create bitmap from resources " + source);
+                    return null;
+                }
+            }
+
+            if (StringExtensions.IsHttpUrl(source))
+            {
+                try
+                {
+                    var cachedFile = HttpFileCache.GetWebFile(source);
+                    if (string.IsNullOrEmpty(cachedFile))
+                    {
+                        logger.Warn("Web file not found: " + source);
+                        return null;
+                    }
+
+                    return BitmapExtensions.BitmapFromFile(cachedFile, loadProperties);
+                }
+                catch (Exception exc) when (!PlayniteEnvironment.ThrowAllErrors)
+                {
+                    logger.Error(exc, $"Failed to create bitmap from {source} file.");
+                    return null;
+                }
+            }
+
+            if (File.Exists(source))
+            {
+                try
+                {
+                    var imageData = BitmapExtensions.BitmapFromFile(source, loadProperties);
                     if (imageData != null)
                     {
                         if (cached)
@@ -202,37 +253,28 @@
                 }
                 catch (Exception e) when (!PlayniteEnvironment.ThrowAllErrors)
                 {
-                    logger.Error(e, "Failed to create bitmap from resources " + source);
-                    return null;
-                }
-            }
-
-            if (StringExtensions.IsHttpUrl(source))
-            {
-                try
-                {
-                    var cachedFile = HttpFileCache.GetWebFile(source);
-                    if (string.IsNullOrEmpty(cachedFile))
-                    {
-                        logger.Warn("Web file not found: " + source);
+                    logger.Error(e, "Failed to create bitmap from " + source);
+                    return null;
+                }
+            }
+
+            try
+            {
+                if (database == null)
+                {
+                    logger.Error("Cannot load database image, database not found.");
+                    return null;
+                }
+
+                try
+                {
+                    var imageData = database.GetFileAsImage(source, loadProperties);
+                    if (imageData == null)
+                    {
+                        logger.Warn("Image not found in database: " + source);
                         return null;
                     }
-
-                    return BitmapExtensions.BitmapFromFile(cachedFile, loadProperties);
-                }
-                catch (Exception exc) when (!PlayniteEnvironment.ThrowAllErrors)
-                {
-                    logger.Error(exc, $"Failed to create bitmap from {source} file.");
-                    return null;
-                }
-            }
-
-            if (File.Exists(source))
-            {
-                try
-                {
-                    var imageData = BitmapExtensions.BitmapFromFile(source, loadProperties);
-                    if (imageData != null)
+                    else
                     {
                         if (cached)
                         {
@@ -245,43 +287,6 @@

                         return imageData;
                     }
-                }
-                catch (Exception e) when (!PlayniteEnvironment.ThrowAllErrors)
-                {
-                    logger.Error(e, "Failed to create bitmap from " + source);
-                    return null;
-                }
-            }
-
-            try
-            {
-                if (database == null)
-                {
-                    logger.Error("Cannot load database image, database not found.");
-                    return null;
-                }
-
-                try
-                {
-                    var imageData = database.GetFileAsImage(source, loadProperties);
-                    if (imageData == null)
-                    {
-                        logger.Warn("Image not found in database: " + source);
-                        return null;
-                    }
-                    else
-                    {
-                        if (cached)
-                        {
-                            Cache.TryAdd(source, imageData, imageData.GetSizeInMemory(),
-                                new Dictionary<string, object>
-                                {
-                                    { btmpPropsFld, loadProperties }
-                                });
-                        }
-
-                        return imageData;
-                    }

                 }
                 catch (Exception exc) when (!PlayniteEnvironment.ThrowAllErrors)


finished refactoring persisted repository and tests for issues #25 and #21

--- test/JabbR-Core.Tests/Repositories/PersistedRepositoryTest.cs
+++ test/JabbR-Core.Tests/Repositories/PersistedRepositoryTest.cs
@@ -55,6 +55,22 @@
         };

+        // Test Client
+        ChatClient client1 = new ChatClient()
+        {
+            Id = "1",
+            LastActivity = DateTime.Now,
+            LastClientActivity = DateTime.Now,
+        };
+
+
+        // Test Settings
+        Settings settings1 = new Settings()
+        {
+            RawSettings = "These are my test settings."
+        };
+
+
         // Test Messages
         ChatMessage message1 = new ChatMessage()
         {
@@ -72,6 +88,37 @@
             HtmlEncoded = false
         };

+
+        // Test Notifications
+        Notification notification1 = new Notification()
+        {
+            Read = false
+        };
+
+        Notification notification2 = new Notification()
+        {
+            Read = false
+        };
+
+
+        // Test Identity
+        ChatUserIdentity identity1 = new ChatUserIdentity()
+        {
+            ProviderName = "Provider",
+            Identity = "Identity Name"
+        };
+
+
+        // Test UserRoomAllowed relationship objects
+        UserRoomAllowed isAllowedR1 = new UserRoomAllowed();
+
+        UserRoomAllowed isAllowedR2 = new UserRoomAllowed();
+
+
+        // Test UserRoomOwner relationship object
+        UserRoomOwner isOwnerR1 = new UserRoomOwner();
+
+
         public PersistedRepositoryTest()
         {
             IServiceCollection service = new ServiceCollection();
@@ -99,8 +146,11 @@
             // Make sure repository returns the correct information
             Assert.Equal(user1, _repository.Users.First());

-            // Clean up data
-            _repository.Remove(user1);
+            // Remove user
+            _repository.Remove(user1);
+
+            // Ensure users list is now empty
+            Assert.Empty(_repository.Users.ToList());

             Console.WriteLine("\tPersistedRepositoryTest.AddAndRemoveUser: Complete");
         }
@@ -119,8 +169,13 @@
             Assert.Equal(room1, _repository.Rooms.First());
             Assert.Equal(room1, _repository.GetRoomByName("Room 1"));

-            // Clean up data
-            _repository.Remove(room1);
+            // Remove the room
+            _repository.Remove(room1);
+
+            //Ensure the room was removed
+            Assert.Null(_repository.GetRoomByName("Room 1"));
+
+            // Clean up data
             _repository.Remove(user1);

             Console.WriteLine("\tPersistedRepositoryTest.AddAndRemoveRoom: Complete");
@@ -133,22 +188,20 @@
             _repository.Add(user1);

             // Create a new client
-            var userKey = _repository.Users.First().Key;
-            var clientExpected = new ChatClient()
-            {
-                Id = "1",
-                LastActivity = DateTime.Now,
-                LastClientActivity = DateTime.Now,
-                UserKey = userKey
-            };
-            _repository.Add(clientExpected);
+            client1.UserKey= _repository.Users.First().Key;
+            _repository.Add(client1);

             // Make sure repository returns the correct information
-            Assert.Equal(clientExpected, _repository.Clients.First());
-            Assert.Equal(clientExpected, _repository.GetClientById("1"));
-
-            // Clean up data
-            _repository.Remove(clientExpected);
+            Assert.Equal(client1, _repository.Clients.First());
+            Assert.Equal(client1, _repository.GetClientById("1"));
+
+            // Remove the client
+            _repository.Remove(client1);
+
+            //Ensure the client was removed
+            Assert.Null(_repository.GetClientById("1"));
+
+            // Clean up data
             _repository.Remove(user1);

             Console.WriteLine("\tPersistedRepositoryTest.AddAndRemoveClient: Complete");
@@ -157,29 +210,27 @@
         [Fact]
         public void AddAndRemoveSettings()
         {
-            // Create new settings
-            var settingsExpected = new Settings()
-            {
-                RawSettings = "These are my test settings."
-            };
-
             // Try to add the settings to the repository
-            _repository.Add(settingsExpected);
+            _repository.Add(settings1);

             // Make sure repository returns the correct information
-            Assert.Equal(settingsExpected, _repository.Settings.First());
-
-            // Clean up data
-            _repository.Remove(settingsExpected);
+            Assert.Equal(settings1, _repository.Settings.First());
+
+            // Remove settings from the repository
+            _repository.Remove(settings1);
+
+            // Ensure the settings were removed
+            Assert.Empty(_repository.Settings);

             Console.WriteLine("\tPersistedRepositoryTest.AddAndRemoveSettings: Complete");
         }

         [Fact]
-        public void AddAndRemoveUserFromRoom()
+        public void AddAndRemoveTwoUsersFromOneRoom()
         {
             // Add a user to the repository
             _repository.Add(user1);
+            _repository.Add(user2);

             // Set the creator key and add the chat room to the repository
             room1.Creator_Key = _repository.Users.First().Key;
@@ -187,25 +238,33 @@

             // Add relationship between user and room
             _repository.AddUserRoom(user1, room1);
-
-            // Verify the relationship was added properly
+            _repository.AddUserRoom(user2, room1);
+
+            // Verify the relationships were added properly
             Assert.True(user1.Rooms.Select(u => u.ChatRoomKeyNavigation).Contains(room1));
             Assert.True(room1.Users.Select(r => r.ChatUserKeyNavigation).Contains(user1));
             Assert.True(_repository.IsUserInRoom(user1, room1));

-            // Remove the relationship
+            Assert.True(user2.Rooms.Select(u => u.ChatRoomKeyNavigation).Contains(room1));
+            Assert.True(room1.Users.Select(r => r.ChatUserKeyNavigation).Contains(user2));
+            Assert.True(_repository.IsUserInRoom(user2, room1));
+
+            // Remove user2 from the room
+            _repository.RemoveUserRoom(user2, room1);
+
+            // Verify the relationship was removed and that user1 is still in the room
+            Assert.False(user2.Rooms.Select(u => u.ChatRoomKeyNavigation).Contains(room1));
+            Assert.False(room1.Users.Select(r => r.ChatUserKeyNavigation).Contains(user2));
+            Assert.False(_repository.IsUserInRoom(user2, room1));
+            Assert.True(_repository.IsUserInRoom(user1, room1));
+
+            // Clean up data
             _repository.RemoveUserRoom(user1, room1);
-
-            // Verify the relationship was removed
-            Assert.False(user1.Rooms.Select(u => u.ChatRoomKeyNavigation).Contains(room1));
-            Assert.False(room1.Users.Select(r => r.ChatUserKeyNavigation).Contains(user1));
-            Assert.False(_repository.IsUserInRoom(user1, room1));
-
-            // Clean up data
-            _repository.Remove(room1);
-            _repository.Remove(user1);
-
-            Console.WriteLine("\tPersistedRepositoryTest.AddAndRemoveUserFromRoom: Complete");
+            _repository.Remove(room1);
+            _repository.Remove(user1);
+            _repository.Remove(user2);
+
+            Console.WriteLine("\tPersistedRepositoryTest.AddAndRemoveTwoUsersFromOneRoom: Complete");
         }

         [Fact]
@@ -309,8 +368,9 @@
             _repository.GetRoomByName("Room 1").ChatMessages.Add(message1);
             _repository.CommitChanges();

-            // Verify previous messages are returned properly
+            // Verify previous messages and all messages are returned properly
             Assert.Equal(new List<ChatMessage>() { message1 }, _repository.GetPreviousMessages("2"));
+            Assert.Equal(new List<ChatMessage>() { message1, message2 }, _repository.GetMessagesByRoom(room1));

             // Clean up data
             _repository.Remove(message1);
@@ -327,6 +387,7 @@
         {
             // Add a user to the repository
             _repository.Add(user1);
+            _repository.Add(user2);

             // Set up a new chat room and add it to the repository
             room1.Creator_Key = _repository.Users.First().Key;
@@ -334,38 +395,57 @@

             // Add relationship between user and room
             _repository.AddUserRoom(user1, room1);
-
-            // Set up the message and add it to the repository
+            _repository.AddUserRoom(user2, room1);
+
+            // Set up the message for user1 and add it to the repository
             message1.RoomKey = room1.Key;
             message1.RoomKeyNavigation = room1;
             message1.UserKey = user1.Key;
             message1.UserKeyNavigation = user1;
             _repository.Add(message1);

-            // Add message to user and room's lists
+            // Add message1 to user1 and room1's lists
             _repository.GetUserByName("User 1").ChatMessages.Add(message1);
             _repository.GetRoomByName("Room 1").ChatMessages.Add(message1);
             _repository.CommitChanges();

-            // Create a new notification and add it to the repository
-            var notification = new Notification()
-            {
-                MessageKey = message1.Key,
-                RoomKey = room1.Key,
-                UserKey = user1.Key,
-                Read = false
-            };
-            _repository.Add(notification);
-
-            // Verify notification was added properly
-            Assert.Equal(new List<Notification>() { notification }, _repository.GetNotificationsByUser(user1).ToList());
-
-            // Clean up data
-            _repository.Remove(notification);
+            // Set up the message for user2 and add it to the repository
+            message2.RoomKey = room1.Key;
+            message2.RoomKeyNavigation = room1;
+            message2.UserKey = user2.Key;
+            message2.UserKeyNavigation = user2;
+            _repository.Add(message2);
+
+            // Add message2 to user2 and room2's lists
+            _repository.GetUserByName("User 2").ChatMessages.Add(message2);
+            _repository.GetRoomByName("Room 1").ChatMessages.Add(message2);
+            _repository.CommitChanges();
+
+            // Set up a new notification for user1 and add it to the repository
+            notification1.MessageKey = message1.Key;
+            notification1.RoomKey = room1.Key;
+            notification1.UserKey = user1.Key;
+            _repository.Add(notification1);
+
+            // Set up a new notification for user2 and add it to the repository
+            notification2.MessageKey = message2.Key;
+            notification2.RoomKey = room1.Key;
+            notification2.UserKey = user2.Key;
+            _repository.Add(notification2);
+
+            // Verify notifications were added properly
+            Assert.Equal(new List<Notification>() { notification1 }, _repository.GetNotificationsByUser(user1).ToList());
+            Assert.Equal(new List<Notification>() { notification2 }, _repository.GetNotificationsByUser(user2).ToList());
+
+            // Clean up data
+            _repository.Remove(notification1);
             _repository.Remove(message1);
+            _repository.Remove(message2);
             _repository.RemoveUserRoom(user1, room1);
-            _repository.Remove(room1);
-            _repository.Remove(user1);
+            _repository.RemoveUserRoom(user2, room1);
+            _repository.Remove(room1);
+            _repository.Remove(user1);
+            _repository.Remove(user2);

             Console.WriteLine("\tPersistedRepositoryTest.GetNotificationByUser: Complete");
         }
@@ -377,22 +457,17 @@
             user1.Identity = "Identity Name";
             _repository.Add(user1);

-            // Create a ChatUserIdentity and add it to the repository
-            var identity = new ChatUserIdentity()
-            {
-                UserKey = user1.Key,
-                UserKeyNavigation = user1,
-                ProviderName = "Provider",
-                Identity = "Identity Name"
-            };
-            _repository.Add(identity);
+            // Setup a ChatUserIdentity and add it to the repository
+            identity1.UserKey = user1.Key;
+            identity1.UserKeyNavigation = user1;
+            _repository.Add(identity1);

             // Verify identity was added properly
             Assert.Equal(user1, _repository.GetUserByIdentity("Provider", "Identity Name"));
             Assert.Equal(user1, _repository.GetUserByLegacyIdentity("Identity Name"));

             // Clean up data
-            _repository.Remove(identity);
+            _repository.Remove(identity1);
             _repository.Remove(user1);

             Console.WriteLine("\tPersistedRepositoryTest.GetUserByIdentity: Complete");
@@ -415,23 +490,18 @@
             room2.Creator_Key = u1Key;
             room2.Private = true;
             _repository.Add(room2);
-
-            // Create the UserRoomAllowed objects that will represent rooms user1 is allowed in
-            var isAllowedR1 = new UserRoomAllowed()
-            {
-                ChatRoomKey = _repository.GetRoomByName("Room 1").Key,
-                ChatUserKey = u1Key,
-                ChatRoomKeyNavigation = room1,
-                ChatUserKeyNavigation = user1
-            };
-            var isAllowedR2 = new UserRoomAllowed()
-            {
-                ChatRoomKey = _repository.GetRoomByName("Room 2").Key,
-                ChatUserKey = u2Key,
-                ChatRoomKeyNavigation = room2,
-                ChatUserKeyNavigation = user1
-            };
-
+
+            // Set up the UserRoomAllowed objects that will represent rooms user1 is allowed in
+            isAllowedR1.ChatRoomKey = _repository.GetRoomByName("Room 1").Key;
+            isAllowedR1.ChatUserKey = u1Key;
+            isAllowedR1.ChatRoomKeyNavigation = room1;
+            isAllowedR1.ChatUserKeyNavigation = user1;
+
+            isAllowedR2.ChatRoomKey = _repository.GetRoomByName("Room 2").Key;
+            isAllowedR2.ChatUserKey = u2Key;
+            isAllowedR2.ChatRoomKeyNavigation = room2;
+            isAllowedR2.ChatUserKeyNavigation = user2;
+
             // Add the relationships to the rooms' allowed users lists and the user's allowed rooms list
             _repository.GetRoomByName("Room 1").AllowedUsers.Add(isAllowedR1);
             _repository.GetRoomByName("Room 2").AllowedUsers.Add(isAllowedR2);
@@ -477,20 +547,15 @@
             _repository.Add(room2);

             // Create the UserRoomAllowed objects that will represent rooms user1 is allowed in
-            var isAllowedR1 = new UserRoomAllowed()
-            {
-                ChatRoomKey = _repository.GetRoomByName("Room 1").Key,
-                ChatUserKey = u1Key,
-                ChatRoomKeyNavigation = room1,
-                ChatUserKeyNavigation = user1
-            };
-            var isAllowedR2 = new UserRoomAllowed()
-            {
-                ChatRoomKey = _repository.GetRoomByName("Room 2").Key,
-                ChatUserKey = u1Key,
-                ChatRoomKeyNavigation = room2,
-                ChatUserKeyNavigation = user1
-            };
+            isAllowedR1.ChatRoomKey = _repository.GetRoomByName("Room 1").Key;
+            isAllowedR1.ChatUserKey = u1Key;
+            isAllowedR1.ChatRoomKeyNavigation = room1;
+            isAllowedR1.ChatUserKeyNavigation = user1;
+
+            isAllowedR2.ChatRoomKey = _repository.GetRoomByName("Room 2").Key;
+            isAllowedR2.ChatUserKey = u1Key;
+            isAllowedR2.ChatRoomKeyNavigation = room2;
+            isAllowedR2.ChatUserKeyNavigation = user1;

             // Add the relationships to the rooms' allowed users lists and the user's allowed rooms list
             _repository.GetRoomByName("Room 1").AllowedUsers.Add(isAllowedR1);
@@ -531,13 +596,10 @@
             _repository.Add(room1);

             // Create the UserRoomOwner object that will represent user1 being an owner
-            var isOwnerR1 = new UserRoomOwner()
-            {
-                ChatRoomKey = _repository.GetRoomByName("Room 1").Key,
-                ChatUserKey = u1Key,
-                ChatRoomKeyNavigation = room1,
-                ChatUserKeyNavigation = user1
-            };
+            isOwnerR1.ChatRoomKey = _repository.GetRoomByName("Room 1").Key;
+            isOwnerR1.ChatUserKey = u1Key;
+            isOwnerR1.ChatRoomKeyNavigation = room1;
+            isOwnerR1.ChatUserKeyNavigation = user1;

             // Add the relationships to the rooms' allowed users lists and the user's allowed rooms list
             _repository.GetRoomByName("Room 1").Owners.Add(isOwnerR1);


Add xml content negotation

Add xml content negotation

--- api/Startup.cs
+++ api/Startup.cs
@@ -25,7 +25,9 @@
         // This method gets called by the runtime. Use this method to add services to the container.
         public void ConfigureServices(IServiceCollection services)
         {
-            services.AddMvc();
+            services.AddMvc()
+                .AddXmlSerializerFormatters();
+
             services.AddSwaggerGen(c =>
             {
                 c.SwaggerDoc("v1", new Info { Title = "Generate Random Data API", Version = "v1" });
@@ -43,9 +45,9 @@
                 c.SwaggerEndpoint("/swagger/v1/swagger.json", "Generate Random Data API V1");
             });

-            var options = new RewriteOptions()
+            var redirectRootToSwagger = new RewriteOptions()
                 .AddRedirect("^$", "swagger");
-            app.UseRewriter(options);
+            app.UseRewriter(redirectRootToSwagger);
         }
     }
 }


Ignore test on TeamCity, which depends on App.config, which does not get copied into test container

--- src/biz.dfch.CS.Commons.Tests/Diagnostics/LoggerTest.cs
+++ src/biz.dfch.CS.Commons.Tests/Diagnostics/LoggerTest.cs
@@ -289,6 +289,7 @@
         }

         [TestMethod]
+        [TestCategory("SkipOnTeamCity")]
         [ExpectContractFailure(MessagePattern = "Assertion.+writeMethodIsImplemented.+arbitrary-message")]
         public void SystemDiagnosticsDebugLogsToTraceListenerFromAppConfig()
         {


Run tests with 9.1 SDK.

Run tests with 9.1 SDK.

--- src/AgentMulder.ReSharper.Tests/TestEnvironmentAssembly.9.0.cs
+++ src/AgentMulder.ReSharper.Tests/TestEnvironmentAssembly.9.0.cs
@@ -1,7 +1,19 @@
-using JetBrains.Application.BuildScript.Application.Zones;
+using System;
+using System.Collections.Generic;
+using JetBrains.Application;
+using JetBrains.Application.BuildScript.Application;
+using JetBrains.Application.BuildScript.Application.Zones;
+using JetBrains.Application.BuildScript.PackageSpecification;
+using JetBrains.Application.BuildScript.Solution;
+using JetBrains.Application.Environment;
+using JetBrains.Application.Environment.HostParameters;
+using JetBrains.Metadata.Reader.API;
+using JetBrains.Metadata.Utils;
 using JetBrains.ReSharper.TestFramework;
 using JetBrains.TestFramework;
 using JetBrains.TestFramework.Application.Zones;
+using JetBrains.TestFramework.Utils;
+using JetBrains.Util;
 using NUnit.Framework;

 [assembly: TestDataPathBase(@"Test\Data")]
@@ -14,4 +26,57 @@
 [SetUpFixture]
 public class ReSharperTestEnvironmentAssembly : ExtensionTestEnvironmentAssembly<TestEnvironmentZone>
 {
+    protected override JetHostItems.Packages CreateJetHostPackages(JetHostItems.Engine engine)
+    {
+      var mainAssembly = GetType().Assembly;
+      var productBinariesDir = mainAssembly.GetPath().Parent;
+
+      // Home dir
+      if (AllAssembliesLocator.TryGetProductHomeDirOnSources(productBinariesDir).IsNullOrEmpty())
+      {
+        var relativeTestDataPath = TestUtil.GetTestDataPathBase_Find_FromAttr(mainAssembly) ?? TestUtil.DefaultTestDataPath;
+        var productHomeDir = FileSystemUtil.GetDirectoryNameOfItemAbove(productBinariesDir, relativeTestDataPath);
+        Environment.SetEnvironmentVariable(AllAssembliesLocator.ProductHomeDirEnvironmentVariableName, productHomeDir.FullPath);
+      }
+
+      return engine.OnPackagesInFlatFolderDependentOnAssembly(mainAssembly,
+        packages =>
+        {
+          var packageFiles = new HashSet<ApplicationPackageFile>(new JetBrains.EqualityComparer<ApplicationPackageFile>(
+            (file1, file2) => file1.LocalInstallPath == file2.LocalInstallPath, file => file.LocalInstallPath.GetHashCode()));
+          var packageReferences = new HashSet<ApplicationPackageReference>(new JetBrains.EqualityComparer<ApplicationPackageReference>(
+            (reference1, reference2) => string.Equals(reference1.PackageId, reference2.PackageId, StringComparison.OrdinalIgnoreCase),
+            reference => reference.PackageId.GetHashCode()));
+          var assemblyNameInfo = AssemblyNameInfo.Parse(mainAssembly.FullName);
+          using (var loader = new MetadataLoader(productBinariesDir))
+          {
+            ProcessAssembly(packages, productBinariesDir, loader, assemblyNameInfo, packageFiles, packageReferences);
+          }
+          var packageArtifact = new ApplicationPackageArtifact(new SubplatformName(assemblyNameInfo.Name), new JetSemanticVersion(assemblyNameInfo.Version),  CompanyInfo.Name, CompanyInfo.NameWithInc, DateTime.UtcNow, null, null, packageFiles, new JetPackageMetadata(), packageReferences, Guid.Empty);
+          return new AllAssembliesOnPackages(packages.Subplatforms.Concat(new SubplatformOnPackage(packageArtifact)).AsCollection());
+        });
+    }
+
+    private static void ProcessAssembly(AllAssemblies allAssemblies, FileSystemPath productBinariesDir, MetadataLoader metadataLoader, AssemblyNameInfo assemblyNameInfo, HashSet<ApplicationPackageFile> packageFiles, HashSet<ApplicationPackageReference> packageReferences)
+    {
+      var assembly = metadataLoader.TryLoad(assemblyNameInfo, JetFunc<AssemblyNameInfo>.False, false);
+      if (assembly == null) return;
+
+      var subplatformOfAssembly = allAssemblies.FindSubplatformOfAssembly(assemblyNameInfo, OnError.Ignore);
+
+      if (subplatformOfAssembly != null)
+      {
+        var subplatformReference = new ApplicationPackageReference(subplatformOfAssembly.Name, subplatformOfAssembly.GetCompanyNameHuman());
+        packageReferences.Add(subplatformReference);
+        return;
+      }
+
+      if (!packageFiles.Add(new ApplicationPackageFile(assembly.Location.MakeRelativeTo(productBinariesDir), assemblyNameInfo)))
+        return;
+
+      foreach (var referencedAssembly in assembly.ReferencedAssembliesNames)
+      {
+        ProcessAssembly(allAssemblies, productBinariesDir, metadataLoader, referencedAssembly, packageFiles, packageReferences);
+      }
+    }
 }


[4.9] BL-9512 Fix Publish to web links (#4280)

* BL-9512 Fix Publish to web links

* Link to book after published
* Link to Terms of Use

--- src/BloomExe/Publish/BloomLibrary/BloomLibraryUploadControl.cs
+++ src/BloomExe/Publish/BloomLibrary/BloomLibraryUploadControl.cs
@@ -320,7 +320,7 @@

 		private void _termsLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 		{
-			SIL.Program.Process.SafeStart(BloomLibraryUrlPrefix + "/terms");
+			SIL.Program.Process.SafeStart(BloomLibraryUrlPrefix + "/page/termsOfUse");
 		}

 		private void SetStateOfNonUploadControls(bool enable)
@@ -457,7 +457,7 @@
 					}
 					else
 					{
-						var url = BloomLibraryUrlPrefix + "/browse/detail/" + _parseId;
+						var url = BloomLibraryUrlPrefix + "/my-books/book/" + _parseId;
 						string congratsMessage = LocalizationManager.GetString("PublishTab.Upload.UploadCompleteNotice",
 							"Congratulations, \"{0}\" is now available on BloomLibrary.org ({1})",
 							"{0} is the book title; {1} is a clickable url which will display the book on the website");
@@ -493,7 +493,7 @@

 		public static string BloomLibraryUrlPrefix
 		{
-			get { return UrlLookup.LookupUrl(UrlType.LibrarySite, BookTransfer.UseSandbox) + "/#"; }
+			get { return UrlLookup.LookupUrl(UrlType.LibrarySite, BookTransfer.UseSandbox); }
 		}

 		string _parseId;


AdventureSample - use multiple returns in Quit method

--- projects/AdventureSample/src/Adventure/adventure.cs
+++ projects/AdventureSample/src/Adventure/adventure.cs
@@ -1106,15 +1106,14 @@

     private int Quit()
     {
-        int ret = 0;
         PRINT_n(("") + ("ARE YOU SURE YOU WANT TO QUIT (Y/N)"));
         quit = (INPUT_s(""));
         if ((((quit.CompareTo("N")) == (0)) ? (-1) : (0)) == (0))
         {
-            ret = PlayAgain();
-        }
-
-        return ret;
+            return PlayAgain();
+        }
+
+        return 0;
     }

     private int PlayAgain()


Adds AssertIntervalCollectionIsSorted to GetEnumerator test of IntervalsStaticPerformanceTests

--- src/C5.Intervals.Benchmarks/IntervalsStaticPerformanceTests.cs
+++ src/C5.Intervals.Benchmarks/IntervalsStaticPerformanceTests.cs
@@ -1,4 +1,7 @@
-namespace C5.Intervals.Benchmarks
+using System.Collections;
+using System.Collections.Generic;
+
+namespace C5.Intervals.Benchmarks
 {
     using System;

@@ -58,13 +61,19 @@
         [Test, TestCaseSource(typeof(TestFactory), "TestCases")]
         public void GetEnumerator(TestConfiguration config)
         {
+            AssertIntervalCollectionIsSorted(config.IntervalCollection);
             var action = new Action(() => config.IntervalCollection.Enumerate());

             var testName = string.Format("{0}_{1}", "GetEnumerator", config.DataSetName);

             action.Benchmark(config.Reference, testName, config.NumberOfIntervals);
+        }

-            // TODO: Need to assert  the collection that comes back from the enumerator is sorted.
+        private void AssertIntervalCollectionIsSorted(IIntervalCollection<IInterval<int>, int> intervalCollection)
+        {
+            IComparer<IInterval<int>> comparer = ComparerFactory<IInterval<int>>
+                .CreateComparer((x, y) => x.CompareLow(y) != 0 ? x.CompareLow(y) : x.CompareHigh(y));
+            Assert.True(intervalCollection.IsSorted(comparer));
         }
     }
 }


Fixed issues when running tests in parallel.

--- src/Cedar.EventStore.MsSql2008.Tests/MsSqlEventStoreFixture.cs
+++ src/Cedar.EventStore.MsSql2008.Tests/MsSqlEventStoreFixture.cs
@@ -23,7 +23,7 @@
             _localDbInstance = localDbProvider.GetOrCreateInstance("CedarEventStoreTests");
             _localDbInstance.Start();

-            var uniqueName = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString().PadLeft(20, '0');
+            var uniqueName = Guid.NewGuid().ToString().Replace("-", string.Empty);
             _databaseName = $"CedarEventStoreTests_{uniqueName}";

             ConnectionString = CreateConnectionString();


WIP Failing test

WIP Failing test

--- tests/Exceptionless.Tests/Controllers/EventControllerTests.cs
+++ tests/Exceptionless.Tests/Controllers/EventControllerTests.cs
@@ -29,6 +29,7 @@
 using Run = Exceptionless.Tests.Utility.Run;
 using Foundatio.Utility;
 using Exceptionless.DateTimeExtensions;
+using Foundatio.Repositories.Models;

 namespace Exceptionless.Tests.Controllers {
     public class EventControllerTests : IntegrationTestsBase {
@@ -384,6 +385,66 @@
             Assert.Equal(expected, results.Count);
         }

+        [InlineData(null)]
+        [InlineData("status:open OR status:regressed")]
+        [InlineData("(status:open OR status:regressed)")]
+        [Theory]
+        public async Task WillExcludeDeletedStacks(string filter) {
+            var utcNow = SystemClock.UtcNow;
+
+            var stack1 = AddTestEvent()
+                .TestProject()
+                .Type(Event.KnownTypes.Log)
+                .Status(StackStatus.Open)
+                .Deleted()
+                .TotalOccurrences(50)
+                .FirstOccurrence(utcNow.SubtractDays(1));
+
+            var stack2 = AddTestEvent()
+                .TestProject()
+                .Type(Event.KnownTypes.Error)
+                .Status(StackStatus.Regressed)
+                .TotalOccurrences(10)
+                .FirstOccurrence(utcNow.SubtractDays(2))
+                .StackReference("https://github.com/exceptionless/Exceptionless")
+                .Version("3.2.1-beta1");
+
+            await SaveTestDataAsync();
+
+            Log.MinimumLevel = LogLevel.Trace;
+            var results = await SendRequestAsAsync<List<StackSummaryModel>>(r => r
+                .AsGlobalAdminUser()
+                .AppendPath("events")
+                .QueryStringIf(() => !String.IsNullOrEmpty(filter), "filter", filter)
+                .QueryString("mode", "stack_new")
+                .StatusCodeShouldBeOk()
+            );
+
+            Assert.Single(results);
+
+            var countResult = await SendRequestAsAsync<CountResult>(r => r
+                .AsGlobalAdminUser()
+                .AppendPath("events", "count")
+                .QueryStringIf(() => !String.IsNullOrEmpty(filter), "filter", filter)
+                .QueryString("aggregations", "date:(date cardinality:stack sum:count~1) cardinality:stack terms:(first @include:true) sum:count~1")
+                .StatusCodeShouldBeOk()
+            );
+
+            var dateAgg = countResult.Aggregations.DateHistogram("date_date");
+            double dateAggStackCount =  dateAgg.Buckets.Sum(t => t.Aggregations.Cardinality("cardinality_stack").Value.GetValueOrDefault());
+            double dateAggEventCount =  dateAgg.Buckets.Sum(t => t.Aggregations.Cardinality("sum_count").Value.GetValueOrDefault());
+            Assert.Equal(1, dateAggStackCount);
+            Assert.Equal(1, dateAggEventCount);
+
+            var total = countResult.Aggregations.Sum("sum_count")?.Value;
+            double newTotal = countResult.Aggregations.Terms<double>("terms_first")?.Buckets.FirstOrDefault()?.Total ?? 0;
+            double uniqueTotal = countResult.Aggregations.Cardinality("cardinality_stack")?.Value ?? 0;
+
+            Assert.Equal(1, total);
+            Assert.Equal(1, newTotal);
+            Assert.Equal(1, uniqueTotal);
+        }
+
         private async Task CreateStacksAndEventsAsync() {
             var utcNow = SystemClock.UtcNow;


Removed IAdoEntityInfo.CacheTimeout property. It already was on base interface type.

--- src/DataAccess/Dccelerator.DataAccess.AdoNet/IAdoEntityInfo.cs
+++ src/DataAccess/Dccelerator.DataAccess.AdoNet/IAdoEntityInfo.cs
@@ -19,7 +19,6 @@

         IAdoNetRepository Repository { get; }

-        TimeSpan CacheTimeout { get; }
         string[] ReaderColumns { get; }

         int IndexOf(string columnName);


Added missing documentation

Added missing documentation

--- src/FubarCoder.RestSharp.Portable.Core/RestClientExtensions.cs
+++ src/FubarCoder.RestSharp.Portable.Core/RestClientExtensions.cs
@@ -237,6 +237,12 @@
             return client;
         }

+        /// <summary>
+        /// Merge parameters from client and request
+        /// </summary>
+        /// <param name="client">The REST client that will execute the request</param>
+        /// <param name="request">The REST request</param>
+        /// <returns>A <see cref="RequestParameters"/> object that contains the merged parameters</returns>
         public static RequestParameters MergeParameters(this IRestClient client, IRestRequest request)
         {
             return new RequestParameters(client, request);


Remove duplicate headCloneUrl variable

Remove duplicate headCloneUrl variable

--- src/GitHub.InlineReviews/Services/PullRequestSessionService.cs
+++ src/GitHub.InlineReviews/Services/PullRequestSessionService.cs
@@ -115,7 +115,7 @@
             var key = new Tuple<string, string>(baseSha, headSha);

             string mergeBase;
-            if(mergeBaseCache.TryGetValue(key, out mergeBase))
+            if (mergeBaseCache.TryGetValue(key, out mergeBase))
             {
                 return mergeBase;
             }
@@ -123,7 +123,6 @@
             var repo = await GetRepository(repository);
             var baseUrl = pullRequest.Base.RepositoryCloneUrl;
             var headUrl = pullRequest.Head.RepositoryCloneUrl;
-            var headCloneUrl = pullRequest.Head.RepositoryCloneUrl;
             var baseRef = pullRequest.Base.Ref;
             var headRef = pullRequest.Head.Ref;
             mergeBase = await gitClient.GetPullRequestMergeBase(repo, baseUrl, headUrl, baseSha, headSha, baseRef, headRef);


Simplified IConventionsBuilder.ForInstance, now returns void as it does not make any sense to further configure.

--- src/Kephas.Core/Composition/Conventions/IConventionsBuilder.cs
+++ src/Kephas.Core/Composition/Conventions/IConventionsBuilder.cs
@@ -45,8 +45,7 @@
         /// </summary>
         /// <param name="type">The registered service type.</param>
         /// <param name="instance">The instance.</param>
-        /// <returns>A <see cref="IPartBuilder"/> to further configure the rule.</returns>
-        IPartBuilder ForInstance(Type type, object instance);
+        void ForInstance(Type type, object instance);

         /// <summary>
         /// Defines a registration for the specified type and its instance factory.


Fix message.

Fix message.

--- src/MsgPack.Rpc.Client/Rpc/Client/Protocols/ClientTransport.cs
+++ src/MsgPack.Rpc.Client/Rpc/Client/Protocols/ClientTransport.cs
@@ -292,7 +292,7 @@
 			this.OnSocketOperationCompleted( sender, e );
 		}

-		private bool HandleSocketError( Socket socket, MessageContext context )
+		internal bool HandleSocketError( Socket socket, MessageContext context )
 		{
 			var rpcError = this.Manager.HandleSocketError( socket, context );
 			if ( rpcError != null )
@@ -314,7 +314,6 @@
 			var rpcError = new RpcErrorMessage( RpcError.RemoteRuntimeError, "Invalid stream.", message );
 			this.RaiseError( context.MessageId, context.SessionId, rpcError, context.CompletedSynchronously );
 			// TODO: configurable
-			// context.Clear();
 			context.NextProcess = this.DumpCorrupttedData;
 		}

@@ -392,6 +391,11 @@

 		private void DumpRequestData( DateTimeOffset sessionStartedAt, EndPoint destination, long sessionId, MessageType type, int? messageId, IList<ArraySegment<byte>> requestData )
 		{
+			if ( !this.Manager.Configuration.DumpCorruptResponse )
+			{
+				return;
+			}
+
 			using ( var stream = OpenDumpStream( sessionStartedAt, destination, sessionId, type, messageId ) )
 			{
 				foreach ( var segment in requestData )
@@ -406,17 +410,26 @@
 		private static Stream OpenDumpStream( DateTimeOffset sessionStartedAt, EndPoint destination, long sessionId, MessageType type, int? messageId )
 		{
 			// TODO: configurable
+			var filePath =
+				Path.Combine(
+					Environment.GetFolderPath( Environment.SpecialFolder.LocalApplicationData ),
+					"MsgPack",
+					"v" + typeof( ClientTransport ).Assembly.GetName().Version,
+					"Client",
+					"Dump",
+					String.Format( CultureInfo.InvariantCulture, "{0:yyyy-MM-dd_HH-mm-ss}-{1}-{2}-{3}{4}.dat", sessionStartedAt, destination == null ? String.Empty : FileSystem.EscapeInvalidPathChars( destination.ToString(), "_" ), sessionId, type, messageId == null ? String.Empty : "-" + messageId )
+				);
+
+			var directoryPath = Path.GetDirectoryName( filePath );
+			if ( !Directory.Exists( directoryPath ) )
+			{
+				Directory.CreateDirectory( directoryPath );
+			}
+
 #if !SILVERLIGHT
 			return
 				new FileStream(
-					Path.Combine(
-						Environment.GetFolderPath( Environment.SpecialFolder.LocalApplicationData ),
-						"MsgPack",
-						"v" + typeof( ClientTransport ).Assembly.GetName().Version,
-						"Client",
-						"Dump",
-						String.Format( CultureInfo.InvariantCulture, "{0:o}-{1}-{2}-{3}{4}.dat", sessionStartedAt, FileSystem.EscapeInvalidPathChars( destination.ToString(), "_" ), sessionId, type, messageId == null ? String.Empty : "-" + messageId )
-					),
+					filePath,
 					FileMode.Append,
 					FileAccess.Write,
 					FileShare.Read,
@@ -685,7 +698,7 @@
 			{
 				MsgPackRpcClientProtocolsTrace.TraceEvent(
 					MsgPackRpcClientProtocolsTrace.ReceiveInboundData,
-					"Receive request. {{ \"SessionID\" : {0}, \"Socket\" : 0x{1:X}, \"RemoteEndPoint\" : \"{2}\", \"LocalEndPoint\" : \"{3}\", \"BytesTransfered\" : {4} }}",
+					"Receive response. {{ \"SessionID\" : {0}, \"Socket\" : 0x{1:X}, \"RemoteEndPoint\" : \"{2}\", \"LocalEndPoint\" : \"{3}\", \"BytesTransfered\" : {4} }}",
 					context.SessionId,
 					this._boundSocket == null ? IntPtr.Zero : this._boundSocket.Handle,
 					this._boundSocket == null ? null : this._boundSocket.RemoteEndPoint,


Exclude EmptyQueryCompiler from code coverage

--- src/NeinLinq.EntityFrameworkCore/RewriteEntityQueryProvider.cs
+++ src/NeinLinq.EntityFrameworkCore/RewriteEntityQueryProvider.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
 using System.Linq;
 using System.Linq.Expressions;
 using System.Threading;
@@ -118,33 +119,40 @@
             return Task.FromResult(Provider.Execute<TResult>(Rewrite(expression)));
         }

+        [ExcludeFromCodeCoverage]
         private class EmptyQueryCompiler : IQueryCompiler
         {
+            [ExcludeFromCodeCoverage]
             public Func<QueryContext, IAsyncEnumerable<TResult>> CreateCompiledAsyncEnumerableQuery<TResult>(Expression query)
             {
                 throw new NotSupportedException();
             }

+            [ExcludeFromCodeCoverage]
             public Func<QueryContext, Task<TResult>> CreateCompiledAsyncTaskQuery<TResult>(Expression query)
             {
                 throw new NotSupportedException();
             }

+            [ExcludeFromCodeCoverage]
             public Func<QueryContext, TResult> CreateCompiledQuery<TResult>(Expression query)
             {
                 throw new NotSupportedException();
             }

+            [ExcludeFromCodeCoverage]
             public TResult Execute<TResult>(Expression query)
             {
                 throw new NotSupportedException();
             }

+            [ExcludeFromCodeCoverage]
             public IAsyncEnumerable<TResult> ExecuteAsync<TResult>(Expression query)
             {
                 throw new NotSupportedException();
             }

+            [ExcludeFromCodeCoverage]
             public Task<TResult> ExecuteAsync<TResult>(Expression query, CancellationToken cancellationToken)
             {
                 throw new NotSupportedException();


Removing Parts_Container_Contained_Summary from ContainerPartDriver

--HG--
branch : 1.x
extra : rebase_source : 2e605b0ebae4cc33cd0fad6f310a096757186390

--- src/Orchard.Web/Core/Containers/Drivers/ContainerPartDriver.cs
+++ src/Orchard.Web/Core/Containers/Drivers/ContainerPartDriver.cs
@@ -80,8 +80,6 @@
                                         Pager: pagerShape
                                     );
                              }),
-                ContentShape("Parts_Container_Contained_Summary",
-                             () => shapeHelper.Parts_Container_Contained_Summary(ContentPart: part)),
                 ContentShape("Parts_Container_Contained_SummaryAdmin",
                              () => shapeHelper.Parts_Container_Contained_SummaryAdmin(ContentPart: part))
                 );


CanConvert should have a context.

CanConvert should have a context.

Bit of a tidy up also.

--- src/Our.Umbraco.Ditto/Extensions/PublishedContentExtensions.cs
+++ src/Our.Umbraco.Ditto/Extensions/PublishedContentExtensions.cs
@@ -42,6 +42,9 @@
         /// </param>
         /// <param name="convertedType">
         /// The <see cref="Action{ConvertedTypeEventArgs}"/> to fire when converted.
+        /// </param>
+        /// <param name="culture">
+        /// The <see cref="CultureInfo"/>
         /// </param>
         /// <typeparam name="T">
         /// The <see cref="Type"/> of items to return.
@@ -74,6 +77,7 @@
         /// <param name="convertedType">
         /// The <see cref="Action{ConvertedTypeEventArgs}"/> to fire when converted.
         /// </param>
+        /// <param name="culture">The <see cref="CultureInfo"/></param>
         /// <typeparam name="T">
         /// The <see cref="Type"/> of items to return.
         /// </typeparam>
@@ -107,6 +111,7 @@
         /// <param name="convertedType">
         /// The <see cref="Action{ConvertedTypeEventArgs}"/> to fire when converted.
         /// </param>
+        /// <param name="culture">The <see cref="CultureInfo"/></param>
         /// <returns>
         /// The converted <see cref="Object"/> as the given type.
         /// </returns>
@@ -182,6 +187,9 @@
         /// </param>
         /// <param name="convertedType">
         /// The <see cref="Action{ConvertedTypeEventArgs}"/> to fire when converted.
+        /// </param>
+        /// <param name="culture">
+        /// The <see cref="CultureInfo"/>.
         /// </param>
         /// <returns>
         /// The resolved <see cref="IEnumerable{T}"/>.
@@ -216,6 +224,7 @@
         /// <param name="type">
         /// The <see cref="Type"/> of items to return.
         /// </param>
+        /// <param name="culture">The <see cref="CultureInfo"/></param>
         /// <returns>
         /// The converted <see cref="Object"/> as the given type.
         /// </returns>
@@ -336,24 +345,26 @@
                             ?? (isEnumerableType ? typeInfo.GenericTypeArguments.First().GetCustomAttribute<TypeConverterAttribute>(true)
                                                  : propertyType.GetCustomAttribute<TypeConverterAttribute>(true));

-                        if (converterAttribute != null)
+                        if (converterAttribute != null && converterAttribute.ConverterTypeName != null)
                         {
-                            if (converterAttribute.ConverterTypeName != null)
+                            // Time custom conversions.
+                            using (DisposableTimer.DebugDuration(type, string.Format("Custom TypeConverter ({0}, {1})", content.Id, propertyInfo.Name), "Complete"))
                             {
-                                // Time custom conversions.
-                                using (DisposableTimer.DebugDuration(type, string.Format("Custom TypeConverter ({0}, {1})", content.Id, propertyInfo.Name), "Complete"))
+                                // Get the custom converter from the attribute and attempt to convert.
+                                var toConvert = Type.GetType(converterAttribute.ConverterTypeName);
+                                if (toConvert != null)
                                 {
-                                    // Get the custom converter from the attribute and attempt to convert.
-                                    var toConvert = Type.GetType(converterAttribute.ConverterTypeName);
-                                    if (toConvert != null)
+                                    var converter = DependencyResolver.Current.GetService(toConvert) as TypeConverter;
+
+                                    if (converter != null)
                                     {
-                                        var converter = DependencyResolver.Current.GetService(toConvert) as TypeConverter;
-                                        if (converter != null && converter.CanConvertFrom(propertyValue.GetType()))
+                                        // Create context to pass to converter implementations.
+                                        // This contains the IPublishedContent and the currently converting property descriptor.
+                                        var descriptor = TypeDescriptor.GetProperties(instance)[propertyInfo.Name];
+                                        var context = new PublishedContentContext(content, descriptor);
+
+                                        if (converter.CanConvertFrom(context, propertyValue.GetType()))
                                         {
-                                            // Create context to pass to converter implementations.
-                                            // This contains the IPublishedContent and the currently converting property descriptor.
-                                            var descriptor = TypeDescriptor.GetProperties(instance)[propertyInfo.Name];
-                                            var context = new PublishedContentContext(content, descriptor);
                                             object converted = converter.ConvertFrom(context, culture, propertyValue);

                                             // Handle Typeconverters returning single objects when we want an IEnumerable.
@@ -388,11 +399,13 @@
                         {
                             // Handle Html strings so we don't have to set the attribute.
                             HtmlStringConverter converter = new HtmlStringConverter();
+
+                            // This contains the IPublishedContent and the currently converting property descriptor.
+                            var descriptor = TypeDescriptor.GetProperties(instance)[propertyInfo.Name];
+                            var context = new PublishedContentContext(content, descriptor);
+
                             if (converter.CanConvertFrom(propertyValue.GetType()))
                             {
-                                // This contains the IPublishedContent and the currently converting property descriptor.
-                                var descriptor = TypeDescriptor.GetProperties(instance)[propertyInfo.Name];
-                                var context = new PublishedContentContext(content, descriptor);
                                 propertyInfo.SetValue(instance, converter.ConvertFrom(context, culture, propertyValue), null);
                             }
                         }


Removing SpecsFor from more Hub tests

Removing SpecsFor from more Hub tests

--- src/SlackConnector.Tests.Unit/SlackConnectorTests/HubsTests.cs
+++ src/SlackConnector.Tests.Unit/SlackConnectorTests/HubsTests.cs
@@ -80,7 +80,7 @@
         }

         [Test]
-        public async Task should_not_contain_channels_that_bot_is_not_a_member_off()
+        public async Task should_not_contain_channels_that_are_archived_and_bot_is_not_a_member_off()
         {
             // given
             var handshakeResponse = new HandshakeResponse
@@ -110,112 +110,65 @@
                 .Verify(x => x.Create(It.Is((ConnectionInformation p) => p.SlackChatHubs.Count == 0)), Times.Once);
         }

-        public class given_groups_are_archived : SpecsFor<SlackConnector>
-        {
-            private HandshakeResponse HandshakeResponse { get; set; }
-            private SlackConnectionFactoryStub SlackFactoryStub { get; set; }
-
-            protected override void InitializeClassUnderTest()
-            {
-                SlackFactoryStub = new SlackConnectionFactoryStub();
-                SUT = new SlackConnector(GetMockFor<IConnectionFactory>().Object, SlackFactoryStub);
-            }
-
-            protected override void Given()
-            {
-                HandshakeResponse = new HandshakeResponse
-                {
-                    Ok = true,
-                    Groups = new[]
-                    {
-                        new Group
-                        {
-                            Id = "group-id",
-                            Name = "group-name",
-                            IsArchived = true,
-                            //Members = new [] { SelfId } //TODO: Need to do self things
-                        }
-                    }
-                };
-
-                GetMockFor<IHandshakeClient>()
-                    .Setup(x => x.FirmShake(It.IsAny<string>()))
-                    .ReturnsAsync(HandshakeResponse);
-
-                GetMockFor<IConnectionFactory>()
-                    .Setup(x => x.CreateHandshakeClient())
-                    .Returns(GetMockFor<IHandshakeClient>().Object);
-
-                GetMockFor<IConnectionFactory>()
-                    .Setup(x => x.CreateWebSocketClient(HandshakeResponse.WebSocketUrl, null))
-                    .ReturnsAsync(GetMockFor<IWebSocketClient>().Object);
-            }
-
-            protected override void When()
-            {
-                SUT.Connect("key").Wait();
-            }
-
-            [Test]
-            public void then_should_not_contain_channels()
-            {
-                SlackFactoryStub.Create_ConnectionInformation.SlackChatHubs.Count.ShouldEqual(0);
-            }
-        }
-
-        public class given_groups_that_are_not_archived_and_is_not_a_member_of_group : SpecsFor<SlackConnector>
-        {
-            private HandshakeResponse HandshakeResponse { get; set; }
-            private const string SelfId = "abc123";
-            private SlackConnectionFactoryStub SlackFactoryStub { get; set; }
-
-            protected override void InitializeClassUnderTest()
-            {
-                SlackFactoryStub = new SlackConnectionFactoryStub();
-                SUT = new SlackConnector(GetMockFor<IConnectionFactory>().Object, SlackFactoryStub);
-            }
-
-            protected override void Given()
-            {
-                HandshakeResponse = new HandshakeResponse
-                {
-                    Ok = true,
-                    Self = new Detail { Id = SelfId },
-                    Groups = new[]
-                    {
-                        new Group
-                        {
-                            Id = "group-id",
-                            Name = "group-name",
-                            IsArchived = false,
-                            Members = new [] { "something-else" }
-                        }
-                    }
-                };
-
-                GetMockFor<IHandshakeClient>()
-                    .Setup(x => x.FirmShake(It.IsAny<string>()))
-                    .ReturnsAsync(HandshakeResponse);
-
-                GetMockFor<IConnectionFactory>()
-                    .Setup(x => x.CreateHandshakeClient())
-                    .Returns(GetMockFor<IHandshakeClient>().Object);
-
-                GetMockFor<IConnectionFactory>()
-                    .Setup(x => x.CreateWebSocketClient(HandshakeResponse.WebSocketUrl, null))
-                    .ReturnsAsync(GetMockFor<IWebSocketClient>().Object);
-            }
-
-            protected override void When()
-            {
-                SUT.Connect("key").Wait();
-            }
-
-            [Test]
-            public void then_should_not_contain_any_channels()
-            {
-                SlackFactoryStub.Create_ConnectionInformation.SlackChatHubs.Count.ShouldEqual(0);
-            }
+        [Test]
+        public async Task should_not_contain_archived_groups()
+        {
+            // given
+            var handshakeResponse = new HandshakeResponse
+            {
+                Ok = true,
+                Groups = new[]
+                {
+                    new Group
+                    {
+                        Id = "group-id",
+                        Name = "group-name",
+                        IsArchived = true
+                    }
+                }
+            };
+
+            _handshakeClient
+                .Setup(x => x.FirmShake(It.IsAny<string>()))
+                .ReturnsAsync(handshakeResponse);
+
+            // when
+            await _slackConnector.Connect("something");
+
+            // then
+            _slackConnectionFactory
+                .Verify(x => x.Create(It.Is((ConnectionInformation p) => p.SlackChatHubs.Count == 0)), Times.Once);
+        }
+
+        [Test]
+        public async Task should_not_contain_groups_that_are_archived_and_bot_is_not_a_member_off()
+        {
+            // given
+            var handshakeResponse = new HandshakeResponse
+            {
+                Ok = true,
+                Groups = new[]
+                {
+                    new Group
+                    {
+                        Id = "group-id",
+                        Name = "group-name",
+                        IsArchived = false,
+                        Members = new [] { "something-else" }
+                    }
+                }
+            };
+
+            _handshakeClient
+                .Setup(x => x.FirmShake(It.IsAny<string>()))
+                .ReturnsAsync(handshakeResponse);
+
+            // when
+            await _slackConnector.Connect("something");
+
+            // then
+            _slackConnectionFactory
+                .Verify(x => x.Create(It.Is((ConnectionInformation p) => p.SlackChatHubs.Count == 0)), Times.Once);
         }

         public class given_instant_message_channel_when_user_id_exists_in_cache : SpecsFor<SlackConnector>


Improve GetTsType error messages

Improve GetTsType error messages

--- src/SyntaxImprovement/Generators/TsFromCs/TsFromCsGenerator.cs
+++ src/SyntaxImprovement/Generators/TsFromCs/TsFromCsGenerator.cs
@@ -56,7 +56,7 @@
 						.Append(isNullable ? "?" : string.Empty)
 						.Append(':')
 						.Append(' ')
-						.Append(GetTsType(property.PropertyType, knownTypes: typeList))
+						.Append(GetTsType(property.PropertyType, knownTypes: typeList, parentTypeName: typeName))
 						.Append(';')
 						.Append(Environment.NewLine);
 				}
@@ -76,7 +76,7 @@
 			return overrideAttribute?.Name ?? type.Name;
 		}

-		private static string GetTsType(Type type, IReadOnlyList<Type> knownTypes)
+		private static string GetTsType(Type type, IReadOnlyList<Type> knownTypes, string parentTypeName)
 		{
 			try
 			{
@@ -84,7 +84,7 @@
 			}
 			catch (Exception ex)
 			{
-				throw new Exception($"Could not {nameof(GetTsType)} of type {type.Namespace}.{type.Name}", ex);
+				throw new Exception($"Could not {nameof(GetTsType)} of type {type.Namespace}.{type.Name}. Parent type: {parentTypeName}", ex);
 			}
 		}


Collapse ChunkEnumerable and ChunkEnumerator.

--- src/System.Private.CoreLib/shared/System/Text/StringBuilder.cs
+++ src/System.Private.CoreLib/shared/System/Text/StringBuilder.cs
@@ -558,8 +558,8 @@
         }

         /// <summary>
-        /// EnumerateChunks returns ChunkEnumerable that follows the IEnumerable pattern and
-        /// thus can be used in a C# 'foreach' statemens to retreive the data in the StringBuilder
+        /// EnumerateChunks returns ChunkEnumerator that follows the IEnumerable pattern and
+        /// thus can be used in a C# 'foreach' statements to retreive the data in the StringBuilder
         /// as chunks (ReadOnlyMemory) of characters.  An example use is:
         ///
         ///      foreach (ReadOnlyMemory<char> chunk in sb.EnumerateChunks())
@@ -577,37 +577,24 @@
         ///             { /* operation on span[i] */ }
         ///    }
         /// </summary>
-        public ChunkEnumerable EnumerateChunks() => new ChunkEnumerable(this);
-
-        /// <summary>
-        /// ChunkEnumerable supports the IEnumerable pattern so foreach works (see EnumerateChunks)
-        /// It needs to be public (so the compiler can use it when building a foreach statement)
-        /// but users typically don't use it explicitly (which is why it is a nested type).
-        /// </summary>
-        readonly public struct ChunkEnumerable
-        {
+        public ChunkEnumerator EnumerateChunks() => new ChunkEnumerator(this);
+
+
+        /// <summary>
+        /// ChunkEnumerator supports both the IEnumerable and IEnumerator pattern so foreach
+        /// works (see EnumerateChunks).  It needs to be public (so the compiler can use it
+        /// when building a foreach statement) but users typically don't use it explicitly.
+        /// (which is why it is a nested type).
+        /// </summary>
+        public struct ChunkEnumerator
+        {
+            [ComponentModel.EditorBrowsable(ComponentModel.EditorBrowsableState.Never)] // Only here to make foreach work
+
             /// <summary>
-            /// Implements the IEnumerable pattern.
+            /// Implement IEnumerable.GetEnumerator() to return  'this' as the IEnumerator
             /// </summary>
-            public ChunkEnumerator GetEnumerator() => new ChunkEnumerator(this._stringBuilder);
-
-            #region private
-            internal ChunkEnumerable(StringBuilder stringBuilder)
-            {
-                Debug.Assert(stringBuilder != null);    // Because it is only called with a 'this' pointer.
-                _stringBuilder = stringBuilder;
-            }
-            readonly private StringBuilder _stringBuilder;   // We ensure this is never null.
-            #endregion
-        }
-
-        /// <summary>
-        /// ChunkEnumerator supports the IEnumerator pattern so foreach works (see EnumerateChunks)
-        /// It needs to be public (so the compiler can use it when building a foreach statement)
-        /// but users typically don't use it explicitly (which is why it is a nested type).
-        /// </summary>
-        public struct ChunkEnumerator
-        {
+            public ChunkEnumerator GetEnumerator() { return this;  }
+
             /// <summary>
             /// Implements the IEnumerator pattern.
             /// </summary>


Revert "Fix issue with URL encoded options passed from Wizard Script command."

--- MIG/MigInterfaceCommand.cs
+++ MIG/MigInterfaceCommand.cs
@@ -56,16 +56,8 @@
                         Command = requests[2];
                         if (requests.Length > 3)
                         {
-                            var decodedFirstOption = System.Uri.UnescapeDataString(requests[3]);
-                            if(decodedFirstOption == requests[3])
-                            {
-                                options = new string[requests.Length - 3];
-                                Array.Copy(requests, 3, options, 0, requests.Length - 3);
-                            }
-                            else // if we have URL encoded options
-                            {
-                                options = decodedFirstOption.Trim('/').Split(new char[] { '/' }, StringSplitOptions.None);
-                            }
+                            options = new string[requests.Length - 3];
+                            Array.Copy(requests, 3, options, 0, requests.Length - 3);
                         }
                     }
                 }


ImportConfiguration

ImportConfiguration

* updated tests required due to renamed parameter

--- src/biz.dfch.PS.Abiquo.Client.Tests/ImportConfigurationTest.cs
+++ src/biz.dfch.PS.Abiquo.Client.Tests/ImportConfigurationTest.cs
@@ -128,9 +128,9 @@

         [TestCategory("SkipOnTeamCity")]
         [TestMethod]
-        public void InvokeWithEmptyPathAndSaveToVariableSucceeds()
+        public void InvokeWithEmptyPathAndDisplayOnlyTrueSucceeds()
         {
-            var parameters = @"-SaveToModuleVariable;";
+            var parameters = @"-DisplayOnly:$true; Get-Variable biz_dfch_PS_Abiquo_Client -ValueOnly -ErrorAction:SilentlyContinue;";
             var results = PsCmdletAssert.Invoke(sut, parameters);
             Assert.IsNotNull(results);
             Assert.AreEqual(1, results.Count);
@@ -138,5 +138,25 @@
             Assert.IsNotNull(result);
             Assert.IsInstanceOfType(result, typeof(ModuleContext));
         }
+
+        [TestCategory("SkipOnTeamCity")]
+        [TestMethod]
+        public void InvokeWithEmptyPathAndDisplayOnlyFalseSucceeds()
+        {
+            var parameters = @"-DisplayOnly:$false; Get-Variable biz_dfch_PS_Abiquo_Client -ValueOnly;";
+            var results = PsCmdletAssert.Invoke(sut, parameters);
+            Assert.IsNotNull(results);
+            Assert.AreEqual(2, results.Count);
+
+            var moduleContext = results[0].BaseObject;
+            Assert.IsNotNull(moduleContext);
+            Assert.IsInstanceOfType(moduleContext, typeof(ModuleContext));
+
+            var variable = results[1].BaseObject;
+            Assert.IsNotNull(variable);
+            Assert.IsInstanceOfType(variable, typeof(ModuleContext));
+
+            Assert.AreEqual(variable, moduleContext);
+        }
     }
 }


prepare for release.

prepare for release.

--- src/ADAL.Common/CommonAssemblyInfo.cs
+++ src/ADAL.Common/CommonAssemblyInfo.cs
@@ -27,11 +27,11 @@
 [assembly: AssemblyCopyright("Copyright (c) Microsoft Open Technologies. All rights reserved.")]
 [assembly: AssemblyTrademark("")]

-[assembly: AssemblyVersion("2.22.0.0")]
+[assembly: AssemblyVersion("2.23.0.0")]

 // Keep major and minor versions in AssemblyFileVersion in sync with AssemblyVersion.
 // Build and revision numbers are replaced on build machine for official builds.
-[assembly: AssemblyFileVersion("2.22.00000.0000")]
+[assembly: AssemblyFileVersion("2.23.00000.0000")]
 // On official build, attribute AssemblyInformationalVersionAttribute is added as well
 // with its value equal to the hash of the last commit to the git branch.
 // e.g.: [assembly: AssemblyInformationalVersionAttribute("4392c9835a38c27516fc0cd7bad7bccdcaeab161")]


prepare for release

prepare for release

prepare for release

--- src/ADAL.Common/CommonAssemblyInfo.cs
+++ src/ADAL.Common/CommonAssemblyInfo.cs
@@ -27,11 +27,11 @@
 [assembly: AssemblyCopyright("Copyright (c) Microsoft Open Technologies. All rights reserved.")]
 [assembly: AssemblyTrademark("")]

-[assembly: AssemblyVersion("2.18.0.0")]
+[assembly: AssemblyVersion("2.19.0.0")]

 // Keep major and minor versions in AssemblyFileVersion in sync with AssemblyVersion.
 // Build and revision numbers are replaced on build machine for official builds.
-[assembly: AssemblyFileVersion("2.18.00000.0000")]
+[assembly: AssemblyFileVersion("2.19.00000.0000")]
 // On official build, attribute AssemblyInformationalVersionAttribute is added as well
 // with its value equal to the hash of the last commit to the git branch.
 // e.g.: [assembly: AssemblyInformationalVersionAttribute("4392c9835a38c27516fc0cd7bad7bccdcaeab161")]


Included JobType for AzureQueue.

Included JobType for AzureQueue.

--- src/Aditi.Scheduler.Models/JobType.cs
+++ src/Aditi.Scheduler.Models/JobType.cs
@@ -2,6 +2,7 @@
 {
     public enum JobType
     {
-        Webhook
+        Webhook,
+        AzureQueue
     }
 }


Rename variables

Rename variables

Give the extension's variables and parameters better names.

--- src/AdventOfCode/Vector3Extensions.cs
+++ src/AdventOfCode/Vector3Extensions.cs
@@ -13,15 +13,15 @@
     /// <summary>
     /// Gets the Manhattan distance between two vectors.
     /// </summary>
-    /// <param name="a">The first vector.</param>
-    /// <param name="b">The second vector.</param>
+    /// <param name="value">The first vector.</param>
+    /// <param name="other">The second vector.</param>
     /// <returns>
-    /// The Manhattan distance between <paramref name="a"/> and <paramref name="b"/>.
+    /// The Manhattan distance between <paramref name="value"/> and <paramref name="other"/>.
     /// </returns>
     [MethodImpl(MethodImplOptions.AggressiveInlining)]
-    public static float ManhattanDistance(this in Vector3 a, in Vector3 b)
+    public static float ManhattanDistance(this in Vector3 value, in Vector3 other)
     {
-        var abs = Vector3.Abs(a - b);
-        return abs.X + abs.Y + abs.Z;
+        var delta = Vector3.Abs(value - other);
+        return delta.X + delta.Y + delta.Z;
     }
 }


Fix crash

Fix crash

--- src/Alex/Worlds/Chunks/ChunkColumn.cs
+++ src/Alex/Worlds/Chunks/ChunkColumn.cs
@@ -77,34 +77,31 @@

 		protected void SetScheduled(int x, int y, int z, bool value)
 		{
-			_scheduledUpdates[GetCoordinateIndex(x, y, z)] = value;
-		}
-
+			var queue = _scheduledUpdates;
+
+			if (queue != null)
+			{
+				queue[GetCoordinateIndex(x, y, z)] = value;
+			}
+		}
+
 		public void ScheduleBorder()
 		{
-			//for (int sectionIndex = 0; sectionIndex < 16; sectionIndex++)
-			{
-			//	var section = Sections[sectionIndex];
-
-			//	if (section == null)
-			//		continue;
-
-				for (int x = 0; x < 16; x++)
-				{
-					for (int z = 0; z < 16; z++)
+			for (int x = 0; x < 16; x++)
+			{
+				for (int z = 0; z < 16; z++)
+				{
+					for (int y = 0; y < 256; y++)
 					{
-						for (int y = 0; y < 256; y++)
+						if (x == 0 || x == 15 || z == 0 || z == 15)
 						{
-							if (x == 0 || x == 15 || z == 0 || z == 15)
-							{
-								_scheduledUpdates[GetCoordinateIndex(x, y, z)] = true;
-							}
+							SetScheduled(x,y,z, true);
 						}
 					}
 				}
 			}
 		}
-
+
 		public void UpdateBuffer(GraphicsDevice device, IBlockAccess world)
 		{
 			Monitor.Enter(_dataLock);
@@ -116,6 +113,11 @@
 				var chunkData     = ChunkData;

 				if (chunkData == null)
+					return;
+
+				var scheduleQueue = _scheduledUpdates;
+
+				if (scheduleQueue == null)
 					return;

 				bool isNew = IsNew;
@@ -139,7 +141,7 @@
 							{
 								var idx = GetCoordinateIndex(x, (sectionIndex * 16) + y, z);

-								bool scheduled = _scheduledUpdates[idx]; // IsScheduled(x, y, z);
+								bool scheduled = scheduleQueue[idx]; // IsScheduled(x, y, z);

 								//if ((skyLightUpdate || blockLightUpdate) && !scheduled)
 								//	{
@@ -464,29 +466,17 @@

 		public void ScheduleBlockUpdate(int x, int y, int z)
 		{
-			if ((x < 0 || x > ChunkWidth) || (y < 0 || y > ChunkHeight) || (z < 0 || z > ChunkDepth))
-				return;
-
-			_scheduledUpdates[GetCoordinateIndex(x, y, z)] = true;
-			//	section.SetScheduled(x, y & 0xf, z, true);
+			SetScheduled(x,y,z, true);
 		}

 		public void ScheduleBlocklightUpdate(int x, int y, int z)
 		{
-			if ((x < 0 || x > ChunkWidth) || (y < 0 || y > ChunkHeight) || (z < 0 || z > ChunkDepth))
-				return;
-
-			_scheduledUpdates[GetCoordinateIndex(x, y, z)] = true;
-		//	section.SetBlockLightScheduled(x, y & 0xf, z, true);
+			SetScheduled(x,y,z, true);
 		}

 		public void ScheduleSkylightUpdate(int x, int y, int z)
 		{
-			if ((x < 0 || x > ChunkWidth) || (y < 0 || y > ChunkHeight) || (z < 0 || z > ChunkDepth))
-				return;
-
-			_scheduledUpdates[GetCoordinateIndex(x, y, z)] = true;
-			//section.SetSkyLightUpdateScheduled(x, y & 0xf, z, true);
+			SetScheduled(x,y,z, true);
 		}

 		public bool AddBlockEntity(BlockCoordinates coordinates, NbtCompound entity)