Changed exception types to match CPtython.

--- numpy/NumpyDotNet/NpyDescr.cs
+++ numpy/NumpyDotNet/NpyDescr.cs
@@ -50,7 +50,7 @@
             } else if (obj is PythonTuple) {
                 result = TryConvertFromTuple(cntx, (PythonTuple)obj);
                 if (result == null) {
-                    throw new ArgumentException("data type not understood.");
+                    throw new ArgumentTypeException("data type not understood.");
                 }
             } else if (obj is List) {
                 result = ConvertFromArrayDescr(cntx, (List)obj, align);
@@ -60,7 +60,7 @@
                 result = DescrFromObject(cntx, obj);
             }
             if (result == null) {
-                throw new ArgumentException("data type not understood");
+                throw new ArgumentTypeException("data type not understood");
             }
             return result;
         }
@@ -100,7 +100,7 @@
                     fields.Add(info);
                 }
             } catch {
-                throw new ArgumentException("data type not understood");
+                throw new ArgumentTypeException("data type not understood");
             }
             return ConvertFromFields(cntx, fields, align);
         }
@@ -438,7 +438,7 @@
             FieldInfo result = new FieldInfo();
             PythonTuple tup = item as PythonTuple;
             if (tup == null || tup.Count < 2) {
-                throw new ArgumentException("Data type not understood");
+                throw new ArgumentTypeException("Data type not understood");
             }
             // Deal with the name and title
             object val = tup[0];
@@ -447,7 +447,7 @@
             } else if (val is PythonTuple) {
                 PythonTuple name_tuple = (PythonTuple)val;
                 if (name_tuple.Count != 2 || !(name_tuple[0] is string) || !(name_tuple[1] is string)) {
-                    throw new ArgumentException("Data type not understood: name and title must both be strings");
+                    throw new ArgumentException("name and title must both be strings");
                 }
                 result.name = (string)name_tuple[0];
                 result.name = (string)name_tuple[1];


Fixed a bug where GetById wasn't checking to see if cache was disabled.

--- Source/Core/Repositories/Base/ElasticSearchReadOnlyRepository.cs
+++ Source/Core/Repositories/Base/ElasticSearchReadOnlyRepository.cs
@@ -236,7 +236,7 @@

             // fallback to doing a find
             if (result == null)
-                result = FindOne(new OneOptions().WithId(id).WithCacheKey(useCache ? id : null).WithExpiresIn(expiresIn));
+                result = FindOne(new OneOptions().WithId(id).WithCacheKey(EnableCache && useCache ? id : null).WithExpiresIn(expiresIn));

             if (EnableCache && result != null && useCache)
                 Cache.Set(GetScopedCacheKey(id), result, expiresIn ?? TimeSpan.FromSeconds(RepositoryConstants.DEFAULT_CACHE_EXPIRATION_SECONDS));


Avoid release frame during dispose

Avoid release frame during dispose

--- Source/HelixToolkit.SharpDX.Shared/Core/ScreenCloneRenderCore.cs
+++ Source/HelixToolkit.SharpDX.Shared/Core/ScreenCloneRenderCore.cs
@@ -536,7 +536,10 @@

             protected override void Dispose(bool disposeManagedResources)
             {
-                ReleaseFrame();
+                while (currentDuplicationTexture.Count > 0)
+                {
+                    currentDuplicationTexture.Pop().Dispose();
+                }
                 duplicationDict.Clear();
                 base.Dispose(disposeManagedResources);
             }


Fix to make sure edited bots are saved.

Fix to make sure edited bots are saved.

--- Source/Server/NetBots.WebServer.Host/App_Start/IdentityConfig.cs
+++ Source/Server/NetBots.WebServer.Host/App_Start/IdentityConfig.cs
@@ -125,6 +125,7 @@
                     myBot.Name = newBot.Name;
                     myBot.URL = newBot.URL;
                     myBot.Image = newBot.Image;
+                    await UpdateAsync(user);
                 }
                 else
                 {


Added model validation to contact form.

Added model validation to contact form.

--- src/Cofoundry.Samples.SimpleSite/ViewComponents/ContactRequestFormViewComponent.cs
+++ src/Cofoundry.Samples.SimpleSite/ViewComponents/ContactRequestFormViewComponent.cs
@@ -1,4 +1,5 @@
 using Cofoundry.Core.Mail;
+using Cofoundry.Core.Validation;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Mvc.ModelBinding.Internal;
 using System;
@@ -11,14 +12,17 @@
     public class ContactRequestFormViewComponent : ViewComponent
     {
         private readonly IMailService _mailService;
+        private readonly IModelValidationService _modelValidationService;
         private readonly SimpleTestSiteSettings _simpleTestSiteSettings;

         public ContactRequestFormViewComponent(
             IMailService mailService,
+            IModelValidationService modelValidationService,
             SimpleTestSiteSettings simpleTestSiteSettings
             )
         {
             _mailService = mailService;
+            _modelValidationService = modelValidationService;
             _simpleTestSiteSettings = simpleTestSiteSettings;
         }

@@ -34,7 +38,9 @@
                 contactRequest.Name = Request.Form[nameof(contactRequest.Name)];
                 contactRequest.EmailAddress = Request.Form[nameof(contactRequest.EmailAddress)];
                 contactRequest.Message = Request.Form[nameof(contactRequest.Message)];
-
+
+                ValidateModel(contactRequest);
+
                 if (ModelState.IsValid)
                 {
                     // Send admin confirmation
@@ -49,5 +55,18 @@
             return View(contactRequest);
         }

+        /// <summary>
+        /// Because model binding isn't supported in view components, we have to
+        /// manually validate the model.
+        /// </summary>
+        private void ValidateModel<TModel>(TModel model)
+        {
+            var errors = _modelValidationService.GetErrors(model);
+
+            foreach (var error in errors)
+            {
+                ModelState.AddModelError(error.Properties.FirstOrDefault(), error.Message);
+            }
+        }
     }
 }


Update NationalBankOfUkraine.cs

Update NationalBankOfUkraine.cs

--- TIKSN.Core/Finance/ForeignExchange/Bank/NationalBankOfUkraine.cs
+++ TIKSN.Core/Finance/ForeignExchange/Bank/NationalBankOfUkraine.cs
@@ -11,13 +11,15 @@
 namespace TIKSN.Finance.ForeignExchange.Bank
 {
     /// <summary>
-    /// Exchange rate converter of National Bank of Ukraine
+    ///     Exchange rate converter of National Bank of Ukraine
     /// </summary>
-    /// <seealso cref="TIKSN.Finance.ICurrencyConverter"/>
+    /// <seealso cref="TIKSN.Finance.ICurrencyConverter" />
     public class NationalBankOfUkraine : ICurrencyConverter, IExchangeRatesProvider
     {
-        private static readonly string[] ignoreList = new[] { "___" };
-        private const string WebServiceUrlFormat = "https://bank.gov.ua/NBUStatService/v1/statdirectory/exchange?date={0:yyyyMMdd}";
+        private const string WebServiceUrlFormat =
+            "https://bank.gov.ua/NBUStatService/v1/statdirectory/exchange?date={0:yyyyMMdd}";
+
+        private static readonly string[] ignoreList = {"___"};
         private static readonly RegionInfo ukraine;
         private static readonly CultureInfo ukrainianCulture;
         private static readonly CurrencyInfo ukrainianHryvnia;
@@ -30,62 +32,51 @@
             ukrainianHryvnia = new CurrencyInfo(ukraine);
         }

-        public NationalBankOfUkraine(ICurrencyFactory currencyFactory)
-        {
-            _currencyFactory = currencyFactory;
-        }
+        public NationalBankOfUkraine(ICurrencyFactory currencyFactory) => this._currencyFactory = currencyFactory;

         /// <summary>
-        /// Converts the currency asynchronous.
+        ///     Converts the currency asynchronous.
         /// </summary>
         /// <param name="baseMoney">The base money.</param>
         /// <param name="counterCurrency">The counter currency.</param>
         /// <param name="asOn">As on.</param>
         /// <param name="cancellationToken"></param>
         /// <returns></returns>
-        public async Task<Money> ConvertCurrencyAsync(Money baseMoney, CurrencyInfo counterCurrency, DateTimeOffset asOn, CancellationToken cancellationToken)
+        public async Task<Money> ConvertCurrencyAsync(Money baseMoney, CurrencyInfo counterCurrency,
+            DateTimeOffset asOn, CancellationToken cancellationToken)
         {
-            var rate = await GetExchangeRateAsync(baseMoney.Currency, counterCurrency, asOn, cancellationToken);
+            var rate = await this.GetExchangeRateAsync(baseMoney.Currency, counterCurrency, asOn, cancellationToken);

             return new Money(counterCurrency, baseMoney.Amount * rate);
         }

         /// <summary>
-        /// Gets the currency pairs asynchronous.
+        ///     Gets the currency pairs asynchronous.
         /// </summary>
         /// <param name="asOn">As on.</param>
         /// <param name="cancellationToken"></param>
         /// <returns></returns>
-        public async Task<IEnumerable<CurrencyPair>> GetCurrencyPairsAsync(DateTimeOffset asOn, CancellationToken cancellationToken)
+        public async Task<IEnumerable<CurrencyPair>> GetCurrencyPairsAsync(DateTimeOffset asOn,
+            CancellationToken cancellationToken)
         {
-            var records = await GetExchangeRatesAsync(asOn, cancellationToken);
+            var records = await this.GetExchangeRatesAsync(asOn, cancellationToken);

             return records.Select(item => item.Pair).ToArray();
         }

         /// <summary>
-        /// Gets the exchange rate asynchronous.
+        ///     Gets the exchange rate asynchronous.
         /// </summary>
         /// <param name="pair">The pair.</param>
         /// <param name="asOn">As on.</param>
         /// <param name="cancellationToken"></param>
         /// <returns></returns>
-        public Task<decimal> GetExchangeRateAsync(CurrencyPair pair, DateTimeOffset asOn, CancellationToken cancellationToken)
-        {
-            return GetExchangeRateAsync(pair.BaseCurrency, pair.CounterCurrency, asOn, cancellationToken);
-        }
+        public Task<decimal> GetExchangeRateAsync(CurrencyPair pair, DateTimeOffset asOn,
+            CancellationToken cancellationToken) =>
+            this.GetExchangeRateAsync(pair.BaseCurrency, pair.CounterCurrency, asOn, cancellationToken);

-        private Exception CreatePairNotSupportedException(CurrencyInfo baseCurrency, CurrencyInfo counterCurrency)
-        {
-            var ex = new NotSupportedException($"Currency pair is not supported by National Bank of Ukraine currency converter for given date.");
-
-            ex.Data.Add("Base Currency", baseCurrency?.ISOCurrencySymbol);
-            ex.Data.Add("Counter Currency", counterCurrency?.ISOCurrencySymbol);
-
-            return ex;
-        }
-
-        public async Task<IEnumerable<ExchangeRate>> GetExchangeRatesAsync(DateTimeOffset asOn, CancellationToken cancellationToken)
+        public async Task<IEnumerable<ExchangeRate>> GetExchangeRatesAsync(DateTimeOffset asOn,
+            CancellationToken cancellationToken)
         {
             using (var httpClient = new HttpClient())
             {
@@ -98,14 +89,20 @@
                     var currencyCode = currencyElement.Element("cc").Value;

                     if (ignoreList.Contains(currencyCode, StringComparer.OrdinalIgnoreCase))
+                    {
                         continue;
+                    }

                     var rate = decimal.Parse(currencyElement.Element("rate").Value, CultureInfo.InvariantCulture);

                     if (!string.IsNullOrEmpty(currencyCode))
                     {
-                        result.Add(new ExchangeRate(new CurrencyPair(_currencyFactory.Create(currencyCode), ukrainianHryvnia), asOn.Date, rate));
-                        result.Add(new ExchangeRate(new CurrencyPair(ukrainianHryvnia, _currencyFactory.Create(currencyCode)), asOn.Date, decimal.One / rate));
+                        result.Add(new ExchangeRate(
+                            new CurrencyPair(this._currencyFactory.Create(currencyCode), ukrainianHryvnia), asOn.Date,
+                            rate));
+                        result.Add(new ExchangeRate(
+                            new CurrencyPair(ukrainianHryvnia, this._currencyFactory.Create(currencyCode)), asOn.Date,
+                            decimal.One / rate));
                     }
                 }

@@ -113,37 +110,47 @@
             }
         }

