Added test for removing a specific node from a set.

git-svn-id: dcafdc6390f06cd4b2e634dc7bbf20f0ade3e1f6@247 299a232d-b705-0410-b782-f21f2f1e606a

--- Source/MSBuild.Community.Tasks.Tests/Xml/XmlMassUpdateTests.cs
+++ Source/MSBuild.Community.Tasks.Tests/Xml/XmlMassUpdateTests.cs
@@ -205,6 +205,30 @@

             traceNode = getNode(task.MergedXmlDocument, "/configuration/system.web/trace");
             Assert.IsNull(traceNode, "The trace element should not exist.");
+        }
+
+        [Test]
+        public void RemoveKeyedElement()
+        {
+            setupTask();
+            setupContent();
+            task.SubstitutionsRoot = "/configuration/substitutions/removeKeyedElement";
+
+            string originalA = getInitialValue("/configuration/appSettings/add[@key='A']/@value");
+            string originalB = getInitialValue("/configuration/appSettings/add[@key='B']/@value");
+            string originalC = getInitialValue("/configuration/appSettings/add[@key='C']/@value");
+            Assert.IsNotNull(originalA, "A should exist.");
+            Assert.IsNotNull(originalB, "B should exist.");
+            Assert.IsNotNull(originalC, "C should exist.");
+
+            bool executeSucceeded = task.Execute();
+            Assert.IsTrue(executeSucceeded, "Task should have succeeded.");
+
+            assertXml(originalA, "/configuration/appSettings/add[@key='A']/@value", "A should not have changed");
+            assertXml(originalC, "/configuration/appSettings/add[@key='C']/@value", "C should not have changed");
+
+            XmlNode bNode = getNode(task.MergedXmlDocument, "/configuration/appSettings/add[@key='B']/@value");
+            Assert.IsNull(bNode, "The B element should not exist.");
         }

         private string getInitialValue(string xpath)
@@ -298,6 +322,11 @@
         <trace xmu:action=""remove"" />
       </system.web>
     </removeElement>
+    <removeKeyedElement>
+      <appSettings>
+        <add xmu:key=""key"" key=""B"" xmu:action=""remove"" />
+      </appSettings>
+    </removeKeyedElement>
 </substitutions>
 </configuration>";


SchedulerWebApiPlugin: save & delete

SchedulerWebApiPlugin: save & delete

--- ThinkingHome.Plugins.Scheduler.WebApi/SchedulerWebApiPlugin.cs
+++ ThinkingHome.Plugins.Scheduler.WebApi/SchedulerWebApiPlugin.cs
@@ -1,4 +1,5 @@
-using System.Linq;
+using System;
+using System.Linq;
 using ThinkingHome.Core.Plugins;
 using ThinkingHome.Plugins.Database;
 using ThinkingHome.Plugins.Scheduler.Model;
@@ -50,53 +51,61 @@
             }
         }

-        /*
-        [WebApiMethod("/api/scripts/web-api/save")]
-        public object SaveScript(HttpRequestParams request)
+        [WebApiMethod("/api/scheduler/web-api/save")]
+        public object SaveSchedulerEvent(HttpRequestParams request)
         {
             var id = request.GetGuid("id");
             var name = request.GetRequiredString("name");
-            var body = request.GetRequiredString("body");
+            var eventAlias = request.GetRequiredString("event");
+            var enabled = request.GetRequiredBool("enabled");
+            var hours = request.GetRequiredInt32("hours");
+            var minutes = request.GetRequiredInt32("minutes");

             using (var session = Context.Require<DatabasePlugin>().OpenSession())
             {
-                UserScript script;
+                SchedulerEvent schedulerEvent;

                 if (id.HasValue)
                 {
-                    script = session.Set<UserScript>().Single(s => s.Id == id.Value);
+                    schedulerEvent = session.Set<SchedulerEvent>().Single(s => s.Id == id.Value);
                 }
                 else
                 {
-                    script = new UserScript { Id = Guid.NewGuid() };
-                    session.Set<UserScript>().Add(script);
+                    schedulerEvent = new SchedulerEvent { Id = Guid.NewGuid() };
+                    session.Set<SchedulerEvent>().Add(schedulerEvent);
                 }

-                script.Name = name;
-                script.Body = body;
+                schedulerEvent.Name = name;
+                schedulerEvent.EventAlias = eventAlias;
+                schedulerEvent.Enabled = enabled;
+                schedulerEvent.Hours = hours;
+                schedulerEvent.Minutes = minutes;
                 session.SaveChanges();
+
+                // reset scheduler event cache
+                Context.Require<SchedulerPlugin>().ReloadTimes();

-                return script.Id;
+                return schedulerEvent.Id;
             }
         }

-        [WebApiMethod("/api/scripts/web-api/delete")]
-        public object DeleteScript(HttpRequestParams request)
+        [WebApiMethod("/api/scheduler/web-api/delete")]
+        public object DeleteSchedulerEvent(HttpRequestParams request)
         {
             var id = request.GetRequiredGuid("id");

             using (var session = Context.Require<DatabasePlugin>().OpenSession())
             {
-                var script = session.Set<UserScript>().Single(s => s.Id == id);
+                var schedulerEvent = session.Set<SchedulerEvent>().Single(s => s.Id == id);

-                session.Set<UserScript>().Remove(script);
+                session.Set<SchedulerEvent>().Remove(schedulerEvent);
                 session.SaveChanges();
+
+                // reset scheduler event cache
+                Context.Require<SchedulerPlugin>().ReloadTimes();
             }

             return null;
-        }
-
-        */
-
+        }
     }
 }


Changed status "Encoding" to "Processing" in order to not make people think, TL re-encodes the Twitch VOD

