Convert file format

Convert file format

--- src/DotNetCore.CAP.MongoDB/IStorage.MongoDB.cs
+++ src/DotNetCore.CAP.MongoDB/IStorage.MongoDB.cs
@@ -1,64 +1,64 @@
-// Copyright (c) .NET Core Community. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-using DotNetCore.CAP.Dashboard;
-using Microsoft.Extensions.Logging;
-using MongoDB.Driver;
-
-namespace DotNetCore.CAP.MongoDB
-{
-    public class MongoDBStorage : IStorage
-    {
-        private readonly CapOptions _capOptions;
-        private readonly IMongoClient _client;
-        private readonly ILogger<MongoDBStorage> _logger;
-        private readonly MongoDBOptions _options;
-
-        public MongoDBStorage(CapOptions capOptions,
-            MongoDBOptions options,
-            IMongoClient client,
-            ILogger<MongoDBStorage> logger)
-        {
-            _capOptions = capOptions;
-            _options = options;
-            _client = client;
-            _logger = logger;
-        }
-
-        public IStorageConnection GetConnection()
-        {
-            return new MongoDBStorageConnection(_capOptions, _options, _client);
-        }
-
-        public IMonitoringApi GetMonitoringApi()
-        {
-            return new MongoDBMonitoringApi(_client, _options);
-        }
-
-        public async Task InitializeAsync(CancellationToken cancellationToken)
-        {
-            if (cancellationToken.IsCancellationRequested)
-            {
-                return;
-            }
-
-            var database = _client.GetDatabase(_options.DatabaseName);
-            var names = (await database.ListCollectionNamesAsync(cancellationToken: cancellationToken))?.ToList();
-
-            if (names.All(n => n != _options.ReceivedCollection))
-            {
-                await database.CreateCollectionAsync(_options.ReceivedCollection, cancellationToken: cancellationToken);
-            }
-
-            if (names.All(n => n != _options.PublishedCollection))
-            {
-                await database.CreateCollectionAsync(_options.PublishedCollection,
-                    cancellationToken: cancellationToken);
-            }
-
+// Copyright (c) .NET Core Community. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using DotNetCore.CAP.Dashboard;
+using Microsoft.Extensions.Logging;
+using MongoDB.Driver;
+
+namespace DotNetCore.CAP.MongoDB
+{
+    public class MongoDBStorage : IStorage
+    {
+        private readonly CapOptions _capOptions;
+        private readonly IMongoClient _client;
+        private readonly ILogger<MongoDBStorage> _logger;
+        private readonly MongoDBOptions _options;
+
+        public MongoDBStorage(CapOptions capOptions,
+            MongoDBOptions options,
+            IMongoClient client,
+            ILogger<MongoDBStorage> logger)
+        {
+            _capOptions = capOptions;
+            _options = options;
+            _client = client;
+            _logger = logger;
+        }
+
+        public IStorageConnection GetConnection()
+        {
+            return new MongoDBStorageConnection(_capOptions, _options, _client);
+        }
+
+        public IMonitoringApi GetMonitoringApi()
+        {
+            return new MongoDBMonitoringApi(_client, _options);
+        }
+
+        public async Task InitializeAsync(CancellationToken cancellationToken)
+        {
+            if (cancellationToken.IsCancellationRequested)
+            {
+                return;
+            }
+
+            var database = _client.GetDatabase(_options.DatabaseName);
+            var names = (await database.ListCollectionNamesAsync(cancellationToken: cancellationToken))?.ToList();
+
+            if (names.All(n => n != _options.ReceivedCollection))
+            {
+                await database.CreateCollectionAsync(_options.ReceivedCollection, cancellationToken: cancellationToken);
+            }
+
+            if (names.All(n => n != _options.PublishedCollection))
+            {
+                await database.CreateCollectionAsync(_options.PublishedCollection,
+                    cancellationToken: cancellationToken);
+            }
+
             var receivedMessageIndexNames = new string[] {
                 nameof(ReceivedMessage.Name), nameof(ReceivedMessage.Added), nameof(ReceivedMessage.ExpiresAt),
                 nameof(ReceivedMessage.StatusName), nameof(ReceivedMessage.Retries), nameof(ReceivedMessage.Version) };
@@ -99,7 +99,7 @@
                 }).ToArray();

                 await col.Indexes.CreateManyAsync(indexes, cancellationToken);
-            }
-        }
-    }
+            }
+        }
+    }
 }


Add missing bezier option to menu

Add missing bezier option to menu

--- osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs
+++ osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs
@@ -171,6 +171,7 @@
                             createMenuItemForPathType(null),
                             createMenuItemForPathType(PathType.Linear),
                             createMenuItemForPathType(PathType.PerfectCurve),
+                            createMenuItemForPathType(PathType.Bezier),
                             createMenuItemForPathType(PathType.Catmull)
                         }
                     }


Use better date format in csv export

Use better date format in csv export

use yyyy-mm-dd instead of yyyy/mm/dd

--- src/GT3X.Parsing.Library/AccelerationSample.cs
+++ src/GT3X.Parsing.Library/AccelerationSample.cs
@@ -66,7 +66,7 @@
         public AcclererationClassMap()
         {
             //set the timestamp format to include milliseconds
-            Map(m => m.Timestamp).Index(0).TypeConverterOption("yyyy/MM/dd HH:mm:ss.fff");
+            Map(m => m.Timestamp).Index(0).TypeConverterOption("yyyy-MM-dd HH:mm:ss.fff");
             Map(m => m.Y).Index(1);
             Map(m => m.X).Index(2);
             Map(m => m.Z).Index(3);


Fix Guid not mapped correctly to IdGraphyType when AutoGenerating Object Graph (#918)

--- src/GraphQL/Utilities/GraphTypeTypeRegistry.cs
+++ src/GraphQL/Utilities/GraphTypeTypeRegistry.cs
@@ -21,7 +21,8 @@
                 [typeof(bool)] = typeof(BooleanGraphType),
                 [typeof(DateTime)] = typeof(DateGraphType),
                 [typeof(DateTimeOffset)] = typeof(DateTimeOffsetGraphType),
-                [typeof(TimeSpan)] = typeof(TimeSpanSecondsGraphType)
+                [typeof(TimeSpan)] = typeof(TimeSpanSecondsGraphType),
+                [typeof(Guid)] = typeof(IdGraphType)
             };
         }


Change version to 1.1

Change version to 1.1

--- src/HabitRPG.Client/Properties/AssemblyInfo.cs
+++ src/HabitRPG.Client/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.1.*")]
-[assembly: AssemblyFileVersion("1.1.*")]
+[assembly: AssemblyVersion("1.1.0.0")]
+[assembly: AssemblyFileVersion("1.1.0.0")]


Added comments for next steps in supporting generics.