-        private async Task<decimal> GetExchangeRateAsync(CurrencyInfo baseCurrency, CurrencyInfo counterCurrency, DateTimeOffset asOn, CancellationToken cancellationToken)
+        private Exception CreatePairNotSupportedException(CurrencyInfo baseCurrency, CurrencyInfo counterCurrency)
+        {
+            var ex = new NotSupportedException(
+                "Currency pair is not supported by National Bank of Ukraine currency converter for given date.");
+
+            ex.Data.Add("Base Currency", baseCurrency?.ISOCurrencySymbol);
+            ex.Data.Add("Counter Currency", counterCurrency?.ISOCurrencySymbol);
+
+            return ex;
+        }
+
+        private async Task<decimal> GetExchangeRateAsync(CurrencyInfo baseCurrency, CurrencyInfo counterCurrency,
+            DateTimeOffset asOn, CancellationToken cancellationToken)
         {
             if (counterCurrency == ukrainianHryvnia)
             {
-                return await GetExchangeRateAsync(baseCurrency, asOn, cancellationToken);
+                return await this.GetExchangeRateAsync(baseCurrency, asOn, cancellationToken);
             }
-            else if (baseCurrency == ukrainianHryvnia)
+
+            if (baseCurrency == ukrainianHryvnia)
             {
-                var counterRate = await GetExchangeRateAsync(counterCurrency, asOn, cancellationToken);
+                var counterRate = await this.GetExchangeRateAsync(counterCurrency, asOn, cancellationToken);

                 return 1m / counterRate;
             }
-            else
-            {
-                throw CreatePairNotSupportedException(baseCurrency, counterCurrency);
-            }
+
+            throw this.CreatePairNotSupportedException(baseCurrency, counterCurrency);
         }

-        private async Task<decimal> GetExchangeRateAsync(CurrencyInfo currency, DateTimeOffset asOn, CancellationToken cancellationToken)
+        private async Task<decimal> GetExchangeRateAsync(CurrencyInfo currency, DateTimeOffset asOn,
+            CancellationToken cancellationToken)
         {
-            var records = await GetExchangeRatesAsync(asOn, cancellationToken);
+            var records = await this.GetExchangeRatesAsync(asOn, cancellationToken);
             var record = records.SingleOrDefault(item => item.Pair.BaseCurrency == currency);

             if (record == null)
             {
-                throw CreatePairNotSupportedException(null, currency);
+                throw this.CreatePairNotSupportedException(null, currency);
             }
-            else
-            {
-                return record.Rate;
-            }
+
+            return record.Rate;
         }
     }
-}+}


MEF has issues with duplicate attributes. Workaround for issue #11841 until MEF fix gets pushed to nuget.

--- src/Features/CSharp/Portable/CodeFixes/GenerateMethod/GenerateMethodCodeFixProvider.cs
+++ src/Features/CSharp/Portable/CodeFixes/GenerateMethod/GenerateMethodCodeFixProvider.cs
@@ -49,8 +49,7 @@
     }

     [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.GenerateMethod), Shared]
-    [ExtensionOrder(Before = PredefinedCodeFixProviderNames.PopulateSwitch)]
-    [ExtensionOrder(After = PredefinedCodeFixProviderNames.GenerateEnumMember)]
+    [ExtensionOrder(After = PredefinedCodeFixProviderNames.GenerateEnumMember, Before = PredefinedCodeFixProviderNames.PopulateSwitch)]
     internal class GenerateMethodCodeFixProvider : AbstractGenerateMemberCodeFixProvider
     {
         public override ImmutableArray<string> FixableDiagnosticIds { get; } =


Address review feedback

Address review feedback

--- src/Microsoft.CodeQuality.Analyzers.Exp/Core/Usage/DisposableFieldsShouldBeDisposed.cs
+++ src/Microsoft.CodeQuality.Analyzers.Exp/Core/Usage/DisposableFieldsShouldBeDisposed.cs
@@ -50,7 +50,7 @@
                 }

                 var fieldDisposeValueMap = new ConcurrentDictionary<IFieldSymbol, /*disposed*/bool>();
-                Action<IFieldSymbol, bool> addOrUpdateFieldDisposedValue = (field, disposed) =>
+                void addOrUpdateFieldDisposedValue(IFieldSymbol field, bool disposed)
                 {
                     Debug.Assert(!field.IsStatic);
                     Debug.Assert(field.Type.IsDisposable(disposeAnalysisHelper.IDisposable));
@@ -69,7 +69,7 @@
                         if (!field.IsStatic &&
                             disposeAnalysisHelper.GetDisposableFields(field.ContainingType).Contains(field))
                         {
-                            addOrUpdateFieldDisposedValue(field, /*disposed*/false);
+                            addOrUpdateFieldDisposedValue(field, disposed: false);
                         }
                     }
                 },
@@ -122,7 +122,7 @@
                                     {
                                         if (disposeAnalysisHelper.IsDisposableCreationOrDisposeOwnershipTransfer(location, containingMethod))
                                         {
-                                            addOrUpdateFieldDisposedValue(field, /*disposed*/false);
+                                            addOrUpdateFieldDisposedValue(field, disposed: false);
                                             break;
                                         }
                                     }


Add new event handling method

Add new event handling method

--- osu.Framework/Graphics/Drawable.cs
+++ osu.Framework/Graphics/Drawable.cs
@@ -3,7 +3,6 @@

 using OpenTK;
 using OpenTK.Graphics;
-using OpenTK.Input;
 using osu.Framework.Allocation;
 using osu.Framework.Caching;
 using osu.Framework.Extensions;
@@ -26,6 +25,7 @@
 using System.Threading;
 using System.Threading.Tasks;
 using osu.Framework.Development;
+using osu.Framework.Event;
 using osu.Framework.MathUtils;
 using JoystickEventArgs = osu.Framework.Input.JoystickEventArgs;

@@ -1669,241 +1669,87 @@
         #region Interaction / Input

         /// <summary>
-        /// Triggers <see cref="OnHover(InputState)"/> with a local version of the given <see cref="InputState"/>.
-        /// </summary>
-        public bool TriggerOnHover(InputState screenSpaceState) => OnHover(createCloneInParentSpace(screenSpaceState));
-
-        /// <summary>
-        /// Triggered once when this Drawable becomes hovered.
-        /// </summary>
-        /// <param name="state">The state at which the Drawable becomes hovered.</param>
-        /// <returns>True if this Drawable would like to handle the hover. If so, then
-        /// no further Drawables up the scene graph will receive hovering events. If
-        /// false, however, then <see cref="OnHoverLost(InputState)"/> will still be
-        /// received once hover is lost.</returns>
+        /// Handle a UI event.
+        /// </summary>
+        /// <param name="e">The event to be handled.</param>
+        /// <returns>If the event supports blocking, returning true will make the event to not propagating further.</returns>
+        protected virtual bool Handle(UIEvent e)
+        {
+            // call a leagacy input handler
+            switch (e)
+            {
+                case MouseMoveEvent mouseMove:
+                    return OnMouseMove(mouseMove.LegacyInputState);
+                case HoverEvent hover:
+                    return OnHover(hover.LegacyInputState);
+                case HoverLostEvent hoverLost:
+                    OnHoverLost(hoverLost.LegacyInputState);
+                    return false;
+                case MouseDownEvent mouseDown:
+                    return OnMouseDown(mouseDown.LegacyInputState, new MouseDownEventArgs { Button = mouseDown.Button });
+                case MouseUpEvent mouseUp:
+                    return OnMouseUp(mouseUp.LegacyInputState, new MouseUpEventArgs { Button = mouseUp.Button });
+                case ClickEvent click:
+                    return OnClick(click.LegacyInputState);
+                case DoubleClickEvent doubleClick:
+                    return OnDoubleClick(doubleClick.LegacyInputState);
+                case DragStartEvent dragStart:
+                    return OnDragStart(dragStart.LegacyInputState);
+                case DragEvent drag:
+                    return OnDrag(drag.LegacyInputState);
+                case DragEndEvent dragEnd:
+                    return OnDragEnd(dragEnd.LegacyInputState);
+                case ScrollEvent scroll:
+                    return OnScroll(scroll.LegacyInputState);
+                case FocusEvent focus:
+                    OnFocus(focus.LegacyInputState);
+                    return false;
+                case FocusLostEvent focusLost:
+                    OnFocusLost(focusLost.LegacyInputState);
+                    return false;
+                case KeyDownEvent keyDown:
+                    return OnKeyDown(keyDown.LegacyInputState, new KeyDownEventArgs { Key = keyDown.Key, Repeat = keyDown.Repeat });
+                case KeyUpEvent keyUp:
+                    return OnKeyUp(keyUp.LegacyInputState, new KeyUpEventArgs { Key = keyUp.Key });
+                case JoystickPressEvent joystickPress:
+                    return OnJoystickPress(joystickPress.LegacyInputState, new JoystickEventArgs { Button = joystickPress.Button });
+                case JoystickReleaseEvent joystickRelease:
+                    return OnJoystickRelease(joystickRelease.LegacyInputState, new JoystickEventArgs { Button = joystickRelease.Button });
+                default:
+                    return false;
+            }
+        }
+
+        /// <summary>
+        /// Trigger a UI event with <see cref="UIEvent.Target"/> set to this <see cref="Drawable"/>.
+        /// </summary>
+        /// <param name="e">The event. Its <see cref="UIEvent.Target"/> will be modified.</param>
+        /// <returns>The result of event handler.</returns>
+        public bool TriggerEvent(UIEvent e)
+        {
+            e.Target = this;
+            return Handle(e);
+        }
+
+        #region Legacy event handling
+        protected virtual bool OnMouseMove(InputState state) => false;
         protected virtual bool OnHover(InputState state) => false;
-
-        /// <summary>
-        /// Triggers <see cref="OnHoverLost(InputState)"/> with a local version of the given <see cref="InputState"/>.
-        /// </summary>
-        public void TriggerOnHoverLost(InputState screenSpaceState) => OnHoverLost(createCloneInParentSpace(screenSpaceState));
-
-        /// <summary>
-        /// Triggered whenever this drawable is no longer hovered.
-        /// </summary>
-        /// <param name="state">The state at which hover is lost.</param>
-        protected virtual void OnHoverLost(InputState state)
-        {
-        }
-
-        /// <summary>
-        /// Triggers <see cref="OnMouseDown(InputState, MouseDownEventArgs)"/> with a local version of the given <see cref="InputState"/>.
-        /// </summary>
-        public bool TriggerOnMouseDown(InputState screenSpaceState = null, MouseDownEventArgs args = null) => OnMouseDown(createCloneInParentSpace(screenSpaceState), args);
-
-        /// <summary>
-        /// Triggered whenever a mouse button is pressed on top of this Drawable.
-        /// </summary>
-        /// <param name="state">The state after the press.</param>
-        /// <param name="args">Specific arguments for mouse down event.</param>
-        /// <returns>True if this Drawable handled the event. If false, then the event
-        /// is propagated up the scene graph to the next eligible Drawable.</returns>
+        protected virtual void OnHoverLost(InputState state) {}
         protected virtual bool OnMouseDown(InputState state, MouseDownEventArgs args) => false;
-
-        /// <summary>
-        /// Triggers <see cref="OnMouseUp(InputState, MouseUpEventArgs)"/> with a local version of the given <see cref="InputState"/>.
-        /// </summary>
-        public bool TriggerOnMouseUp(InputState screenSpaceState = null, MouseUpEventArgs args = null) => OnMouseUp(createCloneInParentSpace(screenSpaceState), args);
-
-        /// <summary>
-        /// Triggered whenever a mouse button is released on top of this Drawable.
-        /// </summary>
-        /// <param name="state">The state after the release.</param>
-        /// <param name="args">Specific arguments for mouse up event.</param>
-        /// <returns>True if this Drawable handled the event. If false, then the event
-        /// is propagated up the scene graph to the next eligible Drawable.</returns>
         protected virtual bool OnMouseUp(InputState state, MouseUpEventArgs args) => false;
