Update FunctionRunner.cs

Update FunctionRunner.cs

--- src/Jobs/Exceptionless.Functions/FunctionRunner.cs
+++ src/Jobs/Exceptionless.Functions/FunctionRunner.cs
@@ -22,7 +22,7 @@
              _serviceProvider = ServiceProvider.GetServiceProvider(Settings.JobBootstrappedServiceProvider, _loggerFactory);
         }

-        public static Task ProcessEventPostQueueItem(String id, EventPost data, DateTimeOffset insertionTime, int dequeueCount, CancellationToken token = default(CancellationToken)) {
+        public static Task ProcessEventPostQueueItem(EventPost data, string id, DateTimeOffset insertionTime, int dequeueCount, CancellationToken token = default(CancellationToken)) {
             return ProcessQueueItem<EventPostsJob, EventPost>(id, data, insertionTime.UtcDateTime, dequeueCount, token);
         }


Comments added

Comments added

--- src/Juhta.Net.WebApi.Exceptions/WebApiException.cs
+++ src/Juhta.Net.WebApi.Exceptions/WebApiException.cs
@@ -77,6 +77,12 @@

             callStack.Add($"-- {this.GetType().FullName} deserialized and rethrown --");

+            // We must ignore 5 call stack lines to get to the line where the actual throw operation happened
+            // - StackTraceHelper.GetCallStack()
+            // - This constructor
+            // - ClientErrorException or ServerErrorException constructor
+            // - Constructor of a class derived from ClientErrorException or ServerErrorException
+            // - ClientError.Throw() or ServerError.Throw()
             callStack.AddRange(StackTraceHelper.GetCallStack(1 + 1 + 1 + 1 + 1));

             m_callStack = callStack.ToArray();
@@ -101,6 +107,11 @@

             callStack.Add($"-- {this.GetType().FullName} thrown --");

+            // We must ignore 4 call stack lines to get to the line where the actual throw operation happened
+            // - StackTraceHelper.GetCallStack()
+            // - This constructor
+            // - ClientErrorException or ServerErrorException constructor
+            // - Constructor of a class derived from ClientErrorException or ServerErrorException
             callStack.AddRange(StackTraceHelper.GetCallStack(1 + 1 + 1 + 1));

             m_callStack = callStack.ToArray();


Fixed tab stops

Fixed tab stops

--- SarsThing/Form1.Designer.cs
+++ SarsThing/Form1.Designer.cs
@@ -90,7 +90,7 @@
             this.txtSalary.Location = new System.Drawing.Point(315, 44);
             this.txtSalary.Name = "txtSalary";
             this.txtSalary.Size = new System.Drawing.Size(211, 26);
-            this.txtSalary.TabIndex = 0;
+            this.txtSalary.TabIndex = 1;
             this.txtSalary.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             this.txtSalary.TextChanged += new System.EventHandler(this.SomethingChanged);
             this.txtSalary.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SomethingKey);
@@ -167,7 +167,7 @@
             this.txtDependents.Location = new System.Drawing.Point(315, 184);
             this.txtDependents.Name = "txtDependents";
             this.txtDependents.Size = new System.Drawing.Size(211, 26);
-            this.txtDependents.TabIndex = 6;
+            this.txtDependents.TabIndex = 5;
             this.txtDependents.Text = "0";
             this.txtDependents.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             this.txtDependents.TextChanged += new System.EventHandler(this.SomethingChanged);
@@ -190,7 +190,7 @@
             this.txtAge.Location = new System.Drawing.Point(315, 12);
             this.txtAge.Name = "txtAge";
             this.txtAge.Size = new System.Drawing.Size(211, 26);
-            this.txtAge.TabIndex = 8;
+            this.txtAge.TabIndex = 0;
             this.txtAge.Text = "18";
             this.txtAge.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             this.txtAge.TextChanged += new System.EventHandler(this.SomethingChanged);
@@ -203,7 +203,7 @@
             this.rdCalculateSalary.Location = new System.Drawing.Point(532, 44);
             this.rdCalculateSalary.Name = "rdCalculateSalary";
             this.rdCalculateSalary.Size = new System.Drawing.Size(203, 26);
-            this.rdCalculateSalary.TabIndex = 10;
+            this.rdCalculateSalary.TabIndex = 7;
             this.rdCalculateSalary.Tag = "A";
             this.rdCalculateSalary.Text = "I want to calculate this";
             this.rdCalculateSalary.UseVisualStyleBackColor = true;
@@ -215,7 +215,7 @@
             this.rdCalculatePayout.Location = new System.Drawing.Point(532, 76);
             this.rdCalculatePayout.Name = "rdCalculatePayout";
             this.rdCalculatePayout.Size = new System.Drawing.Size(203, 26);
-            this.rdCalculatePayout.TabIndex = 11;
+            this.rdCalculatePayout.TabIndex = 8;
             this.rdCalculatePayout.TabStop = true;
             this.rdCalculatePayout.Tag = "A";
             this.rdCalculatePayout.Text = "I want to calculate this";
@@ -241,6 +241,7 @@
             this.txtResultBasic.ReadOnly = true;
             this.txtResultBasic.Size = new System.Drawing.Size(211, 19);
             this.txtResultBasic.TabIndex = 13;
+            this.txtResultBasic.TabStop = false;
             this.txtResultBasic.Text = "0.00";
             this.txtResultBasic.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             //
@@ -263,6 +264,7 @@
             this.txtResultMedical.ReadOnly = true;
             this.txtResultMedical.Size = new System.Drawing.Size(211, 19);
             this.txtResultMedical.TabIndex = 13;
+            this.txtResultMedical.TabStop = false;
             this.txtResultMedical.Text = "0.00";
             this.txtResultMedical.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             //
@@ -285,6 +287,7 @@
             this.txtResultDependents.ReadOnly = true;
             this.txtResultDependents.Size = new System.Drawing.Size(211, 19);
             this.txtResultDependents.TabIndex = 13;
+            this.txtResultDependents.TabStop = false;
             this.txtResultDependents.Text = "0.00";
             this.txtResultDependents.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             //
@@ -306,6 +309,7 @@
             this.txtResultBasePaye.ReadOnly = true;
             this.txtResultBasePaye.Size = new System.Drawing.Size(211, 19);
             this.txtResultBasePaye.TabIndex = 13;
+            this.txtResultBasePaye.TabStop = false;
             this.txtResultBasePaye.Text = "0.00";
             this.txtResultBasePaye.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             //
@@ -327,6 +331,7 @@
             this.txtResultPrimaryRebate.ReadOnly = true;
             this.txtResultPrimaryRebate.Size = new System.Drawing.Size(211, 19);
             this.txtResultPrimaryRebate.TabIndex = 13;
+            this.txtResultPrimaryRebate.TabStop = false;
             this.txtResultPrimaryRebate.Text = "0.00";
             this.txtResultPrimaryRebate.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             //
@@ -349,6 +354,7 @@
             this.txtResultMedicalTaxCredit.ReadOnly = true;
             this.txtResultMedicalTaxCredit.Size = new System.Drawing.Size(211, 19);
             this.txtResultMedicalTaxCredit.TabIndex = 13;
+            this.txtResultMedicalTaxCredit.TabStop = false;
             this.txtResultMedicalTaxCredit.Text = "0.00";
             this.txtResultMedicalTaxCredit.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             //
@@ -371,6 +377,7 @@
             this.txtResultEmployeeUif.ReadOnly = true;
             this.txtResultEmployeeUif.Size = new System.Drawing.Size(211, 19);
             this.txtResultEmployeeUif.TabIndex = 13;
+            this.txtResultEmployeeUif.TabStop = false;
             this.txtResultEmployeeUif.Text = "0.00";
             this.txtResultEmployeeUif.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             //
@@ -393,6 +400,7 @@
             this.txtResultDeductions.ReadOnly = true;
             this.txtResultDeductions.Size = new System.Drawing.Size(211, 19);
             this.txtResultDeductions.TabIndex = 13;
+            this.txtResultDeductions.TabStop = false;
             this.txtResultDeductions.Text = "0.00";
             this.txtResultDeductions.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             //
@@ -415,6 +423,7 @@
             this.txtResultPayout.ReadOnly = true;
             this.txtResultPayout.Size = new System.Drawing.Size(211, 19);
             this.txtResultPayout.TabIndex = 13;
+            this.txtResultPayout.TabStop = false;
             this.txtResultPayout.Text = "0.00";
             this.txtResultPayout.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             //
@@ -436,6 +445,7 @@
             this.txtResultTaxes.ReadOnly = true;
             this.txtResultTaxes.Size = new System.Drawing.Size(211, 19);
             this.txtResultTaxes.TabIndex = 13;
+            this.txtResultTaxes.TabStop = false;
             this.txtResultTaxes.Text = "0.00";
             this.txtResultTaxes.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             //
@@ -450,6 +460,7 @@
             this.txtErrors.ReadOnly = true;
             this.txtErrors.Size = new System.Drawing.Size(928, 58);
             this.txtErrors.TabIndex = 14;
+            this.txtErrors.TabStop = false;
             //
             // txtResultTotalPaye
             //
@@ -460,6 +471,7 @@
             this.txtResultTotalPaye.ReadOnly = true;
             this.txtResultTotalPaye.Size = new System.Drawing.Size(211, 19);
             this.txtResultTotalPaye.TabIndex = 16;
+            this.txtResultTotalPaye.TabStop = false;
             this.txtResultTotalPaye.Text = "0.00";
             this.txtResultTotalPaye.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             //
@@ -487,7 +499,7 @@
             this.txtBonus.Location = new System.Drawing.Point(315, 108);
             this.txtBonus.Name = "txtBonus";
             this.txtBonus.Size = new System.Drawing.Size(211, 26);
-            this.txtBonus.TabIndex = 17;
+            this.txtBonus.TabIndex = 3;
             this.txtBonus.Text = "0";
             this.txtBonus.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             this.txtBonus.TextChanged += new System.EventHandler(this.SomethingChanged);
@@ -504,6 +516,7 @@
             this.txtResultBonus.ReadOnly = true;
             this.txtResultBonus.Size = new System.Drawing.Size(211, 19);
             this.txtResultBonus.TabIndex = 20;
+            this.txtResultBonus.TabStop = false;
             this.txtResultBonus.Text = "0.00";
             this.txtResultBonus.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             //
@@ -526,6 +539,7 @@
             this.txtResultEarnings.ReadOnly = true;
             this.txtResultEarnings.Size = new System.Drawing.Size(211, 19);
             this.txtResultEarnings.TabIndex = 22;
+            this.txtResultEarnings.TabStop = false;
             this.txtResultEarnings.Text = "0.00";
             this.txtResultEarnings.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             //
@@ -544,9 +558,9 @@
             this.chkBenefitsIncluded.AutoSize = true;
             this.chkBenefitsIncluded.Location = new System.Drawing.Point(684, 49);
             this.chkBenefitsIncluded.Name = "chkBenefitsIncluded";
-            this.chkBenefitsIncluded.Size = new System.Drawing.Size(128, 17);
-            this.chkBenefitsIncluded.TabIndex = 23;
-            this.chkBenefitsIncluded.Text = "This includes benefits";
+            this.chkBenefitsIncluded.Size = new System.Drawing.Size(166, 17);
+            this.chkBenefitsIncluded.TabIndex = 9;
+            this.chkBenefitsIncluded.Text = "This number includes benefits";
             this.chkBenefitsIncluded.UseVisualStyleBackColor = true;
             this.chkBenefitsIncluded.CheckedChanged += new System.EventHandler(this.SomethingChanged);
             //
