red: add ExampleFeature.OrderingStepsByDisplayName to v2

--- src/test/Xbehave.Test.Acceptance.Net40/ExampleFeature.cs
+++ src/test/Xbehave.Test.Acceptance.Net40/ExampleFeature.cs
@@ -48,7 +48,6 @@
                     result.DisplayName.Contains("(x: 100, y: 200, sum: 300)")));
         }

-#if !V2
         [Scenario]
         public static void OrderingStepsByDisplayName()
         {
@@ -76,7 +75,6 @@
             "And the fourth result should have a display name ending with 'y'"
                 .f(() => results[3].DisplayName.Should().EndWith("y"));
         }
-#endif

         [Scenario]
         public static void ExamplesWithMissingValues(Type feature, Result[] results)
@@ -268,7 +266,6 @@
             }
         }

-#if !V2
         private static class TwoStepsNamedZandYAndTwoIdenticalExamples
         {
             [Scenario]
@@ -283,7 +280,6 @@
                     .f(() => { });
             }
         }
-#endif

         private static class ScenarioWithThreeParametersASingleStepAndThreeExamplesEachWithOneValue
         {


Expand Children / Expand Tree context menu items

--- Windows/MainForm.cs
+++ Windows/MainForm.cs
@@ -269,7 +269,6 @@
             frontNode.ImageIndex = _iconRegistry.Lookup(node.GetType());
             frontNode.SelectedImageIndex = frontNode.ImageIndex;
             frontNode.Tag = node;
-            frontNode.ContextMenuStrip = BuildNodeContextMenu(node);

             if (node.HasUnexpandedChildren || node.Nodes.Count > 0)
                 frontNode.Nodes.Add(new TreeNode());
@@ -277,12 +276,32 @@
             return frontNode;
         }

-        private ContextMenuStrip BuildNodeContextMenu (DataNode node)
+        private ContextMenuStrip BuildNodeContextMenu (TreeNode frontNode, DataNode node)
         {
             if (node == null)
                 return null;

             ContextMenuStrip menu = new ContextMenuStrip();
+
+            if (node.HasUnexpandedChildren || node.Nodes.Count > 0) {
+                if (frontNode.IsExpanded) {
+                    ToolStripMenuItem itemCollapse = new ToolStripMenuItem("&Collapse", null, _contextCollapse_Click);
+                    itemCollapse.Font = new System.Drawing.Font(itemCollapse.Font, System.Drawing.FontStyle.Bold);
+
+                    ToolStripMenuItem itemExpandChildren = new ToolStripMenuItem("Expand C&hildren", null, _contextExpandChildren_Click);
+                    ToolStripMenuItem itemExpandTree = new ToolStripMenuItem("Expand &Tree", null, _contextExpandTree_Click);
+
+                    menu.Items.AddRange(new ToolStripItem[] {
+                    itemCollapse, new ToolStripSeparator(), itemExpandChildren, itemExpandTree,
+                });
+                }
+                else {
+                    ToolStripMenuItem itemExpand = new ToolStripMenuItem("&Expand", null, _contextExpand_Click);
+                    itemExpand.Font = new System.Drawing.Font(itemExpand.Font, System.Drawing.FontStyle.Bold);
+
+                    menu.Items.Add(itemExpand);
+                }
+            }

             if (node.CanReoderNode) {
                 ToolStripMenuItem itemUp = new ToolStripMenuItem("Move &Up", Properties.Resources.ArrowUp, _contextMoveUp_Click);
@@ -296,6 +315,33 @@
             }

             return (menu.Items.Count > 0) ? menu : null;
+        }
+
+        private void _contextCollapse_Click (object sender, EventArgs e)
+        {
+            if (_nodeTree.SelectedNode != null)
+                _nodeTree.SelectedNode.Collapse();
+        }
+
+        private void _contextExpand_Click (object sender, EventArgs e)
+        {
+            if (_nodeTree.SelectedNode != null)
+                _nodeTree.SelectedNode.Expand();
+        }
+
+        private void _contextExpandChildren_Click (object sender, EventArgs e)
+        {
+            if (_nodeTree.SelectedNode != null) {
+                foreach (TreeNode node in _nodeTree.SelectedNode.Nodes)
+                    node.Expand();
+            }
+        }
+
+        private void _contextExpandTree_Click (object sender, EventArgs e)
+        {
+            if (_nodeTree.SelectedNode != null) {
+                _nodeTree.SelectedNode.ExpandAll();
+            }
         }

         private void _contextMoveUp_Click (object sender, EventArgs e)
@@ -398,7 +444,7 @@
             }

             foreach (TreeNode child in node.Nodes)
-                child.ContextMenuStrip = BuildNodeContextMenu(child.Tag as DataNode);
+                child.ContextMenuStrip = BuildNodeContextMenu(child, child.Tag as DataNode);

             if (node.Nodes.Count == 0 && dataNode.HasUnexpandedChildren) {
                 ExpandNode(node);
@@ -1232,8 +1278,10 @@

         private void _nodeTree_NodeMouseClick (object sender, TreeNodeMouseClickEventArgs e)
         {
-            if (e.Button == MouseButtons.Right)
+            if (e.Button == MouseButtons.Right) {
+                e.Node.ContextMenuStrip = BuildNodeContextMenu(e.Node, e.Node.Tag as DataNode);
                 _nodeTree.SelectedNode = e.Node;
+            }
         }

         private void _nodeTree_DragDrop (object sender, DragEventArgs e)


do not report network error

do not report network error

--- Wox.Core/Updater.cs
+++ Wox.Core/Updater.cs
@@ -43,7 +43,7 @@
                     }
                     catch (Exception e) when (e is HttpRequestException || e is WebException || e is SocketException)
                     {
-                        Logger.WoxError($"Check your connection and proxy settings to api.github.com.", e);
+                        Logger.WoxError($"Check your connection and proxy settings to api.github.com. {e.Message}");
                         updateManager.Dispose();
                         return;
                     }
@@ -67,7 +67,7 @@
                     }
                     catch (Exception e) when (e is HttpRequestException || e is WebException || e is SocketException)
                     {
-                        Logger.WoxError($"Check your connection and proxy settings to github-cloud.s3.amazonaws.com.", e);
+                        Logger.WoxError($"Check your connection and proxy settings to github-cloud.s3.amazonaws.com. {e.Message}");
                         updateManager.Dispose();
                         return;
                     }
@@ -86,11 +86,11 @@
             }
             catch (Exception e) when (e is HttpRequestException || e is WebException || e is SocketException)
             {
-                Logger.WoxError($"Please check your connection and proxy settings to api.github.com.", e);
+                Logger.WoxError($"Please check your connection and proxy settings {e.Message}");
             }
             catch (Exception e)
             {
-                Logger.WoxError($"cannot check update", e);
+                Logger.WoxError($"cannot check update {e.Message}");
             }

         }


Update QueueMethods

Update QueueMethods

--- src/Angora/Methods/QueueMethods.cs
+++ src/Angora/Methods/QueueMethods.cs
@@ -1,4 +1,4 @@
-using System.Binary;
+using System.Buffers.Binary;
 using System.Collections.Generic;
 using System.IO.Pipelines;
 using System.Threading.Tasks;
@@ -24,24 +24,33 @@

             try
             {
-                var payloadSizeHeader = buffer.WriteFrameHeader(FrameType.Method, channelNumber);
-
-                buffer.WriteBigEndian(Method.Queue.Declare);
-                buffer.WriteBigEndian(Reserved);
-                buffer.WriteBigEndian(Reserved);
-                buffer.WriteShortString(queueName);
-                buffer.WriteBits(passive, durable, exclusive, autoDelete);
-                buffer.WriteTable(arguments);
-
-                payloadSizeHeader.WriteBigEndian((uint)buffer.BytesWritten - FrameHeaderSize);
-
-                buffer.WriteBigEndian(FrameEnd);
-
-                await buffer.FlushAsync();
-            }
-            finally
-            {
-                socket.ReleaseWriteBuffer();
+                WritePayload();
+                await buffer.FlushAsync();
+            }
+            finally
+            {
+                socket.ReleaseWriteBuffer();
+            }
+
+            void WritePayload()
+            {
+                var writer = new CustomBufferWriter<PipeWriter>(buffer);
+
+                var payloadSizeHeader = writer.WriteFrameHeader(FrameType.Method, channelNumber);
+
+                writer.Write(Method.Queue.Declare);
+                writer.Write(Reserved);
+                writer.Write(Reserved);
+                writer.WriteShortString(queueName);
+                writer.WriteBits(passive, durable, exclusive, autoDelete);
+                writer.WriteTable(arguments);
+
+                writer.Commit();
+                BinaryPrimitives.WriteUInt32BigEndian(payloadSizeHeader, ((uint)writer.BytesCommitted - FrameHeaderSize));
+
+                writer.Write(FrameEnd);
+
+                writer.Commit();
             }
         }

@@ -51,26 +60,35 @@

             try
             {
-                var payloadSizeHeader = buffer.WriteFrameHeader(FrameType.Method, channelNumber);
-
-                buffer.WriteBigEndian(Method.Queue.Bind);
-                buffer.WriteBigEndian(Reserved);
-                buffer.WriteBigEndian(Reserved);
-                buffer.WriteShortString(queue);
-                buffer.WriteShortString(exchange);
-                buffer.WriteShortString(routingKey);
-                buffer.WriteBits();
-                buffer.WriteTable(arguments);
-
-                payloadSizeHeader.WriteBigEndian((uint)buffer.BytesWritten - FrameHeaderSize);
-
-                buffer.WriteBigEndian(FrameEnd);
-
-                await buffer.FlushAsync();
-            }
-            finally
-            {
-                socket.ReleaseWriteBuffer();
+                WritePayload();
+                await buffer.FlushAsync();
+            }
+            finally
+            {
+                socket.ReleaseWriteBuffer();
+            }
+
+            void WritePayload()
+            {
+                var writer = new CustomBufferWriter<PipeWriter>(buffer);
+
+                var payloadSizeHeader = writer.WriteFrameHeader(FrameType.Method, channelNumber);
+
+                writer.Write(Method.Queue.Bind);
+                writer.Write(Reserved);
+                writer.Write(Reserved);
+                writer.WriteShortString(queue);
+                writer.WriteShortString(exchange);
+                writer.WriteShortString(routingKey);
+                writer.WriteBits();
+                writer.WriteTable(arguments);
+
+                writer.Commit();
+                BinaryPrimitives.WriteUInt32BigEndian(payloadSizeHeader, ((uint)writer.BytesCommitted - FrameHeaderSize));
+
+                writer.Write(FrameEnd);
+
+                writer.Commit();
             }
         }

@@ -80,25 +98,34 @@

             try
             {
-                var payloadSizeHeader = buffer.WriteFrameHeader(FrameType.Method, channelNumber);
-
-                buffer.WriteBigEndian(Method.Queue.Unbind);
-                buffer.WriteBigEndian(Reserved);
-                buffer.WriteBigEndian(Reserved);
-                buffer.WriteShortString(queue);
-                buffer.WriteShortString(exchange);
-                buffer.WriteShortString(routingKey);
-                buffer.WriteTable(arguments);
-
-                payloadSizeHeader.WriteBigEndian((uint)buffer.BytesWritten - FrameHeaderSize);
-
-                buffer.WriteBigEndian(FrameEnd);
-
-                await buffer.FlushAsync();
-            }
-            finally
-            {
-                socket.ReleaseWriteBuffer();
+                WritePayload();
+                await buffer.FlushAsync();
+            }
+            finally
+            {
+                socket.ReleaseWriteBuffer();
+            }
+
+            void WritePayload()
+            {
+                var writer = new CustomBufferWriter<PipeWriter>(buffer);
+
+                var payloadSizeHeader = writer.WriteFrameHeader(FrameType.Method, channelNumber);
+
+                writer.Write(Method.Queue.Unbind);
+                writer.Write(Reserved);
+                writer.Write(Reserved);
+                writer.WriteShortString(queue);
+                writer.WriteShortString(exchange);
+                writer.WriteShortString(routingKey);
+                writer.WriteTable(arguments);
+
+                writer.Commit();
+                BinaryPrimitives.WriteUInt32BigEndian(payloadSizeHeader, ((uint)writer.BytesCommitted - FrameHeaderSize));
+
+                writer.Write(FrameEnd);
+
+                writer.Commit();
             }
         }