--- src/Kephas.Model/Elements/DefaultModelSpace.cs
+++ src/Kephas.Model/Elements/DefaultModelSpace.cs
@@ -202,8 +202,20 @@
         /// </returns>
         protected internal virtual IEnumerable<IClassifier> ComputeClassifiers(IModelConstructionContext constructionContext)
         {
-            // first, get the classifiers and resolve their aspects
+            // first, get the classifiers and collect from them all other classifier references/dependencies
+            // to be able to get a proper sorting upon construction completion
             var unsortedClassifiers = constructionContext.ElementInfos.OfType<IClassifier>().ToList();
+            // TODO get the dependencies from:
+            // 1. Parts (do not resolve yet the classifiers!). This is the only complete information so far.
+            // 2. Constructed Generics
+            // 3. Property/Field/Method parameter Types ? not sure if required.
+            // When constructing generics, must change the signature to include (param, arg) mappings
+
+            // second, construct the required generics. In this phase, the classifier contain brute information.
+            // TODO...
+
+            // third, resolve their aspects.
+            // TODO aspects are can be applied only to non-generic or open-generics
             this.ResolveAspects(unsortedClassifiers);

             // then sort them, to be able to have all the dependencies constructed completely


added frames per second metric

added frames per second metric

--- src/LookingGlass.Renderer.Ogre/RendererOgre.cs
+++ src/LookingGlass.Renderer.Ogre/RendererOgre.cs
@@ -256,6 +256,8 @@
     private Ogr.RequestResourceCallback requestResourceCallbackHandle;
     private Ogr.BetweenFramesCallback betweenFramesCallbackHandle;
     // ==========================================================================
+    private int m_framesPerSecondLastTime = 10; // used to calclate frames per sec
+    private int m_framesPerSecondLastFrames = 1;
     override public bool AfterAllModulesLoaded() {
         // allow others to get our statistics
         m_restHandler = new RestHandler("/stats/" + m_moduleName + "/detailStats", m_stats);
@@ -316,6 +318,18 @@

         // Create a ParameterSet that can be read externally via REST/JSON
         m_ogreStats = new ParameterSet();
+        // add an initial parameter that calculates frames per sec
+        m_ogreStats.Add("framespersecond",
+            delegate(string xx) {
+                int intrvl = Environment.TickCount - m_framesPerSecondLastTime;
+                if (intrvl < 0) intrvl += Int32.MaxValue;   // TickCount wraps
+                float fps = ((float)(m_ogreStatsPinned[Ogr.StatTotalFrames] - m_framesPerSecondLastFrames));
+                fps /= (float)intrvl / 1000f;
+                m_framesPerSecondLastTime = Environment.TickCount;
+                m_framesPerSecondLastFrames = m_ogreStatsPinned[Ogr.StatTotalFrames];
+                return new OMVSD.OSDString(fps.ToString());
+            }, "Frames per second"
+        );
         // Add parameters for each name with a delegate to get the value from the pinned data array
         // The c++ code updates the array and we pick up the values with the ParameterSet delegates
         foreach (string key in m_ogreStatsIndex.Keys) {


Update PerfRunData.cs

Update PerfRunData.cs

Make CreateDirectory method virtual so that derived classes can provide their own Directory implementation, allowing for benchmarking of custom Directory providers (e.q LiteDB)

--- src/Lucene.Net.Benchmark/ByTask/PerfRunData.cs
+++ src/Lucene.Net.Benchmark/ByTask/PerfRunData.cs
@@ -181,7 +181,7 @@
             SetStartTimeMillis();
         }

-        private Store.Directory CreateDirectory(bool eraseIndex, string dirName,
+        protected virtual Store.Directory CreateDirectory(bool eraseIndex, string dirName,
             string dirParam)
         {
             if ("FSDirectory".Equals(config.Get(dirParam, "RAMDirectory"), StringComparison.Ordinal))


Rewrite Descendants(MarkdownObject) iteratively

--- src/Markdig/Syntax/MarkdownObjectExtensions.cs
+++ src/Markdig/Syntax/MarkdownObjectExtensions.cs
@@ -1,131 +1,131 @@
-// Copyright (c) Alexandre Mutel. All rights reserved.
-// This file is licensed under the BSD-Clause 2 license.
-// See the license.txt file in the project root for more information.
-
-using System.Collections.Generic;
-using Markdig.Syntax.Inlines;
-
-namespace Markdig.Syntax
-{
-    /// <summary>
-    /// Extensions for visiting <see cref="Block"/> or <see cref="Inline"/>
-    /// </summary>
-    public static class MarkdownObjectExtensions
-    {
-        /// <summary>
-        /// Iterates over the descendant elements for the specified markdown element, including <see cref="Block"/> and <see cref="Inline"/>.
-        /// </summary>
-        /// <param name="markdownObject">The markdown object.</param>
-        /// <returns>An iteration over the descendant elements</returns>
-        public static IEnumerable<MarkdownObject> Descendants(this MarkdownObject markdownObject)
-        {
-            // TODO: implement a recursiveless method
-
-            var block = markdownObject as ContainerBlock;
-            if (block != null)
-            {
-                foreach (var subBlock in block)
-                {
-                    yield return subBlock;
-
-                    foreach (var sub in subBlock.Descendants())
-                    {
-                        yield return sub;
-                    }
-
-                    // Visit leaf block that have inlines
-                    var leafBlock = subBlock as LeafBlock;
-                    if (leafBlock?.Inline != null)
-                    {
-                        foreach (var subInline in Descendants(leafBlock.Inline))
-                        {
-                            yield return subInline;
-                        }
-                    }
-                }
-            }
-            else
-            {
-                var inline = markdownObject as ContainerInline;
-                if (inline != null)
-                {
-                    var child = inline.FirstChild;
-                    while (child != null)
-                    {
-                        var next = child.NextSibling;
-                        yield return child;
-
-                        foreach (var sub in child.Descendants())
-                        {
-                            yield return sub;
-                        }
-
-                        child = next;
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        /// Iterates over the descendant elements for the specified markdown <see cref="Inline" /> element and filters by the type {T}.
-        /// </summary>
-        /// <typeparam name="T">Type to use for filtering the descendants</typeparam>
-        /// <param name="inline">The inline markdown object.</param>
-        /// <returns>
-        /// An iteration over the descendant elements
-        /// </returns>
-        public static IEnumerable<T> Descendants<T>(this ContainerInline inline) where T : Inline
-        {
-            var child = inline.FirstChild;
-            while (child != null)
-            {
-                var next = child.NextSibling;
-                var childT = child as T;
-                if (childT != null)
-                {
-                    yield return childT;
-                }
-
-                var subContainer = child as ContainerInline;
-                if (subContainer != null)
-                {
-                    foreach (var sub in subContainer.Descendants<T>())
-                    {
-                        yield return sub;
-                    }
-                }
-
-                child = next;
-            }
-        }
-
-        /// <summary>
-        /// Iterates over the descendant elements for the specified markdown <see cref="Block" /> element and filters by the type {T}.
-        /// </summary>
-        /// <typeparam name="T">Type to use for filtering the descendants</typeparam>
-        /// <param name="block">The markdown object.</param>
-        /// <returns>
-        /// An iteration over the descendant elements
-        /// </returns>
-        public static IEnumerable<T> Descendants<T>(this ContainerBlock block) where T : Block
-        {
-            foreach (var subBlock in block)
-            {
-                var subBlockT = subBlock as T;
-                if (subBlockT != null)
-                {
-                    yield return subBlockT;
-                }
-
-                var subBlockContainer = subBlock as ContainerBlock;
-                if (subBlockContainer != null)
-                {
-                    foreach (var sub in subBlockContainer.Descendants<T>())
-                    {
-                        yield return sub;
-                    }
-                }
-            }
-        }
-    }
+// Copyright (c) Alexandre Mutel. All rights reserved.
+// This file is licensed under the BSD-Clause 2 license.
+// See the license.txt file in the project root for more information.
+
+using System.Collections.Generic;
+using Markdig.Syntax.Inlines;
+
+namespace Markdig.Syntax
+{
+    /// <summary>
+    /// Extensions for visiting <see cref="Block"/> or <see cref="Inline"/>
+    /// </summary>
+    public static class MarkdownObjectExtensions
+    {
+        /// <summary>
+        /// Iterates over the descendant elements for the specified markdown element, including <see cref="Block"/> and <see cref="Inline"/>.
+        /// <para>The descendant elements are returned in DFS-like order.</para>
+        /// </summary>
+        /// <param name="markdownObject">The markdown object.</param>
+        /// <returns>An iteration over the descendant elements</returns>
+        public static IEnumerable<MarkdownObject> Descendants(this MarkdownObject markdownObject)
+        {
+            // Fast-path an object with no children to avoid allocating Stack objects
+            if (!(markdownObject is ContainerBlock) && !(markdownObject is ContainerInline)) yield break;
+
+            // TODO: A single Stack<(MarkdownObject block, bool push)> when ValueTuples are available
+            Stack<MarkdownObject> stack = new Stack<MarkdownObject>();
+            Stack<bool> pushStack = new Stack<bool>();
+
+            stack.Push(markdownObject);
+            pushStack.Push(false);
+
+            while (stack.Count > 0)
+            {
+                var block = stack.Pop();
+                var push = pushStack.Pop();
+                if (block is ContainerBlock containerBlock)
+                {
+                    if (push) yield return containerBlock;
+                    int subBlockIndex = containerBlock.Count;
+                    while (subBlockIndex-- > 0)
+                    {
+                        var subBlock = containerBlock[subBlockIndex];
+                        if (subBlock is LeafBlock leafBlock)
+                        {
+                            if (leafBlock.Inline != null)
+                            {
+                                stack.Push(leafBlock.Inline);
+                                pushStack.Push(false);
+                            }
+                        }
+                        stack.Push(subBlock);
+                        pushStack.Push(true);
+                    }
+                }
+                else if (block is ContainerInline containerInline)
+                {
+                    if (push) yield return containerInline;
+                    var child = containerInline.LastChild;
+                    while (child != null)
+                    {
+                        stack.Push(child);
+                        pushStack.Push(true);
+                        child = child.PreviousSibling;
+                    }
+                }
+                else yield return block;
+            }
+        }
+
+        /// <summary>
+        /// Iterates over the descendant elements for the specified markdown <see cref="Inline" /> element and filters by the type {T}.
+        /// </summary>
+        /// <typeparam name="T">Type to use for filtering the descendants</typeparam>
+        /// <param name="inline">The inline markdown object.</param>
+        /// <returns>
+        /// An iteration over the descendant elements
+        /// </returns>
+        public static IEnumerable<T> Descendants<T>(this ContainerInline inline) where T : Inline
+        {
+            var child = inline.FirstChild;
+            while (child != null)
+            {
+                var next = child.NextSibling;
+                T childT = child as T;
+                if (childT != null)
+                {
+                    yield return childT;
+                }
+
+                ContainerInline subContainer = child as ContainerInline;
+                if (subContainer != null)
+                {
+                    foreach (var sub in subContainer.Descendants<T>())
+                    {
+                        yield return sub;
+                    }
+                }
+
+                child = next;
+            }
+        }
+
+        /// <summary>
+        /// Iterates over the descendant elements for the specified markdown <see cref="Block" /> element and filters by the type {T}.
+        /// </summary>
+        /// <typeparam name="T">Type to use for filtering the descendants</typeparam>
+        /// <param name="block">The markdown object.</param>
+        /// <returns>
+        /// An iteration over the descendant elements
+        /// </returns>
+        public static IEnumerable<T> Descendants<T>(this ContainerBlock block) where T : Block
+        {
+            foreach (var subBlock in block)
+            {
+                if (subBlock is T subBlockT)
+                {
+                    yield return subBlockT;
+                }
+
+                if (subBlock is ContainerBlock subBlockContainer)
+                {
+                    foreach (var sub in subBlockContainer.Descendants<T>())
+                    {
+                        yield return sub;
+                    }
+                }
+            }
+        }
+    }
 }


Better error handling when dictionary not found

--- src/MarkdownEdit/SpellCheck/SpellingService.cs
+++ src/MarkdownEdit/SpellCheck/SpellingService.cs
@@ -1,6 +1,6 @@
 using System.Collections.Generic;
-using System.Diagnostics;
 using System.IO;
+using System.Windows;
 using NHunspell;

 namespace MarkdownEdit.SpellCheck
@@ -49,7 +49,7 @@
             }
             else
             {
-                Debug.WriteLine("dictionary not found");
+                MessageBox.Show(Application.Current.MainWindow, language + " dictionary not found", App.Title, MessageBoxButton.OK);
             }
         }


Fixed bug where console would no longer function after running tests

--- src/Potato.Net/Utils/Tests/ProtocolUnitTest.cs
+++ src/Potato.Net/Utils/Tests/ProtocolUnitTest.cs
@@ -101,6 +101,8 @@
                     }
                 };

+                ISandboxProtocolCallbackProxy originalBubbleProxy = game.Bubble;
+
                 game.Bubble = new SandboxProtocolCallbackProxy() {
                     ClientEvent = new Action<IClientEventArgs>(handler)
                 };
@@ -111,7 +113,7 @@
                     this.OnTestEvent(new ProtocolUnitTestEventArgs() { Message = "Timeout on client disconnection." });
                 }

-                game.Bubble = null;
+                game.Bubble = originalBubbleProxy;
             }

             return disconnected;
@@ -136,6 +138,8 @@
                     }
                 };

+                ISandboxProtocolCallbackProxy originalBubbleProxy = game.Bubble;
+
                 game.Bubble = new SandboxProtocolCallbackProxy() {
                     ClientEvent = new Action<IClientEventArgs>(handler)
                 };
@@ -146,7 +150,7 @@
                     this.OnTestEvent(new ProtocolUnitTestEventArgs() { Message = "Timeout on client connection + login. (check end point & credentials)" });
                 }

-                game.Bubble = null;
+                game.Bubble = originalBubbleProxy;
             }

             return loggedIn;
@@ -198,6 +202,8 @@
                             }
                         }
                     };
+
+                    ISandboxProtocolCallbackProxy originalBubbleProxy = game.Bubble;

                     game.Bubble = new SandboxProtocolCallbackProxy() {
                         ClientEvent = new Action<IClientEventArgs>(handler)
@@ -219,7 +225,7 @@
                         this.OnTestEvent(new ProtocolUnitTestEventArgs() { Message = String.Format("Expecting: {0}; Received: {1}", String.Join(", ", expecting), String.Join(", ", unmatchedReceived.ToArray())) });
                     }

-                    game.Bubble = null;
+                    game.Bubble = originalBubbleProxy;
                 }
             }
             this.End = DateTime.Now;


Use target-typed new

Use target-typed new