--- TwitchLeecher/TwitchLeecher.Services/Services/TwitchService.cs
+++ TwitchLeecher/TwitchLeecher.Services/Services/TwitchService.cs
@@ -997,7 +997,7 @@
         private void EncodeVideo(Action<string> log, Action<string> setStatus, Action<int> setProgress,
             Action<bool> setIsEncoding, string ffmpegFile, string playlistFile, string outputFile, CropInfo cropInfo)
         {
-            setStatus("Encoding");
+            setStatus("Processing");
             setIsEncoding(true);

             log(Environment.NewLine + Environment.NewLine + "Executing '" + ffmpegFile + "' on local playlist...");


rename var.

rename var.

--- WalletWasabi.Fluent/ViewModels/Settings/GeneralTabViewModel.cs
+++ WalletWasabi.Fluent/ViewModels/Settings/GeneralTabViewModel.cs
@@ -14,7 +14,7 @@
 	public class GeneralTabViewModel : SettingsTabViewModelBase
 	{
 		private bool _darkModeEnabled;
-		private bool _autocopy;
+		private bool _autoCopy;
 		private bool _customFee;
 		private bool _customChangeAddress;
 		private FeeDisplayFormat _selectedFeeDisplayFormat;
@@ -25,7 +25,7 @@
 			this.ValidateProperty(x => x.DustThreshold, ValidateDustThreshold);

 			_darkModeEnabled = uiConfig.DarkModeEnabled;
-			_autocopy = uiConfig.Autocopy;
+			_autoCopy = uiConfig.Autocopy;
 			_customFee = uiConfig.IsCustomFee;
 			_customChangeAddress = uiConfig.IsCustomChangeAddress;
 			_selectedFeeDisplayFormat = Enum.IsDefined(typeof(FeeDisplayFormat), uiConfig.FeeDisplayFormat)
@@ -76,8 +76,8 @@

 		public bool Autocopy
 		{
-			get => _autocopy;
-			set => this.RaiseAndSetIfChanged(ref _autocopy, value);
+			get => _autoCopy;
+			set => this.RaiseAndSetIfChanged(ref _autoCopy, value);
 		}

 		public bool CustomFee


add closing method

add closing method

--- WalletWasabi.Gui/CrashReporter/Views/CrashReportWindow.xaml.cs
+++ WalletWasabi.Gui/CrashReporter/Views/CrashReportWindow.xaml.cs
@@ -1,3 +1,5 @@
+using System;
+using System.ComponentModel;
 using Avalonia;
 using Avalonia.Markup.Xaml;
 using AvalonStudio.Shell.Controls;
@@ -13,7 +15,12 @@
 #if DEBUG
 			this.AttachDevTools();
 #endif
+			Closing += CrashReportWindow_ClosingAsync;
+		}

+		private void CrashReportWindow_ClosingAsync(object sender, CancelEventArgs e)
+		{
+			Environment.Exit(0);
 		}

 		private void InitializeComponent()


# UI Improvement for Logistics: - None Reported Transporters View

--- Web/Areas/Logistics/Views/Home/NoneReportedTransporters.cshtml
+++ Web/Areas/Logistics/Views/Home/NoneReportedTransporters.cshtml
@@ -1,76 +1,60 @@
-@{
+@using Cats.Helpers
+@{
     ViewBag.Title = "None Reported Transporters";
-    Layout = "~/Views/Shared/_MainLayoutWide.cshtml";
+    //Layout = "~/Views/Shared/_MainLayoutWide.cshtml";
+    Layout = "~/Views/Shared/NewTheme _MainLayout.cshtml";
+    ViewBag.PageTitle = Html.Translate("None Reported Transporters");
+    ViewBag.PageTitleDescription = "";
 }

-
None Reported Transporters

-

-

-
-

-

-

-

-
-                                Transporters which did not report back completely to DRMFSS
-

-
-

-
-
-
-

-

-

-

-                                        Number
-
-                                        Transporter
-                                        Bid Number
-                                        FDP
-                                        Dispatched Date
-

-

-

-

-                                        {{$index + 1}}
-
-                                        {{req.TransporterName}}
-                                        {{req.BidNo}}
-                                        {{req.FDPName}}
-                                        {{req.DispatchedDate}}
-
-

-

-

-
-

-
+

+

+

+

+
 @Html.Translate("Transporters which did not report back completely to DRMFSS")

+                    @*

*@
+

+                        @* @Html.Translate("Show Details")*@
+

-
-

-
-
-
+

+

+

+

+                                Number
+                                Transporter
+                                Bid Number
+                                FDP
+                                Dispatched Date
+

+

+

+

+                                {{$index + 1}}
+                                {{req.TransporterName}}
+                                {{req.BidNo}}
+                                {{req.FDPName}}
+                                {{req.DispatchedDate}}
+

+

+

+

+

+


IIS Multiple PHP handler fixes (from forum thread)

--- WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs
+++ WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs
@@ -4542,26 +4542,50 @@

         #region Php Management

+        protected void AddUniquePhpHandlerToList(List<PhpVersion> result, ConfigurationElement handler)
+        {
+            if (string.Equals(handler["path"].ToString(), "*.php", StringComparison.OrdinalIgnoreCase))
+            {
+                var executable = handler["ScriptProcessor"].ToString().Split('|')[0];
+                if (string.Equals(handler["Modules"].ToString(), "FastCgiModule", StringComparison.OrdinalIgnoreCase) && File.Exists(executable))
+                {
+                    var handlerName = handler["Name"].ToString();
+                    if (!result.Exists(v => v.HandlerName == handlerName && v.ExecutionPath == handler["ScriptProcessor"].ToString()))
+                    {
+                        result.Add(new PhpVersion() { HandlerName = handlerName, Version = GetPhpExecutableVersion(executable), ExecutionPath = handler["ScriptProcessor"].ToString() });
+                    }
+                }
+            }
+        }
+
 	    protected PhpVersion[] GetPhpVersions(ServerManager srvman, WebVirtualDirectory virtualDir)
 	    {
-	        var config = srvman.GetWebConfiguration(GetSiteIdFromVirtualDir(virtualDir), virtualDir.VirtualPath);
-	        //var config = srvman.GetApplicationHostConfiguration();
-	        var handlersSection = config.GetSection(Constants.HandlersSection);
-
 	        var result = new List<PhpVersion>();

-	        // Loop through available maps and fill installed processors
+	        // Loop through all available maps installed for virtualDir, site and server and and fill installed processors
+            var config = srvman.GetWebConfiguration(GetSiteIdFromVirtualDir(virtualDir), virtualDir.VirtualPath);
+            var handlersSection = config.GetSection(Constants.HandlersSection);
 	        foreach (var handler in handlersSection.GetCollection())
 	        {
-	            if (string.Equals(handler["path"].ToString(), "*.php", StringComparison.OrdinalIgnoreCase))
-	            {
-	                var executable = handler["ScriptProcessor"].ToString().Split('|')[0];
-	                if (string.Equals(handler["Modules"].ToString(), "FastCgiModule", StringComparison.OrdinalIgnoreCase) && File.Exists(executable))
-	                {
-	                    var handlerName = handler["Name"].ToString();
-	                    result.Add(new PhpVersion() {HandlerName = handlerName, Version = GetPhpExecutableVersion(executable), ExecutionPath = handler["ScriptProcessor"].ToString()});
-	                }
-	            }
+                AddUniquePhpHandlerToList(result, handler);
+	        }
+
+            if (!(virtualDir is WebSite))
+            {
+                var siteConfig = srvman.GetWebConfiguration(GetSiteIdFromVirtualDir(virtualDir), "/");
+                var siteHandlersSection = siteConfig.GetSection(Constants.HandlersSection);
+
+                foreach (var handler in siteHandlersSection.GetCollection())
+                {
+                    AddUniquePhpHandlerToList(result, handler);
+                }
+            }
+
+	        var srvConfig = srvman.GetApplicationHostConfiguration();
+            var srvHandlersSection = srvConfig.GetSection(Constants.HandlersSection);
+            foreach (var handler in srvHandlersSection.GetCollection())
+	        {
+                AddUniquePhpHandlerToList(result, handler);
 	        }

 	        return result.ToArray();
@@ -4612,11 +4636,42 @@
 	            var handlersCollection = handlersSection.Handlers;

 	            var handlerElement = handlersCollection[handlerName];
+
+                var updatingHandlerOrder = true;
+
+                if (handlerElement == null)
+                {
+                    // If handlerElement is null it is not found in the current virtual dirs handlers collection,
+                    // search in site config and in server config and add the new handler
+                    updatingHandlerOrder = false;
+
+                    if (!(virtualDir is WebSite))
+                    {
+                        var siteConfig = srvman.GetWebConfiguration(GetSiteIdFromVirtualDir(virtualDir), "/");
+                        var siteHandlersSection = (HandlersSection)siteConfig.GetSection(Constants.HandlersSection, typeof(HandlersSection));
+                        var siteHandlersCollection = siteHandlersSection.Handlers;
+
+                        handlerElement = siteHandlersCollection[handlerName];
+                    }
+                }
+
+                if (handlerElement == null)
+                {
+                    var serverConfig = srvman.GetApplicationHostConfiguration();
+                    var serverHandlersSection = (HandlersSection)serverConfig.GetSection(Constants.HandlersSection, typeof(HandlersSection));
+                    var serverHandlersCollection = serverHandlersSection.Handlers;
+
+                    handlerElement = serverHandlersCollection[handlerName];
+                }
+
                 var activeHandlerElement = handlersCollection[GetActivePhpHandlerName(srvman, virtualDir)];

                 var activeHandlerIndex = handlersCollection.IndexOf(activeHandlerElement);
-
-                handlersCollection.Remove(handlerElement);
+
+                if (updatingHandlerOrder)
+                {
+                    handlersCollection.Remove(handlerElement);
+                }

                 handlersCollection.AddCopyAt(activeHandlerIndex, handlerElement);


Attempt to get rendering right

Attempt to get rendering right

--- cli-samples-master/Speakr/Controllers/SubmissionsController.cs
+++ cli-samples-master/Speakr/Controllers/SubmissionsController.cs
@@ -3,6 +3,7 @@
 using System.Linq;
 using System.Threading.Tasks;
 using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.Rendering;
 using Speakr.Models;

 // For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860


stop using InvalidOperationException inappropriately

--- src/internal/target-runner.csx
+++ src/internal/target-runner.csx
@@ -22,7 +22,7 @@
         Target target;
         if (!targets.TryGetValue(name, out target))
         {
-            throw new InvalidOperationException($"Target '{name}' not found.");
+            throw new Exception($"Target '{name}' not found.");
         }

         targetsRan.Add(name);


Update comments

Update comments

--- notepad/Notepad.cs
+++ notepad/Notepad.cs
@@ -367,6 +367,11 @@
         }
 		#endregion

+		/// <summary>
+		/// Open the search form, but show the replace functionality straight away
+		/// </summary>
+		/// <param name="sender"></param>
+		/// <param name="e"></param>
 		private void searchReplaceToolStripMenuItem_Click(object sender, EventArgs e) {
 			var search = new Search(textArea, this, true);
 			search.Show();


Added Java-specific handling of enums to generator.

--- binder/Generators/Java/JavaSources.cs
+++ binder/Generators/Java/JavaSources.cs
@@ -72,6 +72,54 @@

         public override bool VisitEnumDecl(Enumeration @enum)
         {
+            if (@enum.IsIncomplete)
+                return true;
+
+            PushBlock(CSharpBlockKind.Enum);
+            GenerateDeclarationCommon(@enum);
+
+            //Write(Helpers.GetAccess(@enum.Access));
+            Write("enum {0}", SafeIdentifier(@enum.Name));
+
+            //var typeName = TypePrinter.VisitPrimitiveType(@enum.BuiltinType.Type,
+            //                                              new TypeQualifiers());
+
+            //if (@enum.BuiltinType.Type != PrimitiveType.Int)
+            //    Write(" : {0}", typeName);
+
+            NewLine();
+
+            WriteStartBraceIndent();
+            GenerateEnumItems(@enum);
+
+            NewLine();
+            WriteLine("private final int id;");
+            WriteLine($"{@enum.Name}(int id) {{ this.id = id; }}");
+            WriteLine("public int getValue() { return id; }");
+
+            WriteCloseBraceIndent();
+            PopBlock(NewLineKind.BeforeNextBlock);
+
+            return true;
+        }
+
+        public override void GenerateEnumItems(Enumeration @enum)
+        {
+            base.GenerateEnumItems(@enum);
+            WriteLine(";");
+        }
+
+        public override bool VisitEnumItemDecl(Enumeration.Item item)
+        {
+            if (item.Comment != null)
+                GenerateInlineSummary(item.Comment);
+
+            Write(item.Name);
+
+            var @enum = item.Namespace as Enumeration;
+            if (item.ExplicitValue)
+                Write("({0})", @enum.GetItemValueAsString(item));
+
             return true;
         }


[java] Implementation of native method invocation with parameters and return marshaling.

--- binder/Generators/Java/JavaSources.cs
+++ binder/Generators/Java/JavaSources.cs
@@ -263,15 +263,9 @@
             else
             {
                 Write(" ");
-
                 WriteStartBraceIndent();

-                PrimitiveType primitive;
-                var isPrimitive = method.OriginalReturnType.Type.IsPrimitiveType(out primitive);
-
-                var hasReturn = primitive != PrimitiveType.Void;
-                if ((!(method.IsConstructor || method.IsDestructor)) && hasReturn)
-                    GenerateMethodReturn(method);
+                GenerateMethodInvocation(method);

                 WriteCloseBraceIndent();
             }
@@ -281,57 +275,76 @@
             return true;
         }

-        public void GenerateMethodReturn(Method method)
-        {
+        public void GenerateMethodInvocation(Method method)
+        {
+            var contexts = new List<MarshalContext>();
+            var @params = new List<string>();
+
+            if (!method.IsStatic && !(method.IsConstructor || method.IsDestructor))
+                @params.Add("__object");
+
+            int paramIndex = 0;
+            foreach (var param in method.Parameters.Where(m => !m.IsImplicit))
+            {
+                var ctx = new MarshalContext(Context)
+                {
+                    ArgName = param.Name,
+                    Parameter = param,
+                    ParameterIndex = paramIndex++
+                };
+                contexts.Add(ctx);
+
+                var marshal = new JavaMarshalManagedToNative(ctx);
+                param.QualifiedType.Visit(marshal);
+
+                if (!string.IsNullOrWhiteSpace(marshal.Context.SupportBefore))
+                        Write(marshal.Context.SupportBefore);
+
+                @params.Add(marshal.Context.Return);
+            }
+
             PrimitiveType primitive;
-            var isPrimitive = method.OriginalReturnType.Type.IsPrimitiveType(out primitive);
-
-            if (primitive == PrimitiveType.Void)
-                return;
-
-            if (!isPrimitive)
-            {
-                WriteLine("return null;");
-                return;
-            }
-
-            switch (primitive)
-            {
-                case PrimitiveType.Null:
-                    WriteLine("return null;");
-                    break;
-                case PrimitiveType.Bool:
-                    WriteLine("return false;");
-                    break;
-                case PrimitiveType.Char:
-                    WriteLine("return Character.MIN_VALUE;");
-                    break;
-                case PrimitiveType.UChar:
-                    WriteLine("return new UnsignedByte(0);");
-                    break;
-                case PrimitiveType.SChar:
-                case PrimitiveType.Short:
-                case PrimitiveType.Int:
-                case PrimitiveType.Long:
-                case PrimitiveType.LongLong:
-                    WriteLine($"return 0;");
-                    break;
-                case PrimitiveType.UShort:
-                case PrimitiveType.UInt:
-                case PrimitiveType.ULong:
-                    var name = primitive.ToString();
-                    WriteLine($"return new Unsigned{name.Substring(1)}(0);");
-                    break;
-                case PrimitiveType.Float:
-                case PrimitiveType.Double:
-                    WriteLine("return 0.0f;");
-                    break;
-                case PrimitiveType.String:
-                    WriteLine("return new String(\"\");");
-                    break;
-                case PrimitiveType.ULongLong:
-                default:
-                    throw new System.NotImplementedException();
+            method.ReturnType.Type.IsPrimitiveType(out primitive);
+
+            var hasReturn = primitive != PrimitiveType.Void && !(method.IsConstructor || method.IsDestructor);
+            if (hasReturn)
+            {
+                var typeName = method.ReturnType.Visit(TypePrinter);
+                Write("{0} __ret = ", typeName.Type);
+            }
+
+            var unit = method.TranslationUnit;
+            var package = string.Join(".", GetPackageNames(unit));
+            Write($"{package}.{JavaNative.GetNativeLibClassName(unit)}.INSTANCE.{JavaNative.GetCMethodIdentifier(method)}(");
+
+            Write(string.Join(", ", @params));
+
+            WriteLine(");");
+
+            foreach (var marshal in contexts)
+            {
+                if (!string.IsNullOrWhiteSpace(marshal.SupportAfter))
+                    Write(marshal.SupportAfter);
+            }
+
+            if (hasReturn)
+            {
+                var ctx = new MarshalContext(Context)
+                {
+                    ReturnType = method.ReturnType,
+                    ReturnVarName = "__ret"
+                };
+
+                var marshal = new JavaMarshalNativeToManaged(ctx);
+                method.ReturnType.Visit(marshal);
+
+                if (marshal.Context.Return.ToString().Length == 0)
+                    throw new System.Exception();
+
+                if (!string.IsNullOrWhiteSpace(marshal.Context.SupportBefore))
+                        Write(marshal.Context.SupportBefore);
+
+                WriteLine($"return {marshal.Context.Return};");
             }
         }


Updated to handle serialization scenarios

--- cslatest/Csla.Test/CslaQueryProvider/CslaQueryProviderTests.cs
+++ cslatest/Csla.Test/CslaQueryProvider/CslaQueryProviderTests.cs
@@ -15,6 +15,7 @@

 namespace Csla.Test.CslaQueryProvider
 {
+  [Serializable]
   public class RandomThing : BusinessBase<RandomThing>, IConvertible
   {
     [Indexable(IndexModeEnum.IndexModeAlways)]
@@ -117,6 +118,7 @@
     #endregion
   }

+  [Serializable]
   class CollectionExtendingIQueryable<T> : BusinessListBase<CollectionExtendingIQueryable<T>, T> where T : Csla.Core.IEditableBusinessObject { }

   class CustomRandomThingComparer : IEqualityComparer<RandomThing>
@@ -286,6 +288,30 @@
                               select r.SomeVal;
       foreach (var result in subFilteredResult)
         Assert.IsTrue(result is int);
+    }
+
+    [TestMethod]
+    public void TestQueryProviderSelectProjectionWithSerialization()
+    {
+      CollectionExtendingIQueryable<RandomThing> randomBase = new CollectionExtendingIQueryable<RandomThing>();
+      var random = randomBase.Clone();
+
+      Random rnd = new Random();
+      for (int i = 0; i < 99; i++)
+        random.Add(new RandomThing(rnd.Next(300)));
+
+      var filteredResult = from r in random
+                           where r.SomeVal < 100
+                           select r;
+
+      foreach (var result in filteredResult)
+        Assert.IsTrue(result is RandomThing);
+
+      var subFilteredResult = from r in filteredResult
+                              where r.SomeVal < 50
+                              select r.SomeVal;
+      foreach (var result in subFilteredResult)
+        Assert.IsTrue(result is int);
     }

     [TestMethod]


Rename the ___<P,F> overloads to __Convert<P,F> to allow for better type inference by the compiler.

--- cslalightcs/Csla/Core/BusinessBase.cs
+++ cslalightcs/Csla/Core/BusinessBase.cs
@@ -585,7 +585,7 @@
     /// value, the defaultValue value is returned as a
     /// result.
     /// </remarks>
-    protected P GetProperty<F, P>(PropertyInfo<F> propertyInfo, F field)
+    protected P GetPropertyConvert<F, P>(PropertyInfo<F> propertyInfo, F field)
     {
       return Utilities.CoerceValue<P>(typeof(F), null, GetProperty<F>(propertyInfo.Name, field, propertyInfo.DefaultValue, Security.NoAccessBehavior.SuppressException));
     }
@@ -612,7 +612,7 @@
     /// value, the defaultValue value is returned as a
     /// result.
     /// </remarks>
-    protected P GetProperty<F, P>(PropertyInfo<F> propertyInfo, F field, Security.NoAccessBehavior noAccess)
+    protected P GetPropertyConvert<F, P>(PropertyInfo<F> propertyInfo, F field, Security.NoAccessBehavior noAccess)
     {
       return Utilities.CoerceValue<P>(typeof(F), null, GetProperty<F>(propertyInfo.Name, field, propertyInfo.DefaultValue, noAccess));
     }
@@ -654,7 +654,7 @@
     /// value, the defaultValue value is returned as a
     /// result.
     /// </remarks>
-    protected P GetProperty<F, P>(PropertyInfo<F> propertyInfo)
+    protected P GetPropertyConvert<F, P>(PropertyInfo<F> propertyInfo)
     {
       return Utilities.CoerceValue<P>(typeof(F), null, GetProperty<F>(propertyInfo, Security.NoAccessBehavior.SuppressException));
     }
@@ -680,7 +680,7 @@
     /// value, the defaultValue value is returned as a
     /// result.
     /// </remarks>
-    protected P GetProperty<F, P>(PropertyInfo<F> propertyInfo, Security.NoAccessBehavior noAccess)
+    protected P GetPropertyConvert<F, P>(PropertyInfo<F> propertyInfo, Security.NoAccessBehavior noAccess)
     {
       return Utilities.CoerceValue<P>(typeof(F), null, GetProperty<F>(propertyInfo, noAccess));
     }
@@ -757,7 +757,7 @@
     /// </typeparam>
     /// <param name="propertyInfo">
     /// PropertyInfo object containing property metadata.</param>
-    protected P ReadProperty<F, P>(PropertyInfo<F> propertyInfo)
+    protected P ReadPropertyConvert<F, P>(PropertyInfo<F> propertyInfo)
     {
       return Utilities.CoerceValue<P>(typeof(F), null, ReadProperty<F>(propertyInfo));
     }
@@ -869,9 +869,9 @@
     /// If the user is not authorized to change the property, this
     /// overload throws a SecurityException.
     /// </remarks>
-    protected void SetProperty<P, V>(PropertyInfo<P> propertyInfo, ref P field, V newValue)
-    {
-      SetProperty<P, V>(propertyInfo, ref field, newValue, Security.NoAccessBehavior.ThrowException);
+    protected void SetPropertyConvert<P, V>(PropertyInfo<P> propertyInfo, ref P field, V newValue)
+    {
+      SetPropertyConvert<P, V>(propertyInfo, ref field, newValue, Security.NoAccessBehavior.ThrowException);
     }

     /// <summary>
@@ -898,7 +898,7 @@
     /// If the field value is of type string, any incoming
     /// null values are converted to string.Empty.
     /// </remarks>
-    protected void SetProperty<P, V>(PropertyInfo<P> propertyInfo, ref P field, V newValue, Security.NoAccessBehavior noAccess)
+    protected void SetPropertyConvert<P, V>(PropertyInfo<P> propertyInfo, ref P field, V newValue, Security.NoAccessBehavior noAccess)
     {
       SetProperty<P, V>(propertyInfo.Name, ref field, newValue, noAccess);
     }
@@ -1034,9 +1034,9 @@
     /// If the user is not authorized to change the property, this
     /// overload throws a SecurityException.
     /// </remarks>
-    protected void SetProperty<P, F>(PropertyInfo<P> propertyInfo, F newValue)
-    {
-      SetProperty<P, F>(propertyInfo, newValue, Security.NoAccessBehavior.ThrowException);
+    protected void SetPropertyConvert<P, F>(PropertyInfo<P> propertyInfo, F newValue)
+    {
+      SetPropertyConvert<P, F>(propertyInfo, newValue, Security.NoAccessBehavior.ThrowException);
     }

     /// <summary>
@@ -1051,7 +1051,7 @@
     /// <param name="noAccess">
     /// True if an exception should be thrown when the
     /// user is not authorized to change this property.</param>
-    protected void SetProperty<P, F>(PropertyInfo<P> propertyInfo, F newValue, Security.NoAccessBehavior noAccess)
+    protected void SetPropertyConvert<P, F>(PropertyInfo<P> propertyInfo, F newValue, Security.NoAccessBehavior noAccess)
     {
       //if (CanWriteProperty(propertyInfo.Name, noAccess == Security.NoAccessBehavior.ThrowException))
       //{
@@ -1163,7 +1163,7 @@
     /// Loading values does not cause validation rules to be
     /// invoked.
     /// </remarks>
-    protected void LoadProperty<P, F>(PropertyInfo<P> propertyInfo, F newValue)
+    protected void LoadPropertyConvert<P, F>(PropertyInfo<P> propertyInfo, F newValue)
     {
       try
       {


Почистил старые float'ы

Почистил старые float'ы


Added _OppositePlayer reference

Added _OppositePlayer reference

--- Assets/Scripts/Game/Player.cs
+++ Assets/Scripts/Game/Player.cs
@@ -10,6 +10,7 @@
     public Hand _Hand;
     public Deck _Deck;
     public InPlay _InPlay;
+    public Player _OppositePlayer;

     public Transform StartingCharacter; //Set by main menu? GameObject?


Refactored to collections equality assertion

--- BTDBTest/ObjectDbTableTest.cs
+++ BTDBTest/ObjectDbTableTest.cs
@@ -2125,16 +2125,12 @@
         [Fact]
         public void PossibleToEnumerateRelations()
         {
-            void CheckRelationTypes(IEnumerable<Type> types)
-            {
-                var a = types.ToArray();
-
-                Assert.Equal(3, a.Length);
-
-                Assert.Equal(typeof(IPersonTable), a[0]);
-                Assert.Equal(typeof(IJobTable), a[1]);
-                Assert.Equal(typeof(ILicTable), a[2]);
-            }
+            var expected = new List<Type>
+            {
+                typeof(IPersonTable),
+                typeof(IJobTable),
+                typeof(ILicTable)
+            };

             void InitRelations(IObjectDBTransaction transaction)
             {
@@ -2146,13 +2142,13 @@
             using (var tr = _db.StartTransaction())
             {
                 InitRelations(tr);
-                CheckRelationTypes(tr.EnumerateRelationTypes());
-                tr.Commit();
-            }
-
-            using (var tr = _db.StartTransaction())
-            {
-                CheckRelationTypes(tr.EnumerateRelationTypes());
+                Assert.Equal(expected, tr.EnumerateRelationTypes());
+                tr.Commit();
+            }
+
+            using (var tr = _db.StartTransaction())
+            {
+                Assert.Equal(expected, tr.EnumerateRelationTypes());
             }

             ReopenDb();
@@ -2160,7 +2156,7 @@
             using (var tr = _db.StartTransaction())
             {
                 InitRelations(tr);
-                CheckRelationTypes(tr.EnumerateRelationTypes());
+                Assert.Equal(expected, tr.EnumerateRelationTypes());
             }
         }


bindings: csharp: Add iio.Device.hwmon property

This readonly property will be True if the device is a hardware
monitoring device, False if it is a IIO device.

Signed-off-by: Paul Cercueil <a027184a55211cd23e3f3094f1fdc728df5e0500@crapouillou.net>

--- bindings/csharp/Device.cs
+++ bindings/csharp/Device.cs
@@ -210,6 +210,9 @@
         /// The label of this device.
         public string label { get; private set; }

+        /// True if the device is a hardware monitoring device, False if it is a IIO device.
+        public bool hwmon { get; private set; }
+
         /// A <c>list</c> of all the attributes that this device has.
         public readonly List<Attr> attrs;

@@ -271,6 +274,7 @@
             IntPtr label_ptr = iio_device_get_label(dev);

             label = label_ptr == IntPtr.Zero ? "" : Marshal.PtrToStringAnsi(label_ptr);
+            hwmon = id[0] == 'h';
         }

         /// Get the <see cref="iio.Channel"/> object of the specified name.


allow blobs in object-src CSP

allow blobs in object-src CSP

--- util/Setup/NginxConfigBuilder.cs
+++ util/Setup/NginxConfigBuilder.cs
@@ -10,7 +10,8 @@
             "default-src 'self'; style-src 'self' 'unsafe-inline'; " +
             "img-src 'self' data: https://haveibeenpwned.com https://www.gravatar.com; " +
             "child-src 'self' https://*.duosecurity.com; frame-src 'self' https://*.duosecurity.com; " +
-            "connect-src 'self' wss://{0} https://haveibeenpwned.com https://api.pwnedpasswords.com;";
+            "connect-src 'self' wss://{0} https://haveibeenpwned.com https://api.pwnedpasswords.com; " +
+            "object-src 'self' blob:;";

         private readonly Context _context;


Began implementing ActionKey enum

Began implementing ActionKey enum

Began implementing ActionKey enum.


Fix an issue error thrown when saving autorun setting and the key is empty.

--- CreviceApp/UI.LauncherForm.cs
+++ CreviceApp/UI.LauncherForm.cs
@@ -56,21 +56,24 @@
                 else
                 {
                     var registry = AutorunRegistry();
-                    try
+                    if (registry.GetValue(Application.ProductName) != null)
                     {
-                        registry.DeleteValue(Application.ProductName);
-                        Verbose.Print("Autorun was set to false");
-                    }
-                    catch (ArgumentException ex)
-                    {
-                        Verbose.Error("An exception was thrown while writing registory value: {0}", ex.ToString());
+                        try
+                        {
+                            registry.DeleteValue(Application.ProductName);
+                            Verbose.Print("Autorun was set to false");
+                        }
+                        catch (ArgumentException ex)
+                        {
+                            Verbose.Error("An exception was thrown while writing registory value: {0}", ex.ToString());
+                        }
                     }
                     registry.Close();
                 }
             }
         }

-        private void saveSettings()
+        private void SaveSettings()
         {
             AutoRun = checkBox1.Checked;
         }
@@ -103,7 +106,7 @@

         protected override void OnClosing(CancelEventArgs e)
         {
-            saveSettings();
+            SaveSettings();
             base.OnClosing(e);
         }


configurability of IRC channels too

configurability of IRC channels too


Consolidated the closing path logic in PathScan.


pull members up to interface

pull members up to interface

--- dotnet/FreieWahl/FreieWahl.Voting/Storage/IVotingStore.cs
+++ dotnet/FreieWahl/FreieWahl.Voting/Storage/IVotingStore.cs
@@ -19,5 +19,13 @@
         Task<IEnumerable<StandardVoting>> GetAll();

         void ClearAll();
+
+        Task AddQuestion(long votingId, Question question);
+
+        Task DeleteQuestion(long votingId, long questionId);
+
+        Task ClearQuestions(long votingId);
+
+        Task UpdateQuestion(long votingId, Question question);
     }
 }


dotnetcore

dotnetcore

--- src2/SpentBook.Web/Program.cs
+++ src2/SpentBook.Web/Program.cs
@@ -7,6 +7,7 @@
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Logging;
+using SysCommand.ConsoleApp;

 namespace SpentBook.Web
 {
@@ -14,6 +15,7 @@
     {
         public static void Main(string[] args)
         {
+            App.RunApplication();
             BuildWebHost(args).Run();
         }


RSA加密 Signed-off-by: virtual <1185513330@qq.com>

RSA加密
Signed-off-by: virtual <89ab707496410b11c2fba8f5ec0112cf133af8fd@qq.com>

--- test/DotCommon.Test/Encrypt/RsaEncryptorTest.cs
+++ test/DotCommon.Test/Encrypt/RsaEncryptorTest.cs
@@ -65,6 +65,10 @@
             var signed2 = rsa2Encrypter.SignData(str);
             Assert.True(rsa2Encrypter.VerifyData(str, signed2));

+            var sign = rsa2Encrypter.SignData("a=123");
+
+            var expected = @"Cm6L1nwSKn4h1V1CORIYFDo2lPT4gLQtSy9+ZDKQUlq/xyB4B23jmoMy8ecPwi7e8U9RC528T5aRL6ksBFommyGLaTGjrucABjF42wL+lG3Lks7xZ5mhiV4BbCzRfU7DGuI5c6f9xvdpFumT/mQdRZtIFOUCdQCx/oDTSJQ3vNZYoFY02lfnwhMQziQ50YWqodOy1E8JeWZ3R3dovDj1NyHF5OExpuWa0OyWIkuI279waHm92pyet7tb5jzS0lTpq5rSrhG0wb2qhFYedQO87+c6Yusrhghvql4XJ2zEcA9vQvw3nepiuBG9DBm0A2B8GPUlG2gsJHClflEIZQ806A==";
+            Assert.Equal(expected, sign);
         }
     }
 }


dev: add some more scenario tests for Experiment.AutoFixture.

--- test/Experiment.AutoFixtureUnitTest/Scenario.cs
+++ test/Experiment.AutoFixtureUnitTest/Scenario.cs
@@ -1,10 +1,28 @@
 using System;
+using System.Collections.Generic;
+using System.Reflection;
 using Xunit;
+using Xunit.Extensions;

 namespace Jwc.Experiment
 {
     public class Scenario
     {
+        [Theorem]
+        public void TheoremSupportsNonParameterizedTest()
+        {
+            Assert.True(true, "excuted.");
+        }
+
+        [Theorem]
+        [InlineData("expected", 1234)]
+        [ParameterizedTestData]
+        public void TheoremSupportsParameterizedTest(string arg1, int arg2)
+        {
+            Assert.Equal("expected", arg1);
+            Assert.Equal(1234, arg2);
+        }
+
         [Theorem]
         public void TheoremSupportsParameterizedTestWithAutoData(
             string arg1, Type arg2)
@@ -12,5 +30,22 @@
             Assert.NotNull(arg1);
             Assert.NotNull(arg2);
         }
+
+        [Theorem]
+        [InlineData("expected")]
+        public void TheoremSupportsParameterizedTestWithMixedData(
+            string arg1, object arg2)
+        {
+            Assert.Equal("expected", arg1);
+            Assert.NotNull(arg2);
+        }
+
+        private class ParameterizedTestDataAttribute : DataAttribute
+        {
+            public override IEnumerable<object[]> GetData(MethodInfo methodUnderTest, Type[] parameterTypes)
+            {
+                yield return new object[] { "expected", 1234 };
+            }
+        }
     }
 }


dev: Person modest 생성자로 만들어진 객체는 Age가 0임.

--- test/Experiment.AutoFixtureUnitTest/Scenario.cs
+++ test/Experiment.AutoFixtureUnitTest/Scenario.cs
@@ -53,6 +53,7 @@
             [Modest] Person person)
         {
             Assert.Null(person.Name);
+            Assert.Equal(0, person.Age);
         }

         [Theorem]


Test URL parsing error handling

Test URL parsing error handling

--- test/Host.UnitTests/Routing/NodeBuilderTests.cs
+++ test/Host.UnitTests/Routing/NodeBuilderTests.cs
@@ -148,7 +148,8 @@
                 QueryCapture query = result.QueryCaptures.Single();

                 query.ParseParameters(lookup, dictionary);
-                dictionary["capture"].Should().Be("value");
+                dictionary.Should().ContainKey("capture")
+                          .WhichValue.Should().Be("value");
             }

             [Fact]
@@ -166,26 +167,25 @@
                 action.Should().Throw<InvalidOperationException>();
             }