@@ -108,23 +135,32 @@

             try
             {
-                var payloadSizeHeader = buffer.WriteFrameHeader(FrameType.Method, channelNumber);
-
-                buffer.WriteBigEndian(Method.Queue.Purge);
-                buffer.WriteBigEndian(Reserved);
-                buffer.WriteBigEndian(Reserved);
-                buffer.WriteShortString(queue);
-                buffer.WriteBits();
-
-                payloadSizeHeader.WriteBigEndian((uint)buffer.BytesWritten - FrameHeaderSize);
-
-                buffer.WriteBigEndian(FrameEnd);
-
-                await buffer.FlushAsync();
-            }
-            finally
-            {
-                socket.ReleaseWriteBuffer();
+                WritePayload();
+                await buffer.FlushAsync();
+            }
+            finally
+            {
+                socket.ReleaseWriteBuffer();
+            }
+
+            void WritePayload()
+            {
+                var writer = new CustomBufferWriter<PipeWriter>(buffer);
+
+                var payloadSizeHeader = writer.WriteFrameHeader(FrameType.Method, channelNumber);
+
+                writer.Write(Method.Queue.Purge);
+                writer.Write(Reserved);
+                writer.Write(Reserved);
+                writer.WriteShortString(queue);
+                writer.WriteBits();
+
+                writer.Commit();
+                BinaryPrimitives.WriteUInt32BigEndian(payloadSizeHeader, ((uint)writer.BytesCommitted - FrameHeaderSize));
+
+                writer.Write(FrameEnd);
+
+                writer.Commit();
             }
         }

@@ -134,23 +170,32 @@

             try
             {
-                var payloadSizeHeader = buffer.WriteFrameHeader(FrameType.Method, channelNumber);
-
-                buffer.WriteBigEndian(Method.Queue.Delete);
-                buffer.WriteBigEndian(Reserved);
-                buffer.WriteBigEndian(Reserved);
-                buffer.WriteShortString(queue);
-                buffer.WriteBits(onlyIfEmpty, onlyIfUnused);
-
-                payloadSizeHeader.WriteBigEndian((uint)buffer.BytesWritten - FrameHeaderSize);
-
-                buffer.WriteBigEndian(FrameEnd);
-
-                await buffer.FlushAsync();
-            }
-            finally
-            {
-                socket.ReleaseWriteBuffer();
+                WritePayload();
+                await buffer.FlushAsync();
+            }
+            finally
+            {
+                socket.ReleaseWriteBuffer();
+            }
+
+            void WritePayload()
+            {
+                var writer = new CustomBufferWriter<PipeWriter>(buffer);
+
+                var payloadSizeHeader = writer.WriteFrameHeader(FrameType.Method, channelNumber);
+
+                writer.Write(Method.Queue.Delete);
+                writer.Write(Reserved);
+                writer.Write(Reserved);
+                writer.WriteShortString(queue);
+                writer.WriteBits(onlyIfEmpty, onlyIfUnused);
+
+                writer.Commit();
+                BinaryPrimitives.WriteUInt32BigEndian(payloadSizeHeader, ((uint)writer.BytesCommitted - FrameHeaderSize));
+
+                writer.Write(FrameEnd);
+
+                writer.Commit();
             }
         }
     }


add doc

add doc

--- src/Autofac.Extras.Moq/AutoMock.cs
+++ src/Autofac.Extras.Moq/AutoMock.cs
@@ -89,7 +89,7 @@
         /// Create new <see cref="AutoMock"/> instance that will create mocks with behavior defined by a repository.
         /// </summary>
         /// <param name="repository">The repository that defines the behavior. </param>
-        /// <param name="containerBuilder"></param>
+        /// <param name="containerBuilder">container builder used to create the mock container. leave null for AutoMock to create a new one</param>
         /// <returns>
         /// An <see cref="AutoMock"/> based on the provided <see cref="MockRepository"/>.
         /// </returns>
@@ -101,6 +101,7 @@
         /// <summary>
         /// Create new <see cref="AutoMock"/> instance with loose mock behavior.
         /// </summary>
+        /// <param name="containerBuilder">container builder used to create the mock container. leave null for AutoMock to create a new one</param>
         /// <returns>Container initialized for loose behavior.</returns>
         /// <seealso cref="MockRepository"/>
         [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
@@ -112,6 +113,7 @@
         /// <summary>
         /// Create new <see cref="AutoMock"/> instance with strict mock behavior.
         /// </summary>
+        /// <param name="containerBuilder">container builder used to create the mock container. leave null for AutoMock to create a new one</param>
         /// <seealso cref="MockRepository"/>
         /// <returns>Container initialized for loose behavior.</returns>
         [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]


Tried to make IsAnimating logic clearer.

--- src/Avalonia.Base/PriorityValue.cs
+++ src/Avalonia.Base/PriorityValue.cs
@@ -52,7 +52,17 @@
             _validate = validate;
         }

-        public bool IsAnimating => ValuePriority < 0 && GetLevel(ValuePriority).ActiveBindingIndex != -1;
+        /// <summary>
+        /// Gets a value indicating whether the property is animating.
+        /// </summary>
+        public bool IsAnimating
+        {
+            get
+            {
+                return ValuePriority <= (int)BindingPriority.Animation &&
+                    GetLevel(ValuePriority).ActiveBindingIndex != -1;
+            }
+        }

         /// <summary>
         /// Gets the owner of the value.


expose api to encode acme request

expose api to encode acme request

--- src/Certes/Acme/AcmeHttpHandler.cs
+++ src/Certes/Acme/AcmeHttpHandler.cs
@@ -46,7 +46,7 @@
         /// <param name="keyPair">The key pair.</param>
         /// <param name="nonce">The nonce.</param>
         /// <returns>The encoded JSON.</returns>
-        public static string Encode(EntityBase entity, IAccountKey keyPair, string nonce)
+        public static object Encode(EntityBase entity, IAccountKey keyPair, string nonce)
         {
             var jsonSettings = JsonUtil.CreateSettings();
             var unprotectedHeader = new
@@ -79,8 +79,7 @@
                 signature = signedSignatureEncoded
             };

-            var bodyJson = JsonConvert.SerializeObject(body, Formatting.None, jsonSettings);
-            return bodyJson;
+            return body;
         }

         /// <summary>
@@ -138,7 +137,9 @@

         private StringContent GenerateRequestContent(EntityBase entity, IAccountKey keyPair)
         {
-            var bodyJson = Encode(entity, keyPair, this.nonce);
+            var body = Encode(entity, keyPair, this.nonce);
+            var bodyJson = JsonConvert.SerializeObject(body, Formatting.None, jsonSettings);
+
             return new StringContent(bodyJson, Encoding.ASCII, MimeJson);
         }


added ColorConsole.Write methods

added ColorConsole.Write methods

--- src/ColoredConsole/ColorConsole.cs
+++ src/ColoredConsole/ColorConsole.cs
@@ -10,7 +10,7 @@
     {
         private static readonly object @lock = new object();

-        public static void WriteLine(ColorText text)
+        public static void Write(ColorText text)
         {
             lock (@lock)
             {
@@ -37,7 +37,19 @@
                         Console.Write(token);
                     }
                 }
+            }
+        }

+        public static void Write(params ColorToken[] tokens)
+        {
+            Write(new ColorText(tokens));
+        }
+
+        public static void WriteLine(ColorText text)
+        {
+            lock (@lock)
+            {
+                Write(text);
                 Console.WriteLine();
             }
         }


Merging Redth/NuGet

Merging Redth/NuGet