@@ -559,6 +573,7 @@
             this.txtResultTotalUif.ReadOnly = true;
             this.txtResultTotalUif.Size = new System.Drawing.Size(211, 19);
             this.txtResultTotalUif.TabIndex = 25;
+            this.txtResultTotalUif.TabStop = false;
             this.txtResultTotalUif.Text = "0.00";
             this.txtResultTotalUif.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             //
@@ -580,6 +595,7 @@
             this.txtResultSecondaryRebate.ReadOnly = true;
             this.txtResultSecondaryRebate.Size = new System.Drawing.Size(211, 19);
             this.txtResultSecondaryRebate.TabIndex = 27;
+            this.txtResultSecondaryRebate.TabStop = false;
             this.txtResultSecondaryRebate.Text = "0.00";
             this.txtResultSecondaryRebate.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             //
@@ -601,6 +617,7 @@
             this.txtResultTertiaryRebate.ReadOnly = true;
             this.txtResultTertiaryRebate.Size = new System.Drawing.Size(211, 19);
             this.txtResultTertiaryRebate.TabIndex = 29;
+            this.txtResultTertiaryRebate.TabStop = false;
             this.txtResultTertiaryRebate.Text = "0.00";
             this.txtResultTertiaryRebate.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             //
@@ -622,6 +639,7 @@
             this.txtResultPayeLessRebate.ReadOnly = true;
             this.txtResultPayeLessRebate.Size = new System.Drawing.Size(211, 19);
             this.txtResultPayeLessRebate.TabIndex = 31;
+            this.txtResultPayeLessRebate.TabStop = false;
             this.txtResultPayeLessRebate.Text = "0.00";
             this.txtResultPayeLessRebate.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             //
@@ -644,6 +662,7 @@
             this.txtResultEmployerUif.ReadOnly = true;
             this.txtResultEmployerUif.Size = new System.Drawing.Size(211, 19);
             this.txtResultEmployerUif.TabIndex = 33;
+            this.txtResultEmployerUif.TabStop = false;
             this.txtResultEmployerUif.Text = "0.00";
             this.txtResultEmployerUif.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
             //
@@ -663,7 +682,7 @@
             this.cmbTaxYear.Location = new System.Drawing.Point(315, 220);
             this.cmbTaxYear.Name = "cmbTaxYear";
             this.cmbTaxYear.Size = new System.Drawing.Size(211, 21);
-            this.cmbTaxYear.TabIndex = 34;
+            this.cmbTaxYear.TabIndex = 6;
             this.cmbTaxYear.SelectedIndexChanged += new System.EventHandler(this.SomethingChanged);
             //
             // label25


* Fix card flickering when reset. * TopItem is set to null when swiped the last card.

--- src/MLToolkit.Forms.SwipeCardView/SwipeCardView.cs
+++ src/MLToolkit.Forms.SwipeCardView/SwipeCardView.cs
@@ -418,7 +418,7 @@
                 {
                     if (LoopCards)
                         _itemIndex = 0;
-                    else
+                    else
                         break;
                 }

@@ -430,11 +430,12 @@
                     TopItem = ItemsSource[_itemIndex];
                 }

+                card.Scale = GetScale(i);
+                card.Rotation = 0;
+                card.TranslationX = 0;
+                card.TranslationY = -card.Y;
+                ((RelativeLayout)Content).LowerChild(card);
                 card.IsVisible = true;
-                card.Scale = GetScale(i);
-                card.RotateTo(0, 0);
-                card.TranslateTo(0, -card.Y, 0);
-                ((RelativeLayout)Content).LowerChild(card);
                 _itemIndex++;
             }
         }
@@ -597,6 +598,7 @@
         {
             if (_cards[0].IsVisible == false && _cards[1].IsVisible == false)
             {
+                TopItem = null;
                 Setup();
                 return;
             }
@@ -626,8 +628,9 @@
                 {
                     // Reset its scale, opacity and rotation
                     topCard.Scale = BackCardScale;
-                    topCard.RotateTo(0, 0);
-                    topCard.TranslateTo(0, -topCard.Y, 0);
+                    topCard.Rotation = 0;
+                    topCard.TranslationX = 0;
+                    topCard.TranslationY = -topCard.Y;
                 }
                 catch (Exception exception)
                 {


restored

restored

--- src/MainWindow.cs
+++ src/MainWindow.cs
@@ -179,17 +179,14 @@
                 // Invoker.Dispose();
             }

-            // Load (reload) Commands
             Invoker = Commands.Create($@"{Program.ConfigPath}MCEControl.commands", Settings.DisableInternalCommands);
             if (Invoker == null)
                 notifyIcon.Visible = false;
             else {
+                cmdWindow.RefreshList();
+
                 Logger.Instance.Log4.Info($"{Invoker.Count} commands available.");
-                cmdWindow.RefreshList();
-            }
-            cmdWindow.RefreshList();
-
-            Logger.Instance.Log4.Info($"{Invoker.Count} commands available.");
+            }
         }

         private void mainWindow_Closing(object sender, CancelEventArgs e) {
@@ -354,12 +351,6 @@
             }
         }

-        // Anytime a client or server receives data that looks like a command, ReceivData() is called.
-        // Those calls could come from threads other than the UI thread. This implementation relies on
-        // the async behavior of BeginInvoke such that they are each handled sequentially, in the
-        // order they happened.
-        private void ReceivedLine(Reply reply, String cmd) {
->>>>>>> Stashed changes
         private void ShowCommandWindow() {
             if (this.InvokeRequired) {
                 TelemetryService.Instance.TrackEvent("ShowCommandWindow");


Use AddRange instead of creating a new list.

--- src/Magick.NET/Shared/Profiles/Exif/ExifProfile.cs
+++ src/Magick.NET/Shared/Profiles/Exif/ExifProfile.cs
@@ -214,7 +214,7 @@

             var reader = new ExifReader();
             _values = reader.Read(Data);
-            _invalidTags = new List<ExifTag>(reader.InvalidTags);
+            _invalidTags.AddRange(reader.InvalidTags);
             _thumbnailOffset = (int)reader.ThumbnailOffset;
             _thumbnailLength = (int)reader.ThumbnailLength;
         }


(GH-3342) Fix for: TextBoxHelper.SelectAllOnFocus does not work for every mouse click Closes #3342

--- src/MahApps.Metro/Controls/Helper/TextBoxHelper.cs
+++ src/MahApps.Metro/Controls/Helper/TextBoxHelper.cs
@@ -27,8 +27,11 @@
     public static class Spelling
     {
         public static ResourceKey SuggestionMenuItemStyleKey { get; } = new ComponentResourceKey(typeof(Spelling), SpellingResourceKeyId.SuggestionMenuItemStyle);
+
         public static ResourceKey IgnoreAllMenuItemStyleKey { get; } = new ComponentResourceKey(typeof(Spelling), SpellingResourceKeyId.IgnoreAllMenuItemStyle);
+
         public static ResourceKey NoSuggestionsMenuItemStyleKey { get; } = new ComponentResourceKey(typeof(Spelling), SpellingResourceKeyId.NoSuggestionsMenuItemStyle);
+
         public static ResourceKey SeparatorStyleKey { get; } = new ComponentResourceKey(typeof(Spelling), SpellingResourceKeyId.SeparatorStyle);
     }

@@ -66,11 +69,11 @@
         public static readonly DependencyProperty ButtonTemplateProperty = DependencyProperty.RegisterAttached("ButtonTemplate", typeof(ControlTemplate), typeof(TextBoxHelper), new FrameworkPropertyMetadata(null));
         public static readonly DependencyProperty ButtonFontFamilyProperty = DependencyProperty.RegisterAttached("ButtonFontFamily", typeof(FontFamily), typeof(TextBoxHelper), new FrameworkPropertyMetadata(new FontFamilyConverter().ConvertFromString("Marlett")));
         public static readonly DependencyProperty ButtonFontSizeProperty = DependencyProperty.RegisterAttached("ButtonFontSize", typeof(double), typeof(TextBoxHelper), new FrameworkPropertyMetadata(SystemFonts.MessageFontSize));
-
+
         public static readonly DependencyProperty SelectAllOnFocusProperty = DependencyProperty.RegisterAttached("SelectAllOnFocus", typeof(bool), typeof(TextBoxHelper), new FrameworkPropertyMetadata(false));
         public static readonly DependencyProperty IsWaitingForDataProperty = DependencyProperty.RegisterAttached("IsWaitingForData", typeof(bool), typeof(TextBoxHelper), new UIPropertyMetadata(false));

-        public static readonly DependencyProperty HasTextProperty = DependencyProperty.RegisterAttached("HasText", typeof (bool), typeof (TextBoxHelper), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsRender));
+        public static readonly DependencyProperty HasTextProperty = DependencyProperty.RegisterAttached("HasText", typeof(bool), typeof(TextBoxHelper), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsRender));

         public static readonly DependencyProperty IsSpellCheckContextMenuEnabledProperty = DependencyProperty.RegisterAttached("IsSpellCheckContextMenuEnabled", typeof(bool), typeof(TextBoxHelper), new FrameworkPropertyMetadata(default(bool), IsSpellCheckContextMenuEnabledChanged));

@@ -194,6 +197,7 @@
                 {
                     return null;
                 }
+
                 var propertyName = bindingExpression.ResolvedSourcePropertyName;
                 if (!string.IsNullOrEmpty(propertyName))
                 {
@@ -203,8 +207,8 @@
                         return resolvedType.GetProperty(propertyName, BindingFlags.Public | BindingFlags.Instance);
                     }
                 }
-
-            }
+            }
+
             return null;
         }

@@ -352,7 +356,7 @@
         {
             obj.SetValue(IsWaitingForDataProperty, value);
         }
-
+
         [Category(AppName.MahApps)]
         [AttachedPropertyBrowsableForType(typeof(TextBoxBase))]
         [AttachedPropertyBrowsableForType(typeof(PasswordBox))]
@@ -509,7 +513,7 @@
         {
             obj.SetValue(UseFloatingWatermarkProperty, value);
         }
-
+
         /// <summary>
         /// Gets if the attached TextBox has text.
         /// </summary>
@@ -541,11 +545,13 @@

                     txtBox.TextChanged += TextChanged;
                     txtBox.GotFocus += TextBoxGotFocus;
+                    txtBox.PreviewMouseLeftButtonDown += UIElementPreviewMouseLeftButtonDown;
                 }
                 else
                 {
                     txtBox.TextChanged -= TextChanged;
                     txtBox.GotFocus -= TextBoxGotFocus;
+                    txtBox.PreviewMouseLeftButtonDown -= UIElementPreviewMouseLeftButtonDown;
                 }
             }
             else if (d is PasswordBox)
@@ -558,11 +564,13 @@

                     passBox.PasswordChanged += PasswordChanged;
                     passBox.GotFocus += PasswordGotFocus;
+                    passBox.PreviewMouseLeftButtonDown += UIElementPreviewMouseLeftButtonDown;
                 }
                 else
                 {
                     passBox.PasswordChanged -= PasswordChanged;
                     passBox.GotFocus -= PasswordGotFocus;
+                    passBox.PreviewMouseLeftButtonDown -= UIElementPreviewMouseLeftButtonDown;
                 }
             }
             else if (d is NumericUpDown)
@@ -574,12 +582,10 @@
                     numericUpDown.BeginInvoke(() => OnNumericUpDownValueChaged(numericUpDown, new RoutedEventArgs(NumericUpDown.ValueChangedEvent, numericUpDown)));

                     numericUpDown.ValueChanged += OnNumericUpDownValueChaged;
-                    //numericUpDown.GotFocus += NumericUpDownGotFocus;
                 }
                 else
                 {
                     numericUpDown.ValueChanged -= OnNumericUpDownValueChaged;
-                    //numericUpDown.GotFocus -= NumericUpDownGotFocus;
                 }
             }
             else if (d is TimePickerBase)