-            [Fact]
-            public void ShouldThrowFormatExceptionForParsingErrors()
-            {
-                // No need to test the parsing, as that's handled by UrlParse,
-                // just test that we don't silently ignore errors
-                Action action = () => this.builder.Parse("", "{missing brace", new ParameterInfo[0]);
-
-                action.Should().Throw<FormatException>();
-            }
-
-            [Fact]
-            public void ShouldThrowFormatExceptionForParsingParemeterErrors()
+            [Theory]
+            [InlineData("/{param}/{param}", "multiple")]
+            [InlineData("/{param", "closing brace")]
+            [InlineData("/route?queryKeyOnly", "query value")]
+            [InlineData("/route?query={param}", "optional")]
+            [InlineData("/route?query=literal", "capture")]
+            [InlineData("/route", "missing")]
+            [InlineData("/unescaped{brace", "brace")]
+            [InlineData("/{unkownParameter}", "parameter")]
+            public void ShouldThrowFormatExceptionForParsingErrors(string url, string error)
             {
                 ParameterInfo param = CreateParameter<string>("param");

                 // No need to test the parsing, as that's handled by UrlParse,
                 // just test that we don't silently ignore parameter errors
-                Action action = () => this.builder.Parse("", "/unused_parameter/", new[] { param });
-
-                action.Should().Throw<FormatException>();
+                Action action = () => this.builder.Parse("", url, new[] { param });
+
+                action.Should().Throw<FormatException>()
+                      .WithMessage("*" + error + "*");
             }

             private static NodeMatchResult GetMatch(NodeBuilder.IParseResult result, string value)


