Update NestedContentPropertyEditor.cs to fix 2 bugs (#9236)

* Update NestedContentPropertyEditor.cs

Make sure when trying to JsonConvert.DeserializeObject it is json...

* Update NestedContentPropertyEditor.cs

added null check

--- src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs
+++ src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs
@@ -363,7 +363,10 @@
             {
                 if (propertyValue == null || string.IsNullOrWhiteSpace(propertyValue.ToString()))
                     return new List<NestedContentRowValue>();
-
+
+                 if (!propertyValue.ToString().DetectIsJson())
+                    return new List<NestedContentRowValue>();
+
                 var rowValues = JsonConvert.DeserializeObject<List<NestedContentRowValue>>(propertyValue.ToString());

                 // There was a note here about checking if the result had zero items and if so it would return null, so we'll continue to do that
@@ -388,23 +391,26 @@
                         propertyTypes = contentTypePropertyTypes[contentType.Alias] = contentType.CompositionPropertyTypes.ToDictionary(x => x.Alias, x => x);

                     // find any keys that are not real property types and remove them
-                    foreach(var prop in row.RawPropertyValues.ToList())
-                    {
-                        if (IsSystemPropertyKey(prop.Key)) continue;
-
-                        // doesn't exist so remove it
-                        if (!propertyTypes.TryGetValue(prop.Key, out var propType))
-                        {
-                            row.RawPropertyValues.Remove(prop.Key);
-                        }
-                        else
-                        {
-                            // set the value to include the resolved property type
-                            row.PropertyValues[prop.Key] = new NestedContentPropertyValue
+                    if (row.RawPropertyValues != null)
+                    {
+                        foreach (var prop in row.RawPropertyValues.ToList())
+                        {
+                            if (IsSystemPropertyKey(prop.Key)) continue;
+
+                            // doesn't exist so remove it
+                            if (!propertyTypes.TryGetValue(prop.Key, out var propType))
                             {
-                                PropertyType = propType,
-                                Value = prop.Value
-                            };
+                                row.RawPropertyValues.Remove(prop.Key);
+                            }
+                            else
+                            {
+                                // set the value to include the resolved property type
+                                row.PropertyValues[prop.Key] = new NestedContentPropertyValue
+                                {
+                                    PropertyType = propType,
+                                    Value = prop.Value
+                                };
+                            }
                         }
                     }
                 }


Revert usage of Word Diffing in Preview Changes

Fixes #3792

--- src/VisualStudio/Core/Def/Implementation/Preview/FileChange.cs
+++ src/VisualStudio/Core/Def/Implementation/Preview/FileChange.cs
@@ -243,23 +243,9 @@
             var oldString = oldText.ToString();
             var newString = newText.ToString();

-            // first try, cheapest way.
-            var diffResult = diffService.DiffStrings(oldString, newString, new StringDifferenceOptions()
-            {
-                DifferenceType = StringDifferenceTypes.Line | StringDifferenceTypes.Word,
-                WordSplitBehavior = WordSplitBehavior.WhiteSpaceAndPunctuation
-            });
-
-            if (!ContainsBetterDiff(left, right, diffResult, cancellationToken))
-            {
-                return diffResult;
-            }
-
-            // second, try a bit more expansive way
             return diffService.DiffStrings(oldString, newString, new StringDifferenceOptions()
             {
-                DifferenceType = StringDifferenceTypes.Word,
-                WordSplitBehavior = WordSplitBehavior.WhiteSpaceAndPunctuation
+                DifferenceType = StringDifferenceTypes.Line,
             });
         }


Add comments.

Add comments.

--- src/Workspaces/Core/Portable/RegularExpressions/RegexParser.cs
+++ src/Workspaces/Core/Portable/RegularExpressions/RegexParser.cs
@@ -33,6 +33,7 @@
             _captureNamesToSpan = captureNamesToSpan;
             _captureNumbersToSpan = captureNumbersToSpan;

+            // Get the first token.  It is allowed to have trivia on it.
             ConsumeCurrentToken(allowTrivia: true);
         }

@@ -40,6 +41,13 @@
         /// Returns the latest token the lexer has produced, and then asks the lexer to
         /// produce the next token after that.
         /// </summary>
+        /// <param name="allowTrivia">Whether or not trivia is allowed on the next token
+        /// produced.  In the .net parser trivia is only allowed on a few constructs,
+        /// and our parser mimics that behavior.  Note that even if trivia is allowed,
+        /// the type of trivia that can be scanned depends on the current RegexOptions.
+        /// For example, if <see cref="RegexOptions.IgnorePatternWhitespace"/> is currently
+        /// enabled, then '#...' comments are allowed.  Otherwise, only '(?#...)' comemnts
+        /// are allowed.</param>
         private RegexToken ConsumeCurrentToken(bool allowTrivia)
         {
             var previous = _currentToken;
@@ -240,25 +248,16 @@
         }

         private RegexExpressionNode ParseZeroOrMoreQuantifier(RegexPrimaryExpressionNode current)
-        {
-            // Whitespace allowed between the quantifier and the possible following ?.
-            return TryParseLazyQuantifier(new RegexZeroOrMoreQuantifierNode(current,
-                ConsumeCurrentToken(allowTrivia: true)));
-        }
+            // Whitespace allowed between the quantifier and the possible following ? or next sequence item.
+            => TryParseLazyQuantifier(new RegexZeroOrMoreQuantifierNode(current, ConsumeCurrentToken(allowTrivia: true)));

         private RegexExpressionNode ParseOneOrMoreQuantifier(RegexPrimaryExpressionNode current)
-        {
-            // Whitespace allowed between the quantifier and the possible following ?.
-            return TryParseLazyQuantifier(new RegexOneOrMoreQuantifierNode(current,
-                ConsumeCurrentToken(allowTrivia: true)));
-        }
+            // Whitespace allowed between the quantifier and the possible following ? or next sequence item.
+            => TryParseLazyQuantifier(new RegexOneOrMoreQuantifierNode(current, ConsumeCurrentToken(allowTrivia: true)));

         private RegexExpressionNode ParseZeroOrOneQuantifier(RegexPrimaryExpressionNode current)
-        {
-            // Whitespace allowed between the quantifier and the possible following ?.
-            return TryParseLazyQuantifier(new RegexZeroOrOneQuantifierNode(current,
-                ConsumeCurrentToken(allowTrivia: true)));
-        }
+            // Whitespace allowed between the quantifier and the possible following ? or next sequence item.
+            => TryParseLazyQuantifier(new RegexZeroOrOneQuantifierNode(current, ConsumeCurrentToken(allowTrivia: true)));

         private RegexExpressionNode TryParseNumericQuantifier(
             RegexPrimaryExpressionNode expression, RegexToken openBraceToken)
@@ -355,6 +354,7 @@
                 return false;
             }

+            // Whitespace allowed between the quantifier and the possible following ? or next sequence item.
             closeBraceToken = ConsumeCurrentToken(allowTrivia: true);
             return true;
         }
@@ -396,6 +396,9 @@

         private RegexPrimaryExpressionNode ParsePossibleUnexpectedNumericQuantifier(RegexExpressionNode lastExpression)
         {
+            // Native parser looks for something like {0,1} in a top level sequence and reports
+            // an explicit error that that's not allowed.  However, something like {0, 1} is fine
+            // and is treated as six textual tokens.
             var openBraceToken = _currentToken.With(kind: RegexKind.TextToken);
             var start = _lexer.Position;

@@ -406,6 +409,8 @@
                 CheckQuantifierExpression(lastExpression, ref openBraceToken);
             }

+            // Started with { but wasn't a numeric quantifier.  This is totally legal and is just
+            // a textual sequence.  Restart, scanning this token as a normal sequence element.
             ResetToPositionAndConsumeCurrentToken(start, allowTrivia: true);
             return new RegexTextNode(openBraceToken);
         }
@@ -414,25 +419,36 @@
         {
             var token = _currentToken.With(kind: RegexKind.TextToken).AddDiagnosticIfNone(
                 new RegexDiagnostic(WorkspacesResources.Too_many_close_parens, GetSpan(_currentToken)));
+
+            // Technically, since an error occurred, we can do whatever we want here.  However,
+            // the spirit of the native parser is that top level sequence elements are allowed
+            // to have trivia.  So that's the behavior we mimic.
             ConsumeCurrentToken(allowTrivia: true);
             return new RegexTextNode(token);
         }

         private RegexPrimaryExpressionNode ParseText()
+            // Allow trivia between this piece of text and the next sequence element
             => new RegexTextNode(ConsumeCurrentToken(allowTrivia: true).With(kind: RegexKind.TextToken));

         private RegexPrimaryExpressionNode ParseEndAnchor()
+            // Allow trivia between this anchor and the next sequence element
             => new RegexAnchorNode(RegexKind.EndAnchor, ConsumeCurrentToken(allowTrivia: true));

         private RegexPrimaryExpressionNode ParseStartAnchor()
+            // Allow trivia between this anchor and the next sequence element
             => new RegexAnchorNode(RegexKind.StartAnchor, ConsumeCurrentToken(allowTrivia: true));

         private RegexPrimaryExpressionNode ParseWildcard()
+            // Allow trivia between the . and the next sequence element
             => new RegexWildcardNode(ConsumeCurrentToken(allowTrivia: true));

         private RegexGroupingNode ParseGrouping()
         {
             var start = _lexer.Position;
+
+            // Check what immediately follows the (.  If we have (? it is processed specially.
+            // However, we do not treat (? the same as ( ?
             var openParenToken = ConsumeCurrentToken(allowTrivia: false);

             switch (_currentToken.Kind)
@@ -441,6 +457,7 @@
                     return ParseGroupQuestion(openParenToken, _currentToken);

                 default:
+                    // Wasn't (? just parse this as a normal group.
                     _lexer.Position = start;
                     return ParseSimpleGroup(openParenToken);
             }
@@ -451,6 +468,7 @@
             switch (_currentToken.Kind)
             {
                 case RegexKind.CloseParenToken:
+                    // Grouping completed normally.  Allow trivia between it and the next sequence element.
                     return ConsumeCurrentToken(allowTrivia: true);

                 default:
@@ -469,7 +487,13 @@
             var currentOptions = _options;
             _options = embeddedOptions;

+            // We're parsing the embedded sequence inside the current group.  As this is a sequence
+            // we want to allow trivia between the current token we're on, and the first token
+            // of the embedded sequence.
             ConsumeCurrentToken(allowTrivia: true);
+
+            // When parsing out the sequence don't grab the close paren, that will be for our caller
+            // to get.
             var expression = this.ParseAlternatingSequences(consumeCloseParen: false);
             _options = currentOptions;
             return expression;
@@ -496,6 +520,9 @@
             }

             var afterQuestionPos = _lexer.Position;
+
+            // Lots of possible options when we see (?.  Look at the immediately following character
+            // (without any allowed spaces) to decide what to parse out next.
             ConsumeCurrentToken(allowTrivia: false);
             switch (_currentToken.Kind)
             {
@@ -560,7 +587,14 @@
                 RegexToken innerCloseParenToken;
                 if (capture.Kind == RegexKind.NumberToken)
                 {
-                    // If it's a numeric group, it always has to be a real reference.
+                    // If it's a numeric group, it has to be immediately followed by a )
+                    // and the numeric reference has to exist.
+                    //
+                    // That means that (?(4 ) is not treated as an embedded expression but as
+                    // an error.  This is different from (?(a ) which will be treated as an
+                    // embedded expression, and different from (?(a) will will be treated as
+                    // an embedded expression or capture group depending on if 'a' is a existing
+                    // capture name.

                     ConsumeCurrentToken(allowTrivia: false);
                     if (_currentToken.Kind == RegexKind.CloseParenToken)


gmaps:No more WIP

gmaps:No more WIP

--- kagv/gmaps.cs
+++ kagv/gmaps.cs
@@ -27,7 +27,6 @@

         private void gmaps_Load(object sender, EventArgs e)
         {
-            MessageBox.Show("WORK IN PROGRESS-WILL EAT YOUR CAT");

             this.MaximizeBox = false;
             this.FormBorderStyle = FormBorderStyle.FixedSingle;


Make classes private for now.

Make classes private for now.

--- osu.Desktop.Tests/Visual/TestCaseEditorMenuBar.cs
+++ osu.Desktop.Tests/Visual/TestCaseEditorMenuBar.cs
@@ -92,93 +92,93 @@
                 }
             });
         }