-
-        /// <summary>
-        /// Triggers <see cref="OnClick(InputState)"/> with a local version of the given <see cref="InputState"/>.
-        /// </summary>
-        public bool TriggerOnClick(InputState screenSpaceState = null) => OnClick(createCloneInParentSpace(screenSpaceState));
-
-        /// <summary>
-        /// Triggered whenever a mouse click occurs on top of this Drawable.
-        /// </summary>
-        /// <param name="state">The state after the click.</param>
-        /// <returns>True if this Drawable handled the event. If false, then the event
-        /// is propagated up the scene graph to the next eligible Drawable.</returns>
         protected virtual bool OnClick(InputState state) => false;
-
-        /// <summary>
-        /// Triggers <see cref="OnMouseDown(InputState, MouseDownEventArgs)"/> with a local version of the given <see cref="InputState"/>.
-        /// </summary>
-        public bool TriggerOnDoubleClick(InputState screenSpaceState) => OnDoubleClick(createCloneInParentSpace(screenSpaceState));
-
-        /// <summary>
-        /// Triggered whenever a mouse double click occurs on top of this Drawable.
-        /// </summary>
-        /// <param name="state">The state after the double click.</param>
-        /// <returns>True if this Drawable handled the event. If false, then the event
-        /// is propagated up the scene graph to the next eligible Drawable.</returns>
         protected virtual bool OnDoubleClick(InputState state) => false;
-
-        /// <summary>
-        /// Triggers <see cref="OnDragStart(InputState)"/> with a local version of the given <see cref="InputState"/>.
-        /// </summary>
-        public bool TriggerOnDragStart(InputState screenSpaceState) => OnDragStart(createCloneInParentSpace(screenSpaceState));
-
-        /// <summary>
-        /// Triggered whenever this Drawable is initially dragged by a held mouse click
-        /// and subsequent movement.
-        /// </summary>
-        /// <param name="state">The state after the mouse was moved.</param>
-        /// <returns>True if this Drawable accepts being dragged. If so, then future
-        /// <see cref="OnDrag(InputState)"/> and <see cref="OnDragEnd(InputState)"/>
-        /// events will be received. Otherwise, the event is propagated up the scene
-        /// graph to the next eligible Drawable.</returns>
         protected virtual bool OnDragStart(InputState state) => false;
-
-        /// <summary>
-        /// Triggers <see cref="OnDrag(InputState)"/> with a local version of the given <see cref="InputState"/>.
-        /// </summary>
-        public bool TriggerOnDrag(InputState screenSpaceState) => OnDrag(createCloneInParentSpace(screenSpaceState));
-
-        /// <summary>
-        /// Triggered whenever the mouse is moved while dragging.
-        /// Only is received if a drag was previously initiated by returning true
-        /// from <see cref="OnDragStart(InputState)"/>.
-        /// </summary>
-        /// <param name="state">The state after the mouse was moved.</param>
-        /// <returns>Currently unused.</returns>
         protected virtual bool OnDrag(InputState state) => false;
-
-        /// <summary>
-        /// Triggers <see cref="OnDragEnd(InputState)"/> with a local version of the given <see cref="InputState"/>.
-        /// </summary>
-        public bool TriggerOnDragEnd(InputState screenSpaceState) => OnDragEnd(createCloneInParentSpace(screenSpaceState));
-
-        /// <summary>
-        /// Triggered whenever a drag ended. Only is received if a drag was previously
-        /// initiated by returning true from <see cref="OnDragStart(InputState)"/>.
-        /// </summary>
-        /// <param name="state">The state after the drag ended.</param>
-        /// <returns>Currently unused.</returns>
         protected virtual bool OnDragEnd(InputState state) => false;
-
-        /// <summary>
-        /// Triggers <see cref="OnScroll(InputState)"/> with a local version of the given <see cref="InputState"/>.
-        /// </summary>
-        public bool TriggerOnScroll(InputState screenSpaceState) => OnScroll(createCloneInParentSpace(screenSpaceState));
-
-        /// <summary>
-        /// Triggered whenever the mouse scrolled over this Drawable.
-        /// </summary>
-        /// <param name="state">The state after scrolling happened.</param>
-        /// <returns>True if this Drawable handled the event. If false, then the event
-        /// is propagated up the scene graph to the next eligible Drawable.</returns>
         protected virtual bool OnScroll(InputState state) => false;
-
-        /// <summary>
-        /// Triggers <see cref="OnFocus(InputState)"/> with a local version of the given <see cref="InputState"/>
-        /// </summary>
-        /// <param name="screenSpaceState">The input state.</param>
-        public void TriggerOnFocus(InputState screenSpaceState = null) => OnFocus(createCloneInParentSpace(screenSpaceState));
-
-        /// <summary>
-        /// Triggered whenever this Drawable gains focus.
-        /// Focused Drawables receive keyboard input before all other Drawables,
-        /// and thus handle it first.
-        /// </summary>
-        /// <param name="state">The state after focus when focus can be gained.</param>
-        protected virtual void OnFocus(InputState state)
-        {
-        }
-
-        /// <summary>
-        /// Triggers <see cref="OnFocusLost(InputState)"/> with a local version of the given <see cref="InputState"/>
-        /// </summary>
-        /// <param name="screenSpaceState">The input state.</param>
-        public void TriggerOnFocusLost(InputState screenSpaceState = null) => OnFocusLost(createCloneInParentSpace(screenSpaceState));
-
-        /// <summary>
-        /// Triggered whenever this Drawable lost focus.
-        /// </summary>
-        /// <param name="state">The state after focus was lost.</param>
-        protected virtual void OnFocusLost(InputState state)
-        {
-        }
-
-        /// <summary>
-        /// Triggers <see cref="OnKeyDown(InputState, KeyDownEventArgs)"/> with a local version of the given <see cref="InputState"/>.
-        /// </summary>
-        public bool TriggerOnKeyDown(InputState screenSpaceState, KeyDownEventArgs args) => OnKeyDown(createCloneInParentSpace(screenSpaceState), args);
-
-        /// <summary>
-        /// Triggered whenever a key was pressed.
-        /// </summary>
-        /// <param name="state">The state after the key was pressed.</param>
-        /// <param name="args">Specific arguments for key down event.</param>
-        /// <returns>True if this Drawable handled the event. If false, then the event
-        /// is propagated up the scene graph to the next eligible Drawable.</returns>
+        protected virtual void OnFocus(InputState state) {}
+        protected virtual void OnFocusLost(InputState state) {}
         protected virtual bool OnKeyDown(InputState state, KeyDownEventArgs args) => false;
-
-        /// <summary>
-        /// Triggers <see cref="OnKeyUp(InputState, KeyUpEventArgs)"/> with a local version of the given <see cref="InputState"/>.
-        /// </summary>
-        public bool TriggerOnKeyUp(InputState screenSpaceState, KeyUpEventArgs args) => OnKeyUp(createCloneInParentSpace(screenSpaceState), args);
-
-        /// <summary>
-        /// Triggered whenever a key was released.
-        /// </summary>
-        /// <param name="state">The state after the key was released.</param>
-        /// <param name="args">Specific arguments for key up event.</param>
-        /// <returns>True if this Drawable handled the event. If false, then the event
-        /// is propagated up the scene graph to the next eligible Drawable.</returns>
         protected virtual bool OnKeyUp(InputState state, KeyUpEventArgs args) => false;
-
-        /// <summary>
-        /// Triggers <see cref="OnJoystickPress(InputState, JoystickEventArgs)"/> with a local version of the given <see cref="InputState"/>.
-        /// </summary>
-        public bool TriggerOnJoystickPress(InputState screenspaceState, JoystickEventArgs args) => OnJoystickPress(createCloneInParentSpace(screenspaceState), args);
-
-        /// <summary>
-        /// Triggered whenever a joystick button was pressed.
-        /// </summary>
-        /// <param name="state">The state after the button was pressed.</param>
-        /// <param name="args">Specific arguments for the press event.</param>
-        /// <returns>True if this Drawable handled the event. If false, then the event
-        /// is propagated up the scene graph to the next eligible Drawable.</returns>
         protected virtual bool OnJoystickPress(InputState state, JoystickEventArgs args) => false;
-
-        /// <summary>
-        /// Triggers <see cref="OnJoystickRelease(InputState, JoystickEventArgs)"/> with a local version of the given <see cref="InputState"/>.
-        /// </summary>
-        public bool TriggerOnJoystickRelease(InputState screenSpaceState, JoystickEventArgs args) => OnJoystickRelease(createCloneInParentSpace(screenSpaceState), args);
-
-        /// <summary>
-        /// Triggered whenever a joystick button was released.
-        /// </summary>
-        /// <param name="state">The state after the button was released.</param>
-        /// <param name="args">Specific arguments for the release event.</param>
-        /// <returns>True if this Drawable handled the event. If false, then the event
-        /// is propagated up the scene graph to the next eligible Drawable.</returns>
         protected virtual bool OnJoystickRelease(InputState state, JoystickEventArgs args) => false;
-
-        /// <summary>
-        /// Triggers <see cref="OnMouseMove(InputState)"/> with a local version of the given <see cref="InputState"/>.
-        /// </summary>
-        public bool TriggerOnMouseMove(InputState screenSpaceState) => OnMouseMove(createCloneInParentSpace(screenSpaceState));
-
-        /// <summary>
-        /// Triggered whenever the mouse moved over this Drawable.
-        /// </summary>
-        /// <param name="state">The state after the mouse moved.</param>
-        /// <returns>True if this Drawable handled the event. If false, then the event
-        /// is propagated up the scene graph to the next eligible Drawable.</returns>
-        protected virtual bool OnMouseMove(InputState state) => false;
+        #endregion

         private readonly bool handleKeyboardInput, handleMouseInput;

@@ -2081,88 +1927,6 @@
             return true;
         }

-        private struct LocalMouseState : IMouseState
-        {
-            public IMouseState NativeState { get; private set; }
-
-            private readonly Drawable us;
-
-            public LocalMouseState(IMouseState state, Drawable us)
-            {
-                NativeState = state;
-                this.us = us;
-            }
-
-            public Vector2 Delta => Position - LastPosition;
-
-            public Vector2 Position
-            {
-                get => us.Parent?.ToLocalSpace(NativeState.Position) ?? NativeState.Position;
-                set => throw new NotImplementedException();
-            }
-
-            public bool IsPositionValid
-            {
-                get => NativeState.IsPositionValid;
-                set => throw new NotImplementedException();
-            }
-
-            public Vector2 LastPosition
-            {
-                get => us.Parent?.ToLocalSpace(NativeState.LastPosition) ?? NativeState.LastPosition;
-                set => throw new NotImplementedException();
-            }
-
-            public Vector2? PositionMouseDown
-            {
-                get => NativeState.PositionMouseDown == null ? null : us.Parent?.ToLocalSpace(NativeState.PositionMouseDown.Value) ?? NativeState.PositionMouseDown;
-                set => throw new NotImplementedException();
-            }
-
-            public Vector2 Scroll
-            {
-                get => NativeState.Scroll;
-                set => throw new NotSupportedException();
-            }
-
-            public Vector2 LastScroll
-            {
-                get => NativeState.LastScroll;
-                set => throw new NotSupportedException();
-            }
-
-            public Vector2 ScrollDelta => NativeState.ScrollDelta;
-
-            public bool HasPreciseScroll
-            {
-                get => NativeState.HasPreciseScroll;
-                set => NativeState.HasPreciseScroll = value;
-            }
-
-            public ButtonStates<MouseButton> Buttons => NativeState.Buttons;
-
-            public bool HasMainButtonPressed => NativeState.HasMainButtonPressed;
-
-            public bool HasAnyButtonPressed => NativeState.HasAnyButtonPressed;
-
-            public IMouseState Clone()
-            {
-                var cloned = (LocalMouseState)MemberwiseClone();
-                cloned.NativeState = NativeState.Clone();
-                return cloned;
-            }
-
-            public bool IsPressed(MouseButton button)
-            {
-                return NativeState.IsPressed(button);
-            }
-
-            public void SetPressed(MouseButton button, bool pressed)
-            {
-                NativeState.SetPressed(button, pressed);
-            }
-        }
-
         #endregion

         #region Transforms