Rename method to be less misleading

Rename method to be less misleading

Would rather avoid variations of Equals/Equal/IsEqual. There's not
really much equality involved as the types are different.

--- osu.Game/Online/Chat/ChannelManager.cs
+++ osu.Game/Online/Chat/ChannelManager.cs
@@ -472,10 +472,10 @@
                 closedChannels.RemoveAt(closedChannels.Count - 1);

                 // If the user has already joined the channel, try the next one
-                if (joinedChannels.FirstOrDefault(lastClosedChannel.IsEqual) != null)
+                if (joinedChannels.FirstOrDefault(lastClosedChannel.Matches) != null)
                     continue;

-                Channel lastChannel = AvailableChannels.FirstOrDefault(lastClosedChannel.IsEqual);
+                Channel lastChannel = AvailableChannels.FirstOrDefault(lastClosedChannel.Matches);

                 if (lastChannel != null)
                 {
@@ -596,7 +596,7 @@
             Id = id;
         }

-        public bool IsEqual(Channel channel)
+        public bool Matches(Channel channel)
         {
             if (channel.Type != Type) return false;


Update ack code after incorrect merge

Update ack code after incorrect merge

--- osu.Game/Online/Chat/ChannelManager.cs
+++ osu.Game/Online/Chat/ChannelManager.cs
@@ -116,20 +116,7 @@
             if (apiState.Value != APIState.Online)
                 return;

-            scheduledAck?.Cancel();
-
-            var req = new ChatAckRequest();
-            req.Success += _ => scheduleNextRequest();
-            req.Failure += _ => scheduleNextRequest();
-            api.Queue(req);
-
-            // Todo: Handle silences.
-
-            void scheduleNextRequest()
-            {
-                scheduledAck?.Cancel();
-                scheduledAck = Scheduler.AddDelayed(performChatAckRequest, 60000);
-            }
+            SendAck();
         }

         /// <summary>