-    }

-    public class EditorMenuBar : MenuBar
-    {
-    }
-
-    public class EditorMenuBarItem : MenuBarItem
-    {
-        private const int fade_duration = 250;
-        private const float text_size = 17;
-
-        private readonly Container background;
-
-        private Color4 normalColour;
-
-        public EditorMenuBarItem(string title)
-            : base(title)
+        private class EditorMenuBar : MenuBar
         {
-            Content.Padding = new MarginPadding(8);
-
-            AddInternal(background = new Container
-            {
-                RelativeSizeAxes = Axes.Both,
-                Masking = true,
-                Depth = float.MaxValue,
-                Alpha = 0,
-                Child = new Container<Box>
-                {
-                    // The following is done so we can have top rounded corners but not bottom corners
-                    RelativeSizeAxes = Axes.Both,
-                    Height = 2,
-                    Masking = true,
-                    CornerRadius = 5,
-                    Child = new Box { RelativeSizeAxes = Axes.Both }
-                }
-            });
         }

-        [BackgroundDependencyLoader]
-        private void load(OsuColour colours)
+        private class EditorMenuBarItem : MenuBarItem
         {
-            background.Colour = colours.Gray3;
-            ContextMenu.Menu.Background.Colour = colours.Gray3;
-            TitleText.Colour = normalColour = colours.BlueLight;
+            private const int fade_duration = 250;
+            private const float text_size = 17;
+
+            private readonly Container background;
+
+            private Color4 normalColour;
+
+            public EditorMenuBarItem(string title)
+                : base(title)
+            {
+                Content.Padding = new MarginPadding(8);
+
+                AddInternal(background = new Container
+                {
+                    RelativeSizeAxes = Axes.Both,
+                    Masking = true,
+                    Depth = float.MaxValue,
+                    Alpha = 0,
+                    Child = new Container<Box>
+                    {
+                        // The following is done so we can have top rounded corners but not bottom corners
+                        RelativeSizeAxes = Axes.Both,
+                        Height = 2,
+                        Masking = true,
+                        CornerRadius = 5,
+                        Child = new Box { RelativeSizeAxes = Axes.Both }
+                    }
+                });
+            }
+
+            [BackgroundDependencyLoader]
+            private void load(OsuColour colours)
+            {
+                background.Colour = colours.Gray3;
+                ContextMenu.Menu.Background.Colour = colours.Gray3;
+                TitleText.Colour = normalColour = colours.BlueLight;
+            }
+
+            public override void Open()
+            {
+                base.Open();
+
+                background.FadeIn(fade_duration, Easing.OutQuint);
+                TitleText.FadeColour(Color4.White, fade_duration, Easing.OutQuint);
+            }
+
+            public override void Close()
+            {
+                base.Close();
+
+                background.FadeOut(fade_duration, Easing.OutQuint);
+                TitleText.FadeColour(normalColour, fade_duration, Easing.OutQuint);
+            }
+
+            protected override SpriteText CreateTitleText() => new OsuSpriteText { TextSize = text_size };
+
+            protected override ContextMenu<ContextMenuItem> CreateContextMenu() => new OsuContextMenu<ContextMenuItem>
+            {
+                OriginPosition = new Vector2(8, 0)
+            };
         }

-        public override void Open()
+        private class EditorContextMenuSpacer : EditorContextMenuItem
         {
-            base.Open();
+            public override bool HandleInput => false;

-            background.FadeIn(fade_duration, Easing.OutQuint);
-            TitleText.FadeColour(Color4.White, fade_duration, Easing.OutQuint);
+            public EditorContextMenuSpacer()
+                : base(" ")
+            {
+            }
         }

-        public override void Close()
+        private class EditorContextMenuItem : OsuContextMenuItem
         {
-            base.Close();
+            private const int min_text_length = 40;

-            background.FadeOut(fade_duration, Easing.OutQuint);
-            TitleText.FadeColour(normalColour, fade_duration, Easing.OutQuint);
-        }
-
-        protected override SpriteText CreateTitleText() => new OsuSpriteText { TextSize = text_size };
-
-        protected override ContextMenu<ContextMenuItem> CreateContextMenu() => new OsuContextMenu<ContextMenuItem>
-        {
-            OriginPosition = new Vector2(8, 0)
-        };
-    }
-
-    public class EditorContextMenuSpacer : EditorContextMenuItem
-    {
-        public override bool HandleInput => false;
-
-        public EditorContextMenuSpacer()
-            : base(" ")
-        {
-        }
-    }
-
-    public class EditorContextMenuItem : OsuContextMenuItem
-    {
-        private const int min_text_length = 40;
-
-        public EditorContextMenuItem(string title, MenuItemType type = MenuItemType.Standard)
-            : base(title.PadRight(min_text_length), type)
-        {
+            public EditorContextMenuItem(string title, MenuItemType type = MenuItemType.Standard)
+                : base(title.PadRight(min_text_length), type)
+            {
+            }
         }
     }
 }


Add support for automatically reloading framework on a change to the executable assembly.

--- osu.Framework.Desktop/Platform/DesktopGameHost.cs
+++ osu.Framework.Desktop/Platform/DesktopGameHost.cs
@@ -1,6 +1,10 @@
 // Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
 // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

+using System;
+using System.Diagnostics;
+using System.IO;
+using System.Threading;
 using System.Threading.Tasks;
 using osu.Framework.Platform;
 using OpenTK;
@@ -16,6 +20,16 @@

         public DesktopGameHost(string gameName = @"", bool bindIPCPort = false) : base(gameName)
         {
+            foreach (string a in Environment.GetCommandLineArgs())
+            {
+                switch (a)
+                {
+                    case @"--reload-on-change":
+                        ensureShadowCopy();
+                        break;
+                }
+            }
+
             if (bindIPCPort)
             {
                 IpcProvider = new TcpIpcProvider();
@@ -26,6 +40,51 @@
                     IpcTask = IpcProvider.Start();
                 }
             }
+        }
+
+        /// <summary>
+        /// Copy ourselves to a temporary path and watch for updates to the original assembly.
+        /// </summary>
+        private void ensureShadowCopy()
+        {
+            string exe = System.Reflection.Assembly.GetEntryAssembly().Location;
+            if (exe.Contains(@"_shadow"))
+            {
+                //we are already running a shadow copy. monitor the original executable path for changes.
+                exe = exe.Replace(@"_shadow", @"");
+
+                DateTime originalTime = new FileInfo(exe).LastWriteTimeUtc;
+
+                Task.Run(() =>
+                {
+                    while (new FileInfo(exe).LastWriteTimeUtc == originalTime)
+                        Thread.Sleep(1000);
+
+                    Process.Start(exe, @"--reload-on-change");
+                    Environment.Exit(0);
+                });
+
+                return;
+            }
+
+            string shadowExe = exe.Replace(@".exe", @"_shadow.exe");
+
+            int attempts = 5;
+            while (attempts-- > 0)
+            {
+                try
+                {
+                    File.Copy(exe, shadowExe, true);
+                    break;
+                }
+                catch
+                {
+                    Thread.Sleep(200);
+                }
+            }
+
+            Process.Start(shadowExe, @"--reload-on-change");
+            Environment.Exit(0);
         }

         public override TextInputSource GetTextInput() => Window == null ? null : new GameWindowTextInput(Window);


Refactor

Refactor