@@ -607,8 +613,9 @@
                 }
             }
         }
-
-        private static void SetTextLength<TDependencyObject>(TDependencyObject sender, Func<TDependencyObject, int> funcTextLength) where TDependencyObject : DependencyObject
+
+        private static void SetTextLength<TDependencyObject>(TDependencyObject sender, Func<TDependencyObject, int> funcTextLength)
+            where TDependencyObject : DependencyObject
         {
             if (sender != null)
             {
@@ -648,9 +655,14 @@
             ControlGotFocus(sender as TextBox, textBox => textBox.SelectAll());
         }

-        private static void NumericUpDownGotFocus(object sender, RoutedEventArgs e)
-        {
-            ControlGotFocus(sender as NumericUpDown, numericUpDown => numericUpDown.SelectAll());
+        private static void UIElementPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        {
+            if (sender is UIElement uiElement && !uiElement.IsKeyboardFocusWithin && GetSelectAllOnFocus(uiElement))
+            {
+                // always SelectAllOnFocus
+                uiElement.Focus();
+                e.Handled = true;
+            }
         }

         private static void PasswordGotFocus(object sender, RoutedEventArgs e)
@@ -658,7 +670,8 @@
             ControlGotFocus(sender as PasswordBox, passwordBox => passwordBox.SelectAll());
         }

-        private static void ControlGotFocus<TDependencyObject>(TDependencyObject sender, Action<TDependencyObject> action) where TDependencyObject : DependencyObject
+        private static void ControlGotFocus<TDependencyObject>(TDependencyObject sender, Action<TDependencyObject> action)
+            where TDependencyObject : DependencyObject
         {
             if (sender != null)
             {
@@ -848,7 +861,7 @@
             var button = (Button)sender;

             var parent = button.GetAncestors().FirstOrDefault(a => a is TextBox || a is PasswordBox || a is ComboBox);
-
+
             var command = GetButtonCommand(parent);
             var commandParameter = GetButtonCommandParameter(parent) ?? parent;
             if (command != null && command.CanExecute(commandParameter))
@@ -875,6 +888,7 @@
                         ((ComboBox)parent).Text = string.Empty;
                         ((ComboBox)parent).GetBindingExpression(ComboBox.TextProperty)?.UpdateSource();
                     }
+
                     ((ComboBox)parent).SelectedItem = null;
                     ((ComboBox)parent).GetBindingExpression(ComboBox.SelectedItemProperty)?.UpdateSource();
                 }
@@ -894,6 +908,7 @@
                     TextChanged(textbox, new RoutedEventArgs());
                 }
             }
+
             var passbox = d as PasswordBox;
             if (passbox != null)
             {
@@ -905,6 +920,7 @@
                     PasswordChanged(passbox, new RoutedEventArgs());
                 }
             }
+
             var combobox = d as ComboBox;
             if (combobox != null)
             {
@@ -927,4 +943,4 @@
             }
         }
     }
-}
+}


Added a test (pending) that tentatively highlights the issue 525 (Using a static test factory in an abstract generic type)

--- src/MbUnit/MbUnit.Tests/Framework/TestSuiteTest.cs
+++ src/MbUnit/MbUnit.Tests/Framework/TestSuiteTest.cs
@@ -31,6 +31,7 @@
     [TestsOn(typeof(TestSuite))]
     [RunSample(typeof(DynamicSample))]
     [RunSample(typeof(StaticSample))]
+    [RunSample(typeof(ConcreteStaticSample))]
     public class TestSuiteTest : BaseTestWithSampleRunner
     {
         [Test]
@@ -240,6 +241,15 @@
             Assert.IsTrue(test2Run.Step.IsPrimary);
             Assert.IsTrue(test2Run.Step.IsTestCase);
             Assert.AreEqual(test2Data.Id, test2Run.Step.TestId);
+        }
+
+        [Test]
+        [Pending("Issue 525 to be fixed (http://code.google.com/p/mb-unit/issues/detail?id=525).")]
+        public void StaticTestFactoryOnAbstractType() // Issue 525 (http://code.google.com/p/mb-unit/issues/detail?id=525)
+        {
+            var run = Runner.GetPrimaryTestStepRun(x => x.Step.FullName.EndsWith("DynamicSampleMethod"));
+            Assert.IsNotNull(run);
+            AssertLogContains(run, "Hello from SampleMethod!");
         }

         private static readonly Test[] tests = new Test[]
@@ -292,5 +302,33 @@
                 TestLog.WriteLine("Test Ran");
             }
         }
+
+        [TestFixture, Explicit("Sample")]
+        public abstract class AbstractStaticSample<T>
+        {
+            [StaticTestFactory]
+            public static IEnumerable<Test> TestSuite()
+            {
+                var methodInfo = typeof(T).GetMethod("SampleMethod");
+                var method = (Action)Delegate.CreateDelegate(typeof(Action), methodInfo);
+
+                yield return new TestSuite("SampleSuite")
+                {
+                    Children =
+                    {
+                        new TestCase("DynamicSampleMethod", () => method())
+                    }
+                };
+            }
+        }
+
+        [TestFixture, Explicit("Sample")]
+        public class ConcreteStaticSample : AbstractStaticSample<ConcreteStaticSample>
+        {
+            public void SampleMethod()
+            {
+                TestLog.Write("Hello from SampleMethod!");
+            }
+        }
     }
 }


Write the top-level method to generate templates

--- Refit-Tests/InterfaceStubGenerator.cs
+++ Refit-Tests/InterfaceStubGenerator.cs
@@ -22,6 +22,22 @@
     // What if the Interface itself is Generic? (fuck 'em)
     public class InterfaceStubGenerator
     {
+        public string GenerateInterfaceStubs(string[] paths)
+        {
+            var trees = paths.Select(x => CSharpSyntaxTree.ParseFile(x)).ToList();
+            var interfaceNamesToFind = trees.SelectMany(FindInterfacesToGenerate).Distinct().ToList();
+
+            var interfacesToGenerate = trees.SelectMany(x => x.GetRoot().DescendantNodes().OfType<InterfaceDeclarationSyntax>())
+                .Where(x => interfaceNamesToFind.Contains(x.Identifier.ValueText))
+                .ToList();
+
+            var templateInfo = GenerateTemplateInfoForInterfaceList(interfacesToGenerate);
+
+            Encoders.HtmlEncode = (s) => s;
+            var text = Render.FileToString(IntegrationTestHelper.GetPath("GeneratedInterfaceStubTemplate.cs.mustache"), templateInfo);
+            return text;
+        }
+
         public List<string> FindInterfacesToGenerate(SyntaxTree tree)
         {
             var restServiceCalls = tree.GetRoot().DescendantNodes()
@@ -105,6 +121,19 @@
     public class InterfaceStubGeneratorTests
     {
         [Test]
+        public void GenerateInterfaceStubsSmokeTest()
+        {
+            var fixture = new InterfaceStubGenerator();
+
+            var result = fixture.GenerateInterfaceStubs(new[] {
+                IntegrationTestHelper.GetPath("RestService.cs"),
+                IntegrationTestHelper.GetPath("GitHubApi.cs"),
+            });
+
+            Console.WriteLine(result);
+        }
+
+        [Test]
         public void FindInterfacesSmokeTest()
         {
             var input = IntegrationTestHelper.GetPath("RestService.cs");
@@ -143,6 +172,7 @@
                 .ToList();

             var result = fixture.GenerateTemplateInfoForInterfaceList(input);
+
             Encoders.HtmlEncode = (s) => s;
             var text = Render.FileToString(IntegrationTestHelper.GetPath("GeneratedInterfaceStubTemplate.cs.mustache"), result);
             Console.WriteLine(text);


date_interval_create_from_date_string

--- src/Peachpie.Library/DateTime/DateTimeFunctions.cs
+++ src/Peachpie.Library/DateTime/DateTimeFunctions.cs
@@ -616,6 +616,15 @@

             return "th";
         }
+
+        #endregion
+
+        #region date_interval_create_from_date_string
+
+        /// <summary>
+        /// Alias of <see cref="DateInterval.createFromDateString(string)"/>.
+        /// </summary>
+        public static DateInterval date_interval_create_from_date_string(string time) => DateInterval.createFromDateString(time);

         #endregion


Update code analysis suppression list.

Update code analysis suppression list.

--- src/GlobalSuppressions.cs
+++ src/GlobalSuppressions.cs
@@ -12,7 +12,7 @@

 // Filename: GlobalSuppressions.cs

-// Version:  2019-10-25 18:14
+// Version:  2019-12-31 23:11

 //

@@ -52,7 +52,7 @@

 [assembly: SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times", Justification = "False Positive", Scope = "member", Target = "SilDev.DirectoryEx.#GetFullHashCode(System.IO.DirectoryInfo,System.Boolean)")]

-[assembly: SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times", Justification = "False Positive", Scope = "member", Target = "SilDev.Drawing.IconEx+Factory.#Extract(System.String)")]
+[assembly: SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times", Justification = "False Positive", Scope = "member", Target = "SilDev.Drawing.IconFactory.#Extract(System.String)")]

 [assembly: SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times", Justification = "False Positive", Scope = "member", Target = "SilDev.EnvironmentEx.#Version")]

@@ -90,7 +90,7 @@

 [assembly: SuppressMessage("Code Quality", "IDE0068:Use recommended dispose pattern", Justification = "False Positive", Scope = "member", Target = "~M:SilDev.Drawing.ImageEx.GetFrames(System.Drawing.Image,System.Boolean)~System.Collections.Generic.IEnumerable{SilDev.Drawing.ImageEx.Frame}")]

-[assembly: SuppressMessage("Code Quality", "IDE0068:Use recommended dispose pattern", Justification = "Optional via parameter", Scope = "member", Target = "~M:SilDev.Drawing.IconEx.Factory.Save(System.Collections.Generic.IEnumerable{System.Drawing.Image},System.IO.Stream,System.Boolean)")]
+[assembly: SuppressMessage("Code Quality", "IDE0068:Use recommended dispose pattern", Justification = "Optional via parameter", Scope = "member", Target = "~M:SilDev.Drawing.IconFactory.Save(System.Collections.Generic.IEnumerable{System.Drawing.Image},System.IO.Stream,System.Boolean)")]

 [assembly: SuppressMessage("Design", "CA1027:Mark enums with FlagsAttribute", Justification = "FlagsAttribute is used when needed")]

@@ -168,7 +168,7 @@

 [assembly: SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "False Positive", Scope = "member", Target = "~M:SilDev.Crypto.Base64.EncodeStream(System.IO.Stream,System.IO.Stream,System.Int32,System.Boolean)")]

-[assembly: SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "False Positive", Scope = "member", Target = "~M:SilDev.Drawing.IconEx.Factory.ImageCorrection(System.Drawing.Image)~System.Drawing.Image")]
+[assembly: SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "False Positive", Scope = "member", Target = "~M:SilDev.Drawing.IconFactory.ImageCorrection(System.Drawing.Image)~System.Drawing.Image")]

 [assembly: SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "False Positive", Scope = "member", Target = "~M:SilDev.Drawing.ImageEx.GetFrames(System.Drawing.Image,System.Boolean)~System.Collections.Generic.IEnumerable{SilDev.Drawing.ImageEx.Frame}")]

@@ -178,9 +178,9 @@

 [assembly: SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "Optional via parameter", Scope = "member", Target = "~M:SilDev.Compaction.SevenZipHelper.Zip(System.String,System.String,SilDev.Compaction.SevenZipHelper.CompressMode,System.Diagnostics.ProcessWindowStyle,System.Boolean)~System.Diagnostics.Process")]

-[assembly: SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "Optional via parameter", Scope = "member", Target = "~M:SilDev.Drawing.IconEx.Factory.Save(System.Collections.Generic.IEnumerable{System.Drawing.Image},System.IO.Stream,System.Boolean)")]
-
-[assembly: SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "Optional via parameter", Scope = "member", Target = "~M:SilDev.Drawing.IconEx.Factory.Save(System.Drawing.Image,System.IO.Stream,SilDev.Drawing.IconEx.Factory.SizeOption,System.Boolean)")]
+[assembly: SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "Optional via parameter", Scope = "member", Target = "~M:SilDev.Drawing.IconFactory.Save(System.Collections.Generic.IEnumerable{System.Drawing.Image},System.IO.Stream,System.Boolean)")]
+
+[assembly: SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "Optional via parameter", Scope = "member", Target = "~M:SilDev.Drawing.IconFactory.Save(System.Drawing.Image,System.IO.Stream,SilDev.Drawing.IconFactorySizeOption,System.Boolean)")]

 [assembly: SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "Optional via parameter", Scope = "member", Target = "~M:SilDev.ProcessEx.Send(System.String,System.Boolean,System.Boolean)~System.Diagnostics.Process")]