Use ImmutableArray for more guaranteed safety

--- osu.Framework/Platform/GameHost.cs
+++ osu.Framework/Platform/GameHost.cs
@@ -3,6 +3,7 @@

 using System;
 using System.Collections.Generic;
+using System.Collections.Immutable;
 using System.Diagnostics;
 using System.Drawing;
 using System.Globalization;
@@ -655,7 +656,7 @@
                     h.Dispose();
             }

-            AvailableInputHandlers = CreateAvailableInputHandlers().ToArray();
+            AvailableInputHandlers = CreateAvailableInputHandlers().ToImmutableArray();

             foreach (var handler in AvailableInputHandlers)
             {
@@ -846,7 +847,7 @@

         protected abstract IEnumerable<InputHandler> CreateAvailableInputHandlers();

-        public InputHandler[] AvailableInputHandlers { get; private set; }
+        public ImmutableArray<InputHandler> AvailableInputHandlers { get; private set; }

         public abstract ITextInputSource GetTextInput();


Fix incorrect order of `suspended` flag update

--- osu.Framework/Platform/GameHost.cs
+++ osu.Framework/Platform/GameHost.cs
@@ -667,8 +667,8 @@
         /// </summary>
         public void Suspend()
         {
+            suspended = true;
             threadRunner.Suspend();
-            suspended = true;
         }

         /// <summary>


Fixes #4 : make sure /? shows up in advertised help remark

--- NClap/Parser/CommandLineParserEngine.cs
+++ NClap/Parser/CommandLineParserEngine.cs
@@ -352,7 +352,7 @@
                 {
                     builder.AppendLine();
                     appendHeader(Strings.UsageInfoRemarksHeader);
-                    appendLine(string.Format(Strings.UsageInfoHelpAdvertisement, name, $"{namedArgPrefix}{defaultHelpArgumentName}"));
+                    appendLine(string.Format(Strings.UsageInfoHelpAdvertisement, $"{name} {namedArgPrefix}{defaultHelpArgumentName}"));
                 }
             }


Make windowless games always active

Make windowless games always active

--- osu.Framework/Platform/GameHost.cs
+++ osu.Framework/Platform/GameHost.cs
@@ -514,6 +514,8 @@
                     }
                     else
                     {
+                        setActive(true);
+
                         while (ExecutionState != ExecutionState.Stopped)
                             InputThread.RunUpdate();
                     }


Disable platform compatibility warnings on `DynamicClassCompiler`

--- osu.Framework/Testing/DynamicClassCompiler.cs
+++ osu.Framework/Testing/DynamicClassCompiler.cs
@@ -9,6 +9,7 @@
 using osu.Framework.Logging;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
 using System.Threading.Tasks;
 using Microsoft.CodeAnalysis;
 using Microsoft.CodeAnalysis.CSharp;