@@ -416,6 +403,7 @@
                 SinceSilenceId = lastSilenceId
             };

+            req.Failure += _ => scheduleNextRequest();
             req.Success += ack =>
             {
                 foreach (var silence in ack.Silences)
@@ -424,9 +412,17 @@
                         channel.RemoveMessagesFromUser(silence.UserId);
                     lastSilenceId = Math.Max(lastSilenceId ?? 0, silence.Id);
                 }
+
+                scheduleNextRequest();
             };

             api.Queue(req);
+
+            void scheduleNextRequest()
+            {
+                scheduledAck?.Cancel();
+                scheduledAck = Scheduler.AddDelayed(performChatAckRequest, 60000);
+            }
         }

         /// <summary>


Fix hyperdashes not recalculated with HR application

--- osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs
+++ osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs
@@ -28,8 +28,6 @@

             ApplyPositionOffsets(Beatmap);

-            initialiseHyperDash((List<CatchHitObject>)Beatmap.HitObjects);
-
             int index = 0;

             foreach (var obj in Beatmap.HitObjects.OfType<CatchHitObject>())
@@ -90,6 +88,8 @@
                         break;
                 }
             }
+
+            initialiseHyperDash(beatmap);
         }

         private static void applyHardRockOffset(CatchHitObject hitObject, ref float? lastPosition, ref double lastStartTime, FastRandom rng)
@@ -191,14 +191,14 @@
             }
         }