--- src/ProblemDetails/ProblemDetailsMiddleware.cs
+++ src/ProblemDetails/ProblemDetailsMiddleware.cs
@@ -14,9 +14,9 @@
 {
     public class ProblemDetailsMiddleware
     {
-        private static readonly ActionDescriptor EmptyActionDescriptor = new ActionDescriptor();
+        private static readonly ActionDescriptor EmptyActionDescriptor = new();

-        private static readonly RouteData EmptyRouteData = new RouteData();
+        private static readonly RouteData EmptyRouteData = new();

         public ProblemDetailsMiddleware(
             RequestDelegate next,


Encode RelayState on POST

Encode RelayState on POST

--- src/SamlOida/Binding/HttpPostBindingHandler.cs
+++ src/SamlOida/Binding/HttpPostBindingHandler.cs
@@ -2,12 +2,13 @@
 using Microsoft.Extensions.Options;
 using SamlOida.MessageHandler;
 using System;
+using System.Net;
 using System.Text;
 using System.Xml;

 namespace SamlOida.Binding
 {
-    public class HttpPostBindingHandler :  ISamlBindingStrategy
+    public class HttpPostBindingHandler : ISamlBindingStrategy
     {
         private readonly IOptions<SamlOptions> _optionsMonitor;

@@ -27,7 +28,7 @@
             builder.Append($"<input type='hidden' name='{SamlAuthenticationDefaults.SamlRequestKey}' value='{encodedMessage}'/>");

             if (!string.IsNullOrEmpty(relayState))
-                builder.Append($"<input type='hidden' name='{SamlAuthenticationDefaults.RelayStateKey}' value='{relayState}'/>");
+                builder.Append($"<input type='hidden' name='{SamlAuthenticationDefaults.RelayStateKey}' value='{WebUtility.UrlEncode(relayState)}'/>");

             builder.Append("<input type='submit' value='Send'/>");
             builder.Append("</form>");


мелкие доработки

мелкие доработки

--- src/ScriptEngine/Compiler/ExpressionBuilder.cs
+++ src/ScriptEngine/Compiler/ExpressionBuilder.cs
@@ -12,6 +12,7 @@
     {
         Compiler _compiler;
         Stack<Token> _operators;
+        Stack<int> _logicalJumps;

         public ExpressionBuilder(Compiler compiler)
         {
@@ -85,20 +86,20 @@
                         }
                         else if (_compiler._lastExtractedLexem.Token == Token.Minus)
                         {
-                            _operators.Push(Token.UnaryMinus);
+                            PushOperator(Token.UnaryMinus);
                             currentState = STATE_OPERAND_EXPECTED;
                             success = true;
                         }
                         else if (_compiler._lastExtractedLexem.Token == Token.OpenPar)
                         {
-                            _operators.Push(Token.OpenPar);
+                            PushOperator(Token.OpenPar);
                             parCount++;
                             currentState = STATE_UNDEF;
                             success = true;
                         }
                         else if (_compiler._lastExtractedLexem.Token == Token.Not)
                         {
-                            _operators.Push(Token.Not);
+                            PushOperator(Token.Not);
                             currentState = STATE_OPERAND_EXPECTED;
                             success = true;
                         }
@@ -171,9 +172,9 @@

                             if (_operators.Count > 0)
                             {
-                                while ((current = _operators.Pop()) != Token.OpenPar)
+                                while ((current = PopOperator()) != Token.OpenPar)
                                 {
-                                    _compiler.AddCommand(TokenToOperationCode(current), 0);
+                                    AddCommandForToken(current);
                                     if (_operators.Count == 0)
                                     {
                                         throw CompilerException.TokenExpected(Token.OpenPar);
@@ -248,23 +249,16 @@
                 || token == Token.NotEqual;
         }

-        private void UnwindOperators()
-        {
-            while (_operators.Count > 0)
-            {
-                var oper = _operators.Pop();
-                if (oper == Token.OpenPar)
-                    throw CompilerException.ExpressionSyntax();
-
-                _compiler.AddCommand(TokenToOperationCode(oper), 0);
-            }
+        private void AddCommandForToken(Token current)
+        {
+            _compiler.AddCommand(TokenToOperationCode(current), 0);
         }

         private void ProcessExpressionOperator()
         {
             if (_operators.Count == 0)
             {
-                _operators.Push(_compiler._lastExtractedLexem.Token);
+               PushOperator(_compiler._lastExtractedLexem.Token);
                 return;
             }

@@ -276,25 +270,46 @@

                 while (stackPriority >= currentPriority && _operators.Count > 0)
                 {
-                    var stackOp = _operators.Pop();
+                    var stackOp = PopOperator();
                     if (stackOp != Token.OpenPar)
                     {
-                        OperationCode opCode = TokenToOperationCode(stackOp);
-                        _compiler.AddCommand(opCode, 0);
+                        AddCommandForToken(stackOp);
                     }
                     else
                     {
-                        _operators.Push(stackOp);
+                        PushOperator(stackOp);
                         break;
                     }
                 }

-                _operators.Push(_compiler._lastExtractedLexem.Token);
+                PushOperator(_compiler._lastExtractedLexem.Token);

             }
             else
             {
-                _operators.Push(_compiler._lastExtractedLexem.Token);
+               PushOperator(_compiler._lastExtractedLexem.Token);
+            }
+        }
+
+        private void PushOperator(Token token)
+        {
+            _operators.Push(token);
+        }
+
+        private Token PopOperator()
+        {
+            return _operators.Pop();
+        }
+
+        private void UnwindOperators()
+        {
+            while (_operators.Count > 0)
+            {
+                var oper = PopOperator();
+                if (oper == Token.OpenPar)
+                    throw CompilerException.ExpressionSyntax();
+
+                AddCommandForToken(oper);
             }
         }


107.1

--- src/SharpConnect.MySql/0_Public/MySqlClient.cs
+++ src/SharpConnect.MySql/0_Public/MySqlClient.cs
@@ -163,7 +163,7 @@
             }
             else
             {
-                _query = Connection.Conn.CreateQuery(this.CommandText, Parameters);
+                _query = new Query(this.Connection.Conn, this.CommandText, Parameters);
                 var reader = new MySqlDataReader(_query);
                 _query.Execute();
                 return reader;
@@ -177,32 +177,32 @@
             }
             else
             {
-                _query = Connection.Conn.CreateQuery(CommandText, Parameters);
+                _query = new Query(Connection.Conn, CommandText, Parameters);
                 _query.Execute(nextAction);
-            }
-        }
-
-        public uint LastInsertedId
-        {
-            get
-            {
-                return _query.OkPacket.insertId;
-            }
-        }
-        public uint AffectedRows
-        {
-            get
-            {
-                return _query.OkPacket.affectedRows;
             }
         }
         public void Prepare()
         {
             //prepare sql command;
             _isPreparedStmt = true;
-            _query = Connection.Conn.CreateQuery(CommandText, Parameters);
+            _query = new Query(Connection.Conn, CommandText, Parameters);
             _query.Prepare();
         }
+        public uint LastInsertedId
+        {
+            get
+            {
+                return _query.OkPacket.insertId;
+            }
+        }
+        public uint AffectedRows
+        {
+            get
+            {
+                return _query.OkPacket.affectedRows;
+            }
+        }
+
     }

     public class MySqlDataReader


Delete dead Array.Copy code (#3245)

Delete dead Array.Copy code (#3245)

--- src/System.Private.CoreLib/src/System/Array.cs
+++ src/System.Private.CoreLib/src/System/Array.cs
@@ -1167,18 +1167,6 @@
             }
         }

-        // CopyTo copies a collection into an Array, starting at a particular
-        // index into the array.
-        //
-        // This method is to support the ICollection interface, and calls
-        // Array.Copy internally.  If you aren't using ICollection explicitly,
-        // call Array.Copy to avoid an extra indirection.
-        internal void CopyTo<T>(T[] thatArray, int index)
-        {
-            T[] thisArray = (T[])this;
-            Array.Copy(thisArray, 0, thatArray, index, Length);
-        }
-
         public static bool Exists<T>(T[] array, Predicate<T> match)
         {
             return Array.FindIndex(array, match) != -1;


Swapped a variable out in relation to the previous commit. #8

--- src/UWPShoutcastMSS/Parsers/Audio/MP3Parser.cs
+++ src/UWPShoutcastMSS/Parsers/Audio/MP3Parser.cs
@@ -10,13 +10,13 @@
     {
         //Reference: https://www.mp3-tech.org/programmer/frame_header.html

-        public static readonly byte[] FrameSync = new byte[] { (byte)255, (byte)224 }; //12 bits - ADTS sync bits.
+        public static readonly byte[] FrameSync = new byte[] { (byte)255, (byte)7 }; //12 bits - ADTS sync bits.
         public const int HeaderLength = 4;
         //public const int HeaderLengthWithCRC = 9;

         public static bool IsFrameSync(byte firstByte, byte secondByte)
         {
-            return (firstByte == FrameSync[0] && (secondByte >> 5) == (byte)7 && secondByte != (byte)255);
+            return (firstByte == FrameSync[0] && (secondByte >> 5) == FrameSync[1] && secondByte != (byte)255);
         }

         public static double GetMPEGAudioVersion(byte[] header)


Modify ParseInternalLinks to accept null input

--- src/Umbraco.Web/Templates/TemplateUtilities.cs
+++ src/Umbraco.Web/Templates/TemplateUtilities.cs
@@ -7,13 +7,13 @@

 namespace Umbraco.Web.Templates
 {
-	//NOTE: I realize there is only one class in this namespace but I'm pretty positive that there will be more classes in
-	//this namespace once we start migrating and cleaning up more code.
+    //NOTE: I realize there is only one class in this namespace but I'm pretty positive that there will be more classes in
+    //this namespace once we start migrating and cleaning up more code.

-	/// <summary>
-	/// Utility class used for templates
-	/// </summary>
-	public static class TemplateUtilities
+    /// <summary>
+    /// Utility class used for templates
+    /// </summary>
+    public static class TemplateUtilities
 	{
         //TODO: Pass in an Umbraco context!!!!!!!! Don't rely on the singleton so things are more testable
         internal static string ParseInternalLinks(string text, bool preview)
@@ -42,6 +42,9 @@
 	    /// <returns></returns>
 	    public static string ParseInternalLinks(string text)
 		{
+            if (text == null)
+                return "";
+
             //TODO: Pass in an Umbraco context!!!!!!!! Don't rely on the singleton so things are more testable, better yet, pass in urlprovider, routing context, separately

 			//don't attempt to proceed without a context as we cannot lookup urls without one


Remove unused AbpIdentityServerUserClaimsFactory class.

--- src/Abp.ZeroCore.IdentityServer4/IdentityServer4/AbpIdentityServerUserClaimsFactory.cs
+++ src/Abp.ZeroCore.IdentityServer4/IdentityServer4/AbpIdentityServerUserClaimsFactory.cs
@@ -1,39 +0,0 @@
-using System.Linq;
-using System.Security.Claims;
-using System.Threading.Tasks;
-using Abp.Authorization.Roles;
-using Abp.Authorization.Users;
-using Abp.Domain.Uow;
-using Abp.Runtime.Security;
-using Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.Identity;
-using Microsoft.Extensions.Options;
-
-namespace Abp.IdentityServer4
-{
-    public class AbpIdentityServerUserClaimsFactory<TUser, TRole> : UserClaimsPrincipalFactory<TUser, TRole>
-        where TRole : AbpRole<TUser>, new()
-        where TUser : AbpUser<TUser>
-    {
-        public AbpIdentityServerUserClaimsFactory(
-            UserManager<TUser> userManager,
-            RoleManager<TRole> roleManager,
-            IOptions<IdentityOptions> optionsAccessor
-        ) : base(userManager, roleManager, optionsAccessor)
-        {
-        }
-
-        [UnitOfWork]
-        public override async Task<ClaimsPrincipal> CreateAsync(TUser user)
-        {
-            var principal = await base.CreateAsync(user);
-
-            if (user.TenantId.HasValue)
-            {
-                principal.Identities.First().AddClaim(new Claim(AbpClaimTypes.TenantId, user.TenantId.ToString()));
-            }
-
-            return principal;
-        }
-    }
-}


Update tests

Update tests

--- src/Analyzers/CSharp/Tests/UseCompoundAssignment/UseCompoundCoalesceAssignmentTests.cs
+++ src/Analyzers/CSharp/Tests/UseCompoundAssignment/UseCompoundCoalesceAssignmentTests.cs
@@ -3,17 +3,12 @@
 // See the LICENSE file in the project root for more information.

 using System.Threading.Tasks;
-using Microsoft.CodeAnalysis.CodeFixes;
 using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.AddAccessibilityModifiers;
 using Microsoft.CodeAnalysis.CSharp.UseCompoundAssignment;
-using Microsoft.CodeAnalysis.Diagnostics;
-using Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics;
 using Microsoft.CodeAnalysis.Editor.UnitTests.CodeActions;
 using Microsoft.CodeAnalysis.Test.Utilities;
 using Roslyn.Test.Utilities;
 using Xunit;
-using Xunit.Abstractions;

 namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseCompoundAssignment
 {
@@ -23,9 +18,23 @@

     public class UseCompoundCoalesceAssignmentTests
     {
-
-        internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
-            => (new CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer(), new CSharpUseCompoundCoalesceAssignmentCodeFixProvider());
+        private static async Task TestInRegularAndScriptAsync(string testCode, string fixedCode)
+        {
+            await new VerifyCS.Test
+            {
+                TestCode = testCode,
+                FixedCode = fixedCode,
+            }.RunAsync();
+        }
+        private static async Task TestMissingAsync(string testCode, LanguageVersion languageVersion = LanguageVersion.CSharp8)
+        {
+            await new VerifyCS.Test
+            {
+                TestCode = testCode,
+                FixedCode = testCode,
+                LanguageVersion = languageVersion,
+            }.RunAsync();
+        }

         [WorkItem(38059, "https://github.com/dotnet/roslyn/issues/38059")]
         [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseCompoundAssignment)]
@@ -35,7 +44,7 @@
 @"class Program
 {
     private static string s_goo;
-    private static string Goo => s_goo [||]?? (s_goo = new string('c', 42));
+    private static string Goo => s_goo [|??|] (s_goo = new string('c', 42));
 }",
 @"class Program
 {
@@ -52,8 +61,8 @@
 @"class Program
 {
     private static string s_goo;
-    private static string Goo => s_goo [||]?? (s_goo = new string('c', 42));
-}", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_3)));
+    private static string Goo => s_goo ?? (s_goo = new string('c', 42));
+}", LanguageVersion.CSharp7_3);
         }

         [WorkItem(38059, "https://github.com/dotnet/roslyn/issues/38059")]
@@ -64,7 +73,7 @@
 @"class Program
 {
     private static string s_goo;
-    private static string Goo => s_goo [||]?? s_goo = new string('c', 42);
+    private static string Goo => {|CS0131:s_goo ?? s_goo|} = new string('c', 42);
 }");
         }

@@ -76,7 +85,7 @@
 @"class Program
 {
     private static string s_goo;
-    private static string Goo => s_goo [||]?? (s_goo == new string('c', 42));
+    private static string Goo => {|CS0019:s_goo ?? (s_goo == new string('c', 42))|};
 }");
         }

@@ -88,7 +97,7 @@
 @"class Program
 {
     private static string s_goo;
-    private static string Goo => s_goo [||]?? (s_goo ??= new string('c', 42));
+    private static string Goo => s_goo ?? (s_goo ??= new string('c', 42));
 }");
         }

@@ -101,7 +110,7 @@
 {
     private static string s_goo;
     private static string s_goo2;
-    private static string Goo => s_goo [||]?? (s_goo2 = new string('c', 42));
+    private static string Goo => s_goo ?? (s_goo2 = new string('c', 42));
 }");
         }

@@ -113,7 +122,7 @@
 @"class Program
 {
     private static string s_goo;
-    private static string Goo => s_goo.GetType() [||]?? (s_goo.GetType() = new string('c', 42));
+    private static string Goo => s_goo.GetType() ?? ({|CS0131:s_goo.GetType()|} = new string('c', 42));
 }");
         }

@@ -125,7 +134,7 @@
 @"class Program
 {
     private string goo;
-    private string Goo => this.goo [||]?? (this.goo = new string('c', 42));
+    private string Goo => this.goo [|??|] (this.goo = new string('c', 42));
 }",
 @"class Program
 {
@@ -144,7 +153,7 @@
     void Goo()
     {
         int? a = null;
-        var x = a [||]?? (a = 1);
+        var x = a [|??|] (a = 1);
     }
 }",
 @"class Program
@@ -171,7 +180,7 @@
     static void Main()
     {
         int? a = null;
-        M(a [||]?? (a = 1));
+        M(a [|??|] (a = 1));
     }
 }",
 @"using System;
@@ -201,7 +210,7 @@
     static void Main()
     {
         int? a = null;
-        M(a [||]?? (a = 1));
+        M(a [|??|] (a = 1));
     }
 }",
 @"using System;


change IRealServiceProvider to IServiceProvider

--- src/AspectCore.Extensions.DependencyInjection/ActivatorUtilitieInterceptorActivator.cs
+++ src/AspectCore.Extensions.DependencyInjection/ActivatorUtilitieInterceptorActivator.cs
@@ -7,9 +7,9 @@
 {
     internal sealed class ActivatorUtilitieInterceptorActivator : ITypedInterceptorActivator
     {
-        private readonly IRealServiceProvider _serviceProvider;
+        private readonly IServiceProvider _serviceProvider;

-        public ActivatorUtilitieInterceptorActivator(IRealServiceProvider serviceProvider)
+        public ActivatorUtilitieInterceptorActivator(IServiceProvider serviceProvider)
         {
             _serviceProvider = serviceProvider;
         }


Rename

Rename

--- src/EditorFeatures/Core/Wrapping/ChainedExpression/AbstractChainedExpressionWrapper.cs
+++ src/EditorFeatures/Core/Wrapping/ChainedExpression/AbstractChainedExpressionWrapper.cs
@@ -75,7 +75,7 @@
             Document document, int position, SyntaxNode node, CancellationToken cancellationToken)
         {
             // We have to be on a chain part.  If not, there's nothing to do here at all.
-            if (!IsChainPart(node))
+            if (!IsDecomposableChainPart(node))
             {
                 return null;
             }
@@ -83,7 +83,7 @@
             // Has to be the topmost chain part.  If we're not on the topmost, then just
             // bail out here.  Our caller will continue walking upwards until it hits the
             // topmost node.
-            if (IsChainPart(node.Parent))
+            if (IsDecomposableChainPart(node.Parent))
             {
                 return null;
             }
@@ -245,7 +245,7 @@
             return result.ToImmutableAndFree();
         }

-        private bool IsChainPart(SyntaxNode node)
+        private bool IsDecomposableChainPart(SyntaxNode node)
         {
             // This is the effective set of language constructs that can can 'chain'
             // off of a call `.M(...)`.  They are:
@@ -288,7 +288,7 @@

             // We've hit some node that can't be decomposed further (like an argument list,
             // or name node).  Just add directly to the pieces list.
-            if (!IsChainPart(node))
+            if (!IsDecomposableChainPart(node))
             {
                 pieces.Add(node);
                 return;


changed localhost to 127.0.0.1 in prodction code

--- src/Obsidian.Persistence/DependencyInjection/PersistenceServiceCollectionExtensions.cs
+++ src/Obsidian.Persistence/DependencyInjection/PersistenceServiceCollectionExtensions.cs
@@ -15,6 +15,6 @@
         public static IServiceCollection AddMongoRepositories(this IServiceCollection services) =>
             services.AddScoped<IUserRepository, UserMongoRepository>()
                     .AddScoped<IClientRepository, ClientMongoRepository>()
-                    .AddScoped(p => new MongoClient("mongodb://localhost:27017").GetDatabase("Obsidian"));
+                    .AddScoped(p => new MongoClient("mongodb://127.0.0.1:27017").GetDatabase("Obsidian"));
     }
 }


Version bump (closes #68).

Version bump (closes #68).

--- Migrant/Serializer.cs
+++ Migrant/Serializer.cs
@@ -217,7 +217,7 @@
 		private readonly Dictionary<Type, DynamicMethod> readMethodCache;
         private readonly InheritanceAwareList<Delegate> surrogatesForObjects;
         private readonly InheritanceAwareList<Delegate> objectsForSurrogates;
-		private const byte VersionNumber = 1;
+		private const byte VersionNumber = 2;
 		private const byte Magic1 = 0x32;
 		private const byte Magic2 = 0x66;
 		private const byte Magic3 = 0x34;


Perform input validation for the MimeEntity.Content-Id setter

--- MimeKit/MimeEntity.cs
+++ MimeKit/MimeEntity.cs
@@ -101,25 +101,24 @@
 		public string ContentId {
 			get { return contentId; }
 			set {
+				if (value == null)
+					throw new ArgumentNullException ("value");
+
 				if (contentId == value)
 					return;

+				var buffer = Encoding.ASCII.GetBytes (value);
+				InternetAddress addr;
+				int index = 0;
+
+				if (!InternetAddress.TryParse (buffer, ref index, buffer.Length, false, out addr) || !(addr is MailboxAddress))
+					throw new ArgumentException ("Invalid Content-Id format.");
+
+				contentId = "<" + ((MailboxAddress) addr).Address + ">";
+
 				Headers.Changed -= OnHeadersChanged;
-
-				if (value != null) {
-					value = value.Trim ();
-
-					if (value != string.Empty)
-						Headers["Content-Id"] = "<" + value + ">";
-					else
-						Headers["Content-Id"] = string.Empty;
-				} else {
-					Headers.Remove ("Content-Id");
-				}
-
+				Headers["Content-Id"] = contentId;
 				Headers.Changed += OnHeadersChanged;
-				contentId = value;
-				OnChanged ();
 			}
 		}


Cleaned up previous pull request a bit and added some commentary

--- MimeKit/MimeParser.cs
+++ MimeKit/MimeParser.cs
@@ -810,9 +810,25 @@

 			do {
 				if (ReadAhead (inbuf, Math.Max (ReadAheadSize, left), 0) <= left) {
-					// failed to find the end of the headers; EOF reached
-					ParseAndAppendHeader ();
-					state = MimeParserState.Content;
+					// EOF reached before we reached the end of the headers...
+					if (left == 0 && headerIndex == 0) {
+						// the last header we encountered has been parsed cleanly, so try to
+						// fail gracefully by pretending we found the end of the headers...
+						//
+						// For more details, see https://github.com/jstedfast/MimeKit/pull/51
+						state = MimeParserState.Content;
+					} else {
+						// the last header we encountered was truncated - probably best
+						// to error out in this case
+						if (left > 0) {
+							// consume the remaining data
+							AppendRawHeaderData (inputIndex, left);
+							ParseAndAppendHeader ();
+						}
+
+						state = MimeParserState.Error;
+					}
+
 					inputIndex = inputEnd;
 					return;
 				}


Optimization idea that didn't pan out, but may be useful later...

--- MimeKit/MimeParser.cs
+++ MimeKit/MimeParser.cs
@@ -322,9 +322,17 @@

 		static unsafe bool IsMboxMarker (byte* text)
 		{
+#if COMPARE_QWORD
+			const ulong FromMask = 0x000000FFFFFFFFFF;
+			const ulong From     = 0x000000206D6F7246;
+			ulong* qword = (ulong*) text;
+
+			return (*qword & FromMask) == From;
+#else
 			byte* inptr = text;

 			return *inptr++ == (byte) 'F' && *inptr++ == (byte) 'r' && *inptr++ == (byte) 'o' && *inptr++ == (byte) 'm' && *inptr == (byte) ' ';
+#endif
 		}

 		unsafe int StepMboxMarker ()


Cleaned up the quoting code

Cleaned up the quoting code

--- Modules/UserModule.cs
+++ Modules/UserModule.cs
@@ -252,35 +252,12 @@
             await profile.DeleteAsync();
         }

-        [Command("quote"), Summary("Quote a message in current channel. Syntax : !quote messageid")]
-        private async Task QuoteMessage(ulong id)
-        {
-            await Context.Message.DeleteAsync();
-            IMessageChannel channel = Context.Channel;
-            var message = await channel.GetMessageAsync(id);
-            Console.WriteLine($"message {message.Author.Username}  {message.Channel.Name}");
-            var builder = new EmbedBuilder()
-                .WithColor(new Color(200, 128, 128))
-                .WithTimestamp(message.Timestamp)
-                .WithFooter(footer =>
-                {
-                    footer
-                        .WithText($"In channel {message.Channel.Name}");
-                })
-                .WithAuthor(author =>
-                {
-                    author
-                        .WithName(message.Author.Username)
-                        .WithIconUrl(message.Author.GetAvatarUrl());
-                })
-                .AddField("Original message", message.Content.Truncate(1020));
-            var embed = builder.Build();
-            await ReplyAsync("", false, embed);
-        }
-
-        [Command("quote"), Summary("Quote a message. Syntax : !quote #channelname messageid")]
-        private async Task QuoteMessage(IMessageChannel channel, ulong id)
-        {
+        [Command("quote"), Summary("Quote a message. Syntax : !quote messageid #channelname")]
+        private async Task QuoteMessage(ulong id, IMessageChannel channel = null)
+        {
+            // If channel is null use Context.Channel, else use the provided channel
+            channel = channel ?? Context.Channel;
+
             var message = await channel.GetMessageAsync(id);
             var builder = new EmbedBuilder()
                 .WithColor(new Color(200, 128, 128))


Finished adding separators

Finished adding separators

Resolves #24.

--- src/app/Sieve.NET.Core/Sieves/EqualitySieve.cs
+++ src/app/Sieve.NET.Core/Sieves/EqualitySieve.cs
@@ -31,7 +31,7 @@
         public EmptyValuesListBehavior EmptyValuesListBehavior { get; private set; }

         // ReSharper disable once MemberCanBePrivate.Global -- this is public on purpose so that folks can reference it if they need to.
-        public readonly IEnumerable<string> DefaultSeparators = new List<string> { ",", "|" };
+        public readonly IEnumerable<string> DefaultSeparators = new List<string> {",", "|"};

         /// <summary>


Check cancellation after TryRead in ReadAsync

--- src/System.Threading.Tasks.Channels/System/Threading/Tasks/Channels/ReadableChannel.cs
+++ src/System.Threading.Tasks.Channels/System/Threading/Tasks/Channels/ReadableChannel.cs
@@ -43,15 +43,11 @@
         /// <returns>A <see cref="ValueTask{TResult}"/> that represents the asynchronous read operation.</returns>
         public virtual ValueTask<T> ReadAsync(CancellationToken cancellationToken = default(CancellationToken))
         {
-            if (cancellationToken.IsCancellationRequested)
-            {
-                return new ValueTask<T>(Task.FromCanceled<T>(cancellationToken));
-            }
-
             try
             {
-                return TryRead(out T item) ?
-                    new ValueTask<T>(item) :
+                return
+                    TryRead(out T item) ? new ValueTask<T>(item) :
+                    cancellationToken.IsCancellationRequested ? new ValueTask<T>(Task.FromCanceled<T>(cancellationToken)) :
                     ReadAsyncCore(cancellationToken);
             }
             catch (Exception e)


Made the OwnedGeneratedFactory test a bit more complicated, but still passes.

--- src/Test/Autofac.Tests/Features/OwnedInstances/OwnedInstanceRegistrationSourceTests.cs
+++ src/Test/Autofac.Tests/Features/OwnedInstances/OwnedInstanceRegistrationSourceTests.cs
@@ -96,21 +96,28 @@

         public class ClassWithFactory
         {
-            public delegate Owned<ClassWithFactory> OwnedFactory();
+            public string Name { get; set; }
+
+            public delegate Owned<ClassWithFactory> OwnedFactory(string name);
+
+            public ClassWithFactory(string name)
+            {
+                Name = name;
+            }
         }

         [Test]
         public void CanResolveAndUse_OwnedGeneratedFactory()
         {
             var cb = new ContainerBuilder();
-            cb.RegisterType<ClassWithFactory>();
+            cb.Register((c,p) => new ClassWithFactory(p.Named<string>("name")));
             cb.RegisterGeneratedFactory<ClassWithFactory.OwnedFactory>();
-            var c = cb.Build();
-            var factory = c.Resolve<ClassWithFactory.OwnedFactory>();
+            var container = cb.Build();
+            var factory = container.Resolve<ClassWithFactory.OwnedFactory>();
             bool isAccessed;
-            using(var owner = factory())
+            using(var owner = factory("test"))
             {
-                Assert.IsInstanceOf<ClassWithFactory>(owner.Value);
+                Assert.AreEqual("test", owner.Value.Name);
                 isAccessed = true;
             }
             Assert.IsTrue(isAccessed);


Add info how many files are in the folder and how many more to read there.

--- riddisk-konsole/Main.cs
+++ riddisk-konsole/Main.cs
@@ -29,7 +29,7 @@
 				Console.WriteLine ("Files with restricted access:");
 				foreach (string s in log) {
 					Console.WriteLine (s);
-				}
+				}
 			}
 		}

@@ -133,18 +133,28 @@

 			if (files != null)
 			{
-				foreach (System.IO.FileInfo fi in files)
-				{
+
+                Console.Write (String.Format ("{0}/{1} files", 0, files.Length));
+
+                for (int i = 0; i < files.Length; ++i)
+				{
+                    System.IO.FileInfo fi = files[i];
+
 					// If not following symbolic links & finding symbolic link: omit!
 					if (!followSymbolicLinks && IsReparsePoint(fi.FullName))
 					{
 						continue;
 					}

+                    // Reading.
 					try
 					{
 						Stream stream = new System.IO.FileStream(fi.FullName, FileMode.Open, FileAccess.Read);
 						stream.CopyTo(Stream.Null);
+
+                        // going back to the beginning of line.
+                        Console.CursorLeft = 0;
+                        Console.Write (String.Format ("{0}/{1} files", i+1, files.Length));
 					}
 					catch (IOException ioe)
 					{
@@ -157,6 +167,9 @@
 						log.Add (uae.Message);
 					}
 				}
+
+                // Overwrite line with count of files ;)
+                Console.CursorLeft = 0;

 				// Now find all the subdirectories under this directory.
 				subDirs = root.GetDirectories();


fix - Per la presa in carico non viene visualizzata la creazione della telefonata

--- src/backend/SO115App.Models/Servizi/CustomMapper/MapperRichiestaAssistenzaSuSintesi.cs
+++ src/backend/SO115App.Models/Servizi/CustomMapper/MapperRichiestaAssistenzaSuSintesi.cs
@@ -2,6 +2,7 @@
 using SO115App.API.Models.Classi.Condivise;
 using SO115App.API.Models.Classi.Soccorso;
 using SO115App.API.Models.Classi.Soccorso.Eventi;
+using SO115App.API.Models.Classi.Soccorso.Eventi.Segnalazioni;
 using SO115App.API.Models.Servizi.CQRS.Queries.GestioneSoccorso.Shared.SintesiRichiestaAssistenza;
 using SO115App.Models.Classi.Soccorso;
 using SO115App.Models.Servizi.Infrastruttura.GestioneSoccorso.GestioneTipologie;
@@ -58,29 +59,32 @@
             {
                 foreach (var evento in richiesta.Eventi)
                 {
-                    var utente = _getUtenteById.GetUtenteByCodice(evento.CodiceFonte);
+                    if (evento! is Telefonata)
+                    {
+                        var utente = _getUtenteById.GetUtenteByCodice(evento.CodiceFonte);

-                    AttivitaUtente attivita = new AttivitaUtente()
-                    {
-                        Nominativo = utente.Nome + " " + utente.Cognome,
-                        DataInizioAttivita = evento.Istante,
-                        IdUtente = evento.CodiceFonte
-                    };
+                        AttivitaUtente attivita = new AttivitaUtente()
+                        {
+                            Nominativo = utente.Nome + " " + utente.Cognome,
+                            DataInizioAttivita = evento.Istante,
+                            IdUtente = evento.CodiceFonte
+                        };

-                    if (evento is AnnullamentoPresaInCarico)
-                    {
-                        var attivitaToDelete = ListaAttivita.Where(x => x.Nominativo.Equals(attivita.Nominativo)).ToList();
-                        ListaAttivita.Remove(attivitaToDelete[0]);
-                    }
-                    else if (ListaAttivita.Where(x => x.Nominativo.Equals(attivita.Nominativo) && x.DataInizioAttivita <= attivita.DataInizioAttivita).ToList().Count > 0)
-                    {
-                        var attivitaToDelete = ListaAttivita.Where(x => x.Nominativo.Equals(attivita.Nominativo) && x.DataInizioAttivita <= attivita.DataInizioAttivita).ToList();
-                        ListaAttivita.Remove(attivitaToDelete[0]);
-                        ListaAttivita.Add(attivita);
-                    }
-                    else
-                    {
-                        ListaAttivita.Add(attivita);
+                        if (evento is AnnullamentoPresaInCarico)
+                        {
+                            var attivitaToDelete = ListaAttivita.Where(x => x.Nominativo.Equals(attivita.Nominativo)).ToList();
+                            ListaAttivita.Remove(attivitaToDelete[0]);
+                        }
+                        else if (ListaAttivita.Where(x => x.Nominativo.Equals(attivita.Nominativo) && x.DataInizioAttivita <= attivita.DataInizioAttivita).ToList().Count > 0)
+                        {
+                            var attivitaToDelete = ListaAttivita.Where(x => x.Nominativo.Equals(attivita.Nominativo) && x.DataInizioAttivita <= attivita.DataInizioAttivita).ToList();
+                            ListaAttivita.Remove(attivitaToDelete[0]);
+                            ListaAttivita.Add(attivita);
+                        }
+                        else
+                        {
+                            ListaAttivita.Add(attivita);
+                        }
                     }
                 }
             }


Used Configuration.Formatters.JsonFormatter.

--- src/Abp.Web.Api/WebApi/Controllers/ResultWrapperHandler.cs
+++ src/Abp.Web.Api/WebApi/Controllers/ResultWrapperHandler.cs
@@ -4,6 +4,7 @@
 using System.Web.Http;
 using Abp.Dependency;
 using Abp.Web.Models;
+using Abp.WebApi.Configuration;

 namespace Abp.WebApi.Controllers
 {
@@ -12,6 +13,13 @@
     /// </summary>
     public class ResultWrapperHandler : DelegatingHandler, ITransientDependency
     {
+        private readonly IAbpWebApiModuleConfiguration _webApiModuleConfiguration;
+
+        public ResultWrapperHandler(IAbpWebApiModuleConfiguration webApiModuleConfiguration)
+        {
+            _webApiModuleConfiguration = webApiModuleConfiguration;
+        }
+
         protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
         {
             return base.SendAsync(request, cancellationToken).ContinueWith(
@@ -47,8 +55,8 @@
             {
                 response.Content = new ObjectContent<AjaxResponse>(
                     new AjaxResponse(),
-                    GlobalConfiguration.Configuration.Formatters[0]
-                    ); //TODO: change GlobalConfiguration.Configuration.Formatters[0] !!!
+                    _webApiModuleConfiguration.HttpConfiguration.Formatters.JsonFormatter
+                    );
             }

             if (resultObject is AjaxResponse)
@@ -58,8 +66,8 @@

             response.Content = new ObjectContent<AjaxResponse>(
                 new AjaxResponse(resultObject),
-                GlobalConfiguration.Configuration.Formatters[0]
-                ); //TODO: change GlobalConfiguration.Configuration.Formatters[0] !!!
+                _webApiModuleConfiguration.HttpConfiguration.Formatters.JsonFormatter
+                );
         }
     }
 }


Return Task.CompletedTask instead of null

--- src/AngleSharp/Io/Processors/StyleSheetRequestProcessor.cs
+++ src/AngleSharp/Io/Processors/StyleSheetRequestProcessor.cs
@@ -60,7 +60,7 @@
                 return FinishDownloadAsync();
             }

-            return null;
+            return Task.CompletedTask;
         }

         protected override async Task ProcessResponseAsync(IResponse response)


Fixed naming of parameter, IsRequired -> isRequired

--- src/AtleX.CommandLineArguments/Help/ArgumentHelpDetails.cs
+++ src/AtleX.CommandLineArguments/Help/ArgumentHelpDetails.cs
@@ -44,17 +44,17 @@
     /// <param name="description">
     /// The description text of the argument
     /// </param>
-    /// <param name="IsRequired">
+    /// <param name="isRequired">
     /// True when the argument is required, false otherwise
     /// </param>
-    public ArgumentHelpDetails(string argumentName, string description, bool IsRequired)
+    public ArgumentHelpDetails(string argumentName, string description, bool isRequired)
     {
       if (string.IsNullOrWhiteSpace(argumentName))
         throw new ArgumentNullException(nameof(argumentName));

       this.Argument = argumentName;
       this.Description = description ?? throw new ArgumentNullException(nameof(description));
-      this.IsRequired = IsRequired;
+      this.IsRequired = isRequired;
     }
   }
 }


Respect CanScrollHorizontally in Arrange.

Fixes #1065

--- src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs
+++ src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs
@@ -217,8 +217,11 @@
                 if (child != null)
                 {
                     var size = new Size(
-                        Math.Max(finalSize.Width, child.DesiredSize.Width),
+                        CanScrollHorizontally ?
+                            Math.Max(finalSize.Width, child.DesiredSize.Width) :
+                            Math.Min(finalSize.Width, child.DesiredSize.Width),
                         Math.Max(finalSize.Height, child.DesiredSize.Height));
+
                     child.Arrange(new Rect((Point)(-Offset), size));
                     return finalSize;
                 }


Serializer hardening

Serializer hardening

--- src/Backend.Fx/ConfigurationSettings/ISettingSerializer.cs
+++ src/Backend.Fx/ConfigurationSettings/ISettingSerializer.cs
@@ -32,12 +32,12 @@
     {
         public string Serialize(int? setting)
         {
-            return setting?.ToString();
+            return setting?.ToString(CultureInfo.InvariantCulture);
         }

         public int? Deserialize(string value)
         {
-            return string.IsNullOrWhiteSpace(value) ? (int?)null : int.Parse(value);
+            return string.IsNullOrWhiteSpace(value) ? (int?)null : int.Parse(value, CultureInfo.InvariantCulture);
         }
     }

@@ -74,7 +74,7 @@
     {
         public string Serialize(DateTime? setting)
         {
-            return setting?.ToString("r", CultureInfo.InvariantCulture);
+            return setting?.ToString("O", CultureInfo.InvariantCulture);
         }

         public DateTime? Deserialize(string value)


Changed Project Details page to a two column layout.

--- src/CompetitionPlatform/Views/Project/ProjectDetails.cshtml
+++ src/CompetitionPlatform/Views/Project/ProjectDetails.cshtml
@@ -6,113 +6,123 @@
 }

  Back to Projects
+

+
@Model.Name

+

+

-
@Model.Name

-
-

-    $@Model.BudgetFirstPlace
-
1st PLACE

-

+

+                $@Model.BudgetFirstPlace
+
1st PLACE

+

-@if (Model.BudgetSecondPlace != null)
-{
-

-        $@Model.BudgetSecondPlace
-
2nd PLACE

-

-}
-@if (Model.BudgetThirdPlace != null)
-{
-

-        $@Model.BudgetThirdPlace
-
3rd PLACE

-

-}
+            @if (Model.BudgetSecondPlace != null)
+            {
+

+                    $@Model.BudgetSecondPlace
+
2nd PLACE

+

+            }
+            @if (Model.BudgetThirdPlace != null)
+            {
+

+                    $@Model.BudgetThirdPlace
+
3rd PLACE

+

+            }

-

-    @{ int completion;}
+

+                @{ int completion;}

-    @switch (Model.Status)
-    {
-        case Status.Initiative:
-            completion = 20;
-            break;
-        case Status.CompetitionRegistration:
-            completion = 40;
-            break;
-        case Status.Implementation:
-            completion = 60;
-            break;
-        case Status.Voting:
-            completion = 80;
-            break;
-        case Status.Archive:
-            completion = 100;
-            break;
-        default:
-            completion = 0;
-            break;
-    }
+                @switch (Model.Status)
+                {
+                    case Status.Initiative:
+                        completion = 20;
+                        break;
+                    case Status.CompetitionRegistration:
+                        completion = 40;
+                        break;
+                    case Status.Implementation:
+                        completion = 60;
+                        break;
+                    case Status.Voting:
+                        completion = 80;
+                        break;
+                    case Status.Archive:
+                        completion = 100;
+                        break;
+                    default:
+                        completion = 0;
+                        break;
+                }

-

-        @Model.Status
+

+                    @Model.Status
+

+

+
+

+
Tags

+

+                    @if (Model.Categories != null)
+                    {
+                        foreach (var category in Model.Categories)
+                        {
+                            @category
+                        }
+                    }
+

+

+
+

+
Info

+
Participants

+
Comments @Model.CommentsPartial.Comments.Count()

+
Results

+

+
+

+

+                    @Model.Description
+                    @if (Model.FileInfo != null)
+                    {
+

+

+
+

+

+
@Model.FileInfo.FileName

+                                Download
+

+

+                    }
+

+
....

+

+                    @await Html.PartialAsync("CommentsPartial", Model.CommentsPartial)
+

+
....

+

+

+
+

+

+

+                    Category: @Model.Category
+

+

+
+

+

+                    Created: @Model.Created.ToString("MMMM dd, yyyy")
+

+
+                @*

+                    @Model.Created.ToString("MMMM dd, yyyy")
+
*@
+

+

-

-
Tags

-

-        @if (Model.Categories != null)
-        {
-            foreach (var category in Model.Categories)
-            {
-                @category
-            }
-        }
-

-

-
-

-
Category

-

-        @Model.Category
-

-

-
-

-
Created

-

-        @Model.Created.ToString("MMMM dd, yyyy")
-

-

-
-

-
Info

-
Participants

-
Comments @Model.CommentsPartial.Comments.Count()

-
Results

-

-
-

-

-        @Model.Description
-        @if (Model.FileInfo != null)
-        {
-

-

-
-

-

-
@Model.FileInfo.FileName

-                    Download
-

-

-        }
-

-
....

-

-        @await Html.PartialAsync("CommentsPartial", Model.CommentsPartial)
-

-
....

-


Add AnonymousTypeMetadataOrder test

Add AnonymousTypeMetadataOrder test

--- src/Compilers/CSharp/Test/Emit/Emit/CompilationEmitTests.cs
+++ src/Compilers/CSharp/Test/Emit/Emit/CompilationEmitTests.cs
@@ -2772,5 +2772,45 @@
             comp3.VerifyDiagnostics();
             CompileAndVerify(comp3, emitOptions: TestEmitters.RefEmitBug, expectedOutput: "Hello, world!");
         }
+
+        /// <summary>
+        /// Ordering of anonymous type definitions
+        /// in metadata should be deterministic.
+        /// </summary>
+        [Fact]
+        public void AnonymousTypeMetadataOrder()
+        {
+            var source =
+@"class C
+{
+    static void M()
+    {
+        var _1 = new { A = 1, B = 2 };
+        var _2 = new { a = 3, b = 4 };
+        var _3 = new { a = 1, B = 2 };
+        var _4 = new { AB = 3 };
+        var _5 = new { a = 1, B = 2 };
+        var _6 = new { Ab = 5 };
+    }
+}";
+            var compilation = CreateCompilationWithMscorlib(source, options: TestOptions.ReleaseDll);
+            var bytes = compilation.EmitToArray();
+            using (var metadata = ModuleMetadata.CreateFromImage(bytes))
+            {
+                var reader = metadata.MetadataReader;
+                var actualNames = reader.GetTypeDefNames().Select(h => reader.GetString(h));
+                var expectedNames = new[]
+                    {
+                        "<Module>",
+                        "<>f__AnonymousType2`2",
+                        "<>f__AnonymousType1`2",
+                        "<>f__AnonymousType0`2",
+                        "<>f__AnonymousType4`1",
+                        "<>f__AnonymousType3`1",
+                        "C",
+                    };
+                AssertEx.Equal(expectedNames, actualNames);
+            }
+        }
     }
 }


Records: inheritance of members (tests only) (#44595)

--- src/Compilers/CSharp/Test/Semantic/Semantics/RecordTests.cs
+++ src/Compilers/CSharp/Test/Semantic/Semantics/RecordTests.cs
@@ -1,14 +1,17 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.

 #nullable enable

 using System.Collections.Generic;
+using System.Collections.Immutable;
 using System.Linq;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
 using Microsoft.CodeAnalysis.CSharp.Syntax;
 using Microsoft.CodeAnalysis.CSharp.Test.Utilities;
 using Microsoft.CodeAnalysis.Test.Utilities;
+using Roslyn.Test.Utilities;
 using Xunit;

 namespace Microsoft.CodeAnalysis.CSharp.UnitTests.Semantics
@@ -1500,5 +1503,356 @@
                 Diagnostic(ErrorCode.ERR_EOFExpected, "}").WithLocation(11, 1)
             );
         }
-    }
-}+
+        [Fact]
+        public void Inheritance_01()
+        {
+            var source =
+@"class A
+{
+    internal A() { }
+    public object P1 { get; set; }
+    internal object P2 { get; set; }
+    protected internal object P3 { get; set; }
+    protected object P4 { get; set; }
+    private protected object P5 { get; set; }
+    private object P6 { get; set; }
+}
+data class B(object P1, object P2, object P3, object P4, object P5, object P6) : A
+{
+}";
+            var comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview);
+            comp.VerifyDiagnostics();
+            var actualMembers = GetProperties(comp, "B").ToTestDisplayStrings();
+            var expectedMembers = new[]
+            {
+                "System.Object B.P1 { get; }",
+                "System.Object B.P2 { get; }",
+                "System.Object B.P3 { get; }",
+                "System.Object B.P4 { get; }",
+                "System.Object B.P5 { get; }",
+                "System.Object B.P6 { get; }",
+            };
+            AssertEx.Equal(expectedMembers, actualMembers);
+        }
+
+        [Fact]
+        public void Inheritance_02()
+        {
+            var source =
+@"class A
+{
+    internal A() { }
+    private protected object P1 { get; set; }
+    private object P2 { get; set; }
+    private data class B(object P1, object P2) : A
+    {
+    }
+}";
+            var comp = CreateCompilation(source, parseOptions: TestOptions.RegularPreview);
+            comp.VerifyDiagnostics();
+            var actualMembers = GetProperties(comp, "A.B").ToTestDisplayStrings();
+            var expectedMembers = new[]
+            {
+                "System.Object A.B.P1 { get; }",
+                "System.Object A.B.P2 { get; }",
+            };
+            AssertEx.Equal(expectedMembers, actualMembers);
+        }
+
+        [Theory]
+        [InlineData(false)]
+        [InlineData(true)]
+        public void Inheritance_03(bool useCompilationReference)
+        {
+            var sourceA =
+@"public class A
+{
+    public A() { }
+    internal object P { get; set; }
+}
+data class B1(object P) : A
+{
+}";
+            var comp = CreateCompilation(sourceA);
+            AssertEx.Equal(new[] { "System.Object B1.P { get; }" }, GetProperties(comp, "B1").ToTestDisplayStrings());
+            var refA = useCompilationReference ? comp.ToMetadataReference() : comp.EmitToImageReference();
+
+            var sourceB =
+@"data class B2(object P) : A
+{
+}";
+            comp = CreateCompilation(sourceB, references: new[] { refA }, parseOptions: TestOptions.RegularPreview);
+            comp.VerifyDiagnostics();
+            AssertEx.Equal(new[] { "System.Object B2.P { get; }" }, GetProperties(comp, "B2").ToTestDisplayStrings());
+        }
+
+        [Fact]
+        public void Inheritance_04()
+        {
+            var source =
+@"class A
+{
+    internal A() { }
+    public object P1 { get { return null; } set { } }
+    public object P2 { get; init; }
+    public object P3 { get; }
+    public object P4 { set { } }
+    public virtual object P5 { get; set; }
+    public static object P6 { get; set; }
+    public ref object P7 => throw null;
+}
+data class B(object P1, object P2, object P3, object P4, object P5, object P6, object P7) : A
+{
+}";
+            var comp = CreateCompilation(new[] { source, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview);
+            comp.VerifyDiagnostics();
+            var actualMembers = GetProperties(comp, "B").ToTestDisplayStrings();
+            var expectedMembers = new[]
+            {
+                "System.Object B.P1 { get; }",
+                "System.Object B.P2 { get; }",
+                "System.Object B.P3 { get; }",
+                "System.Object B.P4 { get; }",
+                "System.Object B.P5 { get; }",
+                "System.Object B.P6 { get; }",
+                "System.Object B.P7 { get; }",
+            };
+            AssertEx.Equal(expectedMembers, actualMembers);
+        }
+
+        [Fact]
+        public void Inheritance_05()
+        {
+            var source =
+@"class A
+{
+    internal A() { }
+    public object P1 { get; set; }
+    public int P2 { get; set; }
+}
+data class B(int P1, object P2) : A
+{
+}";
+            var comp = CreateCompilation(new[] { source, IsExternalInitTypeDefinition }, parseOptions: TestOptions.RegularPreview);
+            comp.VerifyDiagnostics();
+            var actualMembers = GetProperties(comp, "B").ToTestDisplayStrings();
+            var expectedMembers = new[]
+            {
+                "System.Int32 B.P1 { get; }",
+                "System.Object B.P2 { get; }",
+            };
+            AssertEx.Equal(expectedMembers, actualMembers);
+        }
+
+        [Fact]
+        public void Inheritance_06()
+        {
+            var source =
+@"class A
+{
+    internal int X { get; set; }
+    internal int Y { set { } }
+    internal int Z;
+}
+data class B(int X, int Y, int Z) : A
+{
+}
+class Program
+{
+    static void Main()
+    {
+        var b = new B(1, 2, 3);
+        b.X = 4;
+        b.Y = 5;
+        b.Z = 6;
+        ((A)b).X = 7;
+        ((A)b).Y = 8;
+        ((A)b).Z = 9;
+    }
+}";
+            var comp = CreateCompilation(source);
+            comp.VerifyDiagnostics(
+                // (15,9): error CS0200: Property or indexer 'B.X' cannot be assigned to -- it is read only
+                //         b.X = 4;
+                Diagnostic(ErrorCode.ERR_AssgReadonlyProp, "b.X").WithArguments("B.X").WithLocation(15, 9),
+                // (16,9): error CS0200: Property or indexer 'B.Y' cannot be assigned to -- it is read only
+                //         b.Y = 5;
+                Diagnostic(ErrorCode.ERR_AssgReadonlyProp, "b.Y").WithArguments("B.Y").WithLocation(16, 9),
+                // (17,9): error CS0200: Property or indexer 'B.Z' cannot be assigned to -- it is read only
+                //         b.Z = 6;
+                Diagnostic(ErrorCode.ERR_AssgReadonlyProp, "b.Z").WithArguments("B.Z").WithLocation(17, 9));
+        }
+
+        [Fact]
+        public void Inheritance_07()
+        {
+            var source =
+@"abstract class A
+{
+    public abstract int X { get; }
+    public virtual int Y { get; }
+}
+data class B(int X, int Y) : A
+{
+}";
+            var comp = CreateCompilation(source);
+            comp.VerifyDiagnostics(
+                // (6,12): error CS0534: 'B' does not implement inherited abstract member 'A.X.get'
+                // data class B(int X, int Y) : A
+                Diagnostic(ErrorCode.ERR_UnimplementedAbstractMethod, "B").WithArguments("B", "A.X.get").WithLocation(6, 12));
+        }
+
+        [Fact]
+        public void Inheritance_08()
+        {
+            var source =
+@"using System;
+interface IA
+{
+    int X { get; }
+}
+interface IB
+{
+    int Y { get; }
+}
+data class C(int X, int Y) : IA, IB
+{
+}
+data struct S(int X, int Y) : IA, IB
+{
+}
+class Program
+{
+    static void Main()
+    {
+        var c = new C(1, 2);
+        Console.WriteLine(""{0}, {1}"", c.X, c.Y);
+        Console.WriteLine(""{0}, {1}"", ((IA)c).X, ((IB)c).Y);
+        var s = new S(3, 4);
+        Console.WriteLine(""{0}, {1}"", s.X, s.Y);
+        Console.WriteLine(""{0}, {1}"", ((IA)s).X, ((IB)s).Y);
+    }
+}";
+            CompileAndVerify(source, expectedOutput:
+@"1, 2
+1, 2
+3, 4
+3, 4");
+        }
+
+        [Fact]
+        public void Inheritance_09()
+        {
+            var source =
+@"interface IA
+{
+    int X { get; }
+}
+interface IB
+{
+    object Y { get; set; }
+}
+data class C(object X, object Y) : IA, IB
+{
+}
+data struct S(object X, object Y) : IA, IB
+{
+}";
+            var comp = CreateCompilation(source);
+            comp.VerifyDiagnostics(
+                // (9,36): error CS0738: 'C' does not implement interface member 'IA.X'. 'C.X' cannot implement 'IA.X' because it does not have the matching return type of 'int'.
+                // data class C(object X, object Y) : IA, IB
+                Diagnostic(ErrorCode.ERR_CloseUnimplementedInterfaceMemberWrongReturnType, "IA").WithArguments("C", "IA.X", "C.X", "int").WithLocation(9, 36),
+                // (9,40): error CS0535: 'C' does not implement interface member 'IB.Y.set'
+                // data class C(object X, object Y) : IA, IB
+                Diagnostic(ErrorCode.ERR_UnimplementedInterfaceMember, "IB").WithArguments("C", "IB.Y.set").WithLocation(9, 40),
+                // (12,37): error CS0738: 'S' does not implement interface member 'IA.X'. 'S.X' cannot implement 'IA.X' because it does not have the matching return type of 'int'.
+                // data struct S(object X, object Y) : IA, IB
+                Diagnostic(ErrorCode.ERR_CloseUnimplementedInterfaceMemberWrongReturnType, "IA").WithArguments("S", "IA.X", "S.X", "int").WithLocation(12, 37),
+                // (12,41): error CS0535: 'S' does not implement interface member 'IB.Y.set'
+                // data struct S(object X, object Y) : IA, IB
+                Diagnostic(ErrorCode.ERR_UnimplementedInterfaceMember, "IB").WithArguments("S", "IB.Y.set").WithLocation(12, 41));
+        }
+
+        [Fact]
+        public void Overrides_01()
+        {
+            var source =
+@"class A
+{
+    public sealed override bool Equals(object other) => false;
+    public sealed override int GetHashCode() => 0;
+    public sealed override string ToString() => null;
+}
+data class B(int X, int Y) : A
+{
+}";
+            var comp = CreateCompilation(source);
+            comp.VerifyDiagnostics(
+                // (7,12): error CS0239: 'B.GetHashCode()': cannot override inherited member 'A.GetHashCode()' because it is sealed
+                // data class B(int X, int Y) : A
+                Diagnostic(ErrorCode.ERR_CantOverrideSealed, "B").WithArguments("B.GetHashCode()", "A.GetHashCode()").WithLocation(7, 12),
+                // (7,12): error CS0239: 'B.Equals(object?)': cannot override inherited member 'A.Equals(object)' because it is sealed
+                // data class B(int X, int Y) : A
+                Diagnostic(ErrorCode.ERR_CantOverrideSealed, "B").WithArguments("B.Equals(object?)", "A.Equals(object)").WithLocation(7, 12));
+
+            var actualMembers = comp.GetMember<NamedTypeSymbol>("B").GetMembers().ToTestDisplayStrings();
+            var expectedMembers = new[]
+            {
+                "System.Int32 B.<X>k__BackingField",
+                "System.Int32 B.X.get",
+                "System.Int32 B.X { get; }",
+                "System.Int32 B.<Y>k__BackingField",
+                "System.Int32 B.Y.get",
+                "System.Int32 B.Y { get; }",
+                "System.Boolean B.Equals(B? )",
+                "System.Boolean B.Equals(System.Object? )",
+                "System.Int32 B.GetHashCode()",
+                "B..ctor(System.Int32 X, System.Int32 Y)"
+            };
+            AssertEx.Equal(expectedMembers, actualMembers);
+        }
+
+        [Fact]
+        public void Overrides_02()
+        {
+            var source =
+@"abstract class A
+{
+    public abstract override bool Equals(object other);
+    public abstract override int GetHashCode();
+    public abstract override string ToString();
+}
+data class B(int X, int Y) : A
+{
+}";
+            var comp = CreateCompilation(source);
+            comp.VerifyDiagnostics(
+                // (7,12): error CS0534: 'B' does not implement inherited abstract member 'A.ToString()'
+                // data class B(int X, int Y) : A
+                Diagnostic(ErrorCode.ERR_UnimplementedAbstractMethod, "B").WithArguments("B", "A.ToString()").WithLocation(7, 12));
+
+            var actualMembers = comp.GetMember<NamedTypeSymbol>("B").GetMembers().ToTestDisplayStrings();
+            var expectedMembers = new[]
+            {
+                "System.Int32 B.<X>k__BackingField",
+                "System.Int32 B.X.get",
+                "System.Int32 B.X { get; }",
+                "System.Int32 B.<Y>k__BackingField",
+                "System.Int32 B.Y.get",
+                "System.Int32 B.Y { get; }",
+                "System.Boolean B.Equals(B? )",
+                "System.Boolean B.Equals(System.Object? )",
+                "System.Int32 B.GetHashCode()",
+                "B..ctor(System.Int32 X, System.Int32 Y)"
+            };
+            AssertEx.Equal(expectedMembers, actualMembers);
+        }
+
+        private static ImmutableArray<Symbol> GetProperties(CSharpCompilation comp, string typeName)
+        {
+            return comp.GetMember<NamedTypeSymbol>(typeName).GetMembers().WhereAsArray(m => m.Kind == SymbolKind.Property);
+        }
+    }
+}