@@ -16,6 +17,7 @@

 namespace osu.Framework.Testing
 {
+    [SuppressMessage("Interoperability", "CA1416:Validate platform compatibility")]
     internal class DynamicClassCompiler<T> : IDisposable
         where T : IDynamicallyCompile
     {


Move replies button to a new line

Move replies button to a new line

--- osu.Game/Overlays/Comments/DrawableComment.cs
+++ osu.Game/Overlays/Comments/DrawableComment.cs
@@ -163,20 +163,28 @@
                                                     AutoSizeAxes = Axes.Y,
                                                     Padding = new MarginPadding { Right = 40 }
                                                 },
-                                                info = new FillFlowContainer
+                                                new FillFlowContainer
                                                 {
                                                     AutoSizeAxes = Axes.Both,
-                                                    Direction = FillDirection.Horizontal,
-                                                    Spacing = new Vector2(10, 0),
+                                                    Direction = FillDirection.Vertical,
                                                     Children = new Drawable[]
                                                     {
-                                                        new OsuSpriteText
+                                                        info = new FillFlowContainer
                                                         {
-                                                            Anchor = Anchor.CentreLeft,
-                                                            Origin = Anchor.CentreLeft,
-                                                            Font = OsuFont.GetFont(size: 12),
-                                                            Colour = OsuColour.Gray(0.7f),
-                                                            Text = HumanizerUtils.Humanize(Comment.CreatedAt)
+                                                            AutoSizeAxes = Axes.Both,
+                                                            Direction = FillDirection.Horizontal,
+                                                            Spacing = new Vector2(10, 0),
+                                                            Children = new Drawable[]
+                                                            {
+                                                                new OsuSpriteText
+                                                                {
+                                                                    Anchor = Anchor.CentreLeft,
+                                                                    Origin = Anchor.CentreLeft,
+                                                                    Font = OsuFont.GetFont(size: 12),
+                                                                    Colour = OsuColour.Gray(0.7f),
+                                                                    Text = HumanizerUtils.Humanize(Comment.CreatedAt)
+                                                                },
+                                                            }
                                                         },
                                                         repliesButton = new RepliesButton(Comment.RepliesCount)
                                                         {


Improve statement readability

Improve statement readability

--- osu.Game/Overlays/News/Sidebar/NewsSideBar.cs
+++ osu.Game/Overlays/News/Sidebar/NewsSideBar.cs
@@ -78,7 +78,7 @@

             var allPosts = metadata.NewValue.NewsPosts;

-            if (!allPosts?.Any() ?? true)
+            if (allPosts?.Any() != true)
                 return;

             var lookup = metadata.NewValue.NewsPosts.ToLookup(post => post.PublishedAt.Month);


Make NewsSidebar scrollable

Make NewsSidebar scrollable

--- osu.Game/Overlays/News/Sidebar/NewsSidebar.cs
+++ osu.Game/Overlays/News/Sidebar/NewsSidebar.cs
@@ -9,6 +9,7 @@
 using osu.Framework.Graphics.Shapes;
 using osuTK;
 using System.Linq;
+using osu.Game.Graphics.Containers;

 namespace osu.Game.Overlays.News.Sidebar
 {
@@ -31,30 +32,55 @@
                     RelativeSizeAxes = Axes.Both,
                     Colour = colourProvider.Background4
                 },
+                new Box
+                {
+                    RelativeSizeAxes = Axes.Y,
+                    Width = OsuScrollContainer.SCROLL_BAR_HEIGHT,
+                    Anchor = Anchor.TopRight,
+                    Origin = Anchor.TopRight,
+                    Colour = colourProvider.Background3,
+                    Alpha = 0.5f
+                },
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
-                    Padding = new MarginPadding
+                    Padding = new MarginPadding { Right = -3 }, // Compensate for scrollbar margin
+                    Child = new OsuScrollContainer
                     {
-                        Vertical = 20,
-                        Left = 50,
-                        Right = 30
-                    },
-                    Child = new FillFlowContainer
-                    {
-                        Direction = FillDirection.Vertical,
-                        RelativeSizeAxes = Axes.X,
-                        AutoSizeAxes = Axes.Y,
-                        Spacing = new Vector2(0, 20),
-                        Children = new Drawable[]
+                        RelativeSizeAxes = Axes.Both,
+                        Child = new Container
                         {
-                            new YearsPanel(),
-                            monthsFlow = new FillFlowContainer<MonthSection>
+                            RelativeSizeAxes = Axes.X,
+                            AutoSizeAxes = Axes.Y,
+                            Padding = new MarginPadding { Right = 3 }, // Addeded 3px back
+                            Child = new Container
                             {
+                                RelativeSizeAxes = Axes.X,
                                 AutoSizeAxes = Axes.Y,
-                                RelativeSizeAxes = Axes.X,
-                                Direction = FillDirection.Vertical,
-                                Spacing = new Vector2(0, 10)
+                                Padding = new MarginPadding
+                                {
+                                    Vertical = 20,
+                                    Left = 50,
+                                    Right = 30
+                                },
+                                Child = new FillFlowContainer
+                                {
+                                    Direction = FillDirection.Vertical,
+                                    RelativeSizeAxes = Axes.X,
+                                    AutoSizeAxes = Axes.Y,
+                                    Spacing = new Vector2(0, 20),
+                                    Children = new Drawable[]
+                                    {
+                                        new YearsPanel(),
+                                        monthsFlow = new FillFlowContainer<MonthSection>
+                                        {
+                                            AutoSizeAxes = Axes.Y,
+                                            RelativeSizeAxes = Axes.X,
+                                            Direction = FillDirection.Vertical,
+                                            Spacing = new Vector2(0, 10)
+                                        }
+                                    }
+                                }
                             }
                         }
                     }


Update TypeIterator.cs

Update TypeIterator.cs

增加注释

--- Natasha/Engine/Standard/TypeIterator.cs
+++ Natasha/Engine/Standard/TypeIterator.cs
@@ -5,44 +5,95 @@
     public abstract class TypeIterator
     {
         public Type CurrentType;
+
+        /// <summary>
+        /// 单独处理复杂类型，例如类、接口，不包括集合、字典
+        /// </summary>
+        /// <param name="type"></param>
         public virtual void EntityHandler(Type type)
         {

         }
+
+
         #region ArraySingle
+        /// <summary>
+        /// 一次性赋值的类型，比如int,string,枚举这类的
+        /// </summary>
+        /// <param name="info">构建信息</param>
         public virtual void ArrayOnceTypeHandler(BuilderInfo info)
         {

         }
+
+
+        /// <summary>
+        /// 复杂类型，比如类、接口、集合类型等
+        /// </summary>
+        /// <param name="info"></param>
         public virtual void ArrayEntityHandler(BuilderInfo info)
         {

         }
         #endregion

-        #region Collection
+
+        #region Collection
+        /// <summary>
+        /// 集合接口类型，IEnumable<T>
+        /// </summary>
+        /// <param name="info"></param>
         public virtual void ICollectionHandler(BuilderInfo info)
         {

         }
+
+
+        /// <summary>
+        /// 集合实体类型，比如List<T>
+        /// </summary>
+        /// <param name="info"></param>
         public virtual void CollectionHandler(BuilderInfo info)
         {

         }
+
+
+        /// <summary>
+        /// 字典接口类型，IDictionary<TKey,TValue>
+        /// </summary>
+        /// <param name="info"></param>
         public virtual void IDictionaryHandler(BuilderInfo info)
         {

         }
+
+
+        /// <summary>
+        /// 字典实体类型，Dictionary<TKey,TValue>
+        /// </summary>
+        /// <param name="info"></param>
         public virtual void DictionaryHandler(BuilderInfo info)
         {

         }
         #endregion
+
+
+        /// <summary>
+        /// 一次性类型处理，比如int,string,枚举这类的
+        /// </summary>
+        /// <param name="info"></param>
         public virtual void OnceTypeHandler(BuilderInfo info)
         {

         }

+
+        /// <summary>
+        /// 数组分配方法，数组类型会被拆分，例如：class[]或者int[]
+        /// </summary>
+        /// <param name="type"></param>
         public void ArrayRouter(Type type)
         {
             Type eleType = type.GetElementType();
@@ -63,6 +114,12 @@
                 ArrayEntityHandler(typeInfo);
             }
         }
+
+
+        /// <summary>
+        /// 实体分配方法，会遍历实体类中的所有成员，不包括方法
+        /// </summary>
+        /// <param name="type"></param>
         public void EntityRouter(Type type)
         {

@@ -251,6 +308,12 @@
             EntityReturnHandler(typeInfo);

         }
+
+
+        /// <summary>
+        /// 集合分配方法，将集合拆分处理，例如，IEnumable<T>或List<T>
+        /// </summary>
+        /// <param name="type"></param>
         public void CollectionRouter(Type type)
         {

@@ -276,6 +339,12 @@
                 CollectionHandler(typeInfo);
             }
         }
+
+
+        /// <summary>
+        /// 字典分配方法，将字典拆分处理，例如，IDictionary<TKey,TValue>或Dictionary<TKey,TValue>
+        /// </summary>
+        /// <param name="type"></param>
         public void DictionaryRouter(Type type)
         {

@@ -302,6 +371,12 @@
                 DictionaryHandler(typeInfo);
             }
         }
+
+
+        /// <summary>
+        /// 一次性类型分配方法
+        /// </summary>
+        /// <param name="type"></param>
         public void OnceTypeRouter(Type type)
         {
             BuilderInfo typeInfo = new BuilderInfo();
@@ -312,10 +387,20 @@
         }

         #region StartAndEnd
+        /// <summary>
+        /// 复杂类型刚开始时需要处理的，比如初始化
+        /// </summary>
+        /// <param name="info"></param>
         public virtual void EntityStartHandler(BuilderInfo info)
         {

         }
+
+
+        /// <summary>
+        /// 复杂类型结束时需要处理的，比如返回一个实例
+        /// </summary>
+        /// <param name="info"></param>
         public virtual void EntityReturnHandler(BuilderInfo info)
         {

@@ -393,34 +478,88 @@
         #endregion

         #region Member
+        /// <summary>
+        /// 复杂类型中，一次性类型的成员操作,
+        /// 例如 public int Age; public string Name{get;set;}
+        /// </summary>
+        /// <param name="info"></param>
         public virtual void MemberOnceTypeHandler(BuilderInfo info)
         {

         }
+
+
+        /// <summary>
+        /// 复杂类型中，一次性数组类型的成员操作，
+        /// 例如public int[] Scores;public string[] Names{get;set;}
+        /// </summary>
+        /// <param name="info"></param>
         public virtual void MemberArrayOnceTypeHandler(BuilderInfo info)
         {

         }
+
+
+        /// <summary>
+        /// 复杂类型中，复杂类型数组的成员操作，
+        /// 例如public ClassA[] values;
+        /// </summary>
+        /// <param name="info"></param>
         public virtual void MemberArrayEntityHandler(BuilderInfo info)
         {

         }
+
+
+        /// <summary>
+        /// 复杂类型中，接口集合的成员操作，
+        /// 例如public IEnumables<T> list;
+        /// </summary>
+        /// <param name="info"></param>
         public virtual void MemberICollectionHandler(BuilderInfo info)
         {

         }
+
+
+        /// <summary>
+        /// 复杂类型中，接口集合的成员操作，
+        /// 例如public List<T> list;
+        /// </summary>
+        /// <param name="info"></param>
         public virtual void MemberCollectionHandler(BuilderInfo info)
         {

         }
+
+
+        /// <summary>
+        /// 复杂类型中，复杂类型的成员操作，
+        /// 例如public ClassA SubClass;
+        /// </summary>
+        /// <param name="info"></param>
         public virtual void MemberEntityHandler(BuilderInfo info)
         {

         }
+
+
+        /// <summary>
+        /// 复杂类型中，接口集合的成员操作，
+        /// 例如public IDictionary<TKey,TValue> dict;
+        /// </summary>
+        /// <param name="info"></param>
         public virtual void MemberIDictionaryHandler(BuilderInfo info)
         {

         }
+
+
+        /// <summary>
+        /// 复杂类型中，接口集合的成员操作，
+        /// 例如public Dictionary<TKey,TValue> dict;
+        /// </summary>
+        /// <param name="info"></param>
         public virtual void MemberDictionaryHandler(BuilderInfo info)
         {


Adjust setting section appearance & spacings

--- osu.Game/Overlays/Settings/SettingsSection.cs
+++ osu.Game/Overlays/Settings/SettingsSection.cs
@@ -30,8 +30,7 @@
         public IEnumerable<IFilterable> FilterableChildren => Children.OfType<IFilterable>();
         public virtual IEnumerable<string> FilterTerms => new[] { Header.ToString() };

-        private const int header_size = 26;
-        private const int margin = 20;
+        private const int header_size = 24;
         private const int border_size = 4;

         public bool MatchingFilter
@@ -77,8 +76,8 @@
                 {
                     Padding = new MarginPadding
                     {
-                        Top = margin + border_size,
-                        Bottom = margin + 10,
+                        Top = 28,
+                        Bottom = 40,
                     },
                     RelativeSizeAxes = Axes.X,
                     AutoSizeAxes = Axes.Y,
@@ -86,13 +85,11 @@
                     {
                         header = new OsuSpriteText
                         {
-                            Font = OsuFont.GetFont(size: header_size),
+                            Font = OsuFont.TorusAlternate.With(size: header_size),
                             Text = Header,
-                            Colour = colours.Yellow,
                             Margin = new MarginPadding
                             {
-                                Left = SettingsPanel.CONTENT_MARGINS,
-                                Right = SettingsPanel.CONTENT_MARGINS
+                                Horizontal = SettingsPanel.CONTENT_MARGINS
                             }
                         },
                         FlowContent


Revert "Remove nullable on `RealmBackedResourceStore` realm parameter"

This reverts commit 09e15f5496a8ecee0f0c77f3743a3b664a150da9.

--- osu.Game/Skinning/RealmBackedResourceStore.cs
+++ osu.Game/Skinning/RealmBackedResourceStore.cs
@@ -23,7 +23,7 @@
         private readonly Live<T> liveSource;
         private readonly IDisposable? realmSubscription;

-        public RealmBackedResourceStore(Live<T> source, IResourceStore<byte[]> underlyingStore, RealmAccess realm)
+        public RealmBackedResourceStore(Live<T> source, IResourceStore<byte[]> underlyingStore, RealmAccess? realm)
             : base(underlyingStore)
         {
             liveSource = source;
@@ -31,7 +31,7 @@
             invalidateCache();
             Debug.Assert(fileToStoragePathMapping != null);

-            realmSubscription = realm.RegisterForNotifications(r => r.All<T>().Where(s => s.ID == source.ID), skinChanged);
+            realmSubscription = realm?.RegisterForNotifications(r => r.All<T>().Where(s => s.ID == source.ID), skinChanged);
         }

         protected override void Dispose(bool disposing)


grab Matt The Radar Technician frames

grab Matt The Radar Technician frames

--- ytgify/Program.cs
+++ ytgify/Program.cs
@@ -15,10 +15,11 @@
     {
         static void Main(string[] args)
         {
-            var link = "https://www.youtube.com/watch?v=2a4gyJsY0mc";
-            IEnumerable<VideoInfo> videoInfos = DownloadUrlResolver.GetDownloadUrls(link);
+            //var link = "https://www.youtube.com/watch?v=2a4gyJsY0mc";
+            var link = "https://www.youtube.com/watch?v=FaOSCASqLsE";
+            var videoInfos = DownloadUrlResolver.GetDownloadUrls(link);

-            VideoInfo video = videoInfos.First(info => info.VideoType == VideoType.Mp4);
+            var video = videoInfos.First(info => info.VideoType == VideoType.Mp4);

             if (video.RequiresDecryption)
             {
@@ -27,7 +28,7 @@

             var fname = video.Title;
             var badChars = Path.GetInvalidFileNameChars().Where(c => fname.Contains(c));
-
+
             foreach (var badChar in badChars)
             {
                 fname = fname.Replace(badChar, '_');
@@ -36,15 +37,23 @@
             var videoDownloader = new VideoDownloader(video, Path.Combine(Environment.CurrentDirectory, fname + video.VideoExtension));

             videoDownloader.Execute();
-
-

             var reader = new VideoFileReader();
             reader.Open(Path.Combine(Environment.CurrentDirectory, fname + video.VideoExtension));

-            for (int i = 0; i < 1500; i++)
+            var framesToSkip = 110 * 23.98; //reader.FrameRate;
+            for (int i = 0; i < framesToSkip; i++)
             {
-                Bitmap videoFrame = reader.ReadVideoFrame();
+                var fr = reader.ReadVideoFrame();
+                fr.Dispose();
+
+            }
+
+            var framesToTake = 7 * 23.98;
+
+            for (int i = 0; i < framesToTake; i++)
+            {
+                var videoFrame = reader.ReadVideoFrame();
                 videoFrame.Save(Path.Combine(Environment.CurrentDirectory, "screenie" + i + ".png"));
                 // process the frame somehow
                 // ...
@@ -52,10 +61,8 @@
                 // dispose the frame when it is no longer required
                 videoFrame.Dispose();
             }
-
+
             reader.Close();
-
-
         }
     }
 }


fix warnings

fix warnings

--- src/Features/LanguageServer/ProtocolUnitTests/Completion/CompletionResolveTests.cs
+++ src/Features/LanguageServer/ProtocolUnitTests/Completion/CompletionResolveTests.cs
@@ -362,7 +362,7 @@
                 new ClassifiedTextRun("class name", className)
             };

-        private async Task<T> GetCompletionItemToResolveAsync<T>(
+        private static async Task<T> GetCompletionItemToResolveAsync<T>(
             TestLspServer testLspServer,
             Dictionary<string, IList<LSP.Location>> locations,
             string label,


Added a test to verify encryption with host

--- src/Jarvis.ConfigurationService.Tests/Controllers/HelpersControllerTestWithHost.cs
+++ src/Jarvis.ConfigurationService.Tests/Controllers/HelpersControllerTestWithHost.cs
@@ -49,6 +49,27 @@
             Assert.That((String) parsed["encrypted"], Is.Not.Null);
         }

+        [Test]
+        public void Verify_encryption_utils_with_host()
+        {
+            JObject parsed = CallControllerPostJsonResult("/support/encryption/encrypt", "{StringToEncrypt : 'pippo'}");
+            Assert.That((Boolean)parsed["success"], Is.EqualTo(true));
+            Assert.That((String)parsed["encrypted"], Is.Not.Null);
+
+            JObject parsed2 = CallControllerPostJsonResult("/support/encryption/encrypt", "{StringToEncrypt : 'pippo', HostName : 'host1'}");
+            Assert.That((Boolean)parsed2["success"], Is.EqualTo(true));
+            Assert.That((String)parsed2["encrypted"], Is.Not.Null);
+
+            Assert.That((String)parsed2["encrypted"], Is.Not.EqualTo((String)parsed["encrypted"]));
+        }
+
+        [Test]
+        public void Verify_encryption_utils_with_host_that_has_no_specific_encryption()
+        {
+            JObject parsed2 = CallControllerPostJsonResult("/support/encryption/encrypt", "{StringToEncrypt : 'pippo', HostName : 'hostwithoutkey'}");
+            Assert.That((Boolean)parsed2["success"], Is.EqualTo(false));
+        }
+
         private JObject CallControllerJsonResult(String path)
         {
             using (WebClient client = new WebClient())


Fix Quaternion cast

Fix Quaternion cast

--- ValveResourceFormat/Resource/ResourceTypes/Animation/Skeleton.cs
+++ ValveResourceFormat/Resource/ResourceTypes/Animation/Skeleton.cs
@@ -50,7 +50,7 @@
             var boneNames = skeletonData.Get<NTROArray>("m_boneName").ToArray<string>();
             var boneParents = skeletonData.Get<NTROArray>("m_nParent").ToArray<short>();
             var bonePositions = skeletonData.Get<NTROArray>("m_bonePosParent").ToArray<Vector3>();
-            var boneRotations = skeletonData.Get<NTROArray>("m_boneRotParent").ToArray<Vector4>();
+            var boneRotations = skeletonData.Get<NTROArray>("m_boneRotParent").ToArray<Quaternion>();

             // Initialise bone array
             Bones = new Bone[boneNames.Length];


More robust probing for MetadataToken API

In some contexts MetadataToken API may not be present at all or access to it could be restricted.
In particular since we use expression trees, the moment when we realize that the access is restricted could happen at the time of "Compile()" or at the time of the actual execution of a helper.

This change makes the strategy of switching to a fallback IsEquivalentTo helper more robust.

Regardless of what context we are in, user should not see binder throwing
"MemberInfo.get_MetadataToken() can't be used on this platform"

[tfs-changeset: 1477889]

--- src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinderExtensions.cs
+++ src/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinderExtensions.cs
@@ -278,52 +278,54 @@
             }
         }

-
-        private static readonly Func<MemberInfo, int> s_GetMetadataTokenSentinel = mi => { throw new InvalidOperationException(); };
-        private static Func<MemberInfo, int> s_GetMetadataToken = s_GetMetadataTokenSentinel;
+        // s_MemberEquivalence will replace itself with one version or another
+        // depending on what works at run time
+        private static Func<MemberInfo, MemberInfo, bool> s_MemberEquivalence = (m1, m2) =>
+            {
+                try
+                {
+                    // See if MetadataToken property is available.
+                    Type memberInfo = typeof(MemberInfo);
+                    PropertyInfo property = memberInfo.GetProperty("MetadataToken", typeof(int), Array.Empty<Type>());
+
+                    if ((object)property != null && property.CanRead)
+                    {
+                        // (parameter1, parameter2) => parameter1.MetadataToken == parameter2.MetadataToken
+                        var parameter1 = Expression.Parameter(memberInfo);
+                        var parameter2 = Expression.Parameter(memberInfo);
+                        var memberEquivalence = Expression.Lambda<Func<MemberInfo, MemberInfo, bool>>(
+                            Expression.Equal(
+                                Expression.Property(parameter1, property),
+                                Expression.Property(parameter2, property)),
+                                new[] { parameter1, parameter2 }).Compile();
+
+                        var result = memberEquivalence(m1, m2);
+                        // it worked, so publish it
+                        s_MemberEquivalence = memberEquivalence;
+
+                        return result;
+                    }
+                }
+                catch
+                {
+                    // Platform might not allow access to the property
+                }
+
+                // MetadataToken is not available in some contexts. Looks like this is one of those cases.
+                // fallback to "IsEquivalentTo"
+                Func<MemberInfo, MemberInfo, bool> fallbackMemberEquivalence = (m1param, m2param) => m1param.IsEquivalentTo(m2param);
+
+                // fallback must work
+                s_MemberEquivalence = fallbackMemberEquivalence;
+                return fallbackMemberEquivalence(m1, m2);
+            };

         public static bool HasSameMetadataDefinitionAs(this MemberInfo mi1, MemberInfo mi2)
         {
 #if UNSUPPORTEDAPI
             return (mi1.MetadataToken == mi2.MetadataToken) && (mi1.Module == mi2.Module));
 #else
-            if (!mi1.Module.Equals(mi2.Module))
-            {
-                return false;
-            }
-
-            if ((object)s_GetMetadataToken == (object)s_GetMetadataTokenSentinel)
-            {
-                // See if MetadataToken property is available.
-                Type memberInfo = typeof(MemberInfo);
-                PropertyInfo property = memberInfo.GetProperty("MetadataToken", typeof(int), Array.Empty<Type>());
-
-                if ((object)property == null || !property.CanRead)
-                {
-                    s_GetMetadataToken = null;
-                }
-                else
-                {
-                    var parameter = Expression.Parameter(memberInfo);
-                    try
-                    {
-                        s_GetMetadataToken = Expression.Lambda<Func<MemberInfo, int>>(Expression.Property(parameter, property), new[] { parameter }).Compile();
-                    }
-                    catch
-                    {
-                        // Platform might not allow access to the property
-                        s_GetMetadataToken = null;
-                    }
-                }
-            }
-
-            var getMetadataToken = s_GetMetadataToken;
-            if ((object)getMetadataToken != null)
-            {
-                return getMetadataToken(mi1) == getMetadataToken(mi2);
-            }
-
-            return mi1.IsEquivalentTo(mi2);
+            return mi1.Module.Equals(mi2.Module) && s_MemberEquivalence(mi1, mi2);
 #endif
         }
     }


[trunk] Support single MOC nodes in Xcode generation

--- packages/QtCommon/dev/XcodeBuilder/MocFile.cs
+++ packages/QtCommon/dev/XcodeBuilder/MocFile.cs
@@ -7,14 +7,17 @@
 {
     public partial class XcodeBuilder
     {
-        public object Build(QtCommon.MocFile moduleToBuild, out System.Boolean success)
+        public object
+        Build(
+            QtCommon.MocFile moduleToBuild,
+            out System.Boolean success)
         {
             var node = moduleToBuild.OwningNode;
             var moduleName = node.ModuleName;

             var parentNode = node.Parent;
             Opus.Core.DependencyNode targetNode;
-            if (parentNode.Module is Opus.Core.IModuleCollection)
+            if ((parentNode != null) && (parentNode.Module is Opus.Core.IModuleCollection))
             {
                 targetNode = parentNode.ExternalDependentFor[0];
             }
@@ -25,18 +28,18 @@

             var project = this.Workspace.GetProject(targetNode);

-            Opus.Core.BaseOptionCollection complementOptionCollection = null;
-            if (node.EncapsulatingNode.Module is Opus.Core.ICommonOptionCollection)
-            {
-                var commonOptions = (node.EncapsulatingNode.Module as Opus.Core.ICommonOptionCollection).CommonOptionCollection;
-                if (commonOptions is QtCommon.MocOptionCollection)
-                {
-                    complementOptionCollection = moduleToBuild.Options.Complement(commonOptions);
-                }
-            }
-
             if (null != parentNode)
             {
+                Opus.Core.BaseOptionCollection complementOptionCollection = null;
+                if (node.EncapsulatingNode.Module is Opus.Core.ICommonOptionCollection)
+                {
+                    var commonOptions = (node.EncapsulatingNode.Module as Opus.Core.ICommonOptionCollection).CommonOptionCollection;
+                    if (commonOptions is QtCommon.MocOptionCollection)
+                    {
+                        complementOptionCollection = moduleToBuild.Options.Complement(commonOptions);
+                    }
+                }
+
                 // > 1 because the MocOutputPath is currently in the options, hence never null
                 if (complementOptionCollection.OptionNames.Count > 1)
                 {
@@ -57,7 +60,12 @@
             }
             else
             {
-                throw new Opus.Core.Exception("Single MOC file support in Xcode not yet supported");
+                var shellScriptBuildPhase = project.ShellScriptBuildPhases.Get("MOCing files for " + node.UniqueModuleName, node.ModuleName);
+
+                ShellScriptHelper.WriteShellCommand(node.Target, moduleToBuild.Options, shellScriptBuildPhase);
+
+                shellScriptBuildPhase.InputPaths.Add(moduleToBuild.SourceFileLocation.GetSingleRawPath());
+                shellScriptBuildPhase.OutputPaths.Add(moduleToBuild.Locations[QtCommon.MocFile.OutputFile].GetSingleRawPath());
             }

             success = true;


Update C# bindings.

Update C# bindings.

PiperOrigin-RevId: 458919739
Change-Id: I7737d2736491dae8fce46bc36aa5135007a7a588

--- unity/Runtime/Bindings/MujocoBindings.cs
+++ unity/Runtime/Bindings/MujocoBindings.cs
@@ -1,17 +1,18 @@
-// Copyright 2019 DeepMind Technologies Limited
+// Copyright 2022 DeepMind Technologies Limited
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
 //
-//      http://www.apache.org/licenses/LICENSE-2.0
+//     http://www.apache.org/licenses/LICENSE-2.0
 //
 // Unless required by applicable law or agreed to in writing, software
 // distributed under the License is distributed on an "AS IS" BASIS,
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
-
+// ==============================================================================
+// THIS FILE IS AUTO-GENERATED
 using System;
 using System.Runtime.InteropServices;
 using System.Text;
@@ -23,6 +24,14 @@

 // ----------------------------------Constants----------------------------------

+public const bool THIRD_PARTY_MUJOCO_MJDATA_H_ = true;
+public const bool THIRD_PARTY_MUJOCO_MJEXPORT_H_ = true;
+public const bool MUJOCO_HELPER_DLL_LOCAL = true;
+public const bool MUJOCO_HELPER_DLL_IMPORT = true;
+public const bool MUJOCO_HELPER_DLL_EXPORT = true;
+public const bool MJAPI = true;
+public const bool MJLOCAL = true;
+public const bool THIRD_PARTY_MUJOCO_MJMODEL_H_ = true;
 public const double mjPI = 3.141592653589793;
 public const double mjMAXVAL = 10000000000.0;
 public const double mjMINMU = 1e-05;
@@ -39,10 +48,13 @@
 public const int mjNREF = 2;
 public const int mjNIMP = 5;
 public const int mjNSOLVER = 1000;
+public const bool THIRD_PARTY_MUJOCO_MJRENDER_H_ = true;
 public const int mjNAUX = 10;
 public const int mjMAXTEXTURE = 1000;
+public const bool THIRD_PARTY_MUJOCO_INCLUDE_MJTNUM_H_ = true;
 public const bool mjUSEDOUBLE = true;
 public const double mjMINVAL = 1e-15;
+public const bool THIRD_PARTY_MUJOCO_MJUI_H_ = true;
 public const int mjMAXUISECT = 10;
 public const int mjMAXUIITEM = 80;
 public const int mjMAXUITEXT = 300;
@@ -77,12 +89,15 @@
 public const int mjKEY_F10 = 299;
 public const int mjKEY_F11 = 300;
 public const int mjKEY_F12 = 301;
+public const bool THIRD_PARTY_MUJOCO_MJVISUALIZE_H_ = true;
 public const int mjNGROUP = 6;
 public const int mjMAXLIGHT = 100;
 public const int mjMAXOVERLAY = 500;
 public const int mjMAXLINE = 100;
 public const int mjMAXLINEPNT = 1000;
 public const int mjMAXPLANEGRID = 200;
+public const bool THIRD_PARTY_MUJOCO_MJXMACRO_H_ = true;
+public const bool THIRD_PARTY_MUJOCO_MUJOCO_H_ = true;
 public const int mjVERSION_HEADER = 220;

@@ -134,7 +149,8 @@
   mjENBL_ENERGY = 2,
   mjENBL_FWDINV = 4,
   mjENBL_SENSORNOISE = 8,
-  mjNENABLE = 4,
+  mjENBL_MULTICCD = 16,
+  mjNENABLE = 5,
 }
 public enum mjtJoint : int{
   mjJNT_FREE = 0,
@@ -175,6 +191,7 @@
 public enum mjtIntegrator : int{
   mjINT_EULER = 0,
   mjINT_RK4 = 1,
+  mjINT_IMPLICIT = 2,
 }
 public enum mjtCollision : int{
   mjCOL_ALL = 0,
@@ -228,8 +245,8 @@
 public enum mjtGain : int{
   mjGAIN_FIXED = 0,
   mjGAIN_AFFINE = 1,
-  mjGAIN_MUSCLE = 1,
-  mjGAIN_USER = 2,
+  mjGAIN_MUSCLE = 2,
+  mjGAIN_USER = 3,
 }
 public enum mjtBias : int{
   mjBIAS_NONE = 0,
@@ -423,33 +440,35 @@
   mjFRAME_SITE = 3,
   mjFRAME_CAMERA = 4,
   mjFRAME_LIGHT = 5,
-  mjFRAME_WORLD = 6,
-  mjNFRAME = 7,
+  mjFRAME_CONTACT = 6,
+  mjFRAME_WORLD = 7,
+  mjNFRAME = 8,
 }
 public enum mjtVisFlag : int{
   mjVIS_CONVEXHULL = 0,
   mjVIS_TEXTURE = 1,
   mjVIS_JOINT = 2,
-  mjVIS_ACTUATOR = 3,
-  mjVIS_CAMERA = 4,
-  mjVIS_LIGHT = 5,
-  mjVIS_TENDON = 6,
-  mjVIS_RANGEFINDER = 7,
-  mjVIS_CONSTRAINT = 8,
-  mjVIS_INERTIA = 9,
-  mjVIS_SCLINERTIA = 10,
-  mjVIS_PERTFORCE = 11,
-  mjVIS_PERTOBJ = 12,
-  mjVIS_CONTACTPOINT = 13,
-  mjVIS_CONTACTFORCE = 14,
-  mjVIS_CONTACTSPLIT = 15,
-  mjVIS_TRANSPARENT = 16,
-  mjVIS_AUTOCONNECT = 17,
-  mjVIS_COM = 18,
-  mjVIS_SELECT = 19,
-  mjVIS_STATIC = 20,
-  mjVIS_SKIN = 21,
-  mjNVISFLAG = 22,
+  mjVIS_CAMERA = 3,
+  mjVIS_ACTUATOR = 4,
+  mjVIS_ACTIVATION = 5,
+  mjVIS_LIGHT = 6,
+  mjVIS_TENDON = 7,
+  mjVIS_RANGEFINDER = 8,
+  mjVIS_CONSTRAINT = 9,
+  mjVIS_INERTIA = 10,
+  mjVIS_SCLINERTIA = 11,
+  mjVIS_PERTFORCE = 12,
+  mjVIS_PERTOBJ = 13,
+  mjVIS_CONTACTPOINT = 14,
+  mjVIS_CONTACTFORCE = 15,
+  mjVIS_CONTACTSPLIT = 16,
+  mjVIS_TRANSPARENT = 17,
+  mjVIS_AUTOCONNECT = 18,
+  mjVIS_COM = 19,
+  mjVIS_SELECT = 20,
+  mjVIS_STATIC = 21,
+  mjVIS_SKIN = 22,
+  mjNVISFLAG = 23,
 }
 public enum mjtRndFlag : int{
   mjRND_SHADOW = 0,
@@ -1634,6 +1653,13 @@
   public double* efc_aref;
   public double* subtree_linvel;
   public double* subtree_angmom;
+  public double* qH;
+  public double* qHDiagInv;
+  public int* D_rownnz;
+  public int* D_rowadr;
+  public int* D_colind;
+  public double* qDeriv;
+  public double* qLU;
   public double* actuator_force;
   public double* qfrc_actuator;
   public double* qfrc_smooth;
@@ -1860,6 +1886,7 @@
   public int nuser_sensor;
   public int nnames;
   public int nM;
+  public int nD;
   public int nemax;
   public int njmax;
   public int nconmax;
@@ -2078,11 +2105,13 @@
   public int* actuator_group;
   public byte* actuator_ctrllimited;
   public byte* actuator_forcelimited;
+  public byte* actuator_actlimited;
   public double* actuator_dynprm;
   public double* actuator_gainprm;
   public double* actuator_biasprm;
   public double* actuator_ctrlrange;
   public double* actuator_forcerange;
+  public double* actuator_actrange;
   public double* actuator_gear;
   public double* actuator_cranklength;
   public double* actuator_acc0;
@@ -2466,7 +2495,7 @@
   public fixed byte jointgroup[6];
   public fixed byte tendongroup[6];
   public fixed byte actuatorgroup[6];
-  public fixed byte flags[22];
+  public fixed byte flags[23];
 }

 [StructLayout(LayoutKind.Sequential)]
@@ -2634,12 +2663,6 @@
 // ----------------------------Function declarations----------------------------

 [DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)]
-public static unsafe extern int mj_activate([MarshalAs(UnmanagedType.LPStr)]string filename);
-
-[DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)]
-public static unsafe extern void mj_deactivate();
-
-[DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)]
 public static unsafe extern void mj_defaultVFS(void* vfs);

 [DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)]
@@ -3199,6 +3222,12 @@
 public static unsafe extern void mju_writeLog([MarshalAs(UnmanagedType.LPStr)]string type, [MarshalAs(UnmanagedType.LPStr)]string msg);

 [DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)]
+public static unsafe extern int mj_activate([MarshalAs(UnmanagedType.LPStr)]string filename);
+
+[DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)]
+public static unsafe extern void mj_deactivate();
+
+[DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)]
 public static unsafe extern void mju_zero3(double* res);

 [DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)]
@@ -3458,5 +3487,8 @@

 [DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)]
 public static unsafe extern double mju_sigmoid(double x);