--- osu.Framework/Testing/Drawables/TestCaseButton.cs
+++ osu.Framework/Testing/Drawables/TestCaseButton.cs
@@ -117,7 +117,7 @@
         {
             if (FilteringActive)
             {
-                if (FilteringActive && matchingFilter)
+                if (matchingFilter)
                     Show();
                 else
                     Hide();
@@ -138,8 +138,11 @@
             get => current;
             set
             {
-                if (current == value) return;
+                if (current == value)
+                    return;
+
                 current = value;
+
                 text.FadeColour(value ? Color4.Black : Color4.White, TRANSITION_DURATION);
                 updateVisibility();
             }


Add touch input methods to the manual input manager

--- osu.Framework/Testing/Input/ManualInputManager.cs
+++ osu.Framework/Testing/Input/ManualInputManager.cs
@@ -53,6 +53,9 @@
         public void MoveMouseTo(Drawable drawable, Vector2? offset = null) => MoveMouseTo(drawable.ToScreenSpace(drawable.LayoutRectangle.Centre) + (offset ?? Vector2.Zero));
         public void MoveMouseTo(Vector2 position) => Input(new MousePositionAbsoluteInput { Position = position });

+        public void MoveTouchTo(Drawable drawable, MouseButton source) => MoveTouchTo(drawable.ToScreenSpace(drawable.LayoutRectangle.Centre), source);
+        public void MoveTouchTo(Vector2 position, MouseButton source) => Input(new TouchPositionInput(source, position));
+
         public void Click(MouseButton button)
         {
             PressButton(button);
@@ -64,6 +67,18 @@

         public void PressJoystickButton(JoystickButton button) => Input(new JoystickButtonInput(button, true));
         public void ReleaseJoystickButton(JoystickButton button) => Input(new JoystickButtonInput(button, false));
+
+        public void ActivateTouch(MouseButton source) => Input(new TouchActivityInput(source, true));
+
+        public void ActivateTouchAt(Drawable drawable, MouseButton source) => ActivateTouchAt(drawable.ToScreenSpace(drawable.LayoutRectangle.Centre), source);
+
+        public void ActivateTouchAt(Vector2 position, MouseButton source)
+        {
+            MoveTouchTo(position, source);
+            ActivateTouch(source);
+        }
+
+        public void DeactivateTouch(MouseButton source) => Input(new TouchActivityInput(source, false));

         private class ManualInputHandler : InputHandler
         {


Remove unnecessary overrides

Remove unnecessary overrides

--- osu.Game.Rulesets.Taiko/TaikoHitObjectComposer.cs
+++ osu.Game.Rulesets.Taiko/TaikoHitObjectComposer.cs
@@ -9,17 +9,14 @@
 using osu.Framework.Graphics.Shapes;
 using osu.Framework.Graphics.UserInterface;
 using osu.Framework.Input.Events;
-using osu.Game.Beatmaps;
 using osu.Game.Graphics.UserInterface;
 using osu.Game.Rulesets.Edit;
 using osu.Game.Rulesets.Edit.Tools;
-using osu.Game.Rulesets.Mods;
 using osu.Game.Rulesets.Objects;
 using osu.Game.Rulesets.Objects.Drawables;
 using osu.Game.Rulesets.Objects.Types;
 using osu.Game.Rulesets.Taiko.Objects;
 using osu.Game.Rulesets.Taiko.UI;
-using osu.Game.Rulesets.UI;
 using osu.Game.Screens.Edit.Compose.Components;
 using osuTK;
 using osuTK.Graphics;
@@ -29,8 +26,6 @@
 {
     public class TaikoHitObjectComposer : HitObjectComposer<TaikoHitObject>
     {
-        private DrawableTaikoRuleset drawableRuleset;
-
         public TaikoHitObjectComposer(Ruleset ruleset)
             : base(ruleset)
         {
@@ -43,12 +38,7 @@
             new SwellCompositionTool()
         };

-        protected override ComposeBlueprintContainer CreateBlueprintContainer() => new TaikoBlueprintContainer(drawableRuleset.Playfield.AllHitObjects);
-
-        protected override DrawableRuleset<TaikoHitObject> CreateDrawableRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods = null)
-        {
-            return drawableRuleset = new DrawableTaikoRuleset(ruleset, beatmap, mods);
-        }
+        protected override ComposeBlueprintContainer CreateBlueprintContainer() => new TaikoBlueprintContainer(Playfield.AllHitObjects);
     }

     public class TaikoBlueprintContainer : ComposeBlueprintContainer


Set Masking = false and expose ScrollContainer.

--- osu.Game/Graphics/Containers/SectionsContainer.cs
+++ osu.Game/Graphics/Containers/SectionsContainer.cs
@@ -16,7 +16,7 @@
     public class SectionsContainer : Container
     {
         private Drawable expandableHeader, fixedHeader;
-        private readonly ScrollContainer scrollContainer;
+        public readonly ScrollContainer ScrollContainer;
         private readonly Container<Drawable> sectionsContainer;

         public Drawable ExpandableHeader
@@ -54,7 +54,6 @@
         }

         public Bindable<Drawable> SelectedSection { get; } = new Bindable<Drawable>();
-        public void ScrollToSection(Drawable section) => scrollContainer.ScrollIntoView(section);

         protected virtual Container<Drawable> CreateSectionsContainer()
             => new FillFlowContainer
@@ -97,9 +96,10 @@

         public SectionsContainer()
         {
-            Add(scrollContainer = new ScrollContainer()
+            Add(ScrollContainer = new ScrollContainer()
             {
                 RelativeSizeAxes = Axes.Both,
+                Masking = false,
                 Children = new Drawable[] { sectionsContainer = CreateSectionsContainer() }
             });
         }
@@ -118,7 +118,7 @@

             if (expandableHeader == null) return;

-            float currentScroll = scrollContainer.Current;
+            float currentScroll = ScrollContainer.Current;
             if (currentScroll != lastKnownScroll)
             {
                 lastKnownScroll = currentScroll;
@@ -136,7 +136,7 @@

                 foreach (var section in sections)
                 {
-                    float diff = Math.Abs(scrollContainer.GetChildPosInContent(section) - currentScroll);
+                    float diff = Math.Abs(ScrollContainer.GetChildPosInContent(section) - currentScroll);
                     if (diff < minDiff)
                     {
                         minDiff = diff;


Add benchmark of updating transforms when none are added

--- osu.Framework.Benchmarks/BenchmarkTransformUpdate.cs
+++ osu.Framework.Benchmarks/BenchmarkTransformUpdate.cs
@@ -14,6 +14,7 @@
     public class BenchmarkTransformUpdate : BenchmarkTest
     {
         private TestBox target;
+        private TestBox targetNoTransforms;

         public override void SetUp()
         {
@@ -23,7 +24,8 @@

             ManualClock clock;

-            target = new TestBox { Clock = new FramedClock(clock = new ManualClock()) };
+            targetNoTransforms = new TestBox { Clock = new FramedClock(clock = new ManualClock()) };
+            target = new TestBox { Clock = new FramedClock(clock) };

             // transform one target member over a long period
             target.RotateTo(360, transforms_count * 2);
@@ -34,6 +36,13 @@

             clock.CurrentTime = target.LatestTransformEndTime;
             target.Clock.ProcessFrame();
+        }
+
+        [Benchmark]
+        public void UpdateTransformsWithNonePresent()
+        {
+            for (int i = 0; i < 10000; i++)
+                targetNoTransforms.UpdateTransforms();
         }

         [Benchmark]


Fix regression causing binding settings to fail

--- osu.Game/Graphics/UserInterface/FocusedTextBox.cs
+++ osu.Game/Graphics/UserInterface/FocusedTextBox.cs
@@ -40,6 +40,13 @@
             BorderThickness = 0;
         }

+        protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
+        {
+            if (!HasFocus) return false;
+
+            return base.OnKeyDown(state, args);
+        }
+
         public override bool OnPressed(GlobalAction action)
         {
             if (action == GlobalAction.Back)


Add null check to scrollcontainer.

Add null check to scrollcontainer.

--- osu.Framework/Graphics/Containers/ScrollContainer.cs
+++ osu.Framework/Graphics/Containers/ScrollContainer.cs
@@ -130,7 +130,7 @@

         private void updateSize()
         {
-            scrollbar.ScaleTo(new Vector2(1, Math.Min(1, displayableContent / availableContent)), 200, EasingTypes.OutExpo);
+            scrollbar?.ScaleTo(new Vector2(1, Math.Min(1, displayableContent / availableContent)), 200, EasingTypes.OutExpo);
         }

         private void updateScroll(bool animated = true)


Fix grammar in xmldoc

Fix grammar in xmldoc

--- osu.Game/Overlays/Music/MusicKeyBindingHandler.cs
+++ osu.Game/Overlays/Music/MusicKeyBindingHandler.cs
@@ -12,7 +12,7 @@
 namespace osu.Game.Overlays.Music
 {
     /// <summary>
-    /// Handles <see cref="GlobalAction"/> relating to music playback, and displays a <see cref="Toast"/> via the cached <see cref="OnScreenDisplay"/> accordingly.
+    /// Handles <see cref="GlobalAction"/>s related to music playback, and displays <see cref="Toast"/>s via the global <see cref="OnScreenDisplay"/> accordingly.
     /// </summary>
     public class MusicKeyBindingHandler : Component, IKeyBindingHandler<GlobalAction>
     {


Remove commented code.

Remove commented code.

--- osu.Framework/Graphics/Transformations/ITransform.cs
+++ osu.Framework/Graphics/Transformations/ITransform.cs
@@ -10,7 +10,6 @@
     public interface ITransform : IHasLifetime
     {
         double Duration { get; }
-        //bool IsAlive { get; }

         double StartTime { get; set; }
         double EndTime { get; set; }


Add some more tests of the code fix.

Add some more tests of the code fix.

--- src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/InteropServices/DynamicInterfaceCastableImplementation.Fixer.cs
+++ src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/InteropServices/DynamicInterfaceCastableImplementation.Fixer.cs
@@ -25,6 +25,7 @@

         public override async Task RegisterCodeFixesAsync(CodeFixContext context)
         {
+            System.Diagnostics.Debugger.Break();
             SyntaxGenerator generator = SyntaxGenerator.GetGenerator(context.Document);
             SyntaxNode root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);


Fix potential incorrect connection state resulting in null reference

--- osu.Game/Online/PersistentEndpointClientConnector.cs
+++ osu.Game/Online/PersistentEndpointClientConnector.cs
@@ -145,7 +145,9 @@

         private async Task onConnectionClosed(Exception? ex, CancellationToken cancellationToken)
         {
-            isConnected.Value = false;
+            bool hasBeenCancelled = cancellationToken.IsCancellationRequested;
+
+            await disconnect(true);

             if (ex != null)
                 await handleErrorAndDelay(ex, cancellationToken).ConfigureAwait(false);
@@ -153,7 +155,7 @@
                 Logger.Log($"{ClientName} disconnected", LoggingTarget.Network);

             // make sure a disconnect wasn't triggered (and this is still the active connection).
-            if (!cancellationToken.IsCancellationRequested)
+            if (!hasBeenCancelled)
                 await Task.Run(connect, default).ConfigureAwait(false);
         }

@@ -174,7 +176,9 @@
             }
             finally
             {
+                isConnected.Value = false;
                 CurrentConnection = null;
+
                 if (takeLock)
                     connectionLock.Release();
             }


Fix message display / html stripping

Fix message display / html stripping

--- osu.Game/Overlays/Changelog/ChangelogContentGroup.cs
+++ osu.Game/Overlays/Changelog/ChangelogContentGroup.cs
@@ -10,6 +10,7 @@
 using osu.Game.Online.API.Requests.Responses;
 using System;
 using System.Collections.Generic;
+using System.Text.RegularExpressions;
 using osuTK;
 using osuTK.Graphics;

@@ -262,19 +263,23 @@

                     ChangelogEntries.Add(title);

-                    TextFlowContainer messageContainer = new TextFlowContainer
-                    {
-                        AutoSizeAxes = Axes.Y,
-                        RelativeSizeAxes = Axes.X,
-                    };
-
-                    messageContainer.AddText($"{entry.MessageHtml?.Replace("<p>", "").Replace("</p>", "")}\n", t =>
-                    {
-                        t.Font = OsuFont.GetFont(size: 14); // web: 12,
-                        t.Colour = new Color4(235, 184, 254, 255);
-                    });
-
-                    ChangelogEntries.Add(messageContainer);
+                    if (!string.IsNullOrEmpty(entry.MessageHtml))
+                    {
+                        TextFlowContainer messageContainer = new TextFlowContainer
+                        {
+                            AutoSizeAxes = Axes.Y,
+                            RelativeSizeAxes = Axes.X,
+                        };
+
+                        // todo: use markdown parsing once API returns markdown
+                        messageContainer.AddText(Regex.Replace(entry.MessageHtml, @"<(.|\n)*?>", string.Empty), t =>
+                        {
+                            t.Font = OsuFont.GetFont(size: 14); // web: 12,
+                            t.Colour = new Color4(235, 184, 254, 255);
+                        });
+
+                        ChangelogEntries.Add(messageContainer);
+                    }
                 }
             }
         }


Lagfaering a PartialViewi i beidnir

Lagfaering a PartialViewi i beidnir

--- 3viknaSolutions/3vikna/Views/Home/Request.cshtml
+++ 3viknaSolutions/3vikna/Views/Home/Request.cshtml
@@ -8,7 +8,7 @@

     @Html.Partial("navigationbar")

-    @Html.Partial("Search")
+    @Html.Partial("Searchpartial")

     <table id="RequestTable">
         <thead>


The test now passes

The test now passes

--- Assets/Scripts/Player/PlayerMovementBehaviour.cs
+++ Assets/Scripts/Player/PlayerMovementBehaviour.cs
@@ -13,5 +13,9 @@
         rigidbody = GetComponent<Rigidbody>();
     }

-
+    void FixedUpdate()
+    {
+        PlayerMovement.Update();
+        rigidbody.velocity = PlayerMovement.CurrentVelocity;
+    }
 }


Create Store redirect to store settings

Create Store redirect to store settings

--- BTCPayServer/Controllers/UserStoresController.cs
+++ BTCPayServer/Controllers/UserStoresController.cs
@@ -121,7 +121,10 @@
             var store = await _Repo.CreateStore(GetUserId(), vm.Name);
             CreatedStoreId = store.Id;
             StatusMessage = "Store successfully created";
-            return RedirectToAction(nameof(ListStores));
+            return RedirectToAction(nameof(StoresController.UpdateStore), "Stores", new
+            {
+                storeId = store.Id
+            });
         }

         private static async Task<string> GetBalanceString((BTCPayWallet Wallet, DerivationStrategyBase DerivationStrategy) _)


Conversion of LnrpcInvoice into LightningInvoice

--- BTCPayServer/Payments/Lightning/Lnd/LndClient.cs
+++ BTCPayServer/Payments/Lightning/Lnd/LndClient.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Globalization;
 using System.IO;
 using System.Linq;
 using System.Net.Http;
@@ -33,7 +34,16 @@
                 Memo = description,
                 Expiry = (long)expiry.TotalSeconds
             });
-            throw new NotImplementedException();
+
+            var invoice = new LightningInvoice
+            {
+                // TODO: Verify id corresponds to R_hash
+                Id = BitString(resp.R_hash),
+                Amount = amount,
+                BOLT11 = resp.Payment_request,
+                Status = "unpaid"
+            };
+            return invoice;
         }

         public async Task<LightningNodeInformation> GetInfo(CancellationToken cancellation = default(CancellationToken))
@@ -52,8 +62,8 @@

         public async Task<LightningInvoice> GetInvoice(string invoiceId, CancellationToken cancellation = default(CancellationToken))
         {
-            // var resp = await _decorator.LookupInvoiceAsync(invoiceId, null, cancellation);
-            throw new NotImplementedException();
+            var resp = await _Decorator.LookupInvoiceAsync(invoiceId, null, cancellation);
+            return ConvertLndInvoice(resp);
         }

         public Task<ILightningListenInvoiceSession> Listen(CancellationToken cancellation = default(CancellationToken))
@@ -63,13 +73,44 @@

         async Task<LightningInvoice> ILightningListenInvoiceSession.WaitInvoice(CancellationToken cancellation)
         {
-            //var resp = await _decorator.SubscribeInvoicesAsync(cancellation);
-            throw new NotImplementedException();
+            var resp = await _Decorator.SubscribeInvoicesAsync(cancellation);
+            return ConvertLndInvoice(resp);
+
         }

         public void Dispose()
         {
             _HttpClient?.Dispose();
+        }
+
+        private static string BitString(byte[] bytes)
+        {
+            return BitConverter.ToString(bytes)
+                .Replace("-", "", StringComparison.InvariantCulture)
+                .ToLower(CultureInfo.InvariantCulture);
+        }
+
+        private static LightningInvoice ConvertLndInvoice(LnrpcInvoice resp)
+        {
+            var invoice = new LightningInvoice
+            {
+                // TODO: Verify id corresponds to R_hash
+                Id = BitString(resp.R_hash),
+                Amount = resp.Value,
+                BOLT11 = resp.Payment_request,
+                Status = "unpaid"
+            };
+
+            if (resp.Settle_date.HasValue)
+            {
+                invoice.PaidAt = DateTimeOffset.FromUnixTimeSeconds(resp.Settle_date.Value);
+                invoice.Status = "paid";
+            }
+            else if (DateTimeOffset.FromUnixTimeSeconds(resp.Creation_date.Value + resp.Expiry.Value) > DateTimeOffset.UtcNow)
+            {
+                invoice.Status = "expired";
+            }
+            return invoice;
         }
     }


This version getting posts again, but not dsplaying aything yet

--- facebook-filter/Views/Home/Index.cshtml
+++ facebook-filter/Views/Home/Index.cshtml
@@ -12,9 +12,17 @@

angular-easyfb API demo

-                <button class="btn btn-primary" ng-click="login()" ng-disabled="loginStatus == 'connected'">Connect with Facebook</button>
+                <button class="btn btn-primary"
+                        ng-click="login()"
+                        ng-disabled="loginStatus == 'connected'">
+                    Connect with Facebook
+                </button>

-                <button class="btn btn-danger" ng-click="logout()" ng-disabled="!loginStatus || loginStatus != 'connected'">Logout</button>
+                <button class="btn btn-danger"
+                        ng-click="logout()"
+                        ng-disabled="loginStatus != 'connected'">
+                    Logout
+                </button>

@@ -24,71 +32,90 @@

Login Status: {{loginStatus}}

+
+

+                <button class="btn btn-primary"
+                        ng-click="getPosts()"
+                        ng-disabled="loginStatus != 'connected'">
+                    Get More Posts!
+                </button>
+

+

-
-


Unify the way we raise events within the solution. I.e. through a Raise{EventName}(...) method, which always gets a reference first on the this.{Event} and works on it afterward.

--- CSharp/SimpleOrderRouting.Journey1/LimitOrder.cs
+++ CSharp/SimpleOrderRouting.Journey1/LimitOrder.cs
@@ -45,17 +45,20 @@
         public void Send()
         {
             this.Market.OrderExecuted += this.Market_OrderExecuted;
-            EventHandler<string> marketOnOrderFailed = (sender, s) =>
-                                                                        {
-                                                                          if (OrderFailed != null)
-                                                                          {
-                                                                              OrderFailed(this, s);
-                                                                          }
-                                                                        };
+            EventHandler<string> marketOnOrderFailed = (sender, s) => this.RaiseOrderFailed(s);
             this.Market.OrderFailed += marketOnOrderFailed;
             this.Market.Send(this);
             this.Market.OrderExecuted -= this.Market_OrderExecuted;
             this.Market.OrderFailed -= marketOnOrderFailed;
+        }
+
+        private void RaiseOrderFailed(string s)
+        {
+            var onOrderFailed = this.OrderFailed;
+            if (onOrderFailed != null)
+            {
+                onOrderFailed(this, s);
+            }
         }

         private void Market_OrderExecuted(object sender, DealExecutedEventArgs e)
@@ -69,9 +72,10 @@

         protected void OnOrderExecuted(DealExecutedEventArgs args)
         {
-            if (this.OrderExecuted != null)
+            var onOrderExecuted = this.OrderExecuted;
+            if (onOrderExecuted != null)
             {
-                this.OrderExecuted(this, args);
+                onOrderExecuted(this, args);
             }
         }
     }