Split first name and last name in accounts popup

--- src/Domain/Accounts/code/Views/Accounts/AccountsMenu.cshtml
+++ src/Domain/Accounts/code/Views/Accounts/AccountsMenu.cshtml
@@ -1,58 +1,59 @@
-@using Habitat.Accounts
-@using Habitat.Accounts.Models
-@using Habitat.Accounts.Services
-@using Habitat.Accounts.Texts
-@model Sitecore.Mvc.Presentation.RenderingModel
-

-
-
-
-

-        @if (!(Sitecore.Context.IsLoggedIn && Sitecore.Context.PageMode.IsNormal))
-        {
-

-            Login
-

-

-                Register
-

-        }
-        else
-        {
-

+@using Habitat.Accounts
+@using Habitat.Accounts.Models
+@using Habitat.Accounts.Services
+@using Habitat.Accounts.Texts
+@model Sitecore.Mvc.Presentation.RenderingModel
+

+
+
+
+

+        @if (!(Sitecore.Context.IsLoggedIn && Sitecore.Context.PageMode.IsNormal))
+        {
+

+            Login
+

+

+            Register
+

+        }
+        else
+        {
+

                     @if (!String.IsNullOrEmpty(Sitecore.Context.User.Profile.FullName))
                     {
-
@Captions.Name

-
@Sitecore.Context.User.Profile.FullName

+
@Captions.Name

+
@Sitecore.Context.User.Profile["FirstName"]
@Sitecore.Context.User.Profile["LastName"]

+
                     }

@Captions.Email

@Sitecore.Context.User.Profile.Email

-

-                @Captions.EditDetails
-

-

-

-                @using (Html.BeginForm("Logout", "Accounts", FormMethod.Post))
-                {
-                <input type="submit" value="@Captions.Logout" />
-                }
-

-        }
-

-

-
-

-

-        <form class="modal-content">
-

-                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    ×
-                </button>
-
@Captions.Login

-

-            @Html.Partial("../Accounts/LoginDialog", new LoginInfo())
-        </form>
-

+

+                @Captions.EditDetails
+

+

+

+            @using (Html.BeginForm("Logout", "Accounts", FormMethod.Post))
+            {
+            <input type="submit" value="@Captions.Logout" />
+            }
+

+        }
+