-}
-}
+
+[DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)]
+public static unsafe extern void mjd_transitionFD(mjModel_* m, mjData_* d, double eps, byte centered, double* A, double* B);
+}
+}


Fixed a missing font disposal.

Fixed a missing font disposal.

--- Demos/DemoHarness.cs
+++ Demos/DemoHarness.cs
@@ -408,6 +408,7 @@
                 disposed = true;
                 demo?.Dispose();
                 timeSamples.Dispose();
+                font.Dispose();
             }
         }


Simplify

Simplify

--- src/Tools/ExternalAccess/FSharp/Internal/Classification/FSharpClassificationService.cs
+++ src/Tools/ExternalAccess/FSharp/Internal/Classification/FSharpClassificationService.cs
@@ -11,7 +11,6 @@
 using Microsoft.CodeAnalysis.ExternalAccess.FSharp.Classification;
 using Microsoft.CodeAnalysis.Host.Mef;
 using Microsoft.CodeAnalysis.Text;
-using Roslyn.Utilities;

 namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.Internal.Classification
 {
@@ -49,13 +48,9 @@
         }

         public ValueTask<object?> GetDataToCacheAsync(Document document, CancellationToken cancellationToken)
-        {
-            return new();
-        }
+            => new();

         public ValueTask<TextChangeRange?> ComputeSyntacticChangeRangeAsync(Document oldDocument, Document newDocument, TimeSpan timeout, CancellationToken cancellationToken)