20171247 - Fortnox documentation corrections

--- TimeLog.Api.Documentation/Views/FinancialIntegration/Fortnox.cshtml
+++ TimeLog.Api.Documentation/Views/FinancialIntegration/Fortnox.cshtml
@@ -31,12 +31,10 @@

Debtor group

VAT code (VAT zone)

-
Terms of payment

Invoice template

Discount percentage

VAT no. in TimeLog Project is also the CIN/PIN no. on Fortnox. When a customer is transferred to Fortnox the CIN/PIN no. for that customer on Fortnox will change to the corresponding CIN/PIN no. belonging to the VAT no.

-
Payment terms can be transferred with a customer to Fortnox. However the payment term's days have to match.

Product numbers

@@ -79,7 +77,7 @@

Mapping

-
This section contains the explicit mapping of fields between TimeLog Project and e-conomic.

+
This section contains the explicit mapping of fields between TimeLog Project and Fortnox.

Customers

@@ -191,13 +189,7 @@
                     Currency
                     Only currency is transferred, Fortnox uses own currency rate

-

-                    PaymentTermId
-                    Payment terms
-                    TermsOfPayment
-                    TermOfPayment
-
-

+

                 Discount
                 Fakturarabatt (%)
@@ -310,7 +302,7 @@
                     Betalningsvillkor
                     -
                     TermOfPayment
-                    Terms of payment is set by the customer's payment terms on Fortnox
+                    Terms of payment is set by the customer's payment terms in Fortnox

                     Currency
@@ -451,7 +443,7 @@
                     À-pris
                     Rate
                     Price
-                    Unit attached to product retrieved from e-conomic
+                    Unit attached to product retrieved from Fortnox

                     Description
@@ -524,14 +516,14 @@
                     Valuta
                     CurrencyID
                     ID
-                    The currencyID in TimeLog Project is fetched from the TimeLog Project currency, based on the currency ABB on the purchase from e-conomic
+                    The currencyID in TimeLog Project is fetched from the TimeLog Project currency, based on the currency ABB on the purchase from Fortnox

                     Currency
                     Kurs
                     ExchangeRate
                     Rate
-                    The currency rate in TimeLog Project is fetched from the TimeLog Project currency, based on the currency ABB on the purchase from e-conomic
+                    The currency rate in TimeLog Project is fetched from the TimeLog Project currency, based on the currency ABB on the purchase from Fortnox


Additional Tests

Additional Tests

--- TinyCsvParser/TinyCsvParser.Test/TypeConverter/BoolConverterTest.cs
+++ TinyCsvParser/TinyCsvParser.Test/TypeConverter/BoolConverterTest.cs
@@ -30,4 +30,29 @@
             get { return new[] { "a", string.Empty, "  ", null }; }
         }
     }
+
+    [TestFixture]
+    public class BoolConverterNonDefaultTest : BaseConverterTest<bool>
+    {
+        protected override ITypeConverter<bool> Converter
+        {
+            get { return new BoolConverter("ThisIsTrue", "ThisIsFalse", StringComparison.InvariantCulture); }
+        }
+
+        protected override Tuple<string, bool>[] SuccessTestData
+        {
+            get
+            {
+                return new[] {
+                    MakeTuple("ThisIsTrue", true),
+                    MakeTuple("ThisIsFalse", false),
+                };
+            }
+        }
+
+        protected override string[] FailTestData
+        {
+            get { return new[] { "a", string.Empty, "  ", null, "thisistrue", "thisisfalse" }; }
+        }
+    }
 }


Finish Issue-10

Finish Issue-10

--- VaraniumSharp.Initiator/Configuration/SplunkLoggingConfiguration.cs
+++ VaraniumSharp.Initiator/Configuration/SplunkLoggingConfiguration.cs
@@ -41,7 +41,7 @@
                 IsActive = false;
                 return;
             }
-            serilogConfiguration.WriteTo.EventCollector(SplunkHost, SplunkHost);
+            serilogConfiguration.WriteTo.EventCollector(SplunkHost, SplunkToken);
             IsActive = true;
         }


Expand wallet tab.

Expand wallet tab.

--- WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
+++ WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
@@ -104,6 +104,11 @@
 					if (x is ViewModelBase vmb)
 					{
 						SelectedItem = vmb;
+
+						if (x is WasabiWalletDocumentTabViewModel wwdtvm)
+						{
+							wwdtvm.WalletViewModel.IsExpanded = true;
+						}
 					}
 				});


Extract ToggleLurkingWifeMode function.

Extract ToggleLurkingWifeMode function.

--- WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
+++ WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
@@ -73,11 +73,7 @@

 			CollapseAllCommand = ReactiveCommand.Create(CollapseWallets);

-			LurkingWifeModeCommand = ReactiveCommand.Create(() =>
-			{
-				UiConfig.LurkingWifeMode = !UiConfig.LurkingWifeMode;
-				UiConfig.ToFile();
-			});
+			LurkingWifeModeCommand = ReactiveCommand.Create(ToggleLurkingWifeMode);

 			_isLurkingWifeMode = UiConfig
 				.WhenAnyValue(x => x.LurkingWifeMode)
@@ -109,6 +105,12 @@
 				.Subscribe(x => shell.AddOrSelectDocument(x));
 		}

+		private void ToggleLurkingWifeMode()
+		{
+			UiConfig.LurkingWifeMode = !UiConfig.LurkingWifeMode;
+			UiConfig.ToFile();
+		}
+
 		private void CollapseWallets()
 		{
 			foreach (var wallet in Wallets)


Add RemoveActor function.

Add RemoveActor function.

--- Roton/Emulation/CoreBase.Functions.cs
+++ Roton/Emulation/CoreBase.Functions.cs
@@ -587,7 +587,71 @@
         virtual internal void RemoveActor(int index)
         {
             var actor = Actors[index];
-
+            if (actor.Pointer >= 0)
+            {
+                int refCount = 0;
+                for (int i = 1; i < ActorCount; i++)
+                {
+                    if (Actors[i].Pointer == actor.Pointer)
+                    {
+                        refCount++;
+                    }
+                }
+                if (refCount < 1)
+                {
+                    actor.Code = "";
+                }
+                actor.Pointer = -1;
+            }
+
+            if (index < ActIndex)
+            {
+                ActIndex--;
+            }
+
+            TileAt(actor.Location).CopyFrom(actor.UnderTile);
+            if (actor.Location.Y > 0)
+            {
+                UpdateBoard(actor.Location);
+            }
+
+            for (int i = 1; i < ActorCount; i++)
+            {
+                var a = Actors[i];
+                if (a.Follower >= index)
+                {
+                    if (a.Follower == index)
+                    {
+                        a.Follower = -1;
+                    }
+                    else
+                    {
+                        a.Follower--;
+                    }
+                }
+
+                if (a.Leader >= index)
+                {
+                    if (a.Leader == index)
+                    {
+                        a.Leader = -1;
+                    }
+                    else
+                    {
+                        a.Leader--;
+                    }
+                }
+            }
+
+            if (index < ActorCount)
+            {
+                for (int i = index; i < ActorCount; i++)
+                {
+                    Actors[i].CopyFrom(Actors[i + 1]);
+                }
+            }
+
+            ActorCount--;
         }

         virtual internal void ResetAlerts()


Show more results

Show more results

--- SOVND.Client/Views/MainWindow.xaml.cs
+++ SOVND.Client/Views/MainWindow.xaml.cs
@@ -111,9 +111,6 @@
                         var trackLink = Spotify.GetTrackLink(trackPtr);
                         var track = new Track(trackLink);
                         candidates.Add(track);
-
-                        if (candidates.Count > 10)
-                            break;
                     }
                     SyncHolder.sync.Send((x) => lbPlaylist.ItemsSource = candidates, null);
                 });


Start service-like apps with the currently logged in user credentials

--- ServiceLikeServiceDriver.cs
+++ ServiceLikeServiceDriver.cs
@@ -2,6 +2,7 @@
 using System.Diagnostics;
 using System.IO;
 using System.Runtime.InteropServices;
+using System.Security.Principal;
 using System.ServiceProcess;

 namespace MLocati.ServicesControl
@@ -65,7 +66,10 @@
             process.StartInfo.RedirectStandardError = true;
             process.OutputDataReceived += Process_OutputDataReceived;
             process.ErrorDataReceived += Process_ErrorDataReceived;
-            process.Start();
+            using (var impersonationContext = WindowsIdentity.GetCurrent().Impersonate())
+            {
+                process.Start();
+            }
             process.BeginOutputReadLine();
             process.BeginErrorReadLine();
             this.Process = process;


Misc: Increase MemoryMappedFile size to 15mb

value based on upper limit of max background image size in my songs folder

--- plugins/FileMapDataSender/FileMapManager.cs
+++ plugins/FileMapDataSender/FileMapManager.cs
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
 using System.IO.MemoryMappedFiles;
 using System.Text;