+

+
+

+

+        <form class="modal-content">
+

+                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                    ×
+                </button>
+
@Captions.Login

+

+            @Html.Partial("../Accounts/LoginDialog", new LoginInfo())
+        </form>
+


Added removing of timed out operations to EventStoreConnection back.

--- src/EventStore/EventStore.ClientAPI/EventStoreConnection.cs
+++ src/EventStore/EventStore.ClientAPI/EventStoreConnection.cs
@@ -689,7 +689,7 @@
                         var lastUpdated = new DateTime(Interlocked.Read(ref workerItem.LastUpdatedTicks));
                         if (now - lastUpdated > OperationTimeout)
                         {
-                            Console.WriteLine(workerItem.Operation.CorrelationId);
+                            Console.WriteLine("Timed out, corrId: {0}.", workerItem.Operation.CorrelationId);
                             //Debugger.Break();
                             if (lastUpdated >= _lastReconnectionTimestamp)
                             {
@@ -699,11 +699,11 @@
                                                         lastUpdated,
                                                         _lastReconnectionTimestamp,
                                                         now);
-//                                if (TryRemoveWorkItem(workerItem))
-//                                {
-//                                    _log.Error(err);
-//                                    workerItem.Operation.Fail(new OperationTimedOutException(err));
-//                                }
+                                if (TryRemoveWorkItem(workerItem))
+                                {
+                                    _log.Error(err);
+                                    workerItem.Operation.Fail(new OperationTimedOutException(err));
+                                }
                                 _log.Error(err);
                             }
                             else