-        {
-            return new();
-        }
+            => new();
     }
 }


only write the error or warning if the create in the catch fails as well (#584)

Co-authored-by: Martin Hinshelwood nkdAgility.com <54669547a225ff20cba8b75a4adca540eef25858@nkdagility.com>

--- src/VstsSyncMigrator.Core/Execution/MigrationContext/NodeStructuresMigrationContext.cs
+++ src/VstsSyncMigrator.Core/Execution/MigrationContext/NodeStructuresMigrationContext.cs
@@ -1,12 +1,11 @@
-using Microsoft.TeamFoundation.Server;
-using System;
+using System;
 using System.Diagnostics;
 using System.Linq;
 using System.Xml;
+using Microsoft.TeamFoundation.Server;
+using MigrationTools;
+using MigrationTools.Core.Configuration;
 using MigrationTools.Core.Configuration.Processing;
-using MigrationTools;
-using Microsoft.Extensions.Hosting;
-using MigrationTools.Core.Configuration;
 using Serilog;

 namespace VstsSyncMigrator.Engine
@@ -52,7 +51,7 @@
             //////////////////////////////////////////////////
         }

-        private void ProcessCommonStructure(string treeTypeSource,string treeTypeTarget, NodeInfo[] sourceNodes, ICommonStructureService targetCss, ICommonStructureService sourceCss)
+        private void ProcessCommonStructure(string treeTypeSource, string treeTypeTarget, NodeInfo[] sourceNodes, ICommonStructureService targetCss, ICommonStructureService sourceCss)
         {
             NodeInfo sourceNode = (from n in sourceNodes where n.Path.Contains(treeTypeSource) select n).Single();
             if (sourceNode == null) // May run into language problems!!! This is to try and detect that
@@ -174,11 +173,18 @@
             }
             catch (CommonStructureSubsystemException ex)
             {
-                Log.Error(ex, "Creating Node");
-                Trace.Write("...missing");
-                string newPathUri = css.CreateNode(name, parent.Uri);
-                Trace.Write("...created");
-                node = css.GetNode(newPathUri);
+                try
+                {
+                    string newPathUri = css.CreateNode(name, parent.Uri);
+                    Trace.Write("...created");
+                    node = css.GetNode(newPathUri);
+                }
+                catch
+                {
+                    Log.Error(ex, "Creating Node");
+                    Trace.Write("...missing");
+                    throw;
+                }
             }

             Trace.WriteLine(String.Empty);
@@ -197,10 +203,17 @@
             }
             catch (CommonStructureSubsystemException ex)
             {
-               Log.Warning(ex, "Missing ");
-                string newPathUri = css.CreateNode(name, parent.Uri);
-               Log.Information("...created");
-                node = css.GetNode(newPathUri);
+                try
+                {
+                    string newPathUri = css.CreateNode(name, parent.Uri);
+                    Log.Information("...created");
+                    node = css.GetNode(newPathUri);
+                }
+                catch
+                {
+                    Log.Warning(ex, "Missing ");
+                    throw;
+                }
             }

             try


Revert "Address PR feedback"

Revert "Address PR feedback"

This reverts commit c24e51ef84668dd7342f2fc63d5597aebf54276c.

--- src/Workspaces/Core/Portable/LinkedFileDiffMerging/LinkedFileDiffMergingSession.cs
+++ src/Workspaces/Core/Portable/LinkedFileDiffMerging/LinkedFileDiffMergingSession.cs
@@ -86,7 +86,7 @@

             // Automatically merge non-conflicting diffs while collecting the conflicting diffs

-            var textDifferencingService = _oldSolution.Workspace.Services.GetService<IDocumentTextDifferencingService>();
+            var textDifferencingService = _oldSolution.Workspace.Services.GetService<IDocumentTextDifferencingService>() ?? new DefaultDocumentTextDifferencingService();
             var appliedChanges = await textDifferencingService.GetTextChangesAsync(_oldSolution.GetDocument(linkedDocumentGroup.First()), _newSolution.GetDocument(linkedDocumentGroup.First()), cancellationToken).ConfigureAwait(false);
             var unmergedChanges = new List<UnmergedDocumentChanges>();


コードの整理 インデックスサーバーアドレスのチェックと設定を分けるなど

コードの整理
インデックスサーバーアドレスのチェックと設定を分けるなど

--- DemoP2P/Form1.cs
+++ DemoP2P/Form1.cs
@@ -88,6 +88,11 @@
             }
         }

+        bool TargetGrobal
+        {
+            get { return radioButtonGlobal.Checked || radioButtonAvailable.Checked; }
+        }
+
         #endregion

         private void UpdateUI()
@@ -99,9 +104,8 @@
             radioButtonAllLinkLocal.Enabled = !PeerOpened;
             radioButtonAvailable.Enabled = !PeerOpened;

-            bool bSelectGrobal = radioButtonGlobal.Checked || radioButtonAvailable.Checked;
-            labelIndexServerAddress.Enabled = bSelectGrobal && !PeerOpened;
-            textBoxIndexServerAddress.Enabled = bSelectGrobal && !PeerOpened;
+            labelIndexServerAddress.Enabled = TargetGrobal && !PeerOpened;
+            textBoxIndexServerAddress.Enabled = TargetGrobal && !PeerOpened;

             labelPortNo.Enabled = !PeerOpened;
             numericUpDownPortNo.Enabled = !PeerOpened;
@@ -159,16 +163,20 @@

                 #endregion