comments

comments

--- Daenet.DurableTask.SqlStateProvider/SqlClient.cs
+++ Daenet.DurableTask.SqlStateProvider/SqlClient.cs
@@ -14,42 +14,70 @@

 namespace Daenet.DurableTask.SqlStateProvider
 {
+    /// <summary>
+    /// Client for Connecting to SqlServer
+    /// </summary>
     public class SqlClient
     {
         private string m_ConnectionString;
         private readonly string m_BaseTable;
         private string m_SchemaName;

+        /// <summary>
+        /// Table Name for State with Schema
+        /// </summary>
         public string StateTableWithSchema
         {
             get { return String.Format("{0}.{1}", m_SchemaName, m_BaseTable + "_State"); }
         }

+        /// <summary>
+        /// Table Name for JumpStart entity with Schema
+        /// </summary>
         public string JumpStartTableWithSchema
         {
             get { return String.Format("{0}.{1}", m_SchemaName, m_BaseTable + "_JumpStart"); }
         }

+        /// <summary>
+        /// Table Name for WorkItems with Schema
+        /// </summary>
         public string WorkItemTableWithSchema
         {
             get { return String.Format("{0}.{1}", m_SchemaName, m_BaseTable + "_WorkItem"); }
         }

+        /// <summary>
+        /// Table Name for Jumpstart Entity
+        /// </summary>
         public string JumpStartTableName
         {
             get { return String.Format("{0}", m_BaseTable + "_JumpStart"); }
         }

+        /// <summary>
+        /// Table Name for State Entity
+        /// </summary>
         public string StateTableName
         {
             get { return String.Format("{0}", m_BaseTable + "_State"); }
         }

+        /// <summary>
+        /// Table Name for WorkItems
+        /// </summary>
         public string WorkItemTableName
         {
             get { return String.Format("{0}", m_BaseTable + "_WorkItem"); }
         }

+
+        /// <summary>
+        /// Constructor for SqlClient
+        /// </summary>
+        /// <param name="baseTableName">prefix for all tables</param>
+        /// <param name="sqlConnectionString">ConnectionString to Sql</param>
+        /// <param name="schemaName">Schema name for tables</param>
         public SqlClient(string baseTableName, string sqlConnectionString, string schemaName = "dbo")
         {
             if (string.IsNullOrEmpty(sqlConnectionString))
@@ -80,14 +108,6 @@
                     cmd.Transaction = con.BeginTransaction();

                     StringBuilder command = new StringBuilder();
-
-                    //// get default schema name
-                    //cmd.CommandText = "SELECT SCHEMA_NAME()";
-
-                    //var dbschema = await cmd.ExecuteScalarAsync();
-
-                    //if (dbschema != null)
-                    //    schema = dbschema.ToString();

                     //
                     // State Table
@@ -190,6 +210,13 @@
             }
         }

+        /// <summary>
+        /// Query JumpStartOrchestrations
+        /// </summary>
+        /// <param name="startTime"></param>
+        /// <param name="endTime"></param>
+        /// <param name="top"></param>
+        /// <returns>Matching JumpStartOrchestrations</returns>
         internal async Task<IEnumerable<OrchestrationJumpStartInstanceEntity>> QueryJumpStartOrchestrationsAsync(DateTime startTime, DateTime endTime, int top)
         {
             var entities = new List<OrchestrationJumpStartInstanceEntity>();


Use ConfigureAwait(false) where appropriate

--- DanTup.DartVS.Vsix/DartAnalysisServiceFactory.cs
+++ DanTup.DartVS.Vsix/DartAnalysisServiceFactory.cs
@@ -50,11 +50,11 @@

 					using (HttpClient httpClient = new HttpClient())
 					{
-						using (Stream stream = await httpClient.GetStreamAsync("https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-windows-ia32-release.zip"))
+						using (Stream stream = await httpClient.GetStreamAsync("https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-windows-ia32-release.zip").ConfigureAwait(false))
 						{
 							using (var outputStream = File.OpenWrite(compressed))
 							{
-								await stream.CopyToAsync(outputStream);
+								await stream.CopyToAsync(outputStream).ConfigureAwait(false);
 							}
 						}
 					}


JimEvans: Implementing iPad desired capability for .NET bindings. Also correcting capitalization of "iPhone". Update issue 2895.

r14931

--- dotnet/src/WebDriver/Remote/DesiredCapabilities.cs
+++ dotnet/src/WebDriver/Remote/DesiredCapabilities.cs
@@ -211,10 +211,19 @@
         /// <summary>
         /// Method to return a new DesiredCapabilities using defaults
         /// </summary>
-        /// <returns>New instance of DesiredCapabilities for use with IPhone</returns>
+        /// <returns>New instance of DesiredCapabilities for use with iPhone</returns>
         public static DesiredCapabilities IPhone()
         {
-            return new DesiredCapabilities("iphone", string.Empty, new Platform(PlatformType.Mac));
+            return new DesiredCapabilities("iPhone", string.Empty, new Platform(PlatformType.Mac));
+        }
+
+        /// <summary>
+        /// Method to return a new DesiredCapabilities using defaults
+        /// </summary>
+        /// <returns>New instance of DesiredCapabilities for use with iPad</returns>
+        public static DesiredCapabilities IPad()
+        {
+            return new DesiredCapabilities("iPad", string.Empty, new Platform(PlatformType.Mac));
         }

         /// <summary>


Update Metrics Benchmarks (#2943)

Update Metrics Benchmarks (#2943)

--- test/Benchmarks/Metrics/MetricsBenchmarks.cs
+++ test/Benchmarks/Metrics/MetricsBenchmarks.cs
@@ -26,27 +26,27 @@
 /*
 // * Summary *

-BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1288 (21H1/May2021Update)
-Intel Xeon CPU E5-1650 v4 3.60GHz, 1 CPU, 12 logical and 6 physical cores
-.NET SDK=6.0.100
-  [Host]     : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT
-  DefaultJob : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT
+BenchmarkDotNet=v0.13.1, OS=Windows 10.0.22000
+Intel Core i7-9700 CPU 3.00GHz, 1 CPU, 8 logical and 8 physical cores
+.NET SDK=6.0.200
+  [Host]     : .NET 6.0.2 (6.0.222.6406), X64 RyuJIT
+  DefaultJob : .NET 6.0.2 (6.0.222.6406), X64 RyuJIT

-|                    Method | AggregationTemporality |      Mean |     Error |    StdDev |    Median | Allocated |
-|-------------------------- |----------------------- |----------:|----------:|----------:|----------:|----------:|
-|            CounterHotPath |             Cumulative |  19.35 ns |  0.419 ns |  0.946 ns |  19.25 ns |         - |
-| CounterWith1LabelsHotPath |             Cumulative |  97.25 ns |  1.973 ns |  3.657 ns |  96.57 ns |         - |
-| CounterWith3LabelsHotPath |             Cumulative | 467.93 ns |  9.265 ns | 16.228 ns | 466.28 ns |         - |
-| CounterWith5LabelsHotPath |             Cumulative | 746.34 ns | 14.804 ns | 34.014 ns | 749.77 ns |         - |
-| CounterWith6LabelsHotPath |             Cumulative | 858.71 ns | 17.180 ns | 37.711 ns | 855.80 ns |         - |
-| CounterWith7LabelsHotPath |             Cumulative | 972.73 ns | 19.371 ns | 39.130 ns | 970.10 ns |         - |
-|            CounterHotPath |                  Delta |  20.27 ns |  0.415 ns |  0.912 ns |  20.36 ns |         - |
-| CounterWith1LabelsHotPath |                  Delta |  98.39 ns |  1.979 ns |  4.891 ns |  98.67 ns |         - |
-| CounterWith3LabelsHotPath |                  Delta | 483.07 ns |  9.694 ns | 22.850 ns | 478.88 ns |         - |
-| CounterWith5LabelsHotPath |                  Delta | 723.44 ns | 14.472 ns | 24.574 ns | 722.89 ns |         - |
-| CounterWith6LabelsHotPath |                  Delta | 850.73 ns | 16.661 ns | 19.187 ns | 850.21 ns |         - |
-| CounterWith7LabelsHotPath |                  Delta | 946.01 ns | 18.713 ns | 43.742 ns | 930.80 ns |         - |
+|                    Method | AggregationTemporality |      Mean |    Error |   StdDev | Allocated |
+|-------------------------- |----------------------- |----------:|---------:|---------:|----------:|
+|            CounterHotPath |             Cumulative |  16.60 ns | 0.120 ns | 0.094 ns |         - |
+| CounterWith1LabelsHotPath |             Cumulative |  56.42 ns | 0.413 ns | 0.367 ns |         - |
+| CounterWith3LabelsHotPath |             Cumulative | 138.44 ns | 1.153 ns | 1.079 ns |         - |
+| CounterWith5LabelsHotPath |             Cumulative | 229.78 ns | 3.422 ns | 3.201 ns |         - |
+| CounterWith6LabelsHotPath |             Cumulative | 251.65 ns | 0.954 ns | 0.892 ns |         - |
+| CounterWith7LabelsHotPath |             Cumulative | 282.55 ns | 2.009 ns | 1.781 ns |         - |
+|            CounterHotPath |                  Delta |  16.48 ns | 0.116 ns | 0.108 ns |         - |
+| CounterWith1LabelsHotPath |                  Delta |  57.38 ns | 0.322 ns | 0.285 ns |         - |
+| CounterWith3LabelsHotPath |                  Delta | 140.44 ns | 1.155 ns | 0.964 ns |         - |
+| CounterWith5LabelsHotPath |                  Delta | 224.01 ns | 2.034 ns | 1.699 ns |         - |
+| CounterWith6LabelsHotPath |                  Delta | 249.92 ns | 1.548 ns | 1.372 ns |         - |
+| CounterWith7LabelsHotPath |                  Delta | 281.87 ns | 1.979 ns | 1.852 ns |         - |

 */

@@ -93,14 +93,14 @@
         [Benchmark]
         public void CounterHotPath()
         {
-            this.counter?.Add(100);
+            this.counter.Add(100);
         }

         [Benchmark]
         public void CounterWith1LabelsHotPath()
         {
             var tag1 = new KeyValuePair<string, object>("DimName1", this.dimensionValues[this.random.Next(0, 2)]);
-            this.counter?.Add(100, tag1);
+            this.counter.Add(100, tag1);
         }

         [Benchmark]
@@ -109,7 +109,7 @@
             var tag1 = new KeyValuePair<string, object>("DimName1", this.dimensionValues[this.random.Next(0, 10)]);
             var tag2 = new KeyValuePair<string, object>("DimName2", this.dimensionValues[this.random.Next(0, 10)]);
             var tag3 = new KeyValuePair<string, object>("DimName3", this.dimensionValues[this.random.Next(0, 10)]);
-            this.counter?.Add(100, tag1, tag2, tag3);
+            this.counter.Add(100, tag1, tag2, tag3);
         }

         [Benchmark]
@@ -123,7 +123,7 @@
                 { "DimName4", this.dimensionValues[this.random.Next(0, 5)] },
                 { "DimName5", this.dimensionValues[this.random.Next(0, 10)] },
             };
-            this.counter?.Add(100, tags);
+            this.counter.Add(100, tags);
         }

         [Benchmark]
@@ -138,7 +138,7 @@
                 { "DimName5", this.dimensionValues[this.random.Next(0, 5)] },
                 { "DimName6", this.dimensionValues[this.random.Next(0, 2)] },
             };