Remove deprecated test from ConsoleListenerTests: the behavior under test is better covered already by ExecutionSummaryTests, as ConsoleListener is no longer directly responsible for the behavior.

--- src/Fixie.Tests/Execution/Listeners/ConsoleListenerTests.cs
+++ src/Fixie.Tests/Execution/Listeners/ConsoleListenerTests.cs
@@ -48,47 +48,6 @@
             }
         }

-        public void ShouldNotReportSkipCountsWhenZeroTestsHaveBeenSkipped()
-        {
-            using (var console = new RedirectedConsole())
-            {
-                var listener = new ConsoleListener();
-                var convention = SampleTestClassConvention.Build();
-
-                convention
-                    .Methods
-                    .Where(method => !method.Has<SkipAttribute>());
-
-                typeof(SampleTestClass).Run(listener, convention);
-
-                var testClass = FullName<SampleTestClass>();
-
-                console.Lines()
-                       .Select(CleanBrittleValues)
-                       .ShouldEqual(
-                           "------ Testing Assembly Fixie.Tests.dll ------",
-                           "",
-                           "Console.Out: Fail",
-                           "Console.Error: Fail",
-                           "Console.Out: FailByAssertion",
-                           "Console.Error: FailByAssertion",
-                           "Console.Out: Pass",
-                           "Console.Error: Pass",
-
-                           "Test '" + testClass + ".Fail' failed: Fixie.Tests.FailureException",
-                           "'Fail' failed!",
-                           At<SampleTestClass>("Fail()"),
-                           "",
-                           "Test '" + testClass + ".FailByAssertion' failed: Should.Core.Exceptions.EqualException",
-                           "Assert.Equal() Failure",
-                           "Expected: 2",
-                           "Actual:   1",
-                           At<SampleTestClass>("FailByAssertion()"),
-                           "",
-                           "1 passed, 2 failed, took 1.23 seconds (" + Framework.Version + ").");
-            }
-        }
-
         static string CleanBrittleValues(string actualRawContent)
         {
             //Avoid brittle assertion introduced by test duration.


Decouple UI logic from backend

Decouple UI logic from backend

--- src/GitHub.App/Authentication/TwoFactorChallengeHandler.cs
+++ src/GitHub.App/Authentication/TwoFactorChallengeHandler.cs
@@ -2,32 +2,34 @@
 using System.ComponentModel.Composition;
 using System.Reactive.Linq;
 using GitHub.ViewModels;
-using Microsoft.VisualStudio.PlatformUI;
 using Octokit;
 using ReactiveUI;
+using GitHub.UI;

 namespace GitHub.Authentication
 {
     [Export(typeof(ITwoFactorChallengeHandler))]
     public class TwoFactorChallengeHandler : ITwoFactorChallengeHandler
     {
-        readonly IServiceProvider serviceProvider;
+        //readonly IServiceProvider serviceProvider;
+        readonly Lazy<ITwoFactorDialog> lazyTwoFactorDialog;

         [ImportingConstructor]
-        public TwoFactorChallengeHandler(IServiceProvider serviceProvider)
+        public TwoFactorChallengeHandler(Lazy<ITwoFactorDialog> twoFactorDialog)
         {
-            this.serviceProvider = serviceProvider;
+            //this.serviceProvider = serviceProvider;
+            this.lazyTwoFactorDialog = twoFactorDialog;
         }

         public IObservable<TwoFactorChallengeResult> HandleTwoFactorException(TwoFactorRequiredException exception)
         {
-            var twoFactorDialog = (TwoFactorDialogViewModel)serviceProvider.GetService(typeof(TwoFactorDialogViewModel));
-            var twoFactorView = (IViewFor<TwoFactorDialogViewModel>)serviceProvider.GetService(typeof(IViewFor<TwoFactorDialogViewModel>));
+            var twoFactorDialog = lazyTwoFactorDialog.Value as TwoFactorDialogViewModel;
+            //var twoFactorView = (IViewFor<TwoFactorDialogViewModel>)serviceProvider.GetService(typeof(IViewFor<TwoFactorDialogViewModel>));

             return Observable.Start(() =>
             {
-                twoFactorView.ViewModel = twoFactorDialog;
-                ((DialogWindow)twoFactorView).Show();
+                //twoFactorView.ViewModel = twoFactorDialog;
+                //((DialogWindow)twoFactorView).Show();

                 var userError = new TwoFactorRequiredUserError(exception);
                 return twoFactorDialog.Show(userError)
@@ -37,8 +39,9 @@
                             : Observable.Throw<TwoFactorChallengeResult>(exception));
             }, RxApp.MainThreadScheduler)
             .SelectMany(x => x)
-            .Finally(() =>
-                ((DialogWindow)twoFactorView).Hide());
+            //.Finally(() =>
+            //    ((DialogWindow)twoFactorView).Hide());
+            ;
         }
     }
 }