@@ -38,7 +38,7 @@
             {
                 if (_files.ContainsKey(pipeName))
                     return _files[pipeName];
-                MapContainer f = new MapContainer() { File = MemoryMappedFile.CreateOrOpen(pipeName, 16 * 1024) };
+                MapContainer f = new MapContainer() { File = MemoryMappedFile.CreateOrOpen(pipeName, 15 * 1024 * 1024) };
                 if (pipeName == "Sc-ingamePatterns" || pipeName.StartsWith("conf-") || pipeName.StartsWith("value-"))
                     f.ASCIIonly = true;
                 _files.Add(pipeName, f);


addded some more test

addded some more test

--- SabberStoneKettleServer/KettleTest.cs
+++ SabberStoneKettleServer/KettleTest.cs
@@ -163,31 +163,22 @@
             TagChangeTest(1, 10, 85);
             TagChangeTest(3, (int)GameTag.NEXT_STEP, (int)Step.BEGIN_MULLIGAN);

-            new KettleHistoryBlockEnd {};
-
-            //    PowerList:  Count = 3
-            //         Power: TAG_CHANGE Entity = GameEntity tag = STEP value = BEGIN_MULLIGAN
-            //         Power: BLOCK_START BlockType = TRIGGER Entity = GameEntity EffectCardId = EffectIndex = -1 Target = 0
-            //         Power: TAG_CHANGE Entity = RoxOnTox tag = MULLIGAN_STATE value = INPUT
-            // EntityChoices: id = 1 Player = RoxOnTox TaskList = 4 ChoiceType = MULLIGAN CountMin = 0 CountMax = 3
-            // EntityChoices: Source = GameEntity
-            // EntityChoices: Entities[0] =[name = UNKNOWN ENTITY[cardType = INVALID] id = 11 zone = DECK zonePos = 0 cardId = player = 1]
-            // EntityChoices: Entities[1] =[name = UNKNOWN ENTITY[cardType = INVALID] id = 29 zone = DECK zonePos = 0 cardId = player = 1]
-            // EntityChoices: Entities[2] =[name = UNKNOWN ENTITY[cardType = INVALID] id = 12 zone = DECK zonePos = 0 cardId = player = 1]
-            //     PowerList: Count = 1
-            //         Power: TAG_CHANGE Entity = toshiro tag = MULLIGAN_STATE value = INPUT
-            // EntityChoices: id = 2 Player = toshiro TaskList = 5 ChoiceType = MULLIGAN CountMin = 0 CountMax = 5
-            // EntityChoices: Source = GameEntity
-            // EntityChoices: Entities[0] =[name = UNKNOWN ENTITY[cardType = INVALID] id = 46 zone = DECK zonePos = 0 cardId = player = 2]
-            // EntityChoices: Entities[1] =[name = UNKNOWN ENTITY[cardType = INVALID] id = 50 zone = DECK zonePos = 0 cardId = player = 2]
-            // EntityChoices: Entities[2] =[name = UNKNOWN ENTITY[cardType = INVALID] id = 34 zone = DECK zonePos = 0 cardId = player = 2]
-            // EntityChoices: Entities[3] =[name = UNKNOWN ENTITY[cardType = INVALID] id = 41 zone = DECK zonePos = 0 cardId = player = 2]
-            // EntityChoices: Entities[4] =[name = UNKNOWN ENTITY[cardType = INVALID] id = 68 zone = HAND zonePos = 5 cardId = player = 2]
+            BlockEndTest();
+
+            TagChangeTest(1, (int)GameTag.STEP, (int)Step.BEGIN_MULLIGAN);
+
+            BlockStartTest("", -1, 1, 0, (int)BlockType.TRIGGER);
+            TagChangeTest(2, (int)GameTag.MULLIGAN_STATE, (int)Mulligan.INPUT);
+            EntityChoicesTest((int) ChoiceType.MULLIGAN, 3, 0, 1, new List<int> {11, 29, 12}, 2, 1);
+
+            TagChangeTest(3, (int)GameTag.MULLIGAN_STATE, (int)Mulligan.INPUT);
+            EntityChoicesTest((int)ChoiceType.MULLIGAN, 5, 0, 1, new List<int> { 46,50,34,41,68 }, 3, 2);
+
             //EntitiesChosen: id = 2 Player = toshiro EntitiesCount = 0
             //   SendChoices: id = 1 ChoiceType = MULLIGAN
             //   SendChoices: m_chosenEntities[0] =[name = Fiery War Axe id = 11 zone = HAND zonePos = 1 cardId = CS2_106 player = 1]
             //     PowerList: Count = 42
-            //         Power: BLOCK_END
+            BlockEndTest();
         }

         public static KettleHistoryCreateGame CreateGameTest()
@@ -345,6 +336,25 @@
             };
         }

+        public static KettleHistoryBlockEnd BlockEndTest()
+        {
+            return new KettleHistoryBlockEnd();
+        }
+
+        public static KettleEntityChoices EntityChoicesTest(int choiceType, int countMax, int countMin, int source, List<int> entities, int playerId, int index)
+        {
+            return new KettleEntityChoices
+            {
+                ChoiceType = choiceType,
+                CountMax = countMax,
+                CountMin = countMin,
+                Source = source,
+                Entities = entities,
+                PlayerID = playerId,
+                ID = index,
+            };
+        }
+
         public static KettleHistoryShowEntity ShowEntityTest(int entityId, string cardId, Dictionary<int, int> tags)
         {
             return new KettleHistoryShowEntity


Fixed issue with new Substring method

Fixed issue with new Substring method

--- src/SmartFormat/Extensions/ConditionalExtension.cs
+++ src/SmartFormat/Extensions/ConditionalExtension.cs
@@ -251,7 +251,7 @@

             // Successful
             // Output the substring that doesn't contain the "complex condition"
-            var newStartIndex = m.Index + m.Length;
+            var newStartIndex = m.Index + m.Length - parameter.startIndex;
             outputItem = parameter.Substring(newStartIndex);
             return true;
         }


Cache delegates

Cache delegates

--- src/Spreads.Extensions/Serialization/TypeHelper.cs
+++ src/Spreads.Extensions/Serialization/TypeHelper.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
 using System.Reflection;
@@ -14,6 +15,7 @@
     internal delegate int FromPtrDelegate(IntPtr ptr, ref object value);
     internal delegate int ToPtrDelegate(object value, IntPtr pointer, MemoryStream ms = null);
     internal delegate int SizeOfDelegate(object value, out MemoryStream memoryStream);
+    internal delegate int SizeDelegate();

     internal class TypeParams {
         public int Size { get; set; }
@@ -41,22 +43,52 @@
             return TypeHelper<T>.SizeOf(temp, out memoryStream);
         }

+        internal static int Size<T>() {
+            return TypeHelper<T>.Size;
+        }
+
+        private static readonly Dictionary<Type, FromPtrDelegate> FromPtrDelegateCache = new Dictionary<Type, FromPtrDelegate>();
         internal static FromPtrDelegate GetFromPtrDelegate(Type ty) {
+            FromPtrDelegate temp;
+            if (FromPtrDelegateCache.TryGetValue(ty, out temp)) return temp;
             var mi = typeof(TypeHelper).GetMethod("FromPtr", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
             var genericMi = mi.MakeGenericMethod(ty);
-            return (FromPtrDelegate)Delegate.CreateDelegate(typeof(FromPtrDelegate), genericMi);
-        }
-
+            temp = (FromPtrDelegate)Delegate.CreateDelegate(typeof(FromPtrDelegate), genericMi);
+            FromPtrDelegateCache[ty] = temp;
+            return temp;
+        }
+
+        private static readonly Dictionary<Type, ToPtrDelegate> ToPtrDelegateCache = new Dictionary<Type, ToPtrDelegate>();
         internal static ToPtrDelegate GetToPtrDelegate(Type ty) {
+            ToPtrDelegate temp;
+            if (ToPtrDelegateCache.TryGetValue(ty, out temp)) return temp;
             var mi = typeof(TypeHelper).GetMethod("ToPtr", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
             var genericMi = mi.MakeGenericMethod(ty);
-            return (ToPtrDelegate)Delegate.CreateDelegate(typeof(ToPtrDelegate), genericMi);
-        }
-
+            temp = (ToPtrDelegate)Delegate.CreateDelegate(typeof(ToPtrDelegate), genericMi);
+            ToPtrDelegateCache[ty] = temp;
+            return temp;
+        }
+
+        private static readonly Dictionary<Type, SizeOfDelegate> SizeOfDelegateCache = new Dictionary<Type, SizeOfDelegate>();
         internal static SizeOfDelegate GetSizeOfDelegate(Type ty) {
+            SizeOfDelegate temp;
+            if (SizeOfDelegateCache.TryGetValue(ty, out temp)) return temp;
             var mi = typeof(TypeHelper).GetMethod("SizeOf", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
             var genericMi = mi.MakeGenericMethod(ty);
-            return (SizeOfDelegate)Delegate.CreateDelegate(typeof(SizeOfDelegate), genericMi);
+            temp = (SizeOfDelegate)Delegate.CreateDelegate(typeof(SizeOfDelegate), genericMi);
+            SizeOfDelegateCache[ty] = temp;
+            return temp;
+        }
+
+        private static readonly Dictionary<Type, SizeDelegate> SizeDelegateCache = new Dictionary<Type, SizeDelegate>();
+        internal static SizeDelegate GetSizeDelegate(Type ty) {
+            SizeDelegate temp;
+            if (SizeDelegateCache.TryGetValue(ty, out temp)) return temp;
+            var mi = typeof(TypeHelper).GetMethod("Size", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
+            var genericMi = mi.MakeGenericMethod(ty);
+            temp = (SizeDelegate)Delegate.CreateDelegate(typeof(SizeDelegate), genericMi);
+            SizeDelegateCache[ty] = temp;
+            return temp;
         }
     }

@@ -321,9 +353,8 @@
         /// If type is supported by TypeHelper, is it either a blittable fixed-size type (Size > 0) or
         /// a type with a binary convertor (Size = 0).
         /// </summary>
-        public static bool IsSupportedType => _size >= 0;
-
-        public static bool HasBinaryConverter => _hasBinaryConverter;
+        //public static bool IsSupportedType => _size >= 0;
+
         public static int Version => _hasBinaryConverter ? _convertorInstance.Version : 0;

         public static void RegisterConvertor(IBinaryConverter<T> convertor, bool overrideExisting = false) {


Parallelize token deletion

Parallelize token deletion

--- src/Stormpath.Owin.Middleware/Route/LogoutRoute.cs
+++ src/Stormpath.Owin.Middleware/Route/LogoutRoute.cs
@@ -76,18 +76,23 @@
             var accessToken = cookieParser.Get(_configuration.Web.AccessTokenCookie.Name);
             var refreshToken = cookieParser.Get(_configuration.Web.RefreshTokenCookie.Name);

+            var deleteAccessTokenTask = Task.FromResult(false);
+            var deleteRefreshTokenTask = Task.FromResult(false);
+
             string jti = string.Empty;
             if (IsValidJwt(accessToken, client, out jti))
             {
                 var accessTokenResource = await client.GetAccessTokenAsync($"/accessTokens/{jti}", cancellationToken);
-                await accessTokenResource.DeleteAsync();
+                deleteAccessTokenTask = accessTokenResource.DeleteAsync(cancellationToken);
             }

             if (IsValidJwt(refreshToken, client, out jti))
             {
                 var refreshTokenResource = await client.GetRefreshTokenAsync($"/refreshTokens/{jti}", cancellationToken);
-                await refreshTokenResource.DeleteAsync();
+                deleteRefreshTokenTask = refreshTokenResource.DeleteAsync(cancellationToken);
             }
+
+            await Task.WhenAll(deleteAccessTokenTask, deleteRefreshTokenTask);
         }

         private bool IsValidJwt(string jwt, IClient client, out string jti)


change stream to safe cast

change stream to safe cast

--- src/Telebot/MultipartFormDataContent.extensions.cs
+++ src/Telebot/MultipartFormDataContent.extensions.cs
@@ -72,11 +72,9 @@
             if( valueType == typeof(string) )
                 return new StringContent(value as string);

-            if( valueType == typeof(Stream) )
-                return new StreamContent(value as Stream);
-
-            if( valueType == typeof(FileStream) )
-                return new StreamContent(value as FileStream);
+            var stream = value as Stream;
+            if( stream != null )
+                return new StreamContent( stream );

             return new StringContent(JsonConvert.SerializeObject(value, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }));
         }


make sure PropertyTestsBase proxies inherited tests https://youtrack.jetbrains.com/issue/RIDER-19912

(cherry picked from commit ee571a7fc8e2de5b4d83ed51c7f5f82dc94f905d)

--- src/Tests/Tests/Mapping/Types/PropertyTestsBase.cs
+++ src/Tests/Tests/Mapping/Types/PropertyTestsBase.cs
@@ -1,4 +1,6 @@
 using System;
+using System.Threading.Tasks;
+using Elastic.Xunit.XunitPlumbing;
 using Nest;
 using Elasticsearch.Net;
 using Tests.Core.ManagedElasticsearch.Clusters;
@@ -39,5 +41,20 @@
 		{
 			Properties = this.InitializerProperties
 		};