-            this.counter?.Add(100, tags);
+            this.counter.Add(100, tags);
         }

         [Benchmark]
@@ -154,7 +154,7 @@
                 { "DimName6", this.dimensionValues[this.random.Next(0, 2)] },
                 { "DimName7", this.dimensionValues[this.random.Next(0, 1)] },
             };
-            this.counter?.Add(100, tags);
+            this.counter.Add(100, tags);
         }
     }
 }


increased test timeouts to more stable test results on appveyor

--- GridDomain.Tests.Acceptance/Snapshots/Instance_process_Should_save_snapshots_each_n_messages_according_to_policy.cs
+++ GridDomain.Tests.Acceptance/Snapshots/Instance_process_Should_save_snapshots_each_n_messages_according_to_policy.cs
@@ -24,7 +24,7 @@
         public Instance_process_Should_save_snapshots_each_n_messages_according_to_policy(ITestOutputHelper output)
             : base(
                    output,
-                   new SoftwareProgrammingProcessManagerFixture().UseSqlPersistence().InitSnapshots(5, TimeSpan.FromMilliseconds(5), 2)
+                   new SoftwareProgrammingProcessManagerFixture().UseSqlPersistence().InitSnapshots(5, TimeSpan.FromMilliseconds(1), 2)
                                                                         .IgnoreCommands()) { }

         [Fact]
@@ -59,7 +59,7 @@
                       .Create()
                       .SendToProcessManagers(continueEventB);

-            await Task.Delay(500);
+            await Task.Delay(3000);

             var snapshots = await new AggregateSnapshotRepository(NodeConfig.Persistence.JournalConnectionString,
                                                                   new AggregateFactory()).Load<ProcessStateAggregate<SoftwareProgrammingState>>(processId);


Implement test ExportReader_Can_Parse_DbNull_Fields

--- test/DelimitedDataParser.Test/ExporterTest.Reader.cs
+++ test/DelimitedDataParser.Test/ExporterTest.Reader.cs
@@ -110,6 +110,32 @@
             var rows = new[]
             {
                 new[] { null, "Data 1" }
+            };
+
+            var reader = CreateDbDataReader(columns, rows);
+
+            var sut = new Exporter();
+
+            var output = sut.ExportToString(reader.Object);
+
+            Assert.Equal(
+                @"""Field 1"",""Field 2""" + Environment.NewLine
+                + @""""",""Data 1""",
+                output);
+        }
+
+        [Fact]
+        public void ExportReader_Can_Parse_DbNull_Fields()
+        {
+            var columns = new[]
+            {
+                "Field 1",
+                "Field 2"
+            };
+
+            var rows = new[]
+            {
+                new object[] { DBNull.Value, "Data 1" }
             };

             var reader = CreateDbDataReader(columns, rows);
@@ -844,7 +870,7 @@
             return CreateDbDataReader(columns, new string[0][]);
         }