Restore one test

Restore one test

--- src/GraphQL.Tests/Validation/ArgumentsOfCorrectTypeTests.cs
+++ src/GraphQL.Tests/Validation/ArgumentsOfCorrectTypeTests.cs
@@ -319,8 +319,7 @@
             });
         }

-        [Theory]
-        [ClassData(typeof(CultureList))]
+        [Fact]
         public void float_into_boolean()
         {
             var query = @"{


change should method method call to use generics to define return object

--- src/Lime.Protocol.UnitTests/Serialization/TypeUtilTests.cs
+++ src/Lime.Protocol.UnitTests/Serialization/TypeUtilTests.cs
@@ -56,12 +56,12 @@
         public void GetStringValue_EmptyStringToEmptyArray_ReturnEmptyArray()
         {
             object result = null;
+            //Act
+            TypeUtilEx.TryParseString(string.Empty, typeof(string[]), out result, CultureInfo.InvariantCulture);

-            //Act
-            TypeUtilEx.TryParseString("", typeof(string[]), out result, CultureInfo.InvariantCulture);
-
-            result.ShouldBeOfType(typeof(string[]));
-            ((string[])result).Length.ShouldBe(0);
+            //Assert
+            var output = result.ShouldBeOfType<string[]>();
+            output.ShouldBeEmpty();
         }
     }
 }