--- src/Core/Authoring/PathResolver.cs
+++ src/Core/Authoring/PathResolver.cs
@@ -99,8 +99,14 @@

         private static IEnumerable<SearchPathResult> PerformWildcardSearchInternal(string basePath, string searchPath, bool includeEmptyDirectories, out string normalizedBasePath)
         {
-            if (!searchPath.StartsWith(@"\\", StringComparison.OrdinalIgnoreCase))
-            {
+            if (!searchPath.StartsWith(@"\\", StringComparison.OrdinalIgnoreCase)
+                && Path.DirectorySeparatorChar != '/')
+            {
+                //If the system's DirectorySeparatorChar is '/' we're probably dealing with Mac or *nix
+                // In any case, if '/' is the separator, we don't want to trim off the first char ever
+                // since it would completely change the meaning of the path
+                //  eg: /var/somedir/ is not at all the same as var/somedir (relative vs absolute)
+
                 // If we aren't dealing with network paths, trim the leading slash.
                 searchPath = searchPath.TrimStart(Path.DirectorySeparatorChar);
             }
@@ -221,19 +227,20 @@
             return Path.Combine(targetPath ?? String.Empty, packagePath);
         }

+        private static readonly string OneDotSlash = "." + Path.DirectorySeparatorChar;
+        private static readonly string TwoDotSlash = ".." + Path.DirectorySeparatorChar;
+
         internal static string NormalizeBasePath(string basePath, ref string searchPath)
         {
-            const string relativePath = @"..\";
-
             // If no base path is provided, use the current directory.
-            basePath = String.IsNullOrEmpty(basePath) ? @".\" : basePath;
+            basePath = String.IsNullOrEmpty(basePath) ? OneDotSlash : basePath;

             // If the search path is relative, transfer the ..\ portion to the base path.
             // This needs to be done because the base path determines the root for our enumeration.
-            while (searchPath.StartsWith(relativePath, StringComparison.OrdinalIgnoreCase))
-            {
-                basePath = Path.Combine(basePath, relativePath);
-                searchPath = searchPath.Substring(relativePath.Length);
+            while (searchPath.StartsWith(TwoDotSlash, StringComparison.OrdinalIgnoreCase))
+            {
+                basePath = Path.Combine(basePath, TwoDotSlash);
+                searchPath = searchPath.Substring(TwoDotSlash.Length);
             }

             return Path.GetFullPath(basePath);


State saving and loading "works".

State saving and loading "works".

--- src/Crystal3/CrystalApplication.cs
+++ src/Crystal3/CrystalApplication.cs
@@ -200,38 +200,13 @@

             StorageFile file = await CrystalDataFolder.CreateFileAsync(SuspensionStateFileName, CreationCollisionOption.OpenIfExists);

-            var stream = await file.OpenAsync(FileAccessMode.ReadWrite);
-            var writer = new DataWriter(stream);
-            writer.WriteString(navigationState);
-            await writer.FlushAsync();
-
-            writer.Dispose();
-            try
-            {
-                stream.Dispose();
-            }
-            catch (Exception) { }
+            await FileIO.WriteTextAsync(file, navigationState);
         }
         private async Task LoadAppState()
         {
             StorageFile file = await CrystalDataFolder.CreateFileAsync(SuspensionStateFileName, CreationCollisionOption.OpenIfExists);
-            var stream = await file.OpenReadAsync();
-            var reader = new DataReader(stream);
-
-            string navigationState = string.Empty;
-
-            while (true)
-            {
-                try
-                {
-                    await reader.LoadAsync(1);
-                    navigationState += reader.ReadString(1);
-                }
-                catch (Exception)
-                {
-                    break;
-                }
-            }
+
+            string navigationState = await FileIO.ReadTextAsync(file);

             WindowManager.GetNavigationManagerForCurrentWindow().RootNavigationService.NavigationFrame.SetNavigationState(navigationState);
         }


Right click when hovering with button pressed

--- osu.Framework.Android/Input/AndroidTouchHandler.cs
+++ osu.Framework.Android/Input/AndroidTouchHandler.cs
@@ -22,22 +22,7 @@

         private void handleTouches(object sender, View.TouchEventArgs e)
         {
-            handlePointerEvent(e.Event);
-        }
-
-        private void handleHover(object sender, View.HoverEventArgs e)
-        {
-            handlePointerEvent(e.Event);
-        }
-
-        private void handlePointerEvent(MotionEvent e)
-        {
-            PendingInputs.Enqueue(new MousePositionAbsoluteInput
-            {
-                Position = new osuTK.Vector2(e.GetX() * view.ScaleX, e.GetY() * view.ScaleY)
-            });
-
-            switch (e.Action & MotionEventActions.Mask)
+            switch (e.Event.Action & MotionEventActions.Mask)
             {
                 case MotionEventActions.Down:
                 case MotionEventActions.Move:
@@ -48,6 +33,23 @@
                     PendingInputs.Enqueue(new MouseButtonInput(MouseButton.Left, false));
                     break;
             }
+
+            handlePointerEvent(e.Event);
+        }
+
+        private void handleHover(object sender, View.HoverEventArgs e)
+        {
+            PendingInputs.Enqueue(new MouseButtonInput(MouseButton.Right, e.Event.ButtonState == MotionEventButtonState.StylusPrimary));
+
+            handlePointerEvent(e.Event);
+        }
+
+        private void handlePointerEvent(MotionEvent e)
+        {
+            PendingInputs.Enqueue(new MousePositionAbsoluteInput
+            {
+                Position = new osuTK.Vector2(e.GetX() * view.ScaleX, e.GetY() * view.ScaleY)
+            });
         }

         protected override void Dispose(bool disposing)


Fix grid cell doing shockingly unsafe logic

--- osu.Framework/Graphics/Containers/GridContainer.cs
+++ osu.Framework/Graphics/Containers/GridContainer.cs
@@ -130,7 +130,7 @@
                 for (int c = 0; c < cellColumns; c++)
                 {
                     // Add cell
-                    cells[r, c] = new CellContainer();
+                    cells[r, c] = new CellContainer { OnChildInvalidation = i => InvalidateFromChild(i) };

                     // Allow empty rows
                     if (Content[r] == null)
@@ -290,10 +290,15 @@
             /// </summary>
             public bool DistributedHeight;

+            /// <summary>
+            /// Invoked whenever the child invalidates this <see cref="CellContainer"/>.
+            /// </summary>
+            public Action<Invalidation> OnChildInvalidation;
+
             public override void InvalidateFromChild(Invalidation invalidation, Drawable source = null)
             {
                 if ((invalidation & (Invalidation.RequiredParentSizeToFit | Invalidation.Colour)) > 0)
-                    Parent.InvalidateFromChild(invalidation);
+                    OnChildInvalidation?.Invoke(invalidation);
                 base.InvalidateFromChild(invalidation, source);
             }
         }


Fix `TaikoMascot` texture animation lookups

--- osu.Game.Rulesets.Taiko/UI/TaikoMascotAnimation.cs
+++ osu.Game.Rulesets.Taiko/UI/TaikoMascotAnimation.cs
@@ -85,8 +85,12 @@
             }

             [BackgroundDependencyLoader]
-            private void load(ISkinSource skin)
+            private void load(ISkinSource source)
             {
+                ISkin skin = source.FindProvider(s => getAnimationFrame(s, state, 0) != null);
+
+                if (skin == null) return;
+
                 for (int frameIndex = 0; true; frameIndex++)
                 {
                     var texture = getAnimationFrame(skin, state, frameIndex);
@@ -112,8 +116,12 @@
             }

             [BackgroundDependencyLoader]
-            private void load(ISkinSource skin)
+            private void load(ISkinSource source)
             {
+                ISkin skin = source.FindProvider(s => getAnimationFrame(s, TaikoMascotAnimationState.Clear, 0) != null);
+
+                if (skin == null) return;
+
                 foreach (var frameIndex in clear_animation_sequence)
                 {
                     var texture = getAnimationFrame(skin, TaikoMascotAnimationState.Clear, frameIndex);


Use manual migration

Use manual migration

--- osu.Game/Migrations/20190525060824_SkinSettings.cs
+++ osu.Game/Migrations/20190525060824_SkinSettings.cs
@@ -6,25 +6,34 @@
     {
         protected override void Up(MigrationBuilder migrationBuilder)
         {
-            migrationBuilder.AddColumn<int>(
-                name: "SkinInfoID",
-                table: "Settings",
-                nullable: true);
+            migrationBuilder.Sql(@"create table Settings_dg_tmp
+            (
+	            ID INTEGER not null
+		            constraint PK_Settings
+			            primary key autoincrement,
+	            Key TEXT not null,
+	            RulesetID INTEGER,
+	            Value TEXT,
+	            Variant INTEGER,
+	            SkinInfoID int
+		            constraint Settings_SkinInfo_ID_fk
+			            references SkinInfo
+				            on delete restrict
+            );

-            migrationBuilder.CreateIndex(
-                name: "IX_Settings_SkinInfoID",
-                table: "Settings",
-                column: "SkinInfoID");
+            insert into Settings_dg_tmp(ID, Key, RulesetID, Value, Variant) select ID, Key, RulesetID, Value, Variant from Settings;

-            // unsupported by sqlite
+            drop table Settings;

-            // migrationBuilder.AddForeignKey(
-            //     name: "FK_Settings_SkinInfo_SkinInfoID",
-            //     table: "Settings",
-            //     column: "SkinInfoID",
-            //     principalTable: "SkinInfo",
-            //     principalColumn: "ID",
-            //     onDelete: ReferentialAction.Restrict);
+            alter table Settings_dg_tmp rename to Settings;
+
+            create index IX_Settings_RulesetID_Variant
+	            on Settings (RulesetID, Variant);
+
+            create index Settings_SkinInfoID_index
+	            on Settings (SkinInfoID);
+
+            ");
         }

         protected override void Down(MigrationBuilder migrationBuilder)


Add explicit usage via attribute

Add explicit usage via attribute

--- osu.Game/Online/API/Requests/GetUpdatesResponse.cs
+++ osu.Game/Online/API/Requests/GetUpdatesResponse.cs
@@ -2,13 +2,17 @@
 // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

 using System.Collections.Generic;
+using Newtonsoft.Json;
 using osu.Game.Online.Chat;

 namespace osu.Game.Online.API.Requests
 {
     public class GetUpdatesResponse
     {
+        [JsonProperty]
         public List<Channel> Presence;
+
+        [JsonProperty]
         public List<Message> Messages;
     }
 }


Change from fullscreen to 0.7

Change from fullscreen to 0.7

--- osu.Game/Screens/OnlinePlay/Match/RoomSubScreen.cs
+++ osu.Game/Screens/OnlinePlay/Match/RoomSubScreen.cs
@@ -73,7 +73,7 @@
                     Origin = Anchor.BottomLeft,
                     Depth = float.MinValue,
                     RelativeSizeAxes = Axes.Both,
-                    Height = 1.0f,
+                    Height = 0.7f,
                     Padding = new MarginPadding { Horizontal = HORIZONTAL_OVERFLOW_PADDING },
                     Child = userModsSelectOverlay = new UserModSelectOverlay
                     {


Revert unintended whitespace change.

Revert unintended whitespace change.

--- src/Fixie/Execution/ClassRunner.cs
+++ src/Fixie/Execution/ClassRunner.cs
@@ -50,8 +50,7 @@
             lifecycle.Execute(testClass, caseLifecycle =>
             {
                 if (runCasesInvokedByLifecycle)
-                    throw new Exception(
-                        $"{lifecycle.GetType()} attempted to run {testClass.FullName}'s test cases multiple times, which is not supported.");
+                    throw new Exception($"{lifecycle.GetType()} attempted to run {testClass.FullName}'s test cases multiple times, which is not supported.");

                 runCasesInvokedByLifecycle = true;


debug stack sizing with linq returning neg value

--- src/GraphicObjects/GenericStack.cs
+++ src/GraphicObjects/GenericStack.cs
@@ -80,8 +80,7 @@
 		}
 		protected override int measureRawSize (LayoutingType lt)
 		{
-			int totSpace = Spacing * (Children.Count (c => c.Visible) - 1);
-
+			int totSpace = Math.Max(0, Spacing * (Children.Count (c => c.Visible) - 1));
 			if (lt == LayoutingType.Width) {
 				if (Orientation == Orientation.Horizontal)
 					return contentSize.Width + totSpace + 2 * Margin;


Updated tester

Updated tester

--- LibTester/Program.cs
+++ LibTester/Program.cs
@@ -32,7 +32,7 @@

             Console.WriteLine(dev.SerialNumber);

-            AdbPushPullResult result = dev.Pull("/sdcard/Download/Elternanschreiben Schweden_2016.doc", @"C:\Android\sch.doc");
+            AdbPushPullResult result = dev.Push(@"C:\Android\WA", "/sdcard/TESTER");

             Console.WriteLine(result.Files.Count);


Fixed CreateAndOpenConnection and ToString Methods to work with both MongoClientSettings and ConnectionString

--- src/Hangfire.Mongo/MongoStorage.cs
+++ src/Hangfire.Mongo/MongoStorage.cs
@@ -23,6 +23,8 @@
         private static readonly Regex _connectionStringCredentials = new Regex("mongodb://(.*?)@", RegexOptions.Compiled | RegexOptions.CultureInvariant);

         private readonly string _databaseName;
+
+	    private readonly MongoClientSettings _mongoClientSettings;

         private readonly MongoStorageOptions _options;

@@ -89,6 +91,7 @@
 			if (options == null)
 				throw new ArgumentNullException("options");

+			_mongoClientSettings = mongoClientSettings;
 			_databaseName = databaseName;
 			_options = options;

@@ -163,16 +166,24 @@
         /// <returns>Database context</returns>
         public HangfireDbContext CreateAndOpenConnection()
         {
-            return new HangfireDbContext(_connectionString, _databaseName, _options.Prefix);
+	        return this._connectionString != null ? new HangfireDbContext(this._connectionString, this._databaseName, this._options.Prefix) : new HangfireDbContext(this._mongoClientSettings, this._databaseName, this._options.Prefix);
         }

-        /// <summary>
+	    /// <summary>
         /// Returns text representation of the object
         /// </summary>
         public override string ToString()
         {
             // Obscure the username and password for display purposes
-            string obscuredConnectionString = _connectionStringCredentials.Replace(_connectionString, "mongodb://<username>:<password>@");
+			string obscuredConnectionString = "mongodb://";
+	        if (_connectionString != null)
+	        {
+				obscuredConnectionString = _connectionStringCredentials.Replace(_connectionString, "mongodb://<username>:<password>@");
+	        }
+	        else if (_mongoClientSettings != null && _mongoClientSettings.Server != null)
+	        {
+		        obscuredConnectionString = string.Format("mongodb://<username>:<password>@{0}:{1}", _mongoClientSettings.Server.Host, _mongoClientSettings.Server.Port);
+	        }
             return String.Format("Connection string: {0}, database name: {1}, prefix: {2}", obscuredConnectionString, _databaseName, _options.Prefix);

         }


fix some bugs

fix some bugs

--- Qict.cs
+++ Qict.cs
@@ -214,7 +214,8 @@
         }
         ConsoleWriteLine("");*/

-	int[][] invalidCombinaisons = new int[7][];
+	int[][] invalidCombinaisons = null;
+
 	if(verifTests)
         	invalidCombinaisons = readInvalidCombinaisonsFile(invalidCombinanaisonFile, parameters, parameterValues, parameterPositions);

@@ -247,7 +248,7 @@
             } // x
           } // j
         } // i
-
+
         //ConsoleWriteLine("allPairsDisplay array:");
         //for (int i = 0; i < numberPairs; ++i)
         //{
@@ -694,7 +695,7 @@
 				        string[] strValues = lineTokens[i].Split('=');
 					for(int j=0; j< nbparam; j++)
 					{
-						int posParam = 0;
+						//int posParam = 0;
 						strValues[0]= strValues[0].Trim();
 						strValues[1]= strValues[1].Trim();
 						//ConsoleWriteLine(strValues[0]+" "+parameters[j]);
@@ -719,14 +720,14 @@
 			//Console.ReadLine();
 			//return ERR_EXCEPTION;
 		      }
-			/*for(int aa=0;aa<numberLinesTotal;aa++)
+			for(int aa=0;aa<numberLinesTotal;aa++)
 			{
 				for(int bb=0;bb<nbvalue;bb++)
 				{
 					 ConsoleWrite(" "+array[aa][bb]);
 				}
 				ConsoleWriteLine(" ");
-			}*/
+			}
 		return array;
 	}


Reduce allocs when decoding doubles and floats

--- MaxMind.Db/Buffer.cs
+++ MaxMind.Db/Buffer.cs
@@ -49,9 +49,7 @@
         /// </summary>
         internal double ReadDouble(long offset)
         {
-            var buffer = Read(offset, 8);
-            Array.Reverse(buffer);
-            return BitConverter.ToDouble(buffer, 0);
+            return BitConverter.Int64BitsToDouble(ReadLong(offset, 8));
         }

         /// <summary>
@@ -59,9 +57,13 @@
         /// </summary>
         internal float ReadFloat(long offset)
         {
+#if NETSTANDARD2_0 || NET45
             var buffer = Read(offset, 4);
             Array.Reverse(buffer);
             return BitConverter.ToSingle(buffer, 0);
+#else
+            return BitConverter.Int32BitsToSingle(ReadInteger(0, offset, 4));
+#endif
         }

         /// <summary>


Go back to using MimeKit's base64 encoder instead of Convert.ToBase64String

--- MimeKit/Multipart.cs
+++ MimeKit/Multipart.cs
@@ -109,12 +109,17 @@

 		static string GenerateBoundary ()
 		{
+			var base64 = new Base64Encoder (true);
 			var random = new Random (seed++);
 			var digest = new byte[16];
+			var buf = new byte[24];
+			int length;

 			random.NextBytes (digest);

-			return "=-" + Convert.ToBase64String (digest);
+			length = base64.Flush (digest, 0, digest.Length, buf);
+
+			return "=-" + Encoding.ASCII.GetString (buf, 0, length);
 		}

 		/// <summary>


incoporated PR #7 by @GMouron into the refactored v2 code base

--- src/LibGitUnite/UniteRepository.cs
+++ src/LibGitUnite/UniteRepository.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
+using System.Reflection;
 using LibGit2Sharp;

 namespace LibGitUnite
@@ -13,6 +14,7 @@
         private List<DirectoryInfo> _folderInfo = new List<DirectoryInfo>();
         private readonly Repository _gitRepository;
         private readonly DirectoryInfo _gitDirectoryInfo;
+        private static readonly FieldInfo FullNameField = typeof(FileSystemInfo).GetField("FullPath", BindingFlags.Instance | BindingFlags.NonPublic);

         /// <summary>
         /// Extended LibGit2Sharp.Repository with the Unite version of the Move command
@@ -25,7 +27,7 @@
         public UniteRepository(string path, OptionFlags options)
         {
             _gitDirectoryInfo = new DirectoryInfo(path);
-            _gitRepository = new Repository(_gitDirectoryInfo.FullName);
+            _gitRepository = new Repository(GetFullName(_gitDirectoryInfo));
             _options = options;
         }

@@ -60,6 +62,16 @@
         }

         /// <summary>
+        /// Get the FullName from long file names using the hidden property FullPath
+        /// </summary>
+        /// <param name="fsi"></param>
+        /// <returns>Full Name Field</returns>
+        private static string GetFullName(FileSystemInfo fsi)
+        {
+            return (string)FullNameField.GetValue(fsi);
+        }
+
+        /// <summary>
         /// Builds a list of directory names as seen by the host operating system
         /// </summary>
         /// <returns>A <see cref="UniteRepository"/> aware of directories reported by host OS</returns>
@@ -68,7 +80,7 @@
             try
             {
                 _folderInfo = _gitDirectoryInfo.EnumerateDirectories("*", SearchOption.AllDirectories)
-                .Where(d => !d.FullName.ToLowerInvariant().StartsWith(_gitRepository.Info.Path.TrimEnd('\\').ToLowerInvariant()))
+                .Where(d => !GetFullName(d).ToLowerInvariant().StartsWith(_gitRepository.Info.Path.TrimEnd('\\').ToLowerInvariant()))
                 .ToList();
             }
             catch (Exception ex)
@@ -87,7 +99,7 @@
         {
             if (!_options.HasFlag(OptionFlags.UniteDirectories) || !_folderInfo.Any()) return this;

-            var foldersFullPathMap = new HashSet<string>(_folderInfo.ConvertAll(s => s.FullName));
+            var foldersFullPathMap = new HashSet<string>(_folderInfo.ConvertAll(GetFullName));

             // Find all repository files with directory paths not found in the host OS folder collection
             var indexEntries =
@@ -103,8 +115,8 @@

                 // Match host OS folder based on minimum length to find top level directory to target
                 var folder = _folderInfo
-                    .Where(x => x.FullName.ToLower().Contains(entry.Path.Substring(0, lastIndexOf).ToLower()))
-                    .OrderBy(x => x.FullName.Length)
+                    .Where(x => GetFullName(x).ToLower().Contains(entry.Path.Substring(0, lastIndexOf).ToLower()))
+                    .OrderBy(x => GetFullName(x).Length)
                     .FirstOrDefault();

                 if (folder == null)
@@ -113,7 +125,7 @@
                     continue;
                 }

-                var target = folder.FullName + Separator + filename;
+                var target = GetFullName(folder) + Separator + filename;
                 var sourcePath = _gitRepository.Info.WorkingDirectory + entry.Path;

                 // Unite the git index with the correct OS folder
@@ -129,8 +141,11 @@
         {
             if (!_options.HasFlag(OptionFlags.UniteFiles)) return this;

-            var files = GetAllFileInfos();
-            var filesFullPathMap = new HashSet<string>(files.ConvertAll(s => s.FullName));
+            // The " " at the end of the Path.Combine is a trick to be sure there is a \ at the end of the path
+            // Otherwise, we will exclude files such as .gitattributes
+            var dotGitFolderPath = Path.Combine(GetFullName(_gitDirectoryInfo), ".git", " ").TrimEnd();
+            var files = _gitDirectoryInfo.GetFiles("*", SearchOption.AllDirectories).Where(f => !GetFullName(f).StartsWith(dotGitFolderPath)).ToList();
+            var filesFullPathMap = new HashSet<string>(files.ConvertAll(GetFullName));
             var indexFileEntries = _gitRepository.Index.Where(f => filesFullPathMap.All(s => s.Replace(_gitRepository.Info.WorkingDirectory, string.Empty) != f.Path));

             foreach (var entry in indexFileEntries)
@@ -138,38 +153,13 @@
                 var sourcePath = _gitRepository.Info.WorkingDirectory + entry.Path;

                 // Match host OS filename based on full pathname ignoring case
-                var target = files.FirstOrDefault(f => string.Equals(f.FullName, sourcePath, StringComparison.CurrentCultureIgnoreCase));
+                var target = files.FirstOrDefault(f => string.Equals(GetFullName(f), sourcePath, StringComparison.CurrentCultureIgnoreCase));
                 if (target == null) continue;

                 // Unite the git index with the correct OS folder
-                Unite(sourcePath, target.FullName);
+                Unite(sourcePath, GetFullName(target));
             }
             return this;
-        }
-
-        /// <summary>
-        /// Get a list of files in all host operating system folders identified
-        /// </summary>
-        /// <returns>A list of <see cref="FileInfo"/> reported by host OS</returns>
-        /// ReSharper disable once ParameterTypeCanBeEnumerable.Local
-        private List<FileInfo> GetAllFileInfos()
-        {
-            var fileInfo = new List<FileInfo>();
-
-            try
-            {
-                fileInfo = _folderInfo
-                    .Union(new[] { _gitDirectoryInfo })
-                    .SelectMany(f => f.EnumerateFiles("*", SearchOption.TopDirectoryOnly))
-                    .ToList();
-            }
-            catch (Exception ex)
-            {
-                Console.Write("Git.Unite: ");
-                Console.WriteLine(ex.Message);
-            }
-
-            return fileInfo;
         }

         public void Dispose()


BUG: Lucene.Net.Index.CheckIndex - Fixed issue with converting int to string using ambient context on VersionInfo comparison

--- src/Lucene.Net/Index/CheckIndex.cs
+++ src/Lucene.Net/Index/CheckIndex.cs
@@ -543,7 +543,7 @@
             }

             // find the oldest and newest segment versions
-            string oldest = Convert.ToString(int.MaxValue), newest = Convert.ToString(int.MinValue);
+            string oldest = Convert.ToString(int.MaxValue, CultureInfo.InvariantCulture), newest = Convert.ToString(int.MinValue, CultureInfo.InvariantCulture);
             string oldSegs = null;
             bool foundNonNullVersion = false;
             IComparer<string> versionComparer = StringHelper.VersionComparer;


Issue 1007 - Unclear Exception when EventType not recognized.

Added better error handling for cases where an event type cannot be found to match what types are currently in the database.
Fixes #1007

--- src/Marten/Events/EventSelector.cs
+++ src/Marten/Events/EventSelector.cs
@@ -81,8 +81,15 @@
                 {
                     throw new UnknownEventTypeException(eventTypeName);
                 }
-
-                var type = Events.TypeForDotNetName(dotnetTypeName);
+                Type type;
+                try
+                {
+                    type = Events.TypeForDotNetName(dotnetTypeName);
+                }
+                catch (ArgumentNullException)
+                {
+                    throw new UnknownEventTypeException(dotnetTypeName);
+                }
                 mapping = Events.EventMappingFor(type);
             }