-        private static Mock<DbDataReader> CreateDbDataReader(string[] columns, string[][] rows)
+        private static Mock<DbDataReader> CreateDbDataReader(string[] columns, object[][] rows)
         {
             if (columns == null)
             {


We floor to the current second as some cloud storage providers (AWS) won't provide to the millisecond time resolution

--- test/Foundatio.Tests/Storage/FileStorageTestsBase.cs
+++ test/Foundatio.Tests/Storage/FileStorageTestsBase.cs
@@ -5,6 +5,7 @@
 using System.Text;
 using System.Threading.Tasks;
 using Exceptionless;
+using Foundatio.Extensions;
 using Foundatio.Logging;
 using Foundatio.Logging.Xunit;
 using Foundatio.Storage;
@@ -67,7 +68,7 @@
                 return;

             using (storage) {
-                var startTime = SystemClock.UtcNow;
+                var startTime = SystemClock.UtcNow.Floor(TimeSpan.FromSeconds(1));
                 string path = $"folder\\{Guid.NewGuid()}-nested.txt";
                 Assert.True(await storage.SaveFileAsync(path, "test"));
                 var fileInfo = await storage.GetFileInfoAsync(path);


Update AssemblyPluginTest.cs

Update AssemblyPluginTest.cs

--- test/NatashaUT/AssemblyPluginTest.cs
+++ test/NatashaUT/AssemblyPluginTest.cs
@@ -29,7 +29,7 @@
         }

-        [Fact(DisplayName = "不可回收：MySql插件")]
+        //[Fact(DisplayName = "不可回收：MySql插件")]
         public void Test1()
         {


Refactory PartialFailure example to suit the guide. (#107)

--- examples/ErrorHandling/HandlePartialFailures.cs
+++ examples/ErrorHandling/HandlePartialFailures.cs
@@ -17,8 +17,8 @@
 using Google.Ads.GoogleAds.V1.Resources;
 using Google.Ads.GoogleAds.V1.Services;
 using System;
+using System.Collections.Generic;
 using System.Linq;
-using System.Collections.Generic;

 namespace Google.Ads.GoogleAds.Examples.V1
 {
@@ -70,6 +70,100 @@
         /// <param name="campaignId">ID of the campaign to which ad groups are added.</param>
         public void Run(GoogleAdsClient client, long customerId, long campaignId)
         {
+            try
+            {
+                MutateAdGroupsResponse response = CreateAdGroups(client, customerId, campaignId);
+
+                // Checks for existence of any partial failures in the response.
+                if (CheckIfPartialFailureErrorExists(response))
+                {
+                    Console.WriteLine("Partial failures occurred. Details will be shown below.");
+                }
+                else
+                {
+                    Console.WriteLine("All operations completed successfully. No partial " +
+                        "failures to show.");
+                    return;
+                }
+
+                // Finds the failed operations by looping through the results.
+                PrintResults(response);
+
+                // Display the results.
+                if (response.PartialFailureError == null)
+                {
+                    Console.WriteLine("Partial failures occurred. Details will be shown below.");
+                }
+                else
+                {
+                    Console.WriteLine("All operations completed successfully. No partial " +
+                        "failures to show.");
+                    return;
+                }
+
+                // Finds the failed operations by looping through the results.
+                PrintResults(response);
+            }
+            catch (GoogleAdsException e)
+            {
+                Console.WriteLine("Failure:");
+                Console.WriteLine($"Message: {e.Message}");
+                Console.WriteLine($"Failure: {e.Failure}");
+                Console.WriteLine($"Request ID: {e.RequestId}");
+            }
+        }
+
+        /// <summary>
+        /// Displays the result from the mutate operation.
+        /// </summary>
+        /// <param name="response">The mutate response from the Google Ads API server..</param>
+        private void PrintResults(MutateAdGroupsResponse response)
+        {
+            // Finds the failed operations by looping through the results.
+            int operationIndex = 0;
+            foreach (MutateAdGroupResult result in response.Results)
+            {
+                // This represents the result of a failed operation.
+                if (result.IsEmpty())
+                {
+                    List<GoogleAdsError> errors =
+                        response.PartialFailure.GetErrorsByOperationIndex(operationIndex);
+                    foreach (GoogleAdsError error in errors)
+                    {
+                        Console.WriteLine($"Operation {operationIndex} failed with " +
+                            $"error: {error}.");
+                    }
+                }
+                else
+                {
+                    Console.WriteLine($"Operation {operationIndex} succeeded.",
+                        operationIndex);
+                }
+                operationIndex++;
+            }
+        }
+
+        /// <summary>
+        /// Inspects a response to check for presence of partial failure errors.
+        /// </summary>
+        /// <param name="response">The response.</param>
+        /// <returns>True if there are partial failures, false otherwise.</returns>
+        private static bool CheckIfPartialFailureErrorExists(MutateAdGroupsResponse response)
+        {
+            return response.PartialFailureError == null;
+        }
+
+        /// <summary>
+        /// Attempts to create 3 ad groups with partial failure enabled. One of the ad groups
+        /// will succeed, while the other will fail.
+        /// </summary>
+        /// <param name="client">The Google Ads client.</param>
+        /// <param name="customerId">The customer ID for which the call is made.</param>
+        /// <param name="campaignId">ID of the campaign to which ad groups are added.</param>
+        /// <returns>The mutate response from the Google Ads server.</returns>
+        private static MutateAdGroupsResponse CreateAdGroups(GoogleAdsClient client,
+            long customerId, long campaignId)
+        {
             // Get the AdGroupServiceClient.
             AdGroupServiceClient adGroupService = client.GetService(Services.V1.AdGroupService);

@@ -101,7 +195,6 @@
                 // group from the first operation. Duplicate ad group names are not allowed.
                 new AdGroupOperation()
                 {
-
                     Create = new AdGroup()
                     {
                         Campaign = ResourceNames.Campaign(customerId, campaignId),
@@ -109,53 +202,11 @@
                     }
                 }
             };
-
-            try
-            {
-                // Add the ad groups.
-                MutateAdGroupsResponse response =
-                    adGroupService.MutateAdGroups(customerId.ToString(), operations, true, false);
-
-                // Display the results.
-                if (response.PartialFailureError == null)
-                {
-                    Console.WriteLine("All operations completed successfully. No partial " +
-                        "failures to show.");
-                    return;
-                }
-                else
-                {
-                    // Finds the failed operations by looping through the results.
-                    int operationIndex = 0;
-                    foreach (MutateAdGroupResult result in response.Results)
-                    {
-                        // This represents the result of a failed operation.
-                        if (result.IsEmpty())
-                        {
-                            List<GoogleAdsError> errors =
-                                response.PartialFailure.GetErrorsByOperationIndex(operationIndex);
-                            foreach (GoogleAdsError error in errors)
-                            {
-                                Console.WriteLine($"Operation {operationIndex} failed with " +
-                                    $"error: {error}.");
-                            }
-                        }
-                        else
-                        {
-                            Console.WriteLine($"Operation {operationIndex} succeeded.",
-                                operationIndex);
-                        }
-                        operationIndex++;
-                    }
-                }
-            }
-            catch (GoogleAdsException e)
-            {
-                Console.WriteLine("Failure:");
-                Console.WriteLine($"Message: {e.Message}");
-                Console.WriteLine($"Failure: {e.Failure}");
-                Console.WriteLine($"Request ID: {e.RequestId}");
-            }
+
+            // Add the ad groups.
+            MutateAdGroupsResponse response =
+                adGroupService.MutateAdGroups(customerId.ToString(), operations, true, false);
+            return response;
         }
     }
 }


added xml-doc

added xml-doc

--- xFunc.Maths/Expressions/ExpressionResultType.cs
+++ xFunc.Maths/Expressions/ExpressionResultType.cs
@@ -17,15 +17,36 @@
 namespace xFunc.Maths.Expressions
 {

+    /// <summary>
+    /// Represents results of expressions.
+    /// </summary>
     [Flags]
     public enum ExpressionResultType
     {

+        /// <summary>
+        /// An expression doesn't return anything.
+        /// </summary>
         None = 0x0,
+        /// <summary>
+        /// An expression returns a number.
+        /// </summary>
         Number = 0x1,
+        /// <summary>
+        /// An expression returns a boolean (true or false).
+        /// </summary>
         Boolean = 0x2,
+        /// <summary>
+        /// An expression returns a matrix or a vector.
+        /// </summary>
         Matrix = 0x4,
+        /// <summary>
+        /// An expression returns an expression.
+        /// </summary>
         Expression = 0x8,
+        /// <summary>
+        /// Combines other parameters.
+        /// </summary>
         All = Number | Boolean | Matrix | Expression

     }


revised warning message if SCM url is not valid (fix for http://npanday.codeplex.com/WorkItem/View.aspx?WorkItemId=12120)

git-svn-id: ee144a4ada4e65570a65b3ba2a4ac9d4eedc8fa4@994570 13f79535-47bb-0310-9956-ffa450edef68

--- dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/NPandayImportProjectForm.cs
+++ dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPanday/VisualStudio/Addin/NPandayImportProjectForm.cs
@@ -220,7 +220,7 @@
                     {
                         if (DialogResult.Yes == MessageBox.Show(string.Format("SCM tag {0} was not accessible, would you still like to proceed with Project import?", scmTag), "SCM Tag", MessageBoxButtons.YesNo, MessageBoxIcon.Warning))
                         {
-                            warningMsg = string.Format("\n    SCM tag was not added, because the url {0} was not accessible", scmTag);
+                            warningMsg = string.Format("\n    The SCM URL {0} was added to the POM but could not be resolved and may not be valid.", scmTag);
                         }
                         else
                         {


Level 24

Level 24

--- EarthMagicCharacters/Classes/Monk/GenericMonk.cs
+++ EarthMagicCharacters/Classes/Monk/GenericMonk.cs
@@ -625,7 +625,15 @@
         /// </summary>
         private void Level24()
         {
-            List<string> levelUpReport = new List<string> {   };
+            List<string> levelUpReport = new List<string> { "Title: Master of Spring", "+5% hide in shadows", "+5% walk silently", "TH: +1", "AC: +1" };
+
+            this.Title = "Master of Spring";
+            this.Abilities.HideInShadows += 5;
+            this.Abilities.WalkSilently += 5;
+            this.Attributes.ToHit++;
+            this.Attributes.AC++;
+
+            Util.WriteLine(levelUpReport);
         }

         /// <summary>


Throw unexpected value exception from ColumnDefinitions

--- src/VisualStudio/Core/Def/Implementation/UnusedReferences/Dialog/UnusedReferencesTableProvider.ColumnDefinitions.cs
+++ src/VisualStudio/Core/Def/Implementation/UnusedReferences/Dialog/UnusedReferencesTableProvider.ColumnDefinitions.cs
@@ -1,4 +1,4 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.

@@ -213,7 +213,7 @@
                     ReferenceType.Package => ReferenceImageMonikers.Package,
                     ReferenceType.Project => ReferenceImageMonikers.Project,
                     ReferenceType.Assembly => ReferenceImageMonikers.Assembly,
-                    _ => default
+                    _ => throw ExceptionUtilities.UnexpectedValue(referenceType)
                 };
             }

@@ -224,7 +224,7 @@
                     ReferenceType.Package => ServicesVSResources.Packages,
                     ReferenceType.Project => ServicesVSResources.Projects,
                     ReferenceType.Assembly => ServicesVSResources.Assemblies,
-                    _ => string.Empty
+                    _ => throw ExceptionUtilities.UnexpectedValue(referenceType)
                 };
             }
         }
@@ -258,7 +258,7 @@
                         ReferenceType.Package => KnownMonikers.PackageReference,
                         ReferenceType.Project => KnownMonikers.Library,
                         ReferenceType.Assembly => KnownMonikers.Reference,
-                        _ => default
+                        _ => throw ExceptionUtilities.UnexpectedValue(referenceType)
                     }
                     : default;
             }


commented out the code

commented out the code

--- ElectronNET.CLI/Commands/StartElectronCommand.cs
+++ ElectronNET.CLI/Commands/StartElectronCommand.cs
@@ -65,14 +65,14 @@
                 if (parser != null && parser.Contains("watch"))
                 {

-                    // if not exists then create mklink
-                    if (!Directory.Exists($"{tempBinPath}")) Directory.CreateDirectory(tempBinPath);
-                    if (!Directory.Exists($"{tempBinPath}\\wwwroot")) resultCode = ProcessHelper.CmdExecute($"mklink /D {tempBinPath}\\wwwroot wwwroot", aspCoreProjectPath);
+                    // no need for this code i will remove this before PRS
+                    //if (!Directory.Exists($"{tempBinPath}")) Directory.CreateDirectory(tempBinPath);
+                    //if (!Directory.Exists($"{tempBinPath}\\wwwroot")) resultCode = ProcessHelper.CmdExecute($"mklink /D {tempBinPath}\\wwwroot wwwroot", aspCoreProjectPath);

-                    if (!File.Exists($"{tempBinPath}\\electron.manifest.json"))
-                    {
-                        resultCode = ProcessHelper.CmdExecute($"mklink /h {tempBinPath}\\electron.manifest.json electron.manifest.json", aspCoreProjectPath);
-                    }
+                    //if (!File.Exists($"{tempBinPath}\\electron.manifest.json"))
+                    //{
+                    //    resultCode = ProcessHelper.CmdExecute($"mklink /h {tempBinPath}\\electron.manifest.json electron.manifest.json", aspCoreProjectPath);
+                    //}

                 }
                 else


reenable rc test, use dc creds

reenable rc test, use dc creds

--- test/IBM.WatsonDeveloperCloud.LanguageTranslator.v3.IntegrationTests/LanguageTranslatorServiceIntegrationTestsRC.cs
+++ test/IBM.WatsonDeveloperCloud.LanguageTranslator.v3.IntegrationTests/LanguageTranslatorServiceIntegrationTestsRC.cs
@@ -27,7 +27,7 @@

 namespace IBM.WatsonDeveloperCloud.LanguageTranslator.v3.IntegrationTests
 {
-    //[TestClass]
+    [TestClass]
     public class LanguageTranslatorServiceIntegrationTestsRC
     {
         private static string _apikey;
@@ -70,7 +70,7 @@
                 VcapCredentials vcapCredentials = JsonConvert.DeserializeObject<VcapCredentials>(credentials);
                 var vcapServices = JObject.Parse(credentials);

-                Credential credential = vcapCredentials.GetCredentialByname("language-translator-v3-sdk-rc")[0].Credentials;
+                Credential credential = vcapCredentials.GetCredentialByname("language-translator-v3-sdk-rc-wdc")[0].Credentials;
                 _endpoint = credential.Url;
                 _apikey = credential.IamApikey;
             }


Update summary.

Update summary.

--- Eutherion/Win.MdiAppTemplate/IDockableControl.cs
+++ Eutherion/Win.MdiAppTemplate/IDockableControl.cs
@@ -83,7 +83,7 @@
     public struct MainMenuDropDownItem
     {
         /// <summary>
-        /// Represents the main menu container item.
+        /// Represents the main menu container item. It is assumed to be empty.
         /// </summary>
         public UIMenuNode.Container Container;


Remove unnecessary whitespace

Remove unnecessary whitespace

--- ExpressionToCodeLib/Internal/ObjectToCodeImpl.cs
+++ ExpressionToCodeLib/Internal/ObjectToCodeImpl.cs
@@ -43,7 +43,6 @@
                 }
                 sb.Append(")");
                 return ElidePossiblyMultilineString(config, sb.ToString(), indent, valueSize).Trim();
-
             } else if (val.GetType().GuessTypeClass() == ReflectionHelpers.TypeClass.AnonymousType) {
                 var type = val.GetType();
                 return "new {" +


Adding explicit ApplyTemplate in test

Adding explicit ApplyTemplate in test

--- Fluent.Ribbon.Tests/Controls/SplitButtonTests.cs
+++ Fluent.Ribbon.Tests/Controls/SplitButtonTests.cs
@@ -17,6 +17,8 @@

             using (new TestRibbonWindow(splitButton))
             {
+                splitButton.ApplyTemplate();
+
                 Assert.That(splitButton.IsEnabled, Is.True);

                 var partButton = splitButton.Template.FindName("PART_Button", splitButton) as ToggleButton;


Add test for support quoting empty arguments.

--- test/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs
+++ test/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs
@@ -1,6 +1,7 @@
 // Copyright (c) .NET Foundation and contributors. All rights reserved.
 // Licensed under the MIT license. See LICENSE file in the project root for full license information.

+using System;
 using System.IO;
 using System.Xml.Linq;
 using FluentAssertions;
@@ -709,5 +710,22 @@
             result.Should().Pass()
                 .And.HaveStdOutContaining($"AppOutputsExecutablePath{Constants.ExeSuffix}");
         }
+
+        [Fact]
+        public void ItForwardsEmptyArgumentsToTheApp()
+        {
+            var testAppName = "TestAppSimple";
+            var testInstance = TestAssets.Get(testAppName)
+                .CreateInstance()
+                .WithSourceFiles();
+
+            new RunCommand()
+                .WithWorkingDirectory(testInstance.Root)
+                .ExecuteWithCapturedOutput("a \"\" c")
+                .Should()
+                .Pass()
+                .And
+                .HaveStdOutContaining($"0 = a{Environment.NewLine}1 = {Environment.NewLine}2 = c");
+        }
     }
 }