-        private void initialiseHyperDash(List<CatchHitObject> objects)
+        private static void initialiseHyperDash(IBeatmap beatmap)
         {
             List<CatchHitObject> objectWithDroplets = new List<CatchHitObject>();

-            foreach (var currentObject in objects)
-            {
-                if (currentObject is Fruit)
-                    objectWithDroplets.Add(currentObject);
+            foreach (var currentObject in beatmap.HitObjects)
+            {
+                if (currentObject is Fruit fruitObject)
+                    objectWithDroplets.Add(fruitObject);

                 if (currentObject is JuiceStream)
                 {
@@ -212,7 +212,7 @@

             objectWithDroplets.Sort((h1, h2) => h1.StartTime.CompareTo(h2.StartTime));

-            double halfCatcherWidth = CatcherArea.GetCatcherSize(Beatmap.BeatmapInfo.BaseDifficulty) / 2;
+            double halfCatcherWidth = CatcherArea.GetCatcherSize(beatmap.BeatmapInfo.BaseDifficulty) / 2;
             int lastDirection = 0;
             double lastExcess = halfCatcherWidth;

@@ -220,6 +220,10 @@
             {
                 CatchHitObject currentObject = objectWithDroplets[i];
                 CatchHitObject nextObject = objectWithDroplets[i + 1];
+
+                // Reset variables in-case values have changed (e.g. after applying HR)
+                currentObject.HyperDashTarget = null;
+                currentObject.DistanceToHyperDash = 0;

                 int thisDirection = nextObject.X > currentObject.X ? 1 : -1;
                 double timeToNext = nextObject.StartTime - currentObject.StartTime - 1000f / 60f / 4; // 1/4th of a frame of grace time, taken from osu-stable


Return time value for Discover packet

Return time value for Discover packet

--- source/Cosmos.System2/Network/IPV4/UDP/DHCP/DHCPClient.cs
+++ source/Cosmos.System2/Network/IPV4/UDP/DHCP/DHCPClient.cs
@@ -71,7 +71,7 @@
             {
                 if (packet.RawData[284] == 0x02) //Offer packet received
                 {
-                    SendRequestPacket(packet.Client, packet.Server);
+                    return SendRequestPacket(packet.Client, packet.Server);
                 }
                 else if (packet.RawData[284] == 0x05 || packet.RawData[284] == 0x06) //ACK or NAK DHCP packet received
                 {
@@ -113,7 +113,8 @@
         /// <summary>
         /// Send a packet to find the DHCP server and tell that we want a new IP address
         /// </summary>
-        public void SendDiscoverPacket()
+        /// <returns>time value (-1 = timeout)</returns>
+        public int SendDiscoverPacket()
         {
             NetworkStack.RemoveAllConfigIP();

@@ -128,13 +129,14 @@
                 asked = true;
             }

-            Receive();
+            return Receive();
         }

         /// <summary>
         /// Send a request to apply the new IP configuration
         /// </summary>
-        private void SendRequestPacket(Address RequestedAddress, Address DHCPServerAddress)
+        /// <returns>time value (-1 = timeout)</returns>
+        private int SendRequestPacket(Address RequestedAddress, Address DHCPServerAddress)
         {
             foreach (NetworkDevice networkDevice in NetworkDevice.Devices)
             {
@@ -142,7 +144,7 @@
                 OutgoingBuffer.AddPacket(dhcp_request);
                 NetworkStack.Update();
             }
-            Receive();
+            return Receive();
         }

         /*


+Property setup to be explicit

+Property setup to be explicit

I guess the default array isn't null, but instead an empty one.

--- src/ArguMint/ArguMint.UnitTests/HandlerDispatcherTests.cs
+++ src/ArguMint/ArguMint.UnitTests/HandlerDispatcherTests.cs
@@ -82,6 +82,7 @@
          // Arrange

          var markedMethodMock = new Mock<IMarkedMethod<ArgumentErrorHandlerAttribute>>();
+         markedMethodMock.SetupGet( mm => mm.ParameterTypes ).Returns( new Type[0] );
          var markedMethods = ArrayHelper.Create( markedMethodMock.Object );

          var typeInspectorMock = new Mock<ITypeInspector>();


Fixed assembly cache loading (netstandard library)

--- src/DotVVM.Framework/Compilation/CompiledAssemblyCache.cs
+++ src/DotVVM.Framework/Compilation/CompiledAssemblyCache.cs
@@ -74,17 +74,25 @@
                     typeof(List<>).Assembly
 #endif
                 });
-
-            try
-            {
-                // netstandard assembly is required for netstandard 2.0 and in some cases
-                // for netframework461 and newer. netstandard is not included in netframework452
-                // and will throw FileNotFoundException. Instead of detecting current netframework
-                // version, the exception is swallowed.
-                references = references.Concat(new[] { Assembly.Load(new AssemblyName("netstandard")) });
-            }
-            catch (FileNotFoundException)
-            {
+
+
+            // Once netstandard assembly is loaded you cannot load it again!
+            var netstandardAssembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(a => a.GetName().Name == "netstandard");
+            if (netstandardAssembly != null)
+            {
+                references = references.Concat(new[] { netstandardAssembly });
+            }
+            else
+            {
+                try
+                {
+                    // netstandard assembly is required for netstandard 2.0 and in some cases
+                    // for netframework461 and newer. netstandard is not included in netframework452
+                    // and will throw FileNotFoundException. Instead of detecting current netframework
+                    // version, the exception is swallowed.
+                    references = references.Concat(new[] { Assembly.Load(new AssemblyName("netstandard")) });
+                }
+                catch (FileNotFoundException) { }
             }

             return references.Distinct().ToList();


Minor formatting fixes

Minor formatting fixes

--- src/NUnitFramework/framework/Internal/RuntimeFramework.cs
+++ src/NUnitFramework/framework/Internal/RuntimeFramework.cs
@@ -138,18 +138,18 @@
                 minor = 5;
             }

-            var currentFramework = new RuntimeFramework (runtime, new Version (major, minor))
-                {
+            var currentFramework = new RuntimeFramework( runtime, new Version (major, minor) )
+            {
                 ClrVersion = Environment.Version
-                };
+            };

             if (isMono)
-                {
-                    MethodInfo getDisplayNameMethod = monoRuntimeType.GetMethod(
-                        "GetDisplayName", BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.DeclaredOnly | BindingFlags.ExactBinding);
-                    if (getDisplayNameMethod != null)
-                        currentFramework.DisplayName = (string)getDisplayNameMethod.Invoke(null, new object[0]);
-                }
+            {
+                MethodInfo getDisplayNameMethod = monoRuntimeType.GetMethod(
+                    "GetDisplayName", BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.DeclaredOnly | BindingFlags.ExactBinding);
+                if (getDisplayNameMethod != null)
+                    currentFramework.DisplayName = (string)getDisplayNameMethod.Invoke(null, new object[0]);
+            }
 #endif
             return currentFramework;
         });


Fix cast

Fix cast

--- 200-logic-app/shared/mediaServicesHelpers.csx
+++ 200-logic-app/shared/mediaServicesHelpers.csx
@@ -33,20 +33,20 @@
 {
     IEnumerable<Uri> ValidURIs;
     var ismFile = asset.AssetFiles.AsEnumerable().Where(f => f.Name.EndsWith(".ism")).OrderByDescending(f => f.IsPrimary).FirstOrDefault();
-
+
     if (ismFile != null)
     {
         var locators = asset.Locators.Where(l => l.Type == LocatorType.OnDemandOrigin && l.ExpirationDateTime > DateTime.UtcNow).OrderByDescending(l => l.ExpirationDateTime);

         var se = _context.StreamingEndpoints.AsEnumerable().Where(o => (o.State == StreamingEndpointState.Running) && (CanDoDynPackaging(o))).OrderByDescending(o => o.CdnEnabled);

-        if (se.Count==0) // No running which can do dynpackaging SE. Let's use the default one to get URL
+        if (se.Count() == 0) // No running which can do dynpackaging SE. Let's use the default one to get URL
         {
-            se = _context.StreamingEndpoints.AsEnumerable().Where(o=> o.Name =="default");
+            se = (IOrderedEnumerable<IStreamingEndpoint>)_context.StreamingEndpoints.AsEnumerable().Where(o => o.Name == "default");
         }

         var template = new UriTemplate("{contentAccessComponent}/{ismFileName}/manifest");
-
+
         ValidURIs = locators.SelectMany(l =>
             se.Select(
                     o =>
@@ -78,23 +78,23 @@
 public static IEnumerable<Uri> GetValidPaths(IAsset asset)
 {
     IEnumerable<Uri> ValidURIs;
-
-        var locators = asset.Locators.Where(l => l.Type == LocatorType.OnDemandOrigin && l.ExpirationDateTime > DateTime.UtcNow).OrderByDescending(l => l.ExpirationDateTime);

-        var se = _context.StreamingEndpoints.AsEnumerable().Where(o => (o.State == StreamingEndpointState.Running) && (CanDoDynPackaging(o))).OrderByDescending(o => o.CdnEnabled);
+    var locators = asset.Locators.Where(l => l.Type == LocatorType.OnDemandOrigin && l.ExpirationDateTime > DateTime.UtcNow).OrderByDescending(l => l.ExpirationDateTime);

-        if (se.Count==0) // No running which can do dynpackaging SE. Let's use the default one to get URL
-        {
-            se = _context.StreamingEndpoints.AsEnumerable().Where(o=> o.Name =="default");
-        }
+    var se = _context.StreamingEndpoints.AsEnumerable().Where(o => (o.State == StreamingEndpointState.Running) && (CanDoDynPackaging(o))).OrderByDescending(o => o.CdnEnabled);

-        var template = new UriTemplate("{contentAccessComponent}/");
-        ValidURIs = locators.SelectMany(l => se.Select(
-                    o =>
-                        template.BindByPosition(new Uri("http://" + o.HostName), l.ContentAccessComponent)))
-            .ToArray();
+    if (se.Count() == 0) // No running which can do dynpackaging SE. Let's use the default one to get URL
+    {
+        se = (IOrderedEnumerable<IStreamingEndpoint>)_context.StreamingEndpoints.AsEnumerable().Where(o => o.Name == "default");
+    }

-        return ValidURIs;
+    var template = new UriTemplate("{contentAccessComponent}/");
+    ValidURIs = locators.SelectMany(l => se.Select(
+                o =>
+                    template.BindByPosition(new Uri("http://" + o.HostName), l.ContentAccessComponent)))
+        .ToArray();
+
+    return ValidURIs;
 }

 static public bool CanDoDynPackaging(IStreamingEndpoint mySE)


Guard usage of prepend / append fixes #59

--- AngleSharp/Extensions/ParentNodeExtensions.cs
+++ AngleSharp/Extensions/ParentNodeExtensions.cs
@@ -38,8 +38,11 @@
         /// <param name="nodes">The nodes to prepend.</param>
         public static void PrependNodes(this INode parent, params INode[] nodes)
         {
-            var node = parent.MutationMacro(nodes);
-            parent.PreInsert(node, parent.FirstChild);
+            if (nodes.Length > 0)
+            {
+                var node = parent.MutationMacro(nodes);
+                parent.PreInsert(node, parent.FirstChild);
+            }
         }

         /// <summary>
@@ -49,8 +52,11 @@
         /// <param name="nodes">The nodes to append.</param>
         public static void AppendNodes(this INode parent, params INode[] nodes)
         {
-            var node = parent.MutationMacro(nodes);
-            parent.PreInsert(node, null);
+            if (nodes.Length > 0)
+            {
+                var node = parent.MutationMacro(nodes);
+                parent.PreInsert(node, null);
+            }
         }

         /// <summary>


ListMergeRegions example

ListMergeRegions example

--- ApiExamples/CSharp/ApiExamples/ExMailMerge.cs
+++ ApiExamples/CSharp/ApiExamples/ExMailMerge.cs
@@ -10,6 +10,7 @@
 using System.Collections.Generic;
 using System.Data.Odbc;
 using System.Data.SqlClient;
+using System.Linq;
 using Aspose.Words.Fields;
 using Aspose.Words;
 using Aspose.Words.MailMerging;
@@ -204,6 +205,54 @@
             // Execute the mail merge and save the document
             doc.MailMerge.ExecuteADO(recordset);
             doc.Save(ArtifactsDir + "MailMerge.ExecuteADO.docx");
+            //ExEnd
+        }
+
+        [Test]
+        public void ListMergeRegions()
+        {
+            //ExStart
+            //ExFor:MailMerge.GetFieldNamesForRegion(System.String)
+            //ExFor:MailMerge.GetFieldNamesForRegion(System.String,System.Int32)
+            //ExFor:MailMerge.GetRegionsByName(System.String)
+            //ExFor:MailMerge.RegionEndTag
+            //ExFor:MailMerge.RegionStartTag
+            //ExSummary:Shows how to create, list and read mail merge regions.
+            Document doc = new Document();
+            DocumentBuilder builder = new DocumentBuilder(doc);
+
+            // These tags, which go inside MERGEFIELDs, denote the strings that signify the starts and ends of mail merge regions
+            Assert.AreEqual("TableStart", doc.MailMerge.RegionStartTag);
+            Assert.AreEqual("TableEnd", doc.MailMerge.RegionEndTag);
+
+            // By using these tags, we will start and end a "MailMergeRegion1", which will contain MERGEFIELDs for two columns
+            builder.InsertField(" MERGEFIELD TableStart:MailMergeRegion1");
+            builder.InsertField(" MERGEFIELD Column1");
+            builder.Write(", ");
+            builder.InsertField(" MERGEFIELD Column2");
+            builder.InsertField(" MERGEFIELD TableEnd:MailMergeRegion1");
+
+            // We can keep track of merge regions and their columns by looking at these collections
+            IList<MailMergeRegionInfo> regions = doc.MailMerge.GetRegionsByName("MailMergeRegion1");
+            Assert.AreEqual(1, regions.Count);
+            Assert.AreEqual("MailMergeRegion1", regions[0].Name);
+
+            string[] mergeFieldNames = doc.MailMerge.GetFieldNamesForRegion("MailMergeRegion1");
+            Assert.AreEqual("Column1", mergeFieldNames[0]);
+            Assert.AreEqual("Column2", mergeFieldNames[1]);
+
+            // Insert a region with the same name as an existing region, which will make it a duplicate
+            builder.InsertParagraph(); // A single ror/paragraph cannot be shared by multiple regions
+            builder.InsertField(" MERGEFIELD TableStart:MailMergeRegion1");
+            builder.InsertField(" MERGEFIELD Column3");
+            builder.InsertField(" MERGEFIELD TableEnd:MailMergeRegion1");
+
+            // Regions that share the same name are still accounted for and can be accessed by index
+            regions = doc.MailMerge.GetRegionsByName("MailMergeRegion1");
+            Assert.AreEqual(2, regions.Count);
+
+            mergeFieldNames = doc.MailMerge.GetFieldNamesForRegion("MailMergeRegion1", 1);
+            Assert.AreEqual("Column3", mergeFieldNames[0]);
             //ExEnd
         }


QueueCommand: i'm fucking stupid

QueueCommand: i'm fucking stupid

--- Applebot/Plugins/QueueCommand/QueueCommand.cs
+++ Applebot/Plugins/QueueCommand/QueueCommand.cs
@@ -176,7 +176,7 @@
                         }
                         else
                         {
-                            isOpen = true;
+                            isOpen = false;
                             platform.Send(new SendData("The queue is now closed.", false, message));
                             return;
                         }


Fixing more editor bugs in move to Quest class.

--- Assets/Scripts/QuestEditor/QuestEditorData.cs
+++ Assets/Scripts/QuestEditor/QuestEditorData.cs
@@ -235,6 +235,8 @@
         {
             selection.location = CameraController.GetMouseTile();
             gettingPosition = false;
+            Game.Get().quest.Remove(selection.name);
+            Game.Get().quest.Add(selection.name);
             SelectComponent(selection.name);
         }
         if (gettingMaxPosition)
@@ -455,6 +457,8 @@
     {
         QuestData.Token t = selection as QuestData.Token;
         t.spriteName = esl.selection;
+        Game.Get().quest.Remove(t.name);
+        Game.Get().quest.Add(t.name);
         SelectComponent(t.name);
     }

@@ -1794,6 +1798,8 @@
         {
             d.rotation = 0;
         }
+        Game.Get().quest.Remove(d.name);
+        Game.Get().quest.Add(d.name);
         SelectDoor(d.name);
     }

@@ -1850,6 +1856,7 @@
             index++;
         }
         game.qd.components.Add("Tile" + index, new QuestData.Tile("Tile" + index));
+        game.quest.Add("Tile" + index);
         SelectComponent("Tile" + index);
     }

@@ -1885,6 +1892,7 @@
             index++;
         }
         game.qd.components.Add("Door" + index, new QuestData.Door("Door" + index));
+        game.quest.Add("Door" + index);
         SelectComponent("Door" + index);
     }

@@ -1920,6 +1928,7 @@
             index++;
         }
         game.qd.components.Add("Token" + index, new QuestData.Token("Token" + index));
+        game.quest.Add("Token" + index);
         SelectComponent("Token" + index);
     }


use payjoin key from constants

use payjoin key from constants

--- BTCPayServer/Controllers/WalletsController.cs
+++ BTCPayServer/Controllers/WalletsController.cs
@@ -659,7 +659,7 @@
                             $"Payment {(string.IsNullOrEmpty(uriBuilder.Label) ? string.Empty : $" to {uriBuilder.Label}")} {(string.IsNullOrEmpty(uriBuilder.Message) ? string.Empty : $" for {uriBuilder.Message}")}"
                     });
                 }
-                uriBuilder.UnknowParameters.TryGetValue("bpu", out var vmPayJoinEndpointUrl);
+                uriBuilder.UnknowParameters.TryGetValue(PayjoinClient.BIP21EndpointKey, out var vmPayJoinEndpointUrl);
                 vm.PayJoinEndpointUrl = vmPayJoinEndpointUrl;
             }
             catch


Make free electives work

Make free electives work

--- CAPPamari.Web/Helpers/AutopopulationHelper.cs
+++ CAPPamari.Web/Helpers/AutopopulationHelper.cs
@@ -170,7 +170,6 @@

             foreach (RequirementSetModel reqset in orderedSets)
             {
-                if (reqset.Name == "Free Electives") continue;
                 if (reqset.Name == "HASS") continue;
                 foreach (CourseModel course in unappliedCourses.Where(reqset.CanApplyCourse))
                 {


Improved testing surface area for recent changes to code

--- Castle.DynamicLinqQueryBuilder.Tests/Tests.cs
+++ Castle.DynamicLinqQueryBuilder.Tests/Tests.cs
@@ -3214,6 +3214,39 @@
             result = new[] { new IndexedClass() }.BuildQuery(rule, true, "Item");
             Assert.IsFalse(result.Any());
         }
+        [Test]
+        public void Build_Predicate_Null_Test()
+        {
+            FilterRule rule = null;
+            var predicate = rule.BuildPredicate<ExpressionTreeBuilderTestClass>(new BuildExpressionOptions() {ParseDatesAsUtc = true},
+                out _);
+
+            var resData = GetExpressionTreeData();
+
+            var res = resData.Where(predicate).ToList();
+
+            Assert.IsTrue(res.Count == 4);
+
+        }
+
+        #endregion
+
+        #region Misc
+        [Test]
+        public void Build_Query_Null_Test()
+        {
+            FilterRule rule = null;
+
+
+            var data = GetExpressionTreeData();
+
+            var res = data.AsQueryable().BuildQuery(rule, new BuildExpressionOptions() { ParseDatesAsUtc = true })
+                .ToList();
+
+            Assert.IsTrue(res.Count == 4);
+
+
+        }
         #endregion


Add Manglemire to teradps.io exports

Add Manglemire to teradps.io exports

--- CasualMeter.Common/TeraDpsApi/DataExporter.cs
+++ CasualMeter.Common/TeraDpsApi/DataExporter.cs
@@ -167,6 +167,7 @@
                 areaId != 467 &&
                 areaId != 767 &&
                 areaId != 768 &&
+                areaId != 470 &&
                 areaId != 468
                 )
             {


Default fill model for stop limit order type

--- Common/Securities/SecurityTransactionModel.cs
+++ Common/Securities/SecurityTransactionModel.cs
@@ -65,7 +65,7 @@
         /// <returns>Order fill informaton detailing the average price and quantity filled.</returns>
         /// <seealso cref="StopMarketFill(Security, StopMarketOrder)"/>
         /// <seealso cref="LimitFill(Security, LimitOrder)"/>
-        public OrderEvent MarketFill(Security asset, MarketOrder order)
+        public virtual OrderEvent MarketFill(Security asset, MarketOrder order)
         {
             //Default order event to return.
             var fill = new OrderEvent(order);
@@ -76,7 +76,7 @@
                 order.Status = OrderStatus.Filled;

                 //For backtesting, we assuming the order is 100% filled on first attempt.
-                fill.FillPrice = asset.Price;
+                fill.FillPrice = order.Price;
                 fill.FillQuantity = order.Quantity;
                 fill.Status = order.Status;
             }
@@ -96,7 +96,7 @@
         /// <returns>Order fill informaton detailing the average price and quantity filled.</returns>
         /// <seealso cref="MarketFill(Security, MarketOrder)"/>
         /// <seealso cref="LimitFill(Security, LimitOrder)"/>
-        public OrderEvent StopMarketFill(Security asset, StopMarketOrder order)
+        public virtual OrderEvent StopMarketFill(Security asset, StopMarketOrder order)
         {
             //Default order event to return.
             var fill = new OrderEvent(order);
@@ -106,23 +106,31 @@
                 //If its cancelled don't need anymore checks:
                 if (fill.Status == OrderStatus.Canceled) return fill;

+                //Get the range of prices in the last bar:
+                decimal minimumPrice;
+                decimal maximumPrice;
+                DataMinMaxPrices(asset, out minimumPrice, out maximumPrice);
+
                 //Check if the Stop Order was filled: opposite to a limit order
                 switch (order.Direction)
                 {
                     case OrderDirection.Sell:
                         //-> 1.1 Sell Stop: If Price below setpoint, Sell:
-                        if (asset.Price < order.StopPrice)
+                        if (minimumPrice < order.StopPrice)
                         {
                             order.Status = OrderStatus.Filled;
-                            order.Price = asset.Price;
-                        }
-                        break;
+                            // Assuming worse case scenario fill - fill at lowest of the stop & asset price.
+                            order.Price = Math.Min(order.StopPrice, asset.Price);
+                        }
+                        break;
+
                     case OrderDirection.Buy:
                         //-> 1.2 Buy Stop: If Price Above Setpoint, Buy:
-                        if (asset.Price > order.StopPrice)
+                        if (maximumPrice > order.StopPrice)
                         {
                             order.Status = OrderStatus.Filled;
-                            order.Price = asset.Price;
+                            // Assuming worse case scenario fill - fill at highest of the stop & asset price.
+                            order.Price = Math.Max(order.StopPrice, asset.Price);
                         }
                         break;
                 }
@@ -136,7 +144,89 @@
             }
             catch (Exception err)
             {
-                Log.Error("SecurityTransactionModel.TransOrderDirection.StopFill(): " + err.Message);
+                Log.Error("SecurityTransactionModel.StopMarketFill(): " + err.Message);
+            }
+
+            return fill;
+        }
+
+
+        /// <summary>
+        /// Default stop limit fill model implementation in base class security. (Stop Limit Order Type)
+        /// </summary>
+        /// <param name="asset">Security asset we're filling</param>
+        /// <param name="order">Order packet to model</param>
+        /// <returns>Order fill informaton detailing the average price and quantity filled.</returns>
+        /// <seealso cref="StopMarketFill(Security, StopMarketOrder)"/>
+        /// <seealso cref="LimitFill(Security, LimitOrder)"/>
+        /// <remarks>
+        ///     There is no good way to model limit orders with OHLC because we never know whether the market has
+        ///     gapped past our fill price. We have to make the assumption of a fluid, high volume market.
+        ///
+        ///     Stop limit orders we also can't be sure of the order of the H - L values for the limit fill. The assumption
+        ///     was made the limit fill will be done with closing price of the bar after the stop has been triggered..
+        /// </remarks>
+        public virtual OrderEvent StopLimitFill(Security asset, StopLimitOrder order)
+        {
+            //Default order event to return.
+            var fill = new OrderEvent(order);
+
+            try
+            {
+                //If its cancelled don't need anymore checks:
+                if (fill.Status == OrderStatus.Canceled) return fill;
+
+                //Get the range of prices in the last bar:
+                decimal minimumPrice;
+                decimal maximumPrice;
+                DataMinMaxPrices(asset, out minimumPrice, out maximumPrice);
+
+                //Check if the Stop Order was filled: opposite to a limit order
+                switch (order.Direction)
+                {
+                    case OrderDirection.Buy:
+                        //-> 1.2 Buy Stop: If Price Above Setpoint, Buy:
+                        if (maximumPrice > order.StopPrice || order.StopTriggered)
+                        {
+                            order.StopTriggered = true;
+
+                            // Fill the limit order, using closing price of bar:
+                            // Note > Can't use minimum price, because no way to be sure minimum wasn't before the stop triggered.
+                            if (asset.Price < order.LimitPrice)
+                            {
+                                order.Status = OrderStatus.Filled;
+                                order.Price = order.LimitPrice;
+                            }
+                        }
+                        break;
+
+                    case OrderDirection.Sell:
+                        //-> 1.1 Sell Stop: If Price below setpoint, Sell:
+                        if (minimumPrice < order.StopPrice || order.StopTriggered)
+                        {
+                            order.StopTriggered = true;
+
+                            // Fill the limit order, using minimum price of the bar
+                            // Note > Can't use minimum price, because no way to be sure minimum wasn't before the stop triggered.
+                            if (asset.Price > order.LimitPrice)
+                            {
+                                order.Status = OrderStatus.Filled;
+                                order.Price = order.LimitPrice; // Fill at limit price not asset price.
+                            }
+                        }
+                        break;
+                }
+
+                if (order.Status == OrderStatus.Filled || order.Status == OrderStatus.PartiallyFilled)
+                {
+                    fill.FillQuantity = order.Quantity;
+                    fill.FillPrice = order.Price;
+                    fill.Status = order.Status;
+                }
+            }
+            catch (Exception err)
+            {
+                Log.Error("SecurityTransactionModel.StopLimitFill(): " + err.Message);
             }

             return fill;
@@ -151,7 +241,7 @@
         /// <returns>Order fill informaton detailing the average price and quantity filled.</returns>
         /// <seealso cref="StopMarketFill(Security, StopMarketOrder)"/>
         /// <seealso cref="MarketFill(Security, MarketOrder)"/>
-        public OrderEvent LimitFill(Security asset, LimitOrder order)
+        public virtual OrderEvent LimitFill(Security asset, LimitOrder order)
         {
             //Initialise;
             var fill = new OrderEvent(order);
@@ -161,40 +251,31 @@
                 //If its cancelled don't need anymore checks:
                 if (fill.Status == OrderStatus.Canceled) return fill;

-                //Depending on the resolution, return different data types:
-                var marketData = asset.GetLastData();
-
-                decimal marketDataMinPrice;
-                decimal marketDataMaxPrice;
-                if (marketData.DataType == MarketDataType.TradeBar)
-                {
-                    marketDataMinPrice = ((TradeBar)marketData).Low;
-                    marketDataMaxPrice = ((TradeBar)marketData).High;
-                }
-                else
-                {
-                    marketDataMinPrice = marketData.Value;
-                    marketDataMaxPrice = marketData.Value;
-                }
+                //Get the range of prices in the last bar:
+                decimal minimumPrice;
+                decimal maximumPrice;
+                DataMinMaxPrices(asset, out minimumPrice, out maximumPrice);

                 //-> Valid Live/Model Order:
                 switch (order.Direction)
                 {
                     case OrderDirection.Buy:
                         //Buy limit seeks lowest price
-                        if (marketDataMinPrice < order.LimitPrice)
+                        if (minimumPrice < order.LimitPrice)
                         {
                             //Set order fill:
                             order.Status = OrderStatus.Filled;
-                            order.Price = asset.Price;
+                            // Set order fill price to limit price: 99% of times limit orders fill at their limit price
+                            order.Price = order.LimitPrice;
                         }
                         break;
                     case OrderDirection.Sell:
                         //Sell limit seeks highest price possible
-                        if (marketDataMaxPrice > order.LimitPrice)
+                        if (maximumPrice > order.LimitPrice)
                         {
                             order.Status = OrderStatus.Filled;
-                            order.Price = asset.Price;
+                            // Set order fill price to limit price: 99% of times limit orders fill at their limit price
+                            order.Price = order.LimitPrice;
                         }
                         break;
                 }
@@ -202,7 +283,7 @@
                 if (order.Status == OrderStatus.Filled || order.Status == OrderStatus.PartiallyFilled)
                 {
                     fill.FillQuantity = order.Quantity;
-                    fill.FillPrice = asset.Price;
+                    fill.FillPrice = order.Price;
                     fill.Status = order.Status;
                 }
             }
@@ -232,6 +313,29 @@
         public virtual decimal GetOrderFee(decimal quantity, decimal price)
         {
             return 0;
+        }
+
+
+        /// <summary>
+        /// Get the minimum and maximum price for this security in the last bar:
+        /// </summary>
+        /// <param name="asset">Security asset we're checking</param>
+        /// <param name="minimumPrice">Minimum price in the last data bar</param>
+        /// <param name="maximumPrice">Minimum price in the last data bar</param>
+        public void DataMinMaxPrices(Security asset, out decimal minimumPrice, out decimal maximumPrice)
+        {
+            var marketData = asset.GetLastData();
+
+            if (marketData.DataType == MarketDataType.TradeBar)
+            {
+                minimumPrice = ((TradeBar)marketData).Low;
+                maximumPrice = ((TradeBar)marketData).High;
+            }
+            else
+            {
+                minimumPrice = marketData.Value;
+                maximumPrice = marketData.Value;
+            }
         }


[Controls] Remove UnityBits script dependency

--- Controls/Scripts/Helpers/Controls/Controls.cs
+++ Controls/Scripts/Helpers/Controls/Controls.cs
@@ -36,6 +36,8 @@
 public class Controls : SingletonMonoBehaviour<Controls> {

     public const float LongPressActionDelay = 0.450f;
+
+    public static readonly Vector3 DefaultPrimaryInputPosition = new Vector3(float.MaxValue, float.MaxValue, 0f);

     ControlsModule module;
     List<IControlsEventListener> listeners = new List<IControlsEventListener>();
@@ -107,7 +109,7 @@

     public virtual Vector2 primaryInputPosition {
         get {
-            return PoolableSpawnConfig.INIT_SPAWN_POS;
+            return Controls.DefaultPrimaryInputPosition;
         }
     }


[Update] ShouldRecordの初期値を変更

[Update] ShouldRecordの初期値を変更

--- CurtainFireMakerPlugin/Entities/EntityShot.cs
+++ CurtainFireMakerPlugin/Entities/EntityShot.cs
@@ -20,14 +20,14 @@
         public PmxBoneData RootBone => ModelData.Bones[0];
         public PmxMorphData MaterialMorph => ModelData.MaterialMorph;

-        public class RecordType
-        {
-            public static Predicate<EntityShot> None { get; } = e => false;
-            public static Predicate<EntityShot> Velocity { get; } = e => e.IsUpdatedVelocity;
-            public static Predicate<EntityShot> LocalMat { get; } = e => e.IsUpdatedLocalMat;
-        }
-
-        public Predicate<EntityShot> ShouldRecord { get; set; } = RecordType.LocalMat;
+        public static class RecordType
+        {
+            public static Func<EntityShot, bool> None { get; } = e => false;
+            public static Func<EntityShot, bool> Velocity { get; } = e => e.IsUpdatedVelocity;
+            public static Func<EntityShot, bool> LocalMat { get; } = e => e.IsUpdatedLocalMat;
+        }
+
+        public Func<EntityShot, bool> ShouldRecord { get; set; } = RecordType.Velocity;

         public bool IsUpdatedVelocity { get; private set; } = true;
         public bool IsUpdatedLocalMat { get; private set; } = true;
@@ -163,7 +163,8 @@
                 Rot = rot,
                 InterpolatePointX = interpolation,
                 InterpolatePointY = interpolation,
-                InterpolatePointZ = interpolation
+                InterpolatePointZ = interpolation,
+                InterpolatePointR = interpolation,
             };

             World.VmdMotion.AddVmdMotion(motion);


CMP-595 - Fix edit panel state after refresh in Firefox

--- DancingGoat/Views/Shared/EditModePanel.cshtml
+++ DancingGoat/Views/Shared/EditModePanel.cshtml
@@ -4,7 +4,7 @@

-                <input id="edit-mode-switch" type="checkbox" onchange="toggleEditMode(this.checked)">
+                <input id="edit-mode-switch" type="checkbox" onchange="toggleEditMode(this.checked)" autocomplete="off">


utility func

utility func

--- DbShell.Driver.Common/Structure/ColumnInfo.cs
+++ DbShell.Driver.Common/Structure/ColumnInfo.cs
@@ -182,6 +182,12 @@
             return res;
         }

+        public bool IsSingleColumnPk()
+        {
+            if (OwnerTable?.PrimaryKey?.Columns?.Count != 1) return false;
+            return OwnerTable.PrimaryKey.Columns[0].RefColumn == this;
+        }
+
         public string LengthDisplay
         {
             get


Deployment of DevKitSample v5.22.0.1894 to PROD:MAIN by GitHub Deployment Plugin

--- DeveloperKitSample/Properties/AssemblyInfo.cs
+++ DeveloperKitSample/Properties/AssemblyInfo.cs
@@ -33,4 +33,4 @@
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("5.22.0.0")]
 [assembly: AssemblyVersion("5.22.0.0")]
-[assembly: AssemblyFileVersion("5.22.0.1700")]
+[assembly: AssemblyFileVersion("5.22.0.1894")]


Fixed possibility of nullpointer SMSnotification

--- Digipost.Api.Client.Domain/SmsNotification.cs
+++ Digipost.Api.Client.Domain/SmsNotification.cs
@@ -7,7 +7,7 @@
 namespace Digipost.Api.Client.Domain
 {
     /// <summary>
-    /// Optional SMS notification to Recipient.
+    /// Optional SMS notification to Recipient.
     /// Additional charges apply.
     /// </summary>
     [Serializable]
@@ -22,6 +22,7 @@
         public SmsNotification(int afterHours)
         {
             AfterHours = new List<int> {afterHours};
+            At = new List<Listedtime>();
         }

         /// <summary>
@@ -30,6 +31,7 @@
         public SmsNotification(DateTime sendingTime)
         {
             At = new List<Listedtime> {new Listedtime(sendingTime)};
+            AfterHours =  new List<int>();
         }

         private SmsNotification()


unity: load less tiles in unit tests

unity: load less tiles in unit tests

--- unity/library/UtyMap.Unity.Tests/Data/TileLoadingTests.cs
+++ unity/library/UtyMap.Unity.Tests/Data/TileLoadingTests.cs
@@ -35,13 +35,13 @@
             _compositionRoot.Dispose();
         }

-        [Test(Description = "This test loads 64 tiles from osm file to ensure that there are no unexpected crashes at least at test region.")]
+        [Test(Description = "This test loads 4 tiles at zoom level 16.")]
         public void CanLoadMultipleTilesAtDetailedLevelOfDetails()
         {
             // ARRANGE
             int lod = 16;
             SetupMapData(TestHelper.BerlinPbfData, lod);
-            var count = 10;
+            var count = 1;
             var centerQuadKey = new QuadKey(35205, 21489, lod);

             // ACT & ASSERT


front end clean up - fix button

front end clean up - fix button

--- Fundraise.MvcExample/Views/Admin/Index.cshtml
+++ Fundraise.MvcExample/Views/Admin/Index.cshtml
@@ -28,8 +28,7 @@
                 {

This campaign has no fundraisers.

                 }
-                @Html.ActionLink("New Fundraiser", "FundraiserCreate", new { campaignId = campaign.Id}, null)
-                <button type="button" class="btn btn-default">New Fundraiser</button>
+                @Html.ActionLink("New Fundraiser", "FundraiserCreate", new { campaignId = campaign.Id}, new { @class = "btn btn-default" })


Fixed display of contact information

Fixed display of contact information

--- GoldenTicket/Views/Registration/Review.cshtml
+++ GoldenTicket/Views/Registration/Review.cshtml
@@ -104,7 +104,7 @@

I understand that if my child is chosen for the state Pre-K program, I am responsible for providing regular transportation to and from the program which ensures my child’s attendance each day. If my child is absent for unexcused reasons (including family vacations) for 20 or more school days, I understand that my child will likely lose their slot in the state Pre-K program and it will be given to the next child on the state Pre-K enrollment list.

-
I confirm that I can be reached at the phone numbers listed in this application from August 7 – 8, 2014 if my child is chosen in the state lottery to participate in the state Pre-K program.

+
I confirm that I can be reached at the phone numbers listed in this application on @ViewBag. if my child is chosen in the state lottery to participate in the state Pre-K program.


Add comment about failing test.

Add comment about failing test.

--- Gu.Wpf.UiAutomation.UITests/SubscribeTests.cs
+++ Gu.Wpf.UiAutomation.UITests/SubscribeTests.cs
@@ -1,4 +1,4 @@
-namespace Gu.Wpf.UiAutomation.UiTests
+namespace Gu.Wpf.UiAutomation.UiTests
 {
     using System;
     using System.Collections.Generic;
@@ -99,6 +99,7 @@
         [Test]
         public void ToFocusChangedEvent()
         {
+            // This fails on Win 10 for some reason.
             using (var app = Application.AttachOrLaunch(ExeFileName, "FocusWindow"))
             {
                 var changes = new List<int>();