+
+		// https://youtrack.jetbrains.com/issue/RIDER-19912
+		[U] protected override Task HitsTheCorrectUrl() => base.HitsTheCorrectUrl();
+
+		[U] protected override Task UsesCorrectHttpMethod() => base.UsesCorrectHttpMethod();
+
+		[U] protected override void SerializesInitializer() => base.SerializesInitializer();
+
+		[U] protected override void SerializesFluent() => base.SerializesFluent();
+
+		[I] public override Task ReturnsExpectedStatusCode() => base.ReturnsExpectedResponse();
+
+		[I] public override Task ReturnsExpectedIsValid() => base.ReturnsExpectedIsValid();
+
+		[I] public override Task ReturnsExpectedResponse() => base.ReturnsExpectedResponse();
 	}
 }


Updating package upgrade message

Updating package upgrade message

- Changing the message from using the, grammatically incorrect, `then` to use `than`
- Changing the message from using passive voice to active voice

--- src/Tools/GenerateGlobalAnalyzerConfigs/Program.cs
+++ src/Tools/GenerateGlobalAnalyzerConfigs/Program.cs
@@ -542,9 +542,9 @@

                     case NetAnalyzersPackageName:
                         return $@"
-  <!-- Target to report a warning when SDK NetAnalyzers version is higher then the referenced NuGet NetAnalyzers version -->
+  <!-- Target to report a warning when SDK NetAnalyzers version is higher than the referenced NuGet NetAnalyzers version -->
   <Target Name=""_ReportUpgradeNetAnalyzersNuGetWarning"" BeforeTargets=""CoreCompile"" Condition=""'$(_SkipUpgradeNetAnalyzersNuGetWarning)' != 'true' "">
-    <Warning Text =""The .NET SDK has newer analyzers with version '$({NetAnalyzersSDKAssemblyVersionPropertyName})' then what is provided by version '$({NetAnalyzersNugetAssemblyVersionPropertyName})' of '{NetAnalyzersPackageName}' package. Update or remove this package reference.""
+    <Warning Text =""The .NET SDK has newer analyzers with version '$({NetAnalyzersSDKAssemblyVersionPropertyName})' than what version '$({NetAnalyzersNugetAssemblyVersionPropertyName})' of '{NetAnalyzersPackageName}' package provides. Update or remove this package reference.""
              Condition=""'$({NetAnalyzersNugetAssemblyVersionPropertyName})' != '' AND
                          '$({NetAnalyzersSDKAssemblyVersionPropertyName})' != '' AND
                           $({NetAnalyzersNugetAssemblyVersionPropertyName}) < $({NetAnalyzersSDKAssemblyVersionPropertyName})""/>


Fix potential error in ParametersHelper when parameter property is null

--- src/UwCore/Services/Navigation/ParametersHelper.cs
+++ src/UwCore/Services/Navigation/ParametersHelper.cs
@@ -53,7 +53,7 @@
             if (parametersProperty != null)
             {
                 var parameter = parametersProperty.GetValue(self);
-                return parameter.AreValuesInjected(values);
+                return parameter != null && parameter.AreValuesInjected(values);
             }
             else
             {


Fix update code crashing when no internet connection is available

--- osu.Desktop/Updater/SimpleUpdateManager.cs
+++ osu.Desktop/Updater/SimpleUpdateManager.cs
@@ -41,24 +41,32 @@

         private async void checkForUpdateAsync()
         {
-            var releases = new JsonWebRequest<GitHubRelease>("https://api.github.com/repos/ppy/osu/releases/latest");
-            await releases.PerformAsync();
+            try
+            {
+                var releases = new JsonWebRequest<GitHubRelease>("https://api.github.com/repos/ppy/osu/releases/latest");

-            var latest = releases.ResponseObject;
+                await releases.PerformAsync();

-            if (latest.TagName != version)
+                var latest = releases.ResponseObject;
+
+                if (latest.TagName != version)
+                {
+                    notificationOverlay.Post(new SimpleNotification
+                    {
+                        Text = $"A newer release of osu! has been found ({version} → {latest.TagName}).\n\n"
+                               + "Click here to download the new version, which can be installed over the top of your existing installation",
+                        Icon = FontAwesome.fa_upload,
+                        Activated = () =>
+                        {
+                            host.OpenUrlExternally(getBestUrl(latest));
+                            return true;
+                        }
+                    });
+                }
+            }
+            catch
             {
-                notificationOverlay.Post(new SimpleNotification
-                {
-                    Text = $"A newer release of osu! has been found ({version} → {latest.TagName}).\n\n"
-                           + "Click here to download the new version, which can be installed over the top of your existing installation",
-                    Icon = FontAwesome.fa_upload,
-                    Activated = () =>
-                    {
-                        host.OpenUrlExternally(getBestUrl(latest));
-                        return true;
-                    }
-                });
+                // we shouldn't crash on a web failure. or any failure for the matter.
             }
         }


Change throw to debug assert

Change throw to debug assert

--- osu.Framework/Graphics/InvalidationList.cs
+++ osu.Framework/Graphics/InvalidationList.cs
@@ -2,7 +2,7 @@
 // See the LICENCE file in the repository root for full licence text.

 using System;
-using System.Diagnostics.CodeAnalysis;
+using System.Diagnostics;
 using System.Runtime.CompilerServices;
 using osu.Framework.Layout;

@@ -40,6 +40,9 @@
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public bool Invalidate(InvalidationSource source, Invalidation flags)
         {
+            // Guaranteed by preconditions at the callsite.
+            Debug.Assert(source is InvalidationSource.Self or InvalidationSource.Parent or InvalidationSource.Child);
+
             switch (source)
             {
                 case InvalidationSource.Self:
@@ -52,11 +55,8 @@
                     return invalidate(childInvalidation, flags, out childInvalidation);

                 default:
-                    return throwInvalidSourceException();
+                    return false;
             }
-
-            [DoesNotReturn]
-            static bool throwInvalidSourceException() => throw new ArgumentException("Unexpected invalidation source.", nameof(source));
         }

         /// <summary>


Add minimum resolution settings.

Add minimum resolution settings.

--- osu.Game/Configuration/OsuConfigManager.cs
+++ osu.Game/Configuration/OsuConfigManager.cs
@@ -10,8 +10,8 @@
     {
         protected override void InitialiseDefaults()
         {
-            Set(OsuConfig.Width, 1366);
-            Set(OsuConfig.Height, 768);
+            Set(OsuConfig.Width, 1366, 640);
+            Set(OsuConfig.Height, 768, 480);
             Set(OsuConfig.MouseSensitivity, 1.0);

             Set(OsuConfig.Username, string.Empty);


fixed SupporterRequiredDrawable style

fixed SupporterRequiredDrawable style

--- osu.Game/Overlays/BeatmapListingOverlay.cs
+++ osu.Game/Overlays/BeatmapListingOverlay.cs
@@ -294,6 +294,8 @@
                         {
                             Anchor = Anchor.Centre,
                             Origin = Anchor.Centre,
+                            Font = OsuFont.GetFont(size: 16),
+                            Colour = Colour4.White,
                             Margin = new MarginPadding { Bottom = 10 },
                         },
                         createSupporterTagLink(),


Allow `DrawableAvatar` to accept an `IUser` for now

--- osu.Game/Users/Drawables/DrawableAvatar.cs
+++ osu.Game/Users/Drawables/DrawableAvatar.cs
@@ -14,13 +14,13 @@
     [LongRunningLoad]
     public class DrawableAvatar : Sprite
     {
-        private readonly APIUser user;
+        private readonly IUser user;

         /// <summary>
         /// A simple, non-interactable avatar sprite for the specified user.
         /// </summary>
         /// <param name="user">The user. A null value will get a placeholder avatar.</param>
-        public DrawableAvatar(APIUser user = null)
+        public DrawableAvatar(IUser user = null)
         {
             this.user = user;

@@ -33,10 +33,10 @@
         [BackgroundDependencyLoader]
         private void load(LargeTextureStore textures)
         {
-            if (user != null && user.Id > 1)
+            if (user != null && user.OnlineID > 1)
                 // TODO: The fallback here should not need to exist. Users should be looked up and populated via UserLookupCache or otherwise
                 // in remaining cases where this is required (chat tabs, local leaderboard), at which point this should be removed.
-                Texture = textures.Get(user.AvatarUrl ?? $@"https://a.ppy.sh/{user.Id}");
+                Texture = textures.Get((user as APIUser)?.AvatarUrl ?? $@"https://a.ppy.sh/{user.OnlineID}");

             Texture ??= textures.Get(@"Online/avatar-guest");
         }


WWT.Providers: update ISS TLE to use a new service

The old NASA endpoint has been decommissioned.

--- src/WWT.Providers/OtherProviders/IssTleProvider.cs
+++ src/WWT.Providers/OtherProviders/IssTleProvider.cs
@@ -10,20 +10,21 @@
     {
         public override string ContentType => ContentTypes.Text;

+        const string theUrl = "https://api.wheretheiss.at/v1/satellites/25544/tles?format=text";
+
         public override async Task RunAsync(IWwtContext context, CancellationToken token)
         {
-            string url = "";
-
-            url = "http://spaceflight.nasa.gov/realdata/sightings/SSapplications/Post/JavaSSOP/orbit/ISS/SVPOST.html";
+            string reply = "";

             try
             {
-                string reply = (string)context.Cache["WWTISSTLE"];
+                reply = (string) context.Cache["WWTISSTLE"];
                 DateTime date = DateTime.Now;
                 TimeSpan ts = new TimeSpan(100, 0, 0, 0);
-                if (context.Cache["WWTISSTLDATE"] != null)
+
+                if (context.Cache["WWTISSTLEDATE"] != null)
                 {
-                    date = (DateTime)context.Cache["WWTISSTLDATE"];
+                    date = (DateTime) context.Cache["WWTISSTLEDATE"];
                     ts = DateTime.Now - date;
                 }

@@ -31,54 +32,49 @@
                 {
                     using (WebClient wc = new WebClient())
                     {
-                        string data = wc.DownloadString(url);
+                        string data = wc.DownloadString(theUrl);
+                        string[] lines = data.Split(new char[] { '\n', '\r' });

-                        string[] lines = data.Split(new char[] { '\n', '\r' });
                         string line1 = "";
                         string line2 = "";
+
                         for (int i = 0; i < lines.Length; i++)
                         {
                             lines[i] = lines[i].Trim();
+
                             if (lines[i].Length == 69 && IsTLECheckSumGood(lines[i]))
                             {
                                 if (line1.Length == 0 && lines[i].Substring(0, 1) == "1")
                                 {
                                     line1 = lines[i];
                                 }
+
                                 if (line2.Length == 0 && lines[i].Substring(0, 1) == "2")
                                 {
                                     line2 = lines[i];
                                 }
                             }
                         }
+
                         if (line1 == "" || line2 == "")
                         {
-                            reply = "1 25544U 98067A   13274.85334491  .00007046  00000-0  12878-3 0  7167\n";
-                            reply += "2 25544  51.6486 299.7368 0003212  97.7461 254.0523 15.50562392851247\n";
-                            reply += "Cached during government shutdown";
-
-                        }
-                        else
-                        {
-
-                            reply = line1 + "\n" + line2 + "\nLaste Updated:" + DateTime.Now;
+                            throw new SystemException("TLE webservice response did not include valid TLE data");
                         }

+                        reply = line1 + "\n" + line2 + "\nLast Updated:" + DateTime.Now;
                         context.Cache["WWTISSTLE"] = reply;
-                        context.Cache["WWTISSTLDATE"] = DateTime.Now;
+                        context.Cache["WWTISSTLEDATE"] = DateTime.Now;
                     }
                 }
-
-                await context.Response.WriteAsync(reply, token);
             }
             catch (Exception)
             {
-                string reply = "1 25544U 98067A   13274.85334491  .00007046  00000-0  12878-3 0  7167\n";
+                reply = "1 25544U 98067A   13274.85334491  .00007046  00000-0  12878-3 0  7167\n";
                 reply += "2 25544  51.6486 299.7368 0003212  97.7461 254.0523 15.50562392851247\n";
-                reply += "Cached during NASA Downtime";
+                reply += "WARNING: cached response due to backend failure";
+            }

-                await context.Response.WriteAsync(reply, token);
-            }
+            await context.Response.WriteAsync(reply, token);
         }

         static bool IsTLECheckSumGood(string line)


Improve sync field, sync list, net function functions

--- Scripts/GameApi/LiteNetLibIdentity.cs
+++ Scripts/GameApi/LiteNetLibIdentity.cs
@@ -236,17 +236,16 @@
 #endif
         #endregion

+        #region SyncField Functions
         internal LiteNetLibSyncField ProcessSyncField(LiteNetLibElementInfo info, NetDataReader reader, bool isInitial)
         {
-            if (info.objectId != ObjectId)
+            return ProcessSyncField(GetSyncField(info), reader, isInitial);
+        }
+
+        internal LiteNetLibSyncField ProcessSyncField(LiteNetLibSyncField syncField, NetDataReader reader, bool isInitial)
+        {
+            if (syncField == null)
                 return null;
-            LiteNetLibSyncField syncField = GetSyncField(info);
-            if (syncField == null)
-            {
-                if (Manager.LogError)
-                    Logging.LogError(LogTag, "Cannot process sync field, fieldId [" + info.elementId + "] not found.");
-                return null;
-            }
             syncField.Deserialize(reader, isInitial);
             return syncField;
         }
@@ -257,20 +256,22 @@
                 return null;
             if (info.elementId >= 0 && info.elementId < SyncFields.Count)
                 return SyncFields[info.elementId];
+            if (Manager.LogError)
+                Logging.LogError(LogTag, "Cannot find sync field [" + info.elementId + "].");
             return null;
         }
-
+        #endregion
+
+        #region NetFunction Functions
         internal LiteNetLibFunction ProcessNetFunction(LiteNetLibElementInfo info, NetDataReader reader, bool hookCallback)
         {
-            if (info.objectId != ObjectId)
+            return ProcessNetFunction(GetNetFunction(info), reader, hookCallback);
+        }
+
+        internal LiteNetLibFunction ProcessNetFunction(LiteNetLibFunction netFunction, NetDataReader reader, bool hookCallback)
+        {
+            if (netFunction == null)
                 return null;
-            LiteNetLibFunction netFunction = GetNetFunction(info);
-            if (netFunction == null)
-            {
-                if (Manager.LogError)
-                    Logging.LogError(LogTag, "Cannot process net function, functionId [" + info.elementId + "] not found.");
-                return null;
-            }
             netFunction.DeserializeParameters(reader);
             if (hookCallback)
                 netFunction.HookCallback();
@@ -283,20 +284,22 @@
                 return null;
             if (info.elementId >= 0 && info.elementId < NetFunctions.Count)
                 return NetFunctions[info.elementId];
+            if (Manager.LogError)
+                Logging.LogError(LogTag, "Cannot find net function [" + info.elementId + "].");
             return null;
         }
-
+        #endregion
+
+        #region SyncList Functions
         internal LiteNetLibSyncList ProcessSyncList(LiteNetLibElementInfo info, NetDataReader reader)
         {
-            if (info.objectId != ObjectId)
+            return ProcessSyncList(GetSyncList(info), reader);
+        }
+
+        internal LiteNetLibSyncList ProcessSyncList(LiteNetLibSyncList syncList, NetDataReader reader)
+        {
+            if (syncList == null)
                 return null;
-            LiteNetLibSyncList syncList = GetSyncList(info);
-            if (syncList == null)
-            {
-                if (Manager.LogError)
-                    Logging.LogError(LogTag, "Cannot process sync list, fieldId [" + info.elementId + "] not found.");
-                return null;
-            }
             syncList.DeserializeOperation(reader);
             return syncList;
         }
@@ -307,8 +310,11 @@
                 return null;
             if (info.elementId >= 0 && info.elementId < SyncLists.Count)
                 return SyncLists[info.elementId];
+            if (Manager.LogError)
+                Logging.LogError(LogTag, "Cannot find sync list [" + info.elementId + "].");
             return null;
         }
+        #endregion

         internal LiteNetLibBehaviour ProcessSyncBehaviour(byte behaviourIndex, NetDataReader reader)
         {


max/min aggregators now return "-" if there where no numeric value

--- Seq.App.Transform/TransformReactor.cs
+++ Seq.App.Transform/TransformReactor.cs
@@ -156,7 +156,9 @@
                             result = d;
                         }
                     }
-                    return result;
+                    if (result != null)
+                        return result;
+                    return "-";
                 }));

                 engine.SetGlobalValue("min", new Aggregator(engine, properties, r =>
@@ -170,7 +172,9 @@
                             result = d;
                         }
                     }