removed debug code

removed debug code

--- ASB-Updater/MainWindow.xaml.cs
+++ ASB-Updater/MainWindow.xaml.cs
@@ -48,9 +48,9 @@
             var e = Environment.GetCommandLineArgs();

             //// uncomment for debugging
-            string debugFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "ASBUpdaterTest");
-            Directory.CreateDirectory(debugFolder);
-            e = new string[] { e[0], debugFolder, "doupdate" };
+            //string debugFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "ASBUpdaterTest");
+            //Directory.CreateDirectory(debugFolder);
+            //e = new string[] { e[0], debugFolder, "doupdate" };

             // if the updater was started directly, copy it first to the temp directory and start it from there
             // so it's able to update itself.


2.0.60.0

--- Abnaki.Windows.AssemblyInfo.cs
+++ Abnaki.Windows.AssemblyInfo.cs
@@ -8,5 +8,5 @@
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

-[assembly: AssemblyVersion("2.0.58.0")]
+[assembly: AssemblyVersion("2.0.60.0")]
 //[assembly: AssemblyFileVersion("     ")] // respects AssemblyVersion


Shorter Company

Shorter Company

--- Abnaki.Windows.AssemblyInfo.cs
+++ Abnaki.Windows.AssemblyInfo.cs
@@ -3,7 +3,7 @@
 using System.Reflection;

 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Abnaki Light Industry LLC")]
+[assembly: AssemblyCompany("Abnaki Light Industry")]
 [assembly: AssemblyCopyright("Copyright © 2016 Abnaki Light Industry LLC")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]


Update _ValidationScriptsPartial.cshtml

Update _ValidationScriptsPartial.cshtml

--- src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Shared/_ValidationScriptsPartial.cshtml
+++ src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Shared/_ValidationScriptsPartial.cshtml
@@ -1,2 +1,2 @@
-<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
+<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
 <script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>


add unit tests to check valid start date for training course

--- src/SFA.DAS.ProviderApprenticeshipsService.Web.UnitTests/Orchestrators/BulkUpload/WhenValidatingRecordsBulkUpload.cs
+++ src/SFA.DAS.ProviderApprenticeshipsService.Web.UnitTests/Orchestrators/BulkUpload/WhenValidatingRecordsBulkUpload.cs
@@ -54,7 +54,7 @@
         [TestCase(2020, 10, "This training course is only available to apprentices with a start date before 10 2020", Description = "Start date just after")]
         [TestCase(2020, 11, "This training course is only available to apprentices with a start date before 10 2020", Description = "Start date after")]
         [TestCase(2021, 01, "This training course is only available to apprentices with a start date before 10 2020", Description = "Start date after (month numerically lower)")]