-                peerName = new PeerName(Classifier, PeerNameType);
-
-                peerNameRegistration = new PeerNameRegistration(peerName, PortNo) { Cloud = Cloud };
-                if (radioButtonGlobal.Checked || radioButtonAvailable.Checked)
+                IPAddress[] hostAddresses = null;
+                if (TargetGrobal)
                 {
-                    #region インデックスサーバーの指定
-
-                    peerNameRegistration.UseAutoEndPointSelection = false;
-
-                    var hostAddresses = Dns.GetHostAddresses(textBoxIndexServerAddress.Text);
+                    #region インデックスサーバー名の確認
+
+                    if (string.IsNullOrWhiteSpace(textBoxIndexServerAddress.Text))
+                    {
+                        MessageBox.Show(labelIndexServerAddress.Text + "を入力してください。", Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
+                        textBoxIndexServerAddress.SelectAll();
+                        textBoxIndexServerAddress.Focus();
+                        return;
+                    }
+
+                    hostAddresses = Dns.GetHostAddresses(textBoxIndexServerAddress.Text);
                     if (hostAddresses == null || hostAddresses.Length == 0)
                     {
                         MessageBox.Show(labelIndexServerAddress.Text + "が正しくありません。", Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
@@ -176,6 +184,17 @@
                         textBoxIndexServerAddress.Focus();
                         return;
                     }
+
+                    #endregion
+                }
+
+                peerName = new PeerName(Classifier, PeerNameType);
+                peerNameRegistration = new PeerNameRegistration(peerName, PortNo) { Cloud = Cloud };
+                if (TargetGrobal)
+                {
+                    #region インデックスサーバーの設定
+
+                    peerNameRegistration.UseAutoEndPointSelection = false;
                     foreach (var hostAddress in hostAddresses)
                     {
                         peerNameRegistration.EndPointCollection.Add(new IPEndPoint(hostAddress, PortNo));


Fixed #18 single variable on operator assignment bug

--- Interpreter/Interpreter.cs
+++ Interpreter/Interpreter.cs
@@ -107,7 +107,14 @@
                 var groups = RegexCollection.Store.OpAssignment.Match(lineToInterprete).Groups.OfType<Group>()
                     .Select(a => a.Value).ToArray();

-                lineToInterprete = $"{groups[1]} = ${groups[1].TrimStart('$')} {groups[2]} {groups[3]}";
+                var output = Output;
+                var eOutput = ExplicitOutput;
+                Output = new NoOutput();
+                ExplicitOutput = new NoOutput();
+                lineToInterprete = $"{groups[1]} = ${groups[1].TrimStart('$')} {groups[2]} {InterpretLine(groups[3],access)}";
+                Output = output;
+                ExplicitOutput = eOutput;
+
                 return InterpretLine(lineToInterprete, access);
             }


fix double send tx bug

fix double send tx bug

--- WalletWasabi.Gui/Controls/WalletExplorer/SendControlViewModel.cs
+++ WalletWasabi.Gui/Controls/WalletExplorer/SendControlViewModel.cs
@@ -342,48 +342,6 @@
 					BuildTransactionResult result = await Task.Run(() => Global.WalletService.BuildTransaction(Password, intent, feeStrategy, allowUnconfirmed: true, allowedInputs: selectedCoinReferences));

 					await DoAfterBuildTransaction(result);
-
-					MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusType.SigningTransaction);
-					SmartTransaction signedTransaction = result.Transaction;
-
-					if (IsHardwareWallet && !result.Signed) // If hardware but still has a privkey then it's password, then meh.
-					{
-						try
-						{
-							IsHardwareBusy = true;
-							MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusType.AcquiringSignatureFromHardwareWallet);
-							var client = new HwiClient(Global.Network);
-
-							using var cts = new CancellationTokenSource(TimeSpan.FromMinutes(3));
-							PSBT signedPsbt = null;
-							try
-							{
-								signedPsbt = await client.SignTxAsync(KeyManager.MasterFingerprint.Value, result.Psbt, cts.Token);
-							}
-							catch (HwiException)
-							{
-								await PinPadViewModel.UnlockAsync();
-								signedPsbt = await client.SignTxAsync(KeyManager.MasterFingerprint.Value, result.Psbt, cts.Token);
-							}
-							signedTransaction = signedPsbt.ExtractSmartTransaction(result.Transaction);
-						}
-						catch (Exception ex)
-						{
-							NotificationHelpers.Error(ex.ToUserFriendlyString());
-							Logger.LogError(ex);
-							return;
-						}
-						finally
-						{
-							MainWindowViewModel.Instance.StatusBar.TryRemoveStatus(StatusType.AcquiringSignatureFromHardwareWallet);
-							IsHardwareBusy = false;
-						}
-					}
-
-					MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusType.BroadcastingTransaction);
-					await Task.Run(async () => await Global.TransactionBroadcaster.SendTransactionAsync(signedTransaction));
-
-					ResetUi();
 				}
 				catch (InsufficientBalanceException ex)
 				{


Wording change for clarity (#523)

Wording change for clarity (#523)

--- NuKeeper/Engine/CollaborationFactory.cs
+++ NuKeeper/Engine/CollaborationFactory.cs
@@ -41,7 +41,7 @@

             _platform = _settingsReader.Platform;

-            _nuKeeperLogger.Normal($"Matched collaboration platform {_platform} to uri {apiEndpoint}");
+            _nuKeeperLogger.Normal($"Matched uri '{apiEndpoint}' to collaboration platform '{_platform}'");

             Settings.BaseApiUrl = UriFormats.EnsureTrailingSlash(apiEndpoint);
             Settings.Token = token;


Site stub fix

Site stub fix

--- Nwazet.Commerce.Tests/Stubs/SiteStub.cs
+++ Nwazet.Commerce.Tests/Stubs/SiteStub.cs
@@ -1,49 +1,48 @@
-using System.Collections.Generic;
-using System.Linq;
-using Orchard.ContentManagement;
-using Orchard.ContentManagement.Records;
-using Orchard.Settings;
-using Nwazet.Commerce.Models;
-using Orchard.ContentManagement.FieldStorage.InfosetStorage;
-using Nwazet.Commerce.Tests.Helpers;
-
-namespace Nwazet.Commerce.Tests.Stubs {
-    public class SiteStub : ISite, IContent {
-        public SiteStub(bool allowOverrides, bool defineDefaults, List<PriceTier> sitePriceTiers) {
-            ContentItem = new ContentItem {
-                VersionRecord = new ContentItemVersionRecord {
-                    ContentItemRecord = new ContentItemRecord()
-                },
-                ContentType = "Site"
-            };
-            ContentItem.Weld(new InfosetPart());
-
-            var settings = new ProductSettingsStub(allowOverrides, defineDefaults, sitePriceTiers, ContentItem);
-            ContentItem.Weld(settings);
-        }
-
+using System.Collections.Generic;
+using Orchard.ContentManagement;
+using Orchard.ContentManagement.Records;
+using Orchard.Settings;
+using Nwazet.Commerce.Models;
+using Orchard.ContentManagement.FieldStorage.InfosetStorage;
+
+namespace Nwazet.Commerce.Tests.Stubs {
+    public class SiteStub : ISite {
+        public SiteStub(bool allowOverrides, bool defineDefaults, List<PriceTier> sitePriceTiers) {
+            ContentItem = new ContentItem {
+                VersionRecord = new ContentItemVersionRecord {
+                    ContentItemRecord = new ContentItemRecord()
+                },
+                ContentType = "Site"
+            };
+            ContentItem.Weld(new InfosetPart());
+
+            var settings = new ProductSettingsStub(allowOverrides, defineDefaults, sitePriceTiers, ContentItem);
+            ContentItem.Weld(settings);
+        }
+
         public ContentItem ContentItem { get; private set; }
         public int MaxPageSize { get; set; }
-        public string BaseUrl { get; set; }
-        public string HomePage { get; set; }
-        public int PageSize { get; set; }
+        public int MaxPagedCount { get; set; }
+        public string BaseUrl { get; set; }
+        public string HomePage { get; set; }
+        public int PageSize { get; set; }
         public string PageTitleSeparator { get { return ""; } }
         public string SiteCalendar { get; set; }
-        public ResourceDebugMode ResourceDebugMode { get; set; }
-        public string SiteCulture { get; set; }
-        public string SiteName { get; set; }
-        public string SiteSalt { get; set; }
-        public string SiteTimeZone { get; set; }
-        public string SuperUser { get; set; }
-        public int Id { get; set; }
-    }
-
-    public class ProductSettingsStub : ProductSettingsPart {
-        public ProductSettingsStub(bool allowOverrides, bool defineDefaults, List<PriceTier> sitePriceTiers, ContentItem contentItem) {
-            ContentItem = contentItem;
-            AllowProductOverrides = allowOverrides;
-            DefineSiteDefaults = defineDefaults;
-            PriceTiers = sitePriceTiers;
-        }
-    }
-}
+        public ResourceDebugMode ResourceDebugMode { get; set; }
+        public string SiteCulture { get; set; }
+        public string SiteName { get; set; }
+        public string SiteSalt { get; set; }
+        public string SiteTimeZone { get; set; }
+        public string SuperUser { get; set; }
+        public int Id { get; set; }
+    }
+
+    public class ProductSettingsStub : ProductSettingsPart {
+        public ProductSettingsStub(bool allowOverrides, bool defineDefaults, List<PriceTier> sitePriceTiers, ContentItem contentItem) {
+            ContentItem = contentItem;
+            AllowProductOverrides = allowOverrides;
+            DefineSiteDefaults = defineDefaults;
+            PriceTiers = sitePriceTiers;
+        }
+    }
+}


attribute rename gameMode to GameMode for better naming convention

--- RiotApi.Net.RestClient/Dto/CurrentGame/CurrentGameInfo.cs
+++ RiotApi.Net.RestClient/Dto/CurrentGame/CurrentGameInfo.cs
@@ -32,7 +32,7 @@
         /// </summary>
         [JsonProperty(PropertyName = "gameMode")]
         [JsonConverter(typeof(StringEnumConverter))]
-        public Helpers.Enums.GameMode gameMode { get; set; }
+        public Helpers.Enums.GameMode GameMode { get; set; }

         /// <summary>
         /// The queue type (queue types are documented on the Game Constants page)


change initial directory of open file dialog to last file

close #127

--- OpenCNCPilot/MainWindow.xaml.FileTab.cs
+++ OpenCNCPilot/MainWindow.xaml.FileTab.cs
@@ -26,6 +26,8 @@

 			CurrentFileName = "";
 			ToolPath = GCodeFile.Empty;
+
+			openFileDialogGCode.InitialDirectory = System.IO.Path.GetDirectoryName(openFileDialogGCode.FileName);

 			try
 			{
@@ -58,6 +60,11 @@
 			if (machine.Mode == Machine.OperatingMode.SendFile)
 				return;

+			// prevent exception when the drive letter doesn't exist
+			if (!System.IO.Directory.Exists(openFileDialogGCode.InitialDirectory))
+			{
+				openFileDialogGCode.InitialDirectory = "";
+			}
 			openFileDialogGCode.ShowDialog();
 		}


failing test for #272

failing test for #272

--- JilTests/SerializeTests.cs
+++ JilTests/SerializeTests.cs
@@ -9654,5 +9654,27 @@
             Assert.AreEqual("123", JSON.Serialize<_Issue270?>(new _Issue270 { Val = 123 }));
             Assert.AreEqual("null", JSON.Serialize<_Issue270?>(null));
         }
+
+
+        [Flags]
+        private enum _Issue272Enum { Zero, One, Two }
+
+        private class _Issue272
+        {
+            public Dictionary<_Issue272Enum, int> EnumMap { get; set; }
+        }
+
+        [TestMethod]
+        public void Issue272()
+        {
+            var repro = new _Issue272();
+            repro.EnumMap = new Dictionary<_Issue272Enum, int>();
+            repro.EnumMap.Add(_Issue272Enum.One, 1);
+            repro.EnumMap.Add(_Issue272Enum.Two, 2);
+
+            var json = JSON.Serialize(repro, Options.ExcludeNulls);
+
+            Assert.AreEqual("{\"EnumMap\":{\"One\":1,\"Two\":2}}", json);
+        }
     }
 }


Fix: LT-19153 Unable to create fully customized writing system

* Removed AcceptChanges which resets WS status

--- SIL.WritingSystems/LdmlInFolderWritingSystemRepository.cs
+++ SIL.WritingSystems/LdmlInFolderWritingSystemRepository.cs
@@ -286,7 +286,6 @@
 				// this is a new writing system that was generated from a template, so copy the template over before saving
 				File.Copy(ws.Template, writingSystemFilePath);
 				ws.Template = null;
-				ws.AcceptChanges();
 			}

 			if (!ws.IsChanged && File.Exists(writingSystemFilePath))


fix bug about not clearing obsolete requests

--- JoinRpg.DataModel/Claim.cs
+++ JoinRpg.DataModel/Claim.cs
@@ -87,7 +87,7 @@

         public int? AccommodationRequest_Id { get; set; }
         [ForeignKey(nameof(AccommodationRequest_Id))]
-        public AccommodationRequest AccommodationRequest { get; set; }
+        public virtual AccommodationRequest AccommodationRequest { get; set; }

         #region Finance


Fixing bug in dynamic filter and chaging so static variables can be used to run filter after nested repo mapping

--- DynamicFilter.cs
+++ DynamicFilter.cs
@@ -32,9 +32,13 @@
                 if (builtFilter != null)
                     builtFilter += ':';
                 builtFilter += filters[i - 2] + ':';
-                builtFilter += filters[i - 2] + ':';
+                builtFilter += filters[i - 1] + ':';

-                builtFilter += Joe.Reflection.ReflectionHelper.GetEvalProperty(viewModel, filters[i]);
+                var propinfo = Joe.Reflection.ReflectionHelper.TryGetEvalPropertyInfo(viewModel.GetType(), filters[i]);
+                if (propinfo != null)
+                    builtFilter += propinfo.GetValue(viewModel);
+                else
+                    builtFilter += filters[i];
             }
             return builtFilter;
         }