do not read from console in NAppUpdate.Updater (there might be no stream to read from)

--- src/NAppUpdate.Updater/AppStart.cs
+++ src/NAppUpdate.Updater/AppStart.cs
@@ -184,8 +184,14 @@
 						Console.WriteLine();
 					}
 					Console.WriteLine();
-					Console.WriteLine("Press any key or close this window to exit.");
-					Console.ReadKey();
+					Console.WriteLine("Exiting."); //Must not read console!
+                    //see: http://msdn.microsoft.com/en-us/library/system.console.aspx
+                    //Especially:
+                    //Console class members that work normally when the underlying stream is directed to a console might
+                    //throw an exception if the stream is redirected, for example, to a file. Program your application to
+                    //catch System.IO.IOException exceptions if you redirect a standard stream. You can also use
+                    //the IsOutputRedirected, IsInputRedirected, and IsErrorRedirected properties to determine whether
+                    //a standard stream is redirected before performing an operation that throws an System.IO.IOException exception.
 				}
 				if (!string.IsNullOrEmpty(tempFolder)) SelfCleanUp(tempFolder);
 			    //return;


added Log( string sql) and now hibernate.show_sql works

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@1635

--- src/NHibernate/Impl/BatcherImpl.cs
+++ src/NHibernate/Impl/BatcherImpl.cs
@@ -14,7 +14,8 @@
 	internal abstract class BatcherImpl : IBatcher
 	{
 		protected static readonly ILog log = LogManager.GetLogger( typeof( BatcherImpl ) );
-
+		protected static readonly ILog logSql = LogManager.GetLogger("NHibernate.SQL");
+
 		private static int openCommandCount;
 		private static int openReaderCount;

@@ -82,10 +83,7 @@
 		{
 			try
 			{
-				if( log.IsInfoEnabled )
-				{
-					log.Info( "Preparing " + command.CommandText );
-				}
+				Log(command.CommandText);

 				if( command.Connection != null )
 				{
@@ -130,7 +128,13 @@
 			{
 				batchCommand = PrepareCommand( sql ); // calls ExecuteBatch()
 				batchCommandSql = sql;
-			}
+			}
+			else
+			{
+				log.Debug("reusing command");
+				Log(batchCommand.CommandText);
+			}
+
 			return batchCommand;
 		}

@@ -209,10 +213,7 @@
 		public IDataReader ExecuteReader( IDbCommand cmd )
 		{
 			CheckReaders();
-
 			Prepare( cmd );
-
-
 			IDataReader reader;
 			if( factory.ConnectionProvider.Driver.SupportsMultipleOpenReaders == false )
 			{
@@ -400,6 +401,13 @@
 			get { return session; }
 		}

+		private void Log(String sql){
+			logSql.Debug(sql);
+			if ( factory.IsShowSqlEnabled ) {
+				Console.Out.WriteLine("NHibernate :" + sql);
+			}
+		}
+
 		private static void LogOpenPreparedCommand()
 		{
 			if( log.IsDebugEnabled )


Fixed problem with nullifiables field and out of memory exception with
cascading deletes and circular references.

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@652

--- src/NHibernate/Impl/SessionImpl.cs
+++ src/NHibernate/Impl/SessionImpl.cs
@@ -213,7 +213,7 @@
 		[NonSerialized] private IdentityMap arrayHolders; //key=array, value=ArrayHolder
 		[NonSerialized] private IdentityMap collections; //key=PersistentCollection, value=CollectionEntry

-		private IList nullifiables = new ArrayList();  //set of Keys of deleted objects
+		private IDictionary nullifiables = new Hashtable();  //set of Keys of deleted objects

 		private IInterceptor interceptor;

@@ -1107,6 +1107,7 @@
 				}
 			}

+
 			return e.Status==Status.Saving || (
 				earlyInsert ? !e.ExistsInDatabase : nullifiables.Contains( new Key(e.Id, e.Persister) )
 				);
@@ -1120,20 +1121,21 @@
 		{
 			if (obj==null) throw new NullReferenceException("attempted to delete null");

-			object theObj = UnproxyAndReassociate(obj);
-
-			EntityEntry entry = GetEntry(theObj);
+			//object theObj = UnproxyAndReassociate(obj);
+			obj = UnproxyAndReassociate(obj);
+
+			EntityEntry entry = GetEntry(obj);
 			IClassPersister persister=null;
 			if (entry==null)
 			{
 				log.Debug("deleting a transient instance");

-				persister = GetPersister(theObj);
-				object id = persister.GetIdentifier(theObj);
+				persister = GetPersister(obj);
+				object id = persister.GetIdentifier(obj);

 				if (id==null) throw new HibernateException("the transient instance passed to Delete() has a null identifier");

-				object old = GetEntry( new Key(id, persister) );
+				object old = GetEntity( new Key(id, persister) );

 				if (old!=null)
 				{
@@ -1143,15 +1145,15 @@
 						);
 				}

-				RemoveCollectionsFor(persister, id, theObj);
-
-				AddEntity( new Key(id, persister), theObj);
+				RemoveCollectionsFor(persister, id, obj);
+
+				AddEntity( new Key(id, persister), obj);
 				entry = AddEntry(
-					theObj,
+					obj,
 					Status.Loaded,
-					persister.GetPropertyValues(theObj),
+					persister.GetPropertyValues(obj),
 					id,
-					persister.GetVersion(theObj),
+					persister.GetVersion(obj),
 					LockMode.None,
 					true,
 					persister
@@ -1170,10 +1172,12 @@
 			}

 			if ( !persister.IsMutable )
+			{
 				throw new HibernateException(
 					"attempted to delete an object of immutable class: " +
 					MessageHelper.InfoString(persister)
 					);
+			}

 			if ( log.IsDebugEnabled ) log.Debug( "deleting " + MessageHelper.InfoString(persister, entry.Id) );

@@ -1184,7 +1188,7 @@
 			if (entry.LoadedState==null )
 			{
 				//ie the object came in from Update()
-				entry.DeletedState = persister.GetPropertyValues(theObj);
+				entry.DeletedState = persister.GetPropertyValues(obj);
 			}
 			else
 			{
@@ -1192,30 +1196,32 @@
 				TypeFactory.DeepCopy(entry.LoadedState, propTypes, persister.PropertyUpdateability, entry.DeletedState);
 			}

-			interceptor.OnDelete(theObj, entry.Id, entry.DeletedState, persister.PropertyNames, propTypes);
-
-			NullifyTransientReferences(entry.DeletedState, propTypes, false, theObj);
-
-			ArrayList oldNullifiables = null;
+			interceptor.OnDelete(obj, entry.Id, entry.DeletedState, persister.PropertyNames, propTypes);
+
+			NullifyTransientReferences(entry.DeletedState, propTypes, false, obj);
+
+			// in h2.0.3 this is a Set
+			IDictionary oldNullifiables = null;
 			ArrayList oldDeletions = null;
 			if ( persister.HasCascades )
 			{
-				oldNullifiables = new ArrayList();
-				oldNullifiables.AddRange(nullifiables);
+				oldNullifiables = new Hashtable(nullifiables);
 				oldDeletions = (ArrayList) deletions.Clone();
 			}

-			nullifiables.Add( new Key(entry.Id, persister) );
+			nullifiables[ new Key(entry.Id, persister) ] = new object();
 			entry.Status = Status.Deleted; // before any callbacks, etc, so subdeletions see that this deletion happend first
-			ScheduledDeletion delete = new ScheduledDeletion(entry.Id, version, theObj, persister, this);
+			ScheduledDeletion delete = new ScheduledDeletion(entry.Id, version, obj, persister, this);
 			deletions.Add(delete); // ensures that containing deletions happen before sub-deletions

 			try
 			{
 				// after nullify, because we don't want to nullify references to subdeletions
 				// try to do callback + cascade
-				if ( persister.ImplementsLifecycle ) {
-					if ( ( (ILifecycle)theObj).OnDelete(this) == LifecycleVeto.Veto ) {
+				if ( persister.ImplementsLifecycle )
+				{
+					if ( ( (ILifecycle)obj).OnDelete(this) == LifecycleVeto.Veto )
+					{
 						//rollback deletion
 						RollbackDeletion(entry, delete);
 						return; //don't let it cascade
@@ -1223,25 +1229,25 @@
 				}

 				//BEGIN YUCKINESS:
-				if ( persister.HasCascades ) {
-
+				if ( persister.HasCascades )
+				{
 					int start = deletions.Count;

-					IList newNullifiables = nullifiables;
+					IDictionary newNullifiables = nullifiables;
 					nullifiables = oldNullifiables;

 					cascading++;
 					try
 					{
 						// cascade-delete to collections "BEFORE" the collection owner is deleted
-						Cascades.Cascade(this, persister, theObj, Cascades.CascadingAction.ActionDelete, CascadePoint.CascadeAfterInsertBeforeDelete);
+						Cascades.Cascade(this, persister, obj, Cascades.CascadingAction.ActionDelete, CascadePoint.CascadeAfterInsertBeforeDelete);
 					}
 					finally
 					{
 						cascading--;
-						foreach(object oldNullify in oldNullifiables)
+						foreach(DictionaryEntry oldNullifyDictEntry in oldNullifiables)
 						{
-							newNullifiables.Add(oldNullify);
+							newNullifiables[oldNullifyDictEntry.Key] = oldNullifyDictEntry.Value;
 						}
 						nullifiables = newNullifiables;
 					}
@@ -1270,7 +1276,7 @@
 				//END YUCKINESS

 				// cascade-save to many-to-one AFTER the parent was saved
-				Cascades.Cascade(this, persister, theObj, Cascades.CascadingAction.ActionDelete, CascadePoint.CascadeBeforeInsertAfterDelete);
+				Cascades.Cascade(this, persister, obj, Cascades.CascadingAction.ActionDelete, CascadePoint.CascadeBeforeInsertAfterDelete);
 			}
 			catch (Exception e)
 			{
@@ -1302,11 +1308,10 @@
 		private void RemoveCollection(CollectionPersister role, object id)
 		{
 			if ( log.IsDebugEnabled ) log.Debug( "collection dereferenced while transient " + MessageHelper.InfoString(role, id) );
-			//TODO: H2.0.3 - add back in when CollectionPersister.HasOrphanDelete is coded
-//			if(role.HasOrphanDelete)
-//			{
-//				throw new HibernateException("You may not dereference a collection with cascade=\"all-delete-orphan\"");
-//			}
+			if(role.HasOrphanDelete)
+			{
+				throw new HibernateException("You may not dereference a collection with cascade=\"all-delete-orphan\"");
+			}
 			collectionRemovals.Add( new ScheduledCollectionRemove(role, id, false, this) );
 		}


Improved SwaggerParameter.ActualSchema

Improved SwaggerParameter.ActualSchema

--- src/NSwag.Core/SwaggerParameter.cs
+++ src/NSwag.Core/SwaggerParameter.cs
@@ -44,7 +44,16 @@
         /// Gets the actual schema, either the parameter schema itself (or its reference) or the <see cref="Schema"/> property when <see cref="Kind"/> == body.
         /// <exception cref="InvalidOperationException" accessor="get">The schema reference path is not resolved.</exception>
         [JsonIgnore]
-        public override JsonSchema4 ActualSchema => Schema?.ActualSchema ?? CustomSchema?.ActualSchema ?? base.ActualSchema; // TODO: Use/override ActualTypeSchema?
+        public override JsonSchema4 ActualSchema
+        {
+            get
+            {
+                if (Reference is SwaggerParameter parameter)
+                    return parameter.ActualSchema;
+                else
+                    return Schema?.ActualSchema ?? CustomSchema?.ActualSchema ?? base.ActualSchema;
+            }
+        }

         /// Gets the actual parameter.
         [JsonIgnore]


Use empty strings for namespaces for consistency when importing reflection types

--- Mono.Cecil/Import.cs
+++ Mono.Cecil/Import.cs
@@ -92,7 +92,7 @@
 			if (IsNestedType (type))
 				reference.DeclaringType = ImportType (type.DeclaringType, context, import_kind);
 			else
-				reference.Namespace = type.Namespace;
+				reference.Namespace = type.Namespace ?? string.Empty;

 			if (type.IsGenericType)
 				ImportGenericParameters (reference, type.GetGenericArguments ());


Update Help.cs

Update Help.cs

--- src/NadekoBot/Modules/Help/Help.cs
+++ src/NadekoBot/Modules/Help/Help.cs
@@ -88,7 +88,7 @@

             if (com == null)
             {
-                await channel.SendMessageAsync(":mag: **I can't find that command.**");
+                await channel.SendMessageAsync(🔍 **I can't find that command.**");
                 return;
             }
             var str = $"**__Help for:__ `{com.Text}`**";


-cmds now splits into multiple messages if too long

--- src/NadekoBot/Modules/Help/Help.cs
+++ src/NadekoBot/Modules/Help/Help.cs
@@ -55,8 +55,14 @@
                 await ReplyErrorLocalized("module_not_found").ConfigureAwait(false);
                 return;
             }
+            var j = 0;
+            var groups = cmdsArray.GroupBy(x => j++ / 48).ToArray();

-            await channel.SendTableAsync($"📃 **{GetText("list_of_commands")}**\n", cmdsArray, el => $"{el.Aliases.First(),-15} {"["+el.Aliases.Skip(1).FirstOrDefault()+"]",-8}").ConfigureAwait(false);
+            for (int i = 0; i < groups.Count(); i++)
+            {
+                await channel.SendTableAsync(i == 0 ? $"📃 **{GetText("list_of_commands")}**\n" : "", groups.ElementAt(i), el => $"{el.Aliases.First(),-15} {"[" + el.Aliases.Skip(1).FirstOrDefault() + "]",-8}").ConfigureAwait(false);
+            }
+

             await ConfirmLocalized("commands_instr", Prefix).ConfigureAwait(false);
         }


Flag ActualFreeInbytes with Obsolete

Flag ActualFreeInbytes with Obsolete

--- src/Nest/Domain/Stats/NodeStats.cs
+++ src/Nest/Domain/Stats/NodeStats.cs
@@ -167,6 +167,9 @@
 			public int UsedPercent { get; internal set; }
 			[JsonProperty("actual_free")]
 			public string ActualFree { get; internal set; }
+			[Obsolete]
+			[JsonProperty("actual_free_in_bytes")]
+			public long ActualFreeInbytes { get; internal set; }
 			[JsonProperty("actual_free_in_bytes")]
 			public long ActualFreeInBytes { get; internal set; }
 			[JsonProperty("actual_used")]


Updated FormatArgs

Updated FormatArgs

--- NiL.JS/Core/Tools.cs
+++ NiL.JS/Core/Tools.cs
@@ -1922,7 +1922,7 @@

                         if (v._oValue is GlobalObject)
                             return "global";
-
+
                         if (v._oValue is Proxy)
                         {
                             var hostedType = (v._oValue as Proxy)._hostedType;
@@ -1964,7 +1964,7 @@
         {
             return Tools.JSValueToObjectString(v, 1, 0);
         }
-
+
         public static string JSValueToObjectString(JSValue v, int maxRecursionDepth)
         {
             return Tools.JSValueToObjectString(v, maxRecursionDepth, 0);
@@ -2081,7 +2081,7 @@
             }
             return v.ToString();
         }
-
+
         public static string JSValueToString(JSValue v)
         {
             if (v == null)
@@ -2103,23 +2103,30 @@
         }

-        public static string FormatArgs(IEnumerable<KeyValuePair<string, JSValue>> args)
+        public static string FormatArgs(IEnumerable args)
         {
             if (args == null)
                 return null;

-            var e = args.GetEnumerator();
+            IEnumerable ie = args;
+            if (args is IEnumerable<KeyValuePair<string, JSValue>>)
+                ie = (args as IEnumerable<KeyValuePair<string, JSValue>>).Select((x) => x.Value);
+
+            var e = ie.GetEnumerator();
             if (!e.MoveNext())
                 return null;

-            var arg = e.Current.Value;
+            object o = e.Current;
+            JSValue v = o as JSValue;
             string f = null;

-            if (arg != null && arg.ValueType == JSValueType.String)
-                f = arg.ToString();
+            if (f == null && o != null && (o is string))
+                f = v.ToString();
+            if (f == null && v != null && v.ValueType == JSValueType.String)
+                f = v.ToString();

             bool hasNext = e.MoveNext();
-
+
             var s = new StringBuilder();

             if (f != null && hasNext)
@@ -2127,7 +2134,7 @@
                 int pos = 0;
                 while (pos < f.Length && hasNext)
                 {
-                    arg = e.Current.Value;
+                    v = (o = e.Current) as JSValue;
                     bool usedArg = false;

                     int next = f.IndexOf('%', pos);
@@ -2171,18 +2178,34 @@
                     switch (c)
                     {
                         case 's':
-                            s.Append(Tools.JSValueToString(arg));
+                            if (v != null)
+                                s.Append(Tools.JSValueToString(v));
+                            else
+                                s.Append((o ?? "null").ToString());
+
                             usedArg = true;
                             break;
                         case 'o':
                         case 'O':
                             int maxRec = (c == 'o') ? 1 : 2;
-                            s.Append(Tools.JSValueToObjectString(arg, maxRec));
+                            if (v != null)
+                                s.Append(Tools.JSValueToObjectString(v, maxRec));
+                            else if (o == null)
+                                s.Append("null");
+                            else if (o is string || o is char || o is StringBuilder)
+                                s.Append('"').Append(o.ToString()).Append('"');
+                            else
+                                s.Append((o ?? "null").ToString());
+
                             usedArg = true;
                             break;
                         case 'i':
                         case 'd':
-                            d = (double)Tools.JSObjectToNumber(arg);
+                            d = double.NaN;
+                            if (v != null)
+                                d = (double)Tools.JSObjectToNumber(v);
+                            else if (!Tools.ParseNumber((o ?? "null").ToString(), out d, 0))
+                                d = double.NaN;

                             if (double.IsNaN(d) || double.IsInfinity(d))
                                 d = 0.0;
@@ -2198,7 +2221,11 @@
                             usedArg = true;
                             break;
                         case 'f':
-                            d = (double)Tools.JSObjectToNumber(arg);
+                            d = double.NaN;
+                            if (v != null)
+                                d = (double)Tools.JSObjectToNumber(v);
+                            else if (!Tools.ParseNumber((o ?? "null").ToString(), out d, 0))
+                                d = double.NaN;

                             if (para >= 0)
                                 d = System.Math.Round(d, System.Math.Min(15, para));
@@ -2229,45 +2256,45 @@

                 while (hasNext)
                 {
-                    arg = e.Current.Value;
+                    v = (o = e.Current) as JSValue;
                     s.Append(' ');
-                    if (arg != null)
-                    {
-                        if (arg.ValueType == JSValueType.Object)
-                            s.Append(Tools.JSValueToObjectString(arg));
+                    if (v != null)
+                    {
+                        if (v.ValueType == JSValueType.Object)
+                            s.Append(Tools.JSValueToObjectString(v));
                         else
-                            s.Append(arg.ToString());
+                            s.Append(v.ToString());
                     }
                     else
-                        s.Append("null");
+                        s.Append((o ?? "null").ToString());
                     hasNext = e.MoveNext();
                 }
             }
             else
             {
-                if (arg != null)
-                {
-                    if (arg.ValueType == JSValueType.Object)
-                        s.Append(Tools.JSValueToObjectString(arg));
+                if (v != null)
+                {
+                    if (v.ValueType == JSValueType.Object)
+                        s.Append(Tools.JSValueToObjectString(v));
                     else
-                        s.Append(arg.ToString());
+                        s.Append(v.ToString());
                 }
                 else
-                    s.Append("null");
+                    s.Append((o ?? "null").ToString());

                 while (hasNext)
                 {
-                    arg = e.Current.Value;
+                    v = (o = e.Current) as JSValue;
                     s.Append(' ');
-                    if (arg != null)
-                    {
-                        if (arg.ValueType == JSValueType.Object)
-                            s.Append(Tools.JSValueToObjectString(arg));
+                    if (v != null)
+                    {
+                        if (v.ValueType == JSValueType.Object)
+                            s.Append(Tools.JSValueToObjectString(v));
                         else
-                            s.Append(arg.ToString());
+                            s.Append(v.ToString());
                     }
                     else
-                        s.Append("null");
+                        s.Append((o ?? "null").ToString());
                     hasNext = e.MoveNext();
                 }
             }


if group is defined on Watch.Create the indent is disabled.

--- src/TWCore/Watch.cs
+++ src/TWCore/Watch.cs
@@ -271,8 +271,18 @@
             {
                 double gTime;
                 double cTime;
-                var gValue = string.IsNullOrEmpty(item.Group) ? item.Id.ToString("00") : item.Group;
-                var indent = EnableIndent ? IndentTexts.GetOrAdd(item.Id, num => new string(' ', (num - 1) * 2)) : string.Empty;
+                string indent = null;
+                string gValue;
+                if (string.IsNullOrEmpty(item.Group))
+                {
+                    gValue = item.Id.ToString("00");
+                    if (EnableIndent)
+                        indent = IndentTexts.GetOrAdd(item.Id, num => new string(' ', (num - 1) * 2));
+                }
+                else
+                {
+                    gValue = item.Group;
+                }
                 switch (item.Type)
                 {
                     case 0:
@@ -281,7 +291,7 @@
                     case 1:
                         cTime = item.LastTapTicks * FrequencyTime;
                         item.Counter?.Register(item.Message, cTime);
-                        if (Math.Abs(item.LastTapTicks - item.GlobalTicks) > 0.0000001)
+                        if (Math.Abs(item.LastTapTicks - item.GlobalTicks) > 0.00001)
                         {
                             gTime = item.GlobalTicks * FrequencyTime;
                             Core.Log.Write(item.Level, indent + string.Format("  [{0}-TAP, Time = {1:0.0000}ms, Cumulated = {2:0.0000}ms] {3}", gValue, cTime, gTime, item.Message));
@@ -295,7 +305,7 @@
                         cTime = item.LastTapTicks * FrequencyTime;
                         gTime = item.GlobalTicks * FrequencyTime;
                         item.Counter?.Register(item.Counter.Name == CounterPreffix + item.Message ? "Total" : item.Message, cTime);
-                        if (Math.Abs(cTime - gTime) > 0.0000001)
+                        if (Math.Abs(cTime - gTime) > 0.00001)
                             Core.Log.Write(item.Level, indent + string.Format("[{0}-END, Time = {1:0.0000}ms, Total Time = {2:0.0000}ms] {3}", gValue, cTime, gTime, item.Message));
                         else
                             Core.Log.Write(item.Level, indent + string.Format("[{0}-END, Total Time = {1:0.0000}ms] {2}", gValue, gTime, item.Message));


Added the ability to override the name of the package.

--- src/ThorNet/Thor.cs
+++ src/ThorNet/Thor.cs
@@ -21,11 +21,11 @@

         public ITerminal Terminal { get; }

-		/// <summary>
-		/// Adds an option's value by name.
-		/// </summary>
-		/// <param name="name">The name of the option to provide a value for.</param>
-		/// <param name="value">The value to provide.</param>
+        /// <summary>
+        /// Adds an option's value by name.
+        /// </summary>
+        /// <param name="name">The name of the option to provide a value for.</param>
+        /// <param name="value">The value to provide.</param>
         void IThor.AddOption(string name, string value) {
             List<string> values;
             if (!_options.TryGetValue(name, out values)) {
@@ -34,24 +34,34 @@
             }
             values.Add(value);
         }
-
-		/// <summary>
-		/// Determines if the option has already been specified.
-		/// </summary>
-		/// <param name="name">The name of the option.</param>
-		/// <returns>True if there is a value for the option, otherwise false.</returns>
+
+        /// <summary>
+        /// Gets the name of the package for display in the <see cref="help(string)"/> method.
+        /// </summary>
+        protected virtual string GetPackageName()
+        {
+            string name = GetType().GetTypeInfo().Assembly.GetName().Name;
+
+            return $"dnx {name}";
+        }
+
+        /// <summary>
+        /// Determines if the option has already been specified.
+        /// </summary>
+        /// <param name="name">The name of the option.</param>
+        /// <returns>True if there is a value for the option, otherwise false.</returns>
         bool IThor.HasOption(string name) {
             return _options.ContainsKey(name);
         }

         [Desc("help [COMMAND]", "Describe available commands or one specific command")]
         public void help(string commandName = null) {
-            string name = GetType().GetTypeInfo().Assembly.GetName().Name;
+            string name = GetPackageName();

             // Print all of the commands.
             if (commandName == null) {
                 foreach (ThorCommand command in _commands.OrderBy(p => p.Key).Select(p => p.Value)) {
-                    string message = $"  dnx {name} {command.Example}\t# {command.Description}";
+                    string message = $"  {name} {command.Example}\t# {command.Description}";
                     if (message.Length > Terminal.Width) {
                         message = message.Substring(0, Terminal.Width - 9);
                         message += "...";
@@ -65,7 +75,7 @@
                 ThorCommand command;
                 if (_commands.TryGetValue(commandName, out command)) {
                     Terminal.WriteLine("Usage:");
-                    Terminal.WriteLine($" dnx {name} {command.Example}");
+                    Terminal.WriteLine($" {name} {command.Example}");
                     Terminal.WriteLine();

                     // Print the options.


Apply better styling to Excel output (PG-425)

Column widths and text column word wrapping

--- Glyssen/ProjectExporter.cs
+++ Glyssen/ProjectExporter.cs
@@ -9,6 +9,7 @@
 using Glyssen.Properties;
 using L10NSharp;
 using OfficeOpenXml;
+using OfficeOpenXml.Style;
 using SIL.Reporting;

 namespace Glyssen
@@ -121,6 +122,22 @@
 			{
 				var sheet = xls.Workbook.Worksheets.Add("Script");
 				sheet.Cells["A1"].LoadFromArrays(data.Select(d => d.ToArray()).ToArray());
+				sheet.Cells.Style.VerticalAlignment = ExcelVerticalAlignment.Top;
+				sheet.Column(1).AutoFit(2d, sheet.DefaultColWidth); // line number
+				int offset = 0;
+				if (IncludeVoiceActors)
+				{
+					offset = 1;
+					sheet.Column(2).AutoFit(2d, 20d); // voice actor
+				}
+				sheet.Column(2 + offset).AutoFit(2d, sheet.DefaultColWidth); // style tag
+				sheet.Column(3 + offset).AutoFit(2d, sheet.DefaultColWidth); // book
+				sheet.Column(4 + offset).AutoFit(2d, sheet.DefaultColWidth); // chapter
+				sheet.Column(5 + offset).AutoFit(2d, sheet.DefaultColWidth); // verse
+				sheet.Column(6 + offset).AutoFit(2d, 20d); // character ID
+				sheet.Column(8 + offset).Style.WrapText = true; // script text
+				sheet.Column(8 + offset).Width = 50d;
+				sheet.Column(9 + offset).AutoFit(2d, sheet.DefaultColWidth); // block length
 				xls.Save();
 			}
 		}
@@ -151,6 +168,7 @@

 		internal static List<object> GetExportDataForBlock(Block block, int blockNumber, string bookId, string voiceActor = null, string singleVoiceNarratorOverride = null, bool useCharacterIdInScript = true)
 		{
+			// NOTE: if the order here changes, there may be changes needed in GenerateExcelFile
 			List<object> list = new List<object>();
 			list.Add(blockNumber);
 			if (voiceActor != null)


Implement ResumeAll

Implement ResumeAll

--- src/QuartzNET-DynamoDB/JobStore.cs
+++ src/QuartzNET-DynamoDB/JobStore.cs
@@ -922,7 +922,15 @@

         public void ResumeAll()
         {
-            throw new NotImplementedException();
+            lock (lockObject)
+            {
+                var triggerGroupNames = GetTriggerGroupNames();
+
+                foreach (var groupName in triggerGroupNames)
+                {
+                    ResumeTriggers(GroupMatcher<TriggerKey>.GroupEquals(groupName));
+                }
+            }
         }

         /// <summary>


Isolate QA version from Released one

Isolate QA version from Released one

--- src/SIM.Base/ApplicationManager.cs
+++ src/SIM.Base/ApplicationManager.cs
@@ -87,7 +87,12 @@

     static ApplicationManager()
     {
-      DataFolder = InitializeFolder(Environment.ExpandEnvironmentVariables(AppDataRoot));
+      var processName = Process.GetCurrentProcess().ProcessName + ".exe";
+      ProcessName = processName;
+      IsDebugging = processName.ContainsIgnoreCase(".vshost.");
+      IsQA = processName.ContainsIgnoreCase(".QA.");
+
+      DataFolder = InitializeFolder(Environment.ExpandEnvironmentVariables(AppDataRoot + (IsQA ? "-QA" : "")));
       PluginsFolder = InitializeDataFolder("Plugins");
       CachesFolder = InitializeDataFolder("Caches");
       FilePackagesFolder = InitializeDataFolder("Custom Packages");
@@ -101,11 +106,6 @@
       AppShortVersion = GetShortVersion();
       AppLabel = GetLabel();

-      var processName = Process.GetCurrentProcess().ProcessName + ".exe";
-      ProcessName = processName;
-      IsDebugging = processName.ContainsIgnoreCase(".vshost.");
-      IsQA = processName.ContainsIgnoreCase(".QA.");
-
       TempFolder = InitializeDataFolder("Temp");
     }


Fix redundant mapping

Fix redundant mapping

--- src/SQLite.Net/SQLiteConnection.cs
+++ src/SQLite.Net/SQLiteConnection.cs
@@ -318,12 +318,8 @@
         /// </returns>
         public int CreateTable(Type ty, CreateFlags createFlags = CreateFlags.None)
         {
-            TableMapping map;
-            if (!_tableMappings.TryGetValue(ty.FullName, out map))
-            {
-                map = GetMapping(ty, createFlags);
-                _tableMappings.Add(ty.FullName, map);
-            }
+            var map = GetMapping(ty, createFlags);
+
             var query = "create table if not exists \"" + map.TableName + "\"(\n";

             var mapColumns = map.Columns;


Fix test on mono, failing because of difference in error string

  `Microsoft.Build.Tasks.UnitTests.Unzip_Tests.LogsErrorIfReadOnlyFileCannotBeOverwitten`

This brings back the fix that was reverted earlier:

	commit 620319992a26b108537f2daae0d5eb0c70b3c223
	Author: Ankit Jain <ankit.jain@microsoft.com>
	Date:   Tue Apr 30 15:21:17 2019 -0400

		[mono] Revert an old workaround which is not required anymore.

		Revert "[tests] Fix tests on mono, by using the correct error strings"

		This reverts commit 577912b5858d6b6f958a1cbfffe61c7cebe420fc.

(cherry picked from commit d7cfa9bd3c46e6bc6882b796a2b36d1bcc6b6e02)

--- src/Tasks.UnitTests/Unzip_Tests.cs
+++ src/Tasks.UnitTests/Unzip_Tests.cs
@@ -134,7 +134,9 @@

                 unzip.Execute().ShouldBeFalse(() => _mockEngine.Log);

-                _mockEngine.Log.ShouldContain("D6DFD219DACE48F8B86EFCDF98433333.txt' is denied", () => _mockEngine.Log);
+                _mockEngine.Log.ShouldContain(
+                        $"D6DFD219DACE48F8B86EFCDF98433333.txt{ (NativeMethodsShared.IsMono ? "\"" : "'") } is denied",
+                        () => _mockEngine.Log);
             }
         }


Added Reset method to reset stream and structs

--- ParseLNK/ParseLnk.cs
+++ ParseLNK/ParseLnk.cs
@@ -35,7 +35,7 @@

         public void Parse()
         {
-            Stream.BaseStream.Seek(0, SeekOrigin.Begin);
+            Reset();

             ShellLinkHeader = Stream.ReadStruct<Structs.ShellLinkHeader>();

@@ -62,6 +62,17 @@
             ParseStringData();

             ParseExtraData();
+        }
+
+        private void Reset()
+        {
+            Stream.BaseStream.Seek(0, SeekOrigin.Begin);
+
+            ShellLinkHeader = new Structs.ShellLinkHeader();
+            LinkTargetIdList = new Structs.LinkTargetIDList();
+            LinkInfo = new Structs.LinkInfo();
+            StringData = new Structs.StringData();
+            ExtraData = new Blocks();
         }

         private void ParseLinkTargetIdList()


Update XML doc

Update XML doc

--- Iced/Intel/CpuidFeature.cs
+++ Iced/Intel/CpuidFeature.cs
@@ -513,7 +513,7 @@
 		RDPMC,

 		/// <summary>
-		/// CPUID.(EAX=80000008H, ECX=0H):EBX.RDPRU[bit 4]
+		/// CPUID.80000008H:EBX.RDPRU[bit 4]
 		/// </summary>
 		RDPRU,


Bigfix

Bigfix

--- Illias/Time/Timestamped.cs
+++ Illias/Time/Timestamped.cs
@@ -315,8 +315,8 @@
             if ((Object) Timestamped == null)
                 return false;

-            return _Timestamp.       Equals(Timestamped._Timestamp) &&
-                   _Value.ToString().Equals(Timestamped._Value.ToString());
+            return _Timestamp.Equals(Timestamped._Timestamp) &&
+                   _Value.    Equals(Timestamped._Value);

         }


Adding test for value types

Adding test for value types

--- src/UnitTests/ValueTransformers.cs
+++ src/UnitTests/ValueTransformers.cs
@@ -135,5 +135,40 @@
             }
         }

+        public class TransformingValueTypes : AutoMapperSpecBase
+        {
+            public class Source
+            {
+                public int Value { get; set; }
+            }
+
+            public class Dest
+            {
+                public int Value { get; set; }
+            }
+
+            protected override MapperConfiguration Configuration { get; } = new MapperConfiguration(cfg =>
+            {
+                cfg.ApplyTransform<int>(dest => dest * 2);
+                cfg.CreateProfile("Other", p =>
+                {
+                    p.CreateMap<Source, Dest>();
+                    p.ApplyTransform<int>(dest => dest + 3);
+                });
+            });
+
+            [Fact]
+            public void ShouldApplyProfileFirstThenRoot()
+            {
+                var source = new Source
+                {
+                    Value = 5
+                };
+                var dest = Mapper.Map<Source, Dest>(source);
+
+                dest.Value.ShouldBe((5 + 3) * 2);
+            }
+        }
+
     }
 }


Fix intersection print bug

Fix intersection print bug

--- src/XLParser/ExcelFormulaParser.cs
+++ src/XLParser/ExcelFormulaParser.cs
@@ -367,8 +367,7 @@
                         if (input.IsIntersection())
                         {
                             format = "{0} {2}";
-                        }
-                        if (input.IsBinaryReferenceOperation())
+                        }else if (input.IsBinaryReferenceOperation())
                         {
                             format = "{0}{1}{2}";
                         }


Breaking Change in LiveList version 2.3.0

Breaking Change in LiveList version 2.3.0

--- src/Yaapii.Atoms/Lists/LiveList.cs
+++ src/Yaapii.Atoms/Lists/LiveList.cs
@@ -1,63 +1,71 @@
-// MIT License
-//
-// Copyright(c) 2021 ICARUS Consulting GmbH
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-
-using System;
-using System.Collections.Generic;
+// MIT License
+//
+// Copyright(c) 2021 ICARUS Consulting GmbH
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+
+using System;
+using System.Collections.Generic;
 using Yaapii.Atoms.Enumerable;

-namespace Yaapii.Atoms.List
-{
-    /// <summary>
-    /// Makes a readonly list.
-    /// </summary>
-    /// <typeparam name="T">type of items</typeparam>
-    public sealed class LiveList<T> : ListEnvelope<T>
-    {
-        /// <summary>
-        /// Makes a readonly list.
-        /// </summary>
-        public LiveList(params T[] array) : this(() =>
-            new List<T>(array)
+namespace Yaapii.Atoms.List
+{
+    /// <summary>
+    /// Makes a readonly list.
+    /// </summary>
+    /// <typeparam name="T">type of items</typeparam>
+    public sealed class LiveList<T> : ListEnvelope<T>
+    {
+        /// <summary>
+        /// Makes a readonly list.
+        /// </summary>
+        public LiveList(params T[] array) : this(() =>
+            new List<T>(array)
+        )
+        { }
+
+        /// <summary>
+        /// Makes a readonly list.
+        /// </summary>
+        public LiveList(IEnumerator<T> src) : this(() =>
+            new List<T>(
+                new LiveMany<T>(() => src)
+            )
         )
         { }

-        /// <summary>
-        /// Makes a readonly list.
-        /// </summary>
-        public LiveList(IEnumerator<T> src) : this(() =>
-            new List<T>(
-                new LiveMany<T>(() => src)
-            )
+        /// <summary>
+        /// Makes a readonly list.
+        /// </summary>
+        public LiveList(IEnumerable<T> src) : this(
+            () => new List<T>(src)
         )
         { }
-
-        /// <summary>
-        /// Makes a readonly list.
-        /// </summary>
-        /// <param name="src">source enumerable</param>
-        public LiveList(Func<IList<T>> src) : base(
-            src,
-            true
-        )
-        { }
-    }
-}
+
+        /// <summary>
+        /// Makes a readonly list.
+        /// </summary>
+        /// <param name="src">source enumerable</param>
+        public LiveList(Func<IList<T>> src) : base(
+            src,
+            true
+        )
+        { }
+    }
+}


iis: minor update

iis: minor update

--- iis/PubNubExampleASPNET/Core/PubnubCore.cs
+++ iis/PubNubExampleASPNET/Core/PubnubCore.cs
@@ -1,4 +1,4 @@
-//Build Date: December 23, 2014
+//Build Date: January 13, 2015
 #region "Header"
 #if (UNITY_STANDALONE || UNITY_WEBPLAYER || UNITY_ANDROID || UNITY_IOS)
 #define USE_JSONFX_UNITY_IOS
@@ -950,7 +950,7 @@
 						}
 					}
 				}
-                if (state.ChannelGroups != null && state.ChannelGroups.Length > 0)
+                if (state.ChannelGroups != null && state.ChannelGroups.Length > 0 && state.ChannelGroups[0] != null)
                 {
                     string activeChannelGroup = state.ChannelGroups[0].ToString(); //Assuming one channel exist, else will refactor later
                     PubnubChannelGroupCallbackKey callbackKey = new PubnubChannelGroupCallbackKey();


Make LogLevel publicly available

Make LogLevel publicly available

To turn the logger off in tests, its attribute LogLevel must be
changable from outside the class.

--- IO/Logger.cs
+++ IO/Logger.cs
@@ -34,7 +34,7 @@
 		/// <summary>
 		/// Choose the severity you would like to have logged.
 		/// </summary>
-		public static Severity LogLevel { get; private set; }
+		public static Severity LogLevel { get; set; }

 		/// <summary>
 		/// Initialize this instance.


fix: Refactor

fix: Refactor

--- src/Avalonia.Controls/TreeView.cs
+++ src/Avalonia.Controls/TreeView.cs
@@ -166,11 +166,9 @@
         {
             item.IsExpanded = true;

-            var panel = item.Presenter.Panel;
-
             if (item.Presenter?.Panel != null)
             {
-                foreach (var child in panel.Children)
+                foreach (var child in item.Presenter.Panel.Children)
                 {
                     if (child is TreeViewItem treeViewItem)
                     {


BL-2364 gather yet more information

BL-2364 gather yet more information

--- src/BloomExe/Edit/EditingModel.cs
+++ src/BloomExe/Edit/EditingModel.cs
@@ -579,6 +579,7 @@
 		public void SetupServerWithCurrentPageIframeContents()
 		{
 			_domForCurrentPage = CurrentBook.GetEditableHtmlDomForPage(_pageSelection.CurrentSelection);
+			CheckForBL2364("setup");
 			SetPageZoom();
 			XmlHtmlConverter.MakeXmlishTagsSafeForInterpretationAsHtml(_domForCurrentPage.RawDom);
 			if (_currentPage != null)
@@ -908,6 +909,7 @@
 			// So after a change, this eventually gets called. We then ask the page's book to fix things
 			// up so that those boxes are ready to edit
 			_domForCurrentPage = CurrentBook.GetEditableHtmlDomForPage(_pageSelection.CurrentSelection);
+			CheckForBL2364("reset dom in finish save");
 			_currentlyDisplayedBook.UpdateEditableAreasOfElement(_domForCurrentPage);

 			//Enhance: Probably we could avoid having two saves, by determing what it is that they entail that is required.
@@ -974,7 +976,7 @@
 						Logger.WriteEvent("Error: SaveNow():CanUpdate threw an exception");
 						throw err;
 					}
-					CheckForBL2364();
+					CheckForBL2364("save");
 					//OK, looks safe, time to save.
 					_pageSelection.CurrentSelection.Book.SavePage(_domForCurrentPage);
 				}
@@ -1034,7 +1036,7 @@

 		// One more attempt to catch whatever is causing us to get errors indicating that the page we're trying
 		// to save is not in the book we're trying to save it into.
-		private void CheckForBL2364()
+		private void CheckForBL2364(string when)
 		{
 			try
 			{
@@ -1042,8 +1044,27 @@
 					_domForCurrentPage.SelectSingleNodeHonoringDefaultNS("//div[contains(@class, 'bloom-page')]");
 				string pageDivId = divElement.GetAttribute("id");
 				if (pageDivId != _pageSelection.CurrentSelection.Id)
+				{
+					// Several reports indicate that this occasionally and unrepeatably happens with various call stacks.
+					// This code is aimed at finding out a little more about the circumstances.
+					try
+					{
+						Logger.WriteEvent("BL2364 failure: pageDiv is {0}", _domForCurrentPage.RawDom.OuterXml);
+						Logger.WriteEvent("BL2364 failure: selection div is {0}", _pageSelection.CurrentSelection.GetDivNodeForThisPage().OuterXml);
+					}
+					catch (Exception)
+					{
+						Logger.WriteEvent("Bl2364: failed to write XML of DOM and selection");
+					}
 					throw new ApplicationException(
-						"Bl-2634: id of _domForCurrentPage is not the same as ID of _pageSelection.CurrentSelection");
+						string.Format(
+							"Bl-2634: id of _domForCurrentPage ({0}) is not the same as ID of _pageSelection.CurrentSelection ({1})",
+							pageDivId, _pageSelection.CurrentSelection.Id));
+				}
+				// By comparing this with the stacks dumped when the check fails, we can hopefully tell whether the DOM or
+				// the Current Selection ID somehow changed, which may help partition the space we need to look in to
+				// solve the problem.
+				Logger.WriteMinorEvent(String.Format("CheckForBl2364({0}: both ids are " + _pageSelection.CurrentSelection.Id, when));
 			}
 			catch (Exception err)
 			{


Update ConsoleTable.cs

Update ConsoleTable.cs

--- src/ConsoleTables/ConsoleTable.cs
+++ src/ConsoleTables/ConsoleTable.cs
@@ -53,7 +53,7 @@

             if (Columns.Count != values.Length)
                 throw new Exception(
-                    $"The number columns in the row ({Columns.Count}) does not match the values ({values.Length}");
+                    $"The number columns in the row ({Columns.Count}) does not match the values ({values.Length})");

             Rows.Add(values);
             return this;


Introduce NameReplacementResult class.

Introduce NameReplacementResult class.

--- src/DBVer/Mapping/NameReplacer.cs
+++ src/DBVer/Mapping/NameReplacer.cs
@@ -9,6 +9,21 @@
     {
         public string NamePattern { get; set; }
         public Dictionary<Regex, string> ContentMappings { get; set; }
+    }
+
+    internal class NameReplacementResult
+    {
+        private ReplacementConfig config;
+
+        public string OldName { get; }
+        public string NewName { get; }
+
+        public NameReplacementResult(ReplacementConfig config, string oldName, string newName)
+        {
+            this.config = config;
+            OldName = oldName;
+            NewName = newName;
+        }
     }

     internal class NameReplacer


Added DatabaseRowReader.ToDictionary()

Added DatabaseRowReader.ToDictionary()

--- src/Database/DatabaseRowReader.cs
+++ src/Database/DatabaseRowReader.cs
@@ -33,6 +33,29 @@
         public int GetOrdinal(string name) { return reader.GetOrdinal(name); }
         public int GetValues(object[] values) { return reader.GetValues(values); }

+        /// <summary>
+        /// Returns a <c>Dictionary</c> that represents the current row.
+        /// </summary>
+        /// <returns>The <c>Dictionary</c> representing the row.</returns>
+        public Dictionary<string, object> ToDictionary()
+        {
+            return ToDictionary(StringComparer.OrdinalIgnoreCase);
+        }
+
+        /// <summary>
+        /// Returns a <c>Dictionary</c> that represents the current row allowing to specify the
+        /// StringComparer used to create the <c>Dictionary</c>.
+        /// </summary>
+        /// <returns>The <c>Dictionary</c> representing the row.</returns>
+        public Dictionary<string, object> ToDictionary(StringComparer comparer)
+        {
+            var dictionary = new Dictionary<string, object>(comparer);
+            for (int i = 0; i < FieldCount; i++)
+            {
+                dictionary[GetName(i)] = GetValue(i);
+            }
+            return dictionary;
+        }

         // Fields accessed by ordinal
         public bool GetBoolean(int ordinal) { return reader.GetBoolean(ordinal); }


週の初日・最終日取得関数追加

週の初日・最終日取得関数追加

--- src/DateTime/DateTimeExtension.cs
+++ src/DateTime/DateTimeExtension.cs
@@ -10,21 +10,33 @@

     public static partial class A {

+        /// うるう年であるか返す
+        public static bool IsLeapYear(this DateTime @this) {
+            return DateTime.IsLeapYear(@this.Year);
+        }
+
         /// 月の初日
         public static DateTime FirstDayOfMonth(this DateTime @this) {
             var t = 1 - @this.Day;
             return t == 0 ? @this : @this.AddTicks(t * TimeSpan.TicksPerDay);
         }

-        /// 月の晦日
+        /// 月の最終日
         public static DateTime LastDayOfMonth(this DateTime @this) {
             var t = DateTime.DaysInMonth(@this.Year, @this.Month) - @this.Day;
             return t == 0 ? @this : @this.AddTicks(t * TimeSpan.TicksPerDay);
         }

-        /// うるう年であるか返す
-        public static bool IsLeapYear(this DateTime @this) {
-            return DateTime.IsLeapYear(@this.Year);
+        /// 週の初日
+        public static DateTime FirstDayOfWeek(this DateTime @this) {
+            var t = 0 - (int)@this.DayOfWeek;
+            return t == 0 ? @this : @this.AddTicks(t * TimeSpan.TicksPerDay);
+        }
+
+        /// 週の最終日
+        public static DateTime LastDayOfWeek(this DateTime @this) {
+            var t = 6 - (int)@this.DayOfWeek;
+            return t == 0 ? @this : @this.AddTicks(t * TimeSpan.TicksPerDay);
         }
     }
 }


Minor cleanup

Minor cleanup

--- src/Discord.Net/Models/Channel.cs
+++ src/Discord.Net/Models/Channel.cs
@@ -328,27 +328,17 @@
         public IEnumerable<User> FindUsers(string name, bool exactMatch = false)
         {
             if (name == null) throw new ArgumentNullException(nameof(name));
-
             return _users.Select(x => x.Value.User).Find(name, exactMatch: exactMatch);
         }

-        public Task<Message> SendMessage(string text)
+        public Task<Message> SendMessage(string text) => SendMessageInternal(text, false);
+        public Task<Message> SendTTSMessage(string text) => SendMessageInternal(text, true);
+        private Task<Message> SendMessageInternal(string text, bool isTTS)
         {
             if (text == null) throw new ArgumentNullException(nameof(text));
             if (text == "") throw new ArgumentException("Value cannot be blank", nameof(text));
-            return SendMessageInternal(text, false);
-        }
-        public Task<Message> SendTTSMessage(string text)
-        {
-            if (text == null) throw new ArgumentNullException(nameof(text));
-            if (text == "") throw new ArgumentException("Value cannot be blank", nameof(text));
-            return SendMessageInternal(text, true);
-        }
-        private Task<Message> SendMessageInternal(string text, bool isTTS)
-        {
             if (text.Length > DiscordConfig.MaxMessageSize)
-                throw new ArgumentOutOfRangeException(nameof(text), $"Message must be {DiscordConfig.MaxMessageSize} characters or less.");
-
+                throw new ArgumentOutOfRangeException(nameof(text), $"Message must be {DiscordConfig.MaxMessageSize} characters or less.");
             return Task.FromResult(Client.MessageQueue.QueueSend(this, text, isTTS));
         }

@@ -374,8 +364,7 @@
             return msg;
         }

-        public Task SendIsTyping()
-            => Client.ClientAPI.Send(new SendIsTypingRequest(Id));
+        public Task SendIsTyping() => Client.ClientAPI.Send(new SendIsTypingRequest(Id));
         #endregion

         #region Permissions


Handle everyone mentions a little more properly

--- src/Discord.Net/Models/Message.cs
+++ src/Discord.Net/Models/Message.cs
@@ -215,6 +215,13 @@
 					.Select(x => _client.Users[x.Id, Channel.Server?.Id])
 					.ToArray();
 			}
+			if (model.IsMentioningEveryone != null)
+			{
+				if (model.IsMentioningEveryone.Value && User.GetPermissions(channel).MentionEveryone)
+					MentionedRoles = new Role[] { Server.EveryoneRole };
+				else
+					MentionedRoles = new Role[0];
+            }
 			if (model.Content != null)
 			{
 				string text = model.Content;
@@ -222,18 +229,18 @@

 				//var mentionedUsers = new List<User>();
 				var mentionedChannels = new List<Channel>();
-				var mentionedRoles = new List<Role>();
+				//var mentionedRoles = new List<Role>();
 				text = Mention.CleanUserMentions(_client, server, text/*, mentionedUsers*/);
 				if (server != null)
 				{
 					text = Mention.CleanChannelMentions(_client, server, text, mentionedChannels);
-					text = Mention.CleanRoleMentions(_client, User, channel, text, mentionedRoles);
+					//text = Mention.CleanRoleMentions(_client, User, channel, text, mentionedRoles);
 				}
 				Text = text;

 				//MentionedUsers = mentionedUsers;
 				MentionedChannels = mentionedChannels;
-				MentionedRoles = mentionedRoles;
+				//MentionedRoles = mentionedRoles;
 			}

 			if (server != null)


ScriptRunner.Execute overload should delegate to virtual version

--- src/Dotnet.Script/ScriptRunner.cs
+++ src/Dotnet.Script/ScriptRunner.cs
@@ -17,18 +17,12 @@
             ScriptCompiler = scriptCompiler;
         }

-        public virtual async Task<TReturn> Execute<TReturn>(ScriptContext context)
+        public Task<TReturn> Execute<TReturn>(ScriptContext context)
         {
-            var compilationContext = ScriptCompiler.CreateCompilationContext<TReturn, InteractiveScriptGlobals>(context);
             var globals = new InteractiveScriptGlobals(Console.Out, CSharpObjectFormatter.Instance);
-
             foreach (var arg in context.Args)
-            {
                 globals.Args.Add(arg);
-            }
-
-            var scriptResult = await compilationContext.Script.RunAsync(globals).ConfigureAwait(false);
-            return ProcessScriptState(scriptResult);
+            return Execute<TReturn, InteractiveScriptGlobals>(context, globals);
         }

         public virtual async Task<TReturn> Execute<TReturn, THost>(ScriptContext context, THost host)