-        public void AndTrainingCodeIsPendingThenValidationFails(int existingStartYear, int existingStartMonth, string expectedErrorMessage)
+        public void AndTrainingCodeIsPendingOrExpiredThenValidationFails(int existingStartYear, int existingStartMonth, string expectedErrorMessage)
         {
             var errors = _sut.ValidateRecords(GetTestData(existingStartYear, existingStartMonth, 2021, 09), new List<ITrainingProgramme>
             {
@@ -68,6 +68,24 @@

             errors.Count.Should().Be(1);
             errors.FirstOrDefault().ToString().ShouldBeEquivalentTo($"Row:1 - {expectedErrorMessage}");
+        }
+
+        [TestCase(2019, 06, Description = "Start date first valid")]
+        [TestCase(2019, 07, Description = "Start date valid")]
+        [TestCase(2019, 09, Description = "Start date last valid")]
+        public void AndTrainingCodeIsActiveThenValidationPasses(int existingStartYear, int existingStartMonth)
+        {
+            var errors = _sut.ValidateRecords(GetTestData(existingStartYear, existingStartMonth, 2021, 09), new List<ITrainingProgramme>
+            {
+                new Standard
+                {
+                    EffectiveFrom = new DateTime(2019,6,1),
+                    EffectiveTo = new DateTime(2020,9,1),
+                    Id = "2"
+                }
+            }).ToList();
+
+            errors.Count.Should().Be(0);
         }

         [Test]


Code cleanup, fixing issues with result sorting

--- src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Migration/ImportAzureStorSimpleLegacyApplianceConfig.cs
+++ src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/Migration/ImportAzureStorSimpleLegacyApplianceConfig.cs
@@ -94,119 +94,7 @@
             StringBuilder resultBuilder = new StringBuilder();
             resultBuilder.AppendLine(Resources.ImportLegacyApplianceConfigSuccessMessage);
             parserMsg.Sort(CompareMsgBasedOnType);
-            foreach(LegacyParserMessage msg in parserMsg)
-            {
-                resultBuilder.AppendLine(string.Format("[{0}] : {1}", msg.Type.ToString(), msg.Reason));
-                foreach (string customMsg in msg.CustomMessageList)
-                {
-                    resultBuilder.AppendLine("\t" + customMsg);
-                }
-            }
-
-            return resultBuilder.ToString();
-        }
-
-        /// <summary>
-        /// Function compares the parser message based on category, to sort and group based on msg type
-        /// </summary>
-        /// <param name="lMsg">message for comparison</param>
-        /// <param name="rMsg">message to be compared with</param>
-        /// <returns>result of comparison</returns>
-        private int CompareMsgBasedOnType(LegacyParserMessage lMsg, LegacyParserMessage rMsg)
-        {
-            return lMsg.Type.CompareTo(rMsg);
-        }
-
-        /// <summary>
-        /// Handle exception
-        /// </summary>
-        /// <param name="exception">Handles the exceptions</param>
-        internal override void HandleException(Exception exception)
-        {
-            // Parser throws missing member exception if any expected fields are missing, handling this as special case.
-            if (typeof(MissingMemberException) == exception.GetType())
-            {
-                WriteVerbose(exception.Message);
-                WriteError(new ErrorRecord(exception, string.Empty, ErrorCategory.ParserError, null));
-            }
-            else
-            {
-                base.HandleException(exception);
-            }
-        }
-    }
-
-    #if COMMENTED
-
-    [Cmdlet(VerbsData.Import, "AzureStorSimpleLegacyApplianceConfig2")]
-    public class ImportAzureStorSimpleLegacyApplianceConfig2 : PSCmdlet
-    {
-        [Alias("FilePath")]
-        [Parameter(Position = 0, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageMigrationConfigFilePath)]
-        [ValidateNotNullOrEmpty]
-        public string ConfigFilePath { get; set; }
-
-        [Parameter(Position = 1, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageMigrationTargetDevice)]
-        [ValidateNotNullOrEmpty]
-        public string TargetDeviceName { get; set; }
-
-        [Parameter(Position = 2, Mandatory = true, HelpMessage = StorSimpleCmdletHelpMessage.HelpMessageMigrationConfigDecryptionKey)]
-        public string ConfigDecryptionKey { get; set; }
-
-        protected override void ProcessRecord()
-        {
-            try
-            {
-                WriteVerbose(string.Format("Getting device id for device {0}", TargetDeviceName));
-                string deviceid = "12345";
-                if (!File.Exists(ConfigFilePath))
-                {
-                    WriteVerbose(String.Format(Resources.MigrationConfigFileNotFound, StorSimpleContext.ResourceName, ConfigFilePath));
-                    WriteObject(null);
-                }
-                else if (string.IsNullOrEmpty(deviceid))
-                {
-                    WriteVerbose(String.Format(Resources.NoDeviceFoundWithGivenNameInResourceMessage, StorSimpleContext.ResourceName, TargetDeviceName));
-                    WriteObject(null);
-                }
-                else
-                {
-                    // creating the config file parser instance - parser decrypt the xml and parses the config xml
-                    TestSecretEncryptor secretsEncryptor = new TestSecretEncryptor();
-                    LegacyApplianceConfigParser parser = new LegacyApplianceConfigParser(secretsEncryptor);
-                    LegacyApplianceConfiguration legacyApplianceMetaData = new LegacyApplianceConfiguration();
-
-                    legacyApplianceMetaData.Details = parser.ParseLegacyApplianceConfig(filePath: ConfigFilePath, decryptionKey: ConfigDecryptionKey);
-                    LegacyApplianceConfig config = (LegacyApplianceConfig)legacyApplianceMetaData.Details;
-                    legacyApplianceMetaData.ConfigId = Guid.NewGuid().ToString();
-                    config.InstanceId = config.Name = legacyApplianceMetaData.ConfigId;
-                    legacyApplianceMetaData.ConfigFile = ConfigFilePath;
-                    legacyApplianceMetaData.ImportedOn = DateTime.UtcNow;
-                    legacyApplianceMetaData.TargetApplianceName = TargetDeviceName;
-                    config.DeviceId = deviceid;
-
-                    legacyApplianceMetaData.Result = this.ProcessParserResultText(parser.ParserMessages);
-
-                    WriteObject(legacyApplianceMetaData);
-                }
-            }
-            catch (Exception)
-            {
-                throw;
-            }
-        }
-
-        /// <summary>
-        /// Process the parser messages and generates a result string from the message
-        /// </summary>
-        /// <param name="parserMsg">parser message</param>
-        /// <returns>process parser message</returns>
-        private string ProcessParserResultText(List<LegacyParserMessage> parserMsg)
-        {
-            StringBuilder resultBuilder = new StringBuilder();
-            resultBuilder.AppendLine(Resources.ImportLegacyApplianceConfigSuccessMessage);
-            parserMsg.Sort(CompareMsgBasedOnType);
-            foreach(LegacyParserMessage msg in parserMsg)
+            foreach (LegacyParserMessage msg in parserMsg)
             {
                 resultBuilder.AppendLine(string.Format("[{0}] : {1}", msg.Type.ToString(), msg.Reason));
                 foreach (string customMsg in msg.CustomMessageList)
@@ -231,21 +119,24 @@
         {
             return lMsg.Type.CompareTo(rMsg.Type);
         }
-    }

-    public class TestSecretEncryptor : IServiceSecretEncryptor
-    {
-        const string dummySecretsEncryptionThumbprint = "123456378570545808024949949";
-        public string EncryptSecret(string secretToBeEncrypted)
+
+        /// <summary>
+        /// Handle exception
+        /// </summary>
+        /// <param name="exception">Handles the exceptions</param>
+        internal override void HandleException(Exception exception)
         {
-            return secretToBeEncrypted;
-        }
-
-        public string GetSecretsEncryptionThumbprint()
-        {
-            return dummySecretsEncryptionThumbprint;
+            // Parser throws missing member exception if any expected fields are missing, handling this as special case.
+            if (typeof(MissingMemberException) == exception.GetType())
+            {
+                WriteVerbose(exception.Message);
+                WriteError(new ErrorRecord(exception, string.Empty, ErrorCategory.ParserError, null));
+            }
+            else
+            {
+                base.HandleException(exception);
+            }
         }
     }
-
-    #endif
 }


Add issue number to test.

Add issue number to test.

--- tests/Avalonia.Markup.UnitTests/Data/BindingTests.cs
+++ tests/Avalonia.Markup.UnitTests/Data/BindingTests.cs
@@ -199,6 +199,7 @@
         [Fact]
         public void OneWayToSource_Binding_Should_Not_StackOverflow_With_Null_Value()
         {
+            // Issue #2912
             var target = new TextBlock { Text = null };
             var binding = new Binding
             {


Bump version to 1.5.1

Bump version to 1.5.1

--- src/resharper-unity/Properties/AssemblyInfo.cs
+++ src/resharper-unity/Properties/AssemblyInfo.cs
@@ -31,6 +31,6 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.5.0.0")]
-[assembly: AssemblyFileVersion("1.5.0.0")]
-[assembly: AssemblyInformationalVersion("1.5.0")]
+[assembly: AssemblyVersion("1.5.1.0")]
+[assembly: AssemblyFileVersion("1.5.1.0")]
+[assembly: AssemblyInformationalVersion("1.5.1")]


Send proper Ajax ID

Send proper Ajax ID

--- Amry.Gst.Core/GstWebScraper.cs
+++ Amry.Gst.Core/GstWebScraper.cs
@@ -161,7 +161,7 @@
             req.AddParameter("FAST_VERLAST_SOURCE__", _tokenSource);
             req.AddParameter("FAST_CLIENT_WHEN__", GetJavascriptTime());
             req.AddParameter("FAST_CLIENT_WINDOW__", _windowId);
-            req.AddParameter("FAST_CLIENT_AJAX_ID__", 2);
+            req.AddParameter("FAST_CLIENT_AJAX_ID__", GetAjaxId());

             var resp = await _client.ExecutePostTaskAsync(req);
             UpdateTokenForNextRequest(resp);
@@ -214,7 +214,7 @@
             req.AddParameter("FAST_VERLAST_SOURCE__", _tokenSource);
             req.AddParameter("FAST_CLIENT_WHEN__", GetJavascriptTime());
             req.AddParameter("FAST_CLIENT_WINDOW__", _windowId);
-            req.AddParameter("FAST_CLIENT_AJAX_ID__", 3);
+            req.AddParameter("FAST_CLIENT_AJAX_ID__", GetAjaxId());

             var resp = await _client.ExecutePostTaskAsync(req);
             UpdateTokenForNextRequest(resp);
@@ -268,7 +268,7 @@
             req.AddParameter("FAST_VERLAST_SOURCE__", _tokenSource);
             req.AddParameter("FAST_CLIENT_WHEN__", GetJavascriptTime());
             req.AddParameter("FAST_CLIENT_WINDOW__", _windowId);
-            req.AddParameter("FAST_CLIENT_AJAX_ID__", 4);
+            req.AddParameter("FAST_CLIENT_AJAX_ID__", GetAjaxId());

             var resp = await _client.ExecutePostTaskAsync(req);
             UpdateTokenForNextRequest(resp);
@@ -373,6 +373,11 @@
             _requestCount++;
         }

+        string GetAjaxId()
+        {
+            return _token.Substring(0, _token.IndexOf('.'));
+        }
+
         static long GetJavascriptTime()
         {
             return (long) DateTime.UtcNow


Should probably check my code before committing it.

--- InventoryManagement/InventoryManagement/Form1.cs
+++ InventoryManagement/InventoryManagement/Form1.cs
@@ -213,7 +213,7 @@
 			displayView.RowFilter = filter;
 		}

-		private string formatString(string format)
+		private static string formatString(string format)
 		{
 			StringBuilder sb = new StringBuilder();
 			for (int i = 0; i < format.Length; i++)
@@ -494,8 +494,8 @@
 		public static bool isValidPrimaryKey(String name, String platform)
 		{
 			DataRow[] rows = mainDataSet.Tables["inventory"].Select(
-				"name='" + name + "' AND " +
-				"inventory='" + platform + "'"
+				"name='" + formatString(name) + "' AND " +
+				"platform='" + formatString(platform) + "'"
 			);
 			foreach (DataRow row in rows)
 			{


#81: Includes Multibranch Pipelines to work like folders.

--- JenkinsTray/BusinessComponents/JenkinsService.cs
+++ JenkinsTray/BusinessComponents/JenkinsService.cs
@@ -77,6 +77,10 @@
                     var xml = new XmlDocument();
                     xml.LoadXml(xmlStr);
                     var nodes = xml.SelectNodes("/folder/job");
+                    if (nodes.Count == 0)
+                    {
+                        nodes = xml.SelectNodes("/workflowMultiBranchProject/job");
+                    }
                     projects.AddRange(GetProjects(nodes, server));
                 }
                 else


Revise member accessibility

Revise member accessibility

--- ApplicationView/ThemeConfig.cs
+++ ApplicationView/ThemeConfig.cs
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2017, Lars Brubaker, John Lewin
+Copyright (c) 2018, Lars Brubaker, John Lewin
 All rights reserved.

 Redistribution and use in source and binary forms, with or without
@@ -41,11 +41,12 @@
 	using MatterHackers.MatterControl.PartPreviewWindow;
 	using MatterHackers.MatterControl.PrinterCommunication;
 	using MatterHackers.VectorMath;
+	using Newtonsoft.Json;

 	public class ThemeConfig
 	{
-		public static ImageBuffer RestoreNormal { get; private set; }
-		public static ImageBuffer RestoreHover { get; private set; }
+		private static ImageBuffer restoreNormal;
+		private static ImageBuffer restoreHover;
 		private static ImageBuffer restorePressed;

 		public int FontSize7 { get; } = 7;
@@ -56,18 +57,17 @@
 		public int FontSize12 { get; } = 12;
 		public int FontSize14 { get; } = 14;

-		private readonly int defaultScrollBarWidth = 120;
-		private readonly int sideBarButtonWidth = 138;
-
-		public int DefaultFontSize { get; } = 11;
+		public int DefaultFontSize { get; set; } = 11;
 		public int DefaultContainerPadding { get; } = 10;
-		public int H1PointSize { get; set; } = 11;
+		public int H1PointSize { get; } = 11;

 		public double ButtonHeight => 32 * GuiWidget.DeviceScale;
-		public double MicroButtonHeight => 20 * GuiWidget.DeviceScale;
-		public double MicroButtonWidth => 30 * GuiWidget.DeviceScale;
 		public double TabButtonHeight => 30 * GuiWidget.DeviceScale;
 		public double MenuGutterWidth => 35 * GuiWidget.DeviceScale;
+
+		private double microButtonHeight => 20 * GuiWidget.DeviceScale;
+		private double microButtonWidth => 30 * GuiWidget.DeviceScale;
+		private readonly int defaultScrollBarWidth = 120;

 		/// <summary>
 		/// Indicates if icons should be inverted due to black source images on a dark theme
@@ -114,11 +114,11 @@

 		public BorderDouble TextButtonPadding { get; } = new BorderDouble(14, 0);

-		public BorderDouble ButtonSpacing { get; }
-
-		public BorderDouble ToolbarPadding { get; set; } = 3;
-
-		public BorderDouble TabbarPadding { get; set; } = new BorderDouble(3, 1);
+		public BorderDouble ButtonSpacing { get; } = new BorderDouble(right: 3);
+
+		public BorderDouble ToolbarPadding { get; } = 3;
+
+		public BorderDouble TabbarPadding { get; } = new BorderDouble(3, 1);

 		/// <summary>
 		/// The height or width of a given vertical or horizontal splitter bar
@@ -181,7 +181,6 @@

 		public ThemeConfig()
 		{
-			this.ButtonSpacing = new BorderDouble(right: 3);
 			this.SeparatorMargin = (this.ButtonSpacing * 2).Clone(left: this.ButtonSpacing.Right);
 		}

@@ -191,14 +190,14 @@

 			if (AggContext.OperatingSystem == OSType.Android)
 			{
-				RestoreNormal = ColorCircle(size, new Color(200, 0, 0));
+				restoreNormal = ColorCircle(size, new Color(200, 0, 0));
 			}
 			else
 			{
-				RestoreNormal = ColorCircle(size, Color.Transparent);
-			}
-
-			RestoreHover = ColorCircle(size, new Color("#DB4437"));
+				restoreNormal = ColorCircle(size, Color.Transparent);
+			}
+
+			restoreHover = ColorCircle(size, new Color("#DB4437"));
 			restorePressed = ColorCircle(size, new Color(255, 0, 0));

 			this.Colors = colors;
@@ -271,8 +270,8 @@
 				HoverColor = this.AccentMimimalOverlay,
 				Margin = new BorderDouble(right: 1),
 				HAnchor = HAnchor.Absolute,
-				Height = this.MicroButtonHeight,
-				Width = this.MicroButtonWidth
+				Height = this.microButtonHeight,
+				Width = this.microButtonWidth
 			};

 			// Add to sibling list if supplied
@@ -394,10 +393,10 @@
 		{
 			return new Button(
 				new ButtonViewStates(
-					new ImageWidget(RestoreNormal),
-					new ImageWidget(RestoreHover),
+					new ImageWidget(restoreNormal),
+					new ImageWidget(restoreHover),
 					new ImageWidget(restorePressed),
-					new ImageWidget(RestoreNormal)))
+					new ImageWidget(restoreNormal)))
 			{
 				VAnchor = VAnchor.Center,
 				Margin = new BorderDouble(0, 0, 5, 0)


Fixed bug for checking out

Fixed bug for checking out

--- Assets/Scripts/CashRegister.cs
+++ Assets/Scripts/CashRegister.cs
@@ -36,55 +36,55 @@
 				}

 			}
+		}
+		else if (other.CompareTag("Player") && other.gameObject.name == "Melonpixie")
+		{
+			currentInterObj = other.gameObject;
+			currentInterObjScriptInventory = currentInterObj.GetComponent<Inventory>();

-			else if (other.CompareTag("Player") && other.gameObject.name == "Melonpixie")
+			Debug.Log(currentInterObjScriptCBC2.Win_percentage);
+			if (currentInterObjScriptInventory.itemAdded)
 			{
-				currentInterObj = other.gameObject;
-				currentInterObjScriptInventory = currentInterObj.GetComponent<Inventory>();
+				if (currentInterObjScriptCBC2.Win_percentage >= 1.0f)
+				{
+					Debug.Log("P2 WINs");
+				}

-				Debug.Log(currentInterObjScriptCBC2.Win_percentage);
-				if (currentInterObjScriptInventory.itemAdded)
+			}
+		}
+		else if (other.CompareTag("Player") && other.gameObject.name == "Cat")
+		{
+			currentInterObj = other.gameObject;
+			currentInterObjScriptInventory = currentInterObj.GetComponent<Inventory>();
+
+			Debug.Log(currentInterObjScriptCBC3.Win_percentage);
+			if (currentInterObjScriptInventory.itemAdded)
+			{
+				if (currentInterObjScriptCBC3.Win_percentage >= 1.0f)
 				{
-					if (currentInterObjScriptCBC2.Win_percentage >= 1.0f)
-					{
-						Debug.Log("P2 WINs");
-					}
+					Debug.Log("P3 WINs");

 				}
+
 			}
-			else if (other.CompareTag("Player") && other.gameObject.name == "Cat")
+		}
+
+		else if (other.CompareTag("Player") && other.gameObject.name == "Bunny")
+		{
+			currentInterObj = other.gameObject;
+			currentInterObjScriptInventory = currentInterObj.GetComponent<Inventory>();
+
+			Debug.Log(currentInterObjScriptCBC4.Win_percentage);
+			if (currentInterObjScriptInventory.itemAdded)
 			{
-				currentInterObj = other.gameObject;
-				currentInterObjScriptInventory = currentInterObj.GetComponent<Inventory>();
-
-				Debug.Log(currentInterObjScriptCBC3.Win_percentage);
-				if (currentInterObjScriptInventory.itemAdded)
+				if (currentInterObjScriptCBC4.Win_percentage >= 1.0f)
 				{
-					if (currentInterObjScriptCBC3.Win_percentage >= 1.0f)
-					{
-						Debug.Log("P3 WINs");
-
-					}
+					Debug.Log("P4 WINs");

 				}
+
 			}
-
-			else if (other.CompareTag("Player") && other.gameObject.name == "Bunny")
-			{
-				currentInterObj = other.gameObject;
-				currentInterObjScriptInventory = currentInterObj.GetComponent<Inventory>();
-
-				Debug.Log(currentInterObjScriptCBC4.Win_percentage);
-				if (currentInterObjScriptInventory.itemAdded)
-				{
-					if (currentInterObjScriptCBC4.Win_percentage >= 1.0f)
-					{
-						Debug.Log("P4 WINs");
-
-					}
-
-				}
-			}
+
 		}
 	}
 }