fixed DefaultImplementationsConvention

fixed DefaultImplementationsConvention

--- src/Maestro/Conventions/DefaultImplementationsConvention.cs
+++ src/Maestro/Conventions/DefaultImplementationsConvention.cs
@@ -1,7 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Reflection;
 using Maestro.Configuration;

 namespace Maestro.Conventions
@@ -17,17 +16,19 @@

 		public void Process(IEnumerable<Type> types, IContainerExpression containerExpression)
 		{
-			types = types as IList<Type> ?? types.ToList();
+			types = types as IReadOnlyCollection<Type> ?? types.ToList();

-			var interfaces = types.Where(x => x.IsInterface());
-			var classes = types.Where(x => x.IsConcreteClass()).GroupBy(x => x.Namespace ?? string.Empty).ToDictionary(x => x.Key, x => x.ToList());
+			var interfaces = types.Where(x => x.IsInterface() && x.Name.StartsWith("I"));
+		   var classes = types
+		      .Where(x => x.IsConcreteClass())
+		      .ToDictionary(x => x.FullName);

 			foreach (var @interface in interfaces)
 			{
-				List<Type> list;
-				if (!classes.TryGetValue(@interface.Namespace ?? string.Empty, out list)) continue;
-				var @class = list.SingleOrDefault(x => x.Name == @interface.Name.Substring(1));
-				if (@class == null) continue;
+			   var key = @interface.FullName;
+			   key = key.Remove(key.Length - @interface.Name.Length) + @interface.Name.Substring(1);
+			   Type @class;
+			   if (!classes.TryGetValue(key, out @class)) continue;
 				_serviceRegistration(new ConventionalTypeInstanceRegistrator<object>(containerExpression, @interface, @class));
 			}
 		}


Refactor DiskManager to use the new cache class.

svn path=/trunk/bitsharp/; revision=145163

--- src/MonoTorrent/MonoTorrent.Client/Managers/DiskManager.cs
+++ src/MonoTorrent/MonoTorrent.Client/Managers/DiskManager.cs
@@ -19,6 +19,7 @@
         private object bufferLock = new object();
         private Queue<BufferedIO> bufferedReads;
         private Queue<BufferedIO> bufferedWrites;
+        private ICache<BufferedIO> cache;
         private bool disposed;
         private ClientEngine engine;
         private MainLoopTask LoopTask;
@@ -80,6 +81,7 @@
         {
             this.bufferedReads = new Queue<BufferedIO>();
             this.bufferedWrites = new Queue<BufferedIO>();
+            this.cache = new Cache<BufferedIO>(true).Synchronize ();
             this.engine = engine;
             this.readLimiter = new RateLimiter();
             this.readMonitor = new SpeedMonitor();
@@ -223,7 +225,8 @@
         {
             string path = manager.SavePath;
             ArraySegment<byte> b = new ArraySegment<byte>(buffer, bufferOffset, bytesToRead);
-            BufferedIO io = new BufferedIO(manager, b, pieceStartIndex, bytesToRead, manager.Torrent.PieceLength, manager.Torrent.Files);
+            BufferedIO io = new BufferedIO();
+            io.Initialise(manager, b, pieceStartIndex, bytesToRead, manager.Torrent.PieceLength, manager.Torrent.Files);
             IOLoop.QueueWait((MainLoopTask)delegate {
                 PerformRead(io);
             });
@@ -329,6 +332,8 @@
 							ClientEngine.BufferManager.FreeBuffer(ref list[i].buffer);
 						}
 						hasher.TransformFinalBlock(hashBuffer.Array, hashBuffer.Offset, 0);
+                        for (int i = 0; i < list.Count; i++)
+                            cache.Enqueue(list[i]);
 						callback(hasher.Hash);
 					}
 				});
@@ -342,7 +347,8 @@
 				if ((i + bytesToRead) > fileSize)
 					bytesToRead = (int)(fileSize - i);

-				io = new BufferedIO(manager, hashBuffer, i, bytesToRead, manager.Torrent.PieceLength, manager.Torrent.Files);
+				io = cache.Dequeue();
+				io.Initialise(manager, hashBuffer, i, bytesToRead, manager.Torrent.PieceLength, manager.Torrent.Files);
 				list.Add(io);

 				if (bytesToRead != Piece.BlockSize)


make encoding private

make encoding private

--- src/Nanophone.RegistryHost.InMemoryRegistry/Base64Codec.cs
+++ src/Nanophone.RegistryHost.InMemoryRegistry/Base64Codec.cs
@@ -5,33 +5,37 @@
 {
     public class Base64Codec
     {
-        public Encoding Encoding { get; set; }
+        private readonly Encoding _encoding;
+
+        public Base64Codec(Encoding encoding)
+        {
+            _encoding = encoding;
+        }

         public Base64Codec()
-        {
-            Encoding = Encoding.UTF8;
-        }
+            : this(Encoding.UTF8)
+        { }

         public string Encode(string s)
         {
-            var bytes = Encoding.GetBytes(s);
+            var bytes = _encoding.GetBytes(s);
             return Convert.ToBase64String(bytes);
         }

         public byte[] EncodeToBytes(string s)
         {
-            return Encoding.GetBytes(Encode(s));
+            return _encoding.GetBytes(Encode(s));
         }

         public string Decode(string s)
         {
             var bytes = Convert.FromBase64String(s);
-            return Encoding.GetString(bytes);
+            return _encoding.GetString(bytes);
         }

         public string DecodeFromBytes(byte[] bytes)
         {
-            return Decode(Encoding.GetString(bytes));
+            return Decode(_encoding.GetString(bytes));
         }
     }
 }