-                    return result;
+                    if (result != null)
+                        return (double)result;
+                    return "-";
                 }));

                 engine.SetGlobalValue("mean", new Aggregator(engine, properties, r =>


First change towards master bff per solution: create a variable CurrentBffPath, set before the inclusion of the individual project bff This will allow to change the paths within the projects from relative to master bff to relative to that variable

--- Sharpmake.Generators/FastBuild/Bff.cs
+++ Sharpmake.Generators/FastBuild/Bff.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2017 Ubisoft Entertainment
+// Copyright (c) 2017 Ubisoft Entertainment
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -99,6 +99,9 @@
         private static Dictionary<string, CompilerSettings> s_masterCompilerSettings = new Dictionary<string, CompilerSettings>();
         private static Strings s_masterBffFilenames = new Strings();

+        public const string CurrentBffPathVariable = ".CurrentBffPath";
+        public const string CurrentBffPathKey = "$CurrentBffPath$";
+
         public static bool IsMasterBffFilename(string filename)
         {
             return s_masterBffFilenames.Contains(filename);
@@ -293,9 +296,20 @@

                     foreach (var projectBffFullPath in totalIncludeList)
                     {
-                        string projectBffRelativeFromMasterBff = Util.PathGetRelative(masterBffPath, projectBffFullPath, true);
-
-                        result.AppendLine($"#include \"{projectBffRelativeFromMasterBff}\"");
+                        string projectFullPath = Path.GetDirectoryName(projectBffFullPath);
+                        var projectPathRelativeFromMasterBff = Util.PathGetRelative(masterBffPath, projectFullPath, true);
+
+                        string bffKeyRelative = Path.Combine(CurrentBffPathKey, Path.GetFileName(projectBffFullPath));
+
+                        string include = string.Join(
+                            Environment.NewLine,
+                            "{",
+                            $"    {CurrentBffPathVariable} = \"{projectPathRelativeFromMasterBff}\"",
+                            $"    #include \"{bffKeyRelative}\"",
+                            "}"
+                        );
+
+                        result.AppendLine(include);
                     }

                     fastBuildMasterBffDependencies = result.ToString();


minor fix related to the previous change

svn path=/trunk/; revision=4510

--- src/PhotoStore.cs
+++ src/PhotoStore.cs
@@ -384,7 +384,7 @@

 		uint timer = Log.DebugTimerStart ();

-		SqliteDataReader reader = Database.Query (new DbCommand ("SELECT id, time, description, roll_id, default_version_id, rating, md5_sum " +
+		SqliteDataReader reader = Database.Query (new DbCommand ("SELECT id, time, description, roll_id, default_version_id, rating, photos.md5_sum AS md5_sum " +
 									 " FROM photos " +
 									 " LEFT JOIN photo_versions AS pv ON photos.id = pv.photo_id" +
 							                 " WHERE photos.uri = :uri OR pv.uri = :uri", "uri", uri.ToString ()));


Check Minimum SDK version

Check Minimum SDK version

--- Smithers.Reading/DependencyChecker.cs
+++ Smithers.Reading/DependencyChecker.cs
@@ -51,7 +51,7 @@

     public static class DependencyChecker
     {
-        const string PUBLIC_PREVIEW_VERSION_PREFIX = "2.0.1407";
+        const string PUBLIC_PREVIEW_MIN_VERSION_PREFIX = "2.0.1407";
         const string NUIDB_SOURCE_FOLDER = @"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0\ExtensionSDKs\Microsoft.Kinect.Face\2.0\Redist\CommonConfiguration\x64\NuiDatabase";
         const string KINECT_FACE_ASSEMBLY_PUBLIC_PREVIEW_PATH = @"C:\Program Files\Microsoft SDKs\Kinect\v2.0-PublicPreview1407\Assemblies\Microsoft.Kinect.Face.dll";
         const string KINECT_FACE_ASSEMBLY_07_30_PATH = @"C:\Program Files\Microsoft SDKs\Kinect\MainV2\Assemblies\Microsoft.Kinect.Face.dll";
@@ -92,9 +92,8 @@
                 if (File.Exists(KINECT_FACE_ASSEMBLY_PUBLIC_PREVIEW_PATH))
                 {
                     sourcePath = KINECT_FACE_ASSEMBLY_PUBLIC_PREVIEW_PATH;
-
                 }
-                else if(File.Exists(KINECT_FACE_ASSEMBLY_07_30_PATH))
+                else if (File.Exists(KINECT_FACE_ASSEMBLY_07_30_PATH))
                 {
                     sourcePath = KINECT_FACE_ASSEMBLY_07_30_PATH;

@@ -160,7 +159,7 @@
                 // this line will raise a FileNotFoundException.
                 FileVersionInfo info = GetSDKVersion();

-                if (!info.FileVersion.StartsWith(PUBLIC_PREVIEW_VERSION_PREFIX))
+                if (info.FileVersion.CompareTo(PUBLIC_PREVIEW_MIN_VERSION_PREFIX) < 0)
                 {
                     throw new DependencyException("Incompatible Kinect v2 SDK detected. Please make sure you are using the latest SDK");
                 }


proper fix for the strip lock

proper fix for the strip lock

svn path=/trunk/; revision=3851

--- src/Widgets/Filmstrip.cs
+++ src/Widgets/Filmstrip.cs
@@ -629,6 +629,9 @@
 				float dv = acc * interval / 1000f;
 				float halfway_distance = 0.5f * (speed + dv) * (speed + dv) / acc;
 				float distance = Math.Abs (filmstrip.Position - target);
+				if (distance == 0) {
+					return false;
+				}

 				if (Math.Abs (speed) > 30 && distance > halfway_distance) { //HYPERSPACE JUMP
 					handler (target + (float)Math.Sign (filmstrip.Position - target) * halfway_distance);
@@ -644,7 +647,7 @@

 				float increment = speed * interval / 1000f;

-				if (distance == 0 || Math.Abs (distance - increment) < 0.01) {
+				if (Math.Abs (distance - increment) < 0.01) {
 					handler (target);
 					return false;
 				}


Update: Simplyfiy the UDI lookups in the base handler (and support stringUdi).

--- uSync8.BackOffice/SyncHandlers/SyncHandlerBase.cs
+++ uSync8.BackOffice/SyncHandlers/SyncHandlerBase.cs
@@ -63,8 +63,8 @@

         // we calculate these now based on the entityType ?
         private UmbracoObjectTypes itemObjectType { get; set; } = UmbracoObjectTypes.Unknown;
-
-
+
+
         private UmbracoObjectTypes itemContainerType = UmbracoObjectTypes.Unknown;

         public SyncHandlerBase(
@@ -96,7 +96,7 @@

             this.syncFileService = syncFileService;

-            this.runtimeCache = appCaches.RuntimeCache;
+            this.runtimeCache = appCaches.RuntimeCache;

             var thisType = GetType();
             var meta = thisType.GetCustomAttribute<SyncHandlerAttribute>(false);
@@ -181,7 +181,7 @@
                     {
                         if (actions.Any(x => x.FileName == item.update.Key))
                         {
-
+
                             var action = actions.FirstOrDefault(x => x.FileName == item.update.Key);
                             actions.Remove(action);
                             action.Message += attempt.Message;
@@ -281,7 +281,8 @@
                     callback?.Invoke($"Cleaning {folderName}", item.Index, cleanMarkers.Count);

                     var cleanActions = CleanFolder(item.filePath, false, config.UseFlatStructure);
-                    if (cleanActions.Any()) {
+                    if (cleanActions.Any())
+                    {
                         actions.AddRange(cleanActions);
                     }
                     else
@@ -339,7 +340,8 @@
             var folderKey = flat == true ? 1 : folder.GetHashCode();

             var cacheKey = $"uSyncKeyList_{folderKey}_{this.Alias}";
-            return runtimeCache.GetCacheItem(cacheKey, () => {
+            return runtimeCache.GetCacheItem(cacheKey, () =>
+            {
                 var keys = new List<Guid>();
                 var files = syncFileService.GetFiles(folder, "*.config");
                 foreach (var file in files)
@@ -412,7 +414,7 @@
                     }
                     else
                     {
-                        return SyncAttempt<TObject>.Succeed(Path.GetFileName(filePath), default(TObject) ,ChangeType.NoChange, "Not Imported (Based on config)");
+                        return SyncAttempt<TObject>.Succeed(Path.GetFileName(filePath), default(TObject), ChangeType.NoChange, "Not Imported (Based on config)");
                     }
                 }
             }
@@ -431,7 +433,7 @@
         ///  check to see if this element should be imported as part of the process.
         /// </summary>
         virtual protected bool ShouldImport(XElement node, HandlerSettings config) => true;
-
+
         /// <summary>
         ///  Check to see if this elment should be exported.
         /// </summary>
@@ -839,19 +841,9 @@

         public IEnumerable<uSyncAction> Export(Udi udi, string folder, HandlerSettings settings)
         {
-            if (udi is GuidUdi guidUdi)
-            {
-                var item = this.GetFromService(guidUdi.Guid);
-                if (item != null)
-                    return Export(item, folder, settings);
-            }
-            else if (udi is StringUdi stringUdi)
-            {
-                // its not a guidUdi, lets just get the section
-                var item = this.GetFromService(stringUdi.Id);
-                if (item != null)
-                    return Export(item, folder, settings);
-            }
+            var item = FindByUdi(udi);
+            if (!item.Equals(default))
+                return Export(item, folder, settings);

             return uSyncAction.Fail(nameof(udi), typeof(TObject), ChangeType.Fail, "Item not found")
                 .AsEnumerableOfOne();
@@ -859,23 +851,26 @@

         public SyncAttempt<XElement> GetElement(Udi udi)
         {
-            if (udi is GuidUdi guidUdi)
-            {
-                var element = this.GetFromService(guidUdi.Guid);
-                if (element == null)
-                {
-                    var entity = entityService.Get(guidUdi.Guid);
-                    if (entity != null)
-                        element = GetFromService(entity.Id);
-                }
-
-                if (element != null)
-                    return this.serializer.Serialize(element);
-            }
-
-            return SyncAttempt<XElement>.Fail(udi.ToString(), ChangeType.Fail);
-        }
-
+            var element = FindByUdi(udi);
+            if (!element.Equals(default))
+                return this.serializer.Serialize(element);
+
+            return SyncAttempt<XElement>.Fail(udi.ToString(), ChangeType.Fail, "Item not found");
+        }
+
+
+        private TObject FindByUdi(Udi udi)
+        {
+            switch (udi)
+            {
+                case GuidUdi guidUdi:
+                    return GetFromService(guidUdi.Guid);
+                case StringUdi stringUdi:
+                    return GetFromService(stringUdi.Id);
+            }
+
+            return default;
+        }
         public IEnumerable<uSyncDependency> GetDependencies(Guid key, DependencyFlags flags)
         {
             var item = this.GetFromService(key);


minor code cleanup

minor code cleanup

--- projects/CaseTracker/HoverWindow.cs
+++ projects/CaseTracker/HoverWindow.cs
@@ -1,7 +1,6 @@
 using System;
 using System.Diagnostics;
 using System.Configuration;
-using System.Security.Cryptography;
 using System.Security.Cryptography;
 using System.Collections.Generic;
 using System.ComponentModel;


Reverting previous checkin, parser can't continue with #2015

git-tfs-id: [http://falcon:8080/tfs/Projects]$/Phalanger/Main;C5442

--- Source/Core.Parsers/Parsers/Parser.cs
+++ Source/Core.Parsers/Parsers/Parser.cs
@@ -451,6 +451,7 @@
 			if (item as VariableUse == null)
 			{
                 errors.Add(FatalErrors.CheckVarUseFault, SourceUnit, span);
+                throw new CompilerException();
 			}
 		}


Fix typo in xmldoc comment

Fix typo in xmldoc comment

--- Source/NSubstitute/Raise.cs
+++ Source/NSubstitute/Raise.cs
@@ -41,7 +41,7 @@

         /// <summary>
         /// Raise an event of type <typeparamref name="THandler" /> with the provided arguments. If no arguments are provided
-        /// NSubstitute will try and provide reasonble defaults.
+        /// NSubstitute will try to provide reasonable defaults.
         /// </summary>
         public static DelegateEventWrapper<THandler> Event<THandler>(params object[] arguments)
         {


Add some integration tests

Add some integration tests

--- realm/Tests/IntegrationTests.Shared/IntegrationTests.cs
+++ realm/Tests/IntegrationTests.Shared/IntegrationTests.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
 using System.IO;
@@ -78,11 +79,93 @@
         }

         [Test]
+        public void CreateObjectTest()
+        {
+            // Act
+            using (var transaction = _realm.BeginWrite())
+            {
+                _realm.CreateObject<Person>();
+                transaction.Commit();
+            }
+
+            // Assert
+            var allPeople = _realm.All<Person>().ToList();
+            Assert.That(allPeople.Count, Is.EqualTo(1));
+        }
+
+        [Test]
+        public void SetAndGetPropertyTest()
+        {
+            // Arrange
+            Person p;
+            using (var transaction = _realm.BeginWrite())
+            {
+                p = _realm.CreateObject<Person>();
+
+                // Act
+                p.FirstName = "John";
+                p.IsInteresting = true;
+                transaction.Commit();
+            }
+
+            var receivedFirstName = p.FirstName;
+            var receivedIsInteresting = p.IsInteresting;
+
+            // Assert
+            Assert.That(receivedFirstName, Is.EqualTo("John"));
+            Assert.That(receivedIsInteresting, Is.True);
+        }
+
+        [Test]
+        public void SetRemappedPropertyTest()
+        {
+            // Arrange
+            Person p;
+            using (var transaction = _realm.BeginWrite())
+            {
+                p = _realm.CreateObject<Person>();
+
+                // Act
+                p.Email = "John@a.com";
+
+                transaction.Commit();
+            }
+            var receivedEmail = p.Email;
+
+            // Assert
+            Assert.That(receivedEmail, Is.EqualTo("John@a.com"));
+        }
+
+        [Test]
+        public void CreateObjectOutsideTransactionShouldFail()
+        {
+            // Arrange, act and assert
+            Assert.Throws<Exception>(() => _realm.CreateObject<Person>());
+        }
+
+        [Test]
+        public void SetPropertyOutsideTransactionShouldFail()
+        {
+            // Arrange
+            Person p;
+            using (var transaction = _realm.BeginWrite())
+            {
+                p = _realm.CreateObject<Person>();
+                transaction.Commit();
+            }
+            var receivedEmail = p.Email;
+
+            // Act and assert
+            Assert.Throws<Exception>(() => p.FirstName = "John");
+        }
+
+
+        [Test]
         public void RemoveTest()
         {
             // Arrange
             Person p1, p2, p3;
-            using (_realm.BeginWrite())
+            using (var transaction = _realm.BeginWrite())
             {
                 //p1 = new Person { FirstName = "A" };
                 //p2 = new Person { FirstName = "B" };
@@ -90,18 +173,20 @@
                 p1 = _realm.CreateObject<Person>(); p1.FirstName = "A";
                 p2 = _realm.CreateObject<Person>(); p2.FirstName = "B";
                 p3 = _realm.CreateObject<Person>(); p3.FirstName = "C";
+                transaction.Commit();
             }

             // Act
-            using (_realm.BeginWrite())
+            using (var transaction = _realm.BeginWrite())
+            {
                 _realm.Remove(p2);
+                transaction.Commit();
+            }

             // Assert
             //Assert.That(!p2.InRealm);

             var allPeople = _realm.All<Person>().ToList();
-            foreach (var p in allPeople)
-                Debug.WriteLine("Person: " + p.FirstName);

             Assert.That(allPeople, Is.EquivalentTo(new List<Person> { p1, p3 }));
         }


Need that too...

Need that too...

--- ksp_plugin_adapter/ksp_plugin_adapter.cs
+++ ksp_plugin_adapter/ksp_plugin_adapter.cs
@@ -443,6 +443,8 @@
              FlightGlobals.Bodies[7].orbit.pos);
     Log.Info("Ike measured orbit.vel : " +
              FlightGlobals.Bodies[7].orbit.vel);
+    Log.Info("Ike position : " +
+             FlightGlobals.Bodies[7].position);
   }

   private void InitializePlugin() {


MOAR LOGS !!!

MOAR LOGS !!!

--- ksp_plugin_adapter/ksp_plugin_adapter.cs
+++ ksp_plugin_adapter/ksp_plugin_adapter.cs
@@ -405,11 +405,27 @@
              (Vector3d)VesselParentRelativeVelocity(
                  plugin_,
                  active_vessel.id.ToString()));
-    Log.Info("Kraken : " + (Vector3d)Krakensbane.GetFrameVelocity());
-    Log.Info("Root rb velocity : " +
+    Log.Info("Kraken : " + Krakensbane.GetFrameVelocity());
+    Log.Info("Root rb velocity (32) : " +
              (Vector3d)active_vessel.rootPart.rb.velocity);
-    Log.Info("Root part partTransform.position : " +
+    Log.Info("Root part partTransform.position (32) : " +
              (Vector3d)active_vessel.rootPart.partTransform.position);
+    Log.Info("Measured orbit.pos : " + active_vessel.orbit.pos);
+    Log.Info("Measured orbit.vel : " + active_vessel.orbit.vel);
+    Log.Info("reference body reference body position : " +
+             active_vessel.orbit.referenceBody.referenceBody.position);
+    Log.Info("reference body Principia orbit.pos : " +
+             (Vector3d)CelestialDisplacementFromParent(
+                 plugin_,
+                 active_vessel.orbit.referenceBody.flightGlobalsIndex));
+    Log.Info("reference body Principia orbit.vel : " +
+             (Vector3d)CelestialParentRelativeVelocity(
+                 plugin_,
+                 active_vessel.orbit.referenceBody.flightGlobalsIndex));
+    Log.Info("reference body measured orbit.pos : " +
+             active_vessel.orbit.referenceBody.orbit.pos);
+    Log.Info("reference body measured orbit.vel : " +
+             active_vessel.orbit.referenceBody.orbit.vel);
   }

   private void InitializePlugin() {