Update epoch to help tight loop.

Update epoch to help tight loop.

--- Pulsar4X/Pulsar4X.Lib/Helpers/Orbit.cs
+++ Pulsar4X/Pulsar4X.Lib/Helpers/Orbit.cs
@@ -238,6 +238,7 @@
 			{
                 // Don't attempt to calculate large timeframes.
 				timeSinceEpoch -= m_orbitalPeriod;
+                Epoch += m_orbitalPeriod;
 			}

             // http://en.wikipedia.org/wiki/Mean_anomaly (M = M0 + nT)


Remove INotifyPropertyChanged from IMainWindowViewModel

--- src/Gui/IMainWindowViewModel.cs
+++ src/Gui/IMainWindowViewModel.cs
@@ -6,7 +6,7 @@

 namespace GBLive.Gui
 {
-    public interface IMainWindowViewModel : INotifyPropertyChanged
+    public interface IMainWindowViewModel
     {
         bool IsLive { get; set; }
         string LiveShowTitle { get; set; }


Cleaned Settings class

Cleaned Settings class

--- src/Gui/WinFormsGui/Settings.cs
+++ src/Gui/WinFormsGui/Settings.cs
@@ -7,29 +7,29 @@
 {
 	public class Settings
 	{
-		public bool IsLogActive { get; set; }
+		private bool IsLogActive { get; set; }

-		public string Lang { get; set; }
+		private string Lang { get; set; }

-		public bool Sort { get; set; }
+		private bool Sort { get; set; }

-		public bool SortToMore { get; set; }
+		private bool SortToMore { get; set; }

-		public bool SortToLess { get; set; }
+		private bool SortToLess { get; set; }

-		public bool Timer { get; set; }
+		private bool Timer { get; set; }

-		public bool Autorun { get; set; }
+		private bool Autorun { get; set; }

-		public bool ShowWonTip { get; set; }
+		private bool ShowWonTip { get; set; }

-		public bool ShowFarmTip { get; set; }
+		private bool ShowFarmTip { get; set; }

-		public bool WishlistSort { get; set; }
+		private bool WishlistSort { get; set; }

-		public int TimerInterval { get; set; }
+		private int TimerInterval { get; set; }

-		public int TimerLoops { get; set; }
+		private int TimerLoops { get; set; }

 		public void Load()
 		{
@@ -62,7 +62,7 @@
 			Properties.Settings.Default.Save();
 		}

-		public bool Save()
+		public void Save()
 		{
 			var settings = new Settings
 			{
@@ -87,12 +87,10 @@
 					var serializer = new XmlSerializer(typeof (Settings));
 					serializer.Serialize(fs, settings);
 				}
-				return true;
 			}
 			catch (Exception ex)
 			{
 				MessageBox.Show(@"Ошибка", ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
-				return false;
 			}
 		}
 	}


Text receives the original char sequence as a ReadOnlySpan<char> rather than a string per se, though any string passed in will be converted implicitly.

--- src/Parsley/Text.cs
+++ src/Parsley/Text.cs
@@ -6,10 +6,10 @@
     readonly ReadOnlySpan<char> input;
     int line;

-    public Text(string input)
+    public Text(ReadOnlySpan<char> input)
         : this(input, 0, 1) { }

-    Text(string input, int index, int line)
+    Text(ReadOnlySpan<char> input, int index, int line)
     {
         this.input = input;
         this.index = index;


修正一个魔改流程存在的问题

修正一个魔改流程存在的问题

--- ElectronicObserver/Utility/Modify/ModifyConfiguration.cs
+++ ElectronicObserver/Utility/Modify/ModifyConfiguration.cs
@@ -55,10 +55,11 @@
 				return;
 			}

-			if ( File.Exists( ModifyFileName ) ) {
+            modifies = new List<ModifyConfigurationNode>();

-				modifies = new List<ModifyConfigurationNode>();
+            if ( File.Exists( ModifyFileName ) ) {

+
 				try {

 					var array = JavaScriptSerializer.DeserializeObject( File.ReadAllText( ModifyFileName ) );


Data Contract required on the base class

--- src/Hl7.Fhir.Core/Model/Base.cs
+++ src/Hl7.Fhir.Core/Model/Base.cs
@@ -41,6 +41,7 @@
 namespace Hl7.Fhir.Model
 {
     [InvokeIValidatableObject]
+    [System.Runtime.Serialization.DataContract]
     public abstract class Base : Hl7.Fhir.Validation.IValidatableObject, IDeepCopyable, IDeepComparable
     {
         public abstract bool IsExactly(IDeepComparable other);


remove traces

remove traces

--- ksp_plugin_adapter/ksp_plugin_adapter.cs
+++ ksp_plugin_adapter/ksp_plugin_adapter.cs
@@ -509,7 +509,6 @@
   }

   private void LateUpdate() {
-    Log.Info("LateUpdate");
     if (map_renderer_ == null) {
       map_renderer_ =
           PlanetariumCamera.Camera.gameObject.AddComponent<RenderingActions>();
@@ -646,7 +645,6 @@
   }

   private void FixedUpdate() {
-    Log.Info("FixedUpdate");
     if (GameSettings.ORBIT_WARP_DOWN_AT_SOI) {
       Log.Info("Setting GameSettings.ORBIT_WARP_DOWN_AT_SOI to false");
       GameSettings.ORBIT_WARP_DOWN_AT_SOI = false;
@@ -794,7 +792,6 @@
        }
      }

-    Log.Info("AdvanceTime");
      plugin_.AdvanceTime(universal_time, Planetarium.InverseRotAngle);
      is_post_apocalyptic_ |= plugin_.HasEncounteredApocalypse(out revelation_);

@@ -849,14 +846,12 @@
    }

   private void DisableVesselPrecalculate() {
-    Log.Info("ObscenelyEarly");
     foreach (var vessel in FlightGlobals.Vessels) {
       vessel.precalc.enabled = false;
     }
   }

   private void SetBodyFramesAndPrecalculateVessels() {
-    Log.Info("Precalc");
     AdvanceTimeAndNudgeVesselsAfterPhysicsSimulation();
     SetBodyFrames();
     // Unfortunately there is no way to get scheduled between Planetarium and
@@ -873,7 +868,6 @@
   }

   private void UpdateVesselOrbits() {
-    Log.Info("Early");
     if (PluginRunning()) {
       ApplyToVesselsOnRails(
           vessel => UpdateVessel(vessel, Planetarium.GetUniversalTime()));
@@ -1024,7 +1018,6 @@
   }

   private void RenderTrajectories() {
-    Log.Info("RenderTrajectories");
     if (!PluginRunning()) {
       return;
     }


S138: This method has more lines than the 80 lines authorized. Split it into smaller methods.

--- Extensions/CodeGeneration/CodeGenerationDisplayDriver.cs
+++ Extensions/CodeGeneration/CodeGenerationDisplayDriver.cs
@@ -26,64 +26,6 @@
                 {
                     var codeBuilder = new StringBuilder();

-                    string ConvertJToken(JToken jToken)
-                    {
-                        if (jToken is JValue jValue)
-                        {
-                            var value = jValue.Value;
-                            return value switch
-                            {
-                                // Should be ToLowerInvariant() as the value will generate C#.
-#pragma warning disable CA1308 // Normalize strings to uppercase
-                                bool _ => value.ToString().ToLowerInvariant(),
-#pragma warning restore CA1308 // Normalize strings to uppercase
-                                string _ => $"\"{value}\"",
-                                _ => value.ToString().Replace(',', '.'), // Replace decimal commas.
-                            };
-                        }
-                        else if (jToken is JArray jArray)
-                        {
-                            return "new[] { " + string.Join(", ", jArray.Select(item => ConvertJToken(item))) + " }";
-                        }
-                        else if (jToken is JObject jObject)
-                        {
-                            // Using a quoted string so it doesn't mess up the syntax highlighting of the rest of the
-                            // code.
-                            return T["\"FIX ME! Couldn't determine the actual type to instantiate.\" {0}", jObject.ToString()];
-                        }
-                        else
-                        {
-                            throw new NotSupportedException($"Settings values of type {jToken.GetType()} are not supported.");
-                        }
-                    }
-
-                    void AddSettingsWithout<T>(JObject settings, int indentationDepth)
-                    {
-                        var indentation = string.Join(string.Empty, Enumerable.Repeat(" ", indentationDepth));
-
-                        var filteredSettings = ((IEnumerable<KeyValuePair<string, JToken>>)settings)
-                            .Where(setting => setting.Key != typeof(T).Name);
-                        foreach (var setting in filteredSettings)
-                        {
-                            var properties = setting.Value.Where(property => property is JProperty).Cast<JProperty>().ToArray();
-
-                            if (properties.Length == 0) continue;
-
-                            codeBuilder.AppendLine($"{indentation}.WithSettings(new {setting.Key}");
-                            codeBuilder.AppendLine(indentation + "{");
-
-                            // This doesn't support multi-level object hierarchies for settings but come on, who uses
-                            // complex settings objects?
-                            for (int i = 0; i < properties.Length; i++)
-                            {
-                                var property = properties[i];
-                                codeBuilder.AppendLine($"{indentation}    {property.Name} = {ConvertJToken(property.Value)}{(i != properties.Length - 1 ? "," : string.Empty)}");
-                            }
-
-                            codeBuilder.AppendLine(indentation + "})");
-                        }
-                    }
-
                     // Building the code for the type.
                     codeBuilder.AppendLine($"_contentDefinitionManager.AlterTypeDefinition(\"{model.Name}\", type => type");

@@ -100,7 +42,7 @@
                         codeBuilder.AppendLine($"    .Stereotype(\"{contentTypeSettings.Stereotype}\")");
                     }

-                    AddSettingsWithout<ContentTypeSettings>(model.Settings, 4);
+                    AddSettingsWithout<ContentTypeSettings>(codeBuilder, model.Settings, 4);

                     foreach (var part in model.Parts)
                     {
@@ -110,32 +52,13 @@

                         var partStartingLength = codeBuilder.Length;

-                        if (!string.IsNullOrEmpty(partSettings.DisplayName))
-                        {
-                            codeBuilder.AppendLine($"        .WithDisplayName(\"{partSettings.DisplayName}\")");
-                        }
+                        AddWithLine(codeBuilder, nameof(partSettings.DisplayName), partSettings.DisplayName);
+                        AddWithLine(codeBuilder, nameof(partSettings.Description), partSettings.Description);
+                        AddWithLine(codeBuilder, nameof(partSettings.Position), partSettings.Position);
+                        AddWithLine(codeBuilder, nameof(partSettings.DisplayMode), partSettings.DisplayMode);
+                        AddWithLine(codeBuilder, nameof(partSettings.Editor), partSettings.Editor);

-                        if (!string.IsNullOrEmpty(partSettings.Description))
-                        {
-                            codeBuilder.AppendLine($"        .WithDescription(\"{partSettings.Description}\")");
-                        }
-
-                        if (!string.IsNullOrEmpty(partSettings.Position))
-                        {
-                            codeBuilder.AppendLine($"        .WithPosition(\"{partSettings.Position}\")");
-                        }
-
-                        if (!string.IsNullOrEmpty(partSettings.DisplayMode))
-                        {
-                            codeBuilder.AppendLine($"        .WithDisplayMode(\"{partSettings.DisplayMode}\")");
-                        }
-
-                        if (!string.IsNullOrEmpty(partSettings.Editor))
-                        {
-                            codeBuilder.AppendLine($"        .WithEditor(\"{partSettings.Editor}\")");
-                        }
-
-                        AddSettingsWithout<ContentTypePartSettings>(part.Settings, 8);
+                        AddSettingsWithout<ContentTypePartSettings>(codeBuilder, part.Settings, 8);

                         // Checking if anything was added to the part's settings.
                         if (codeBuilder.Length == partStartingLength)
@@ -159,62 +82,31 @@
                     foreach (var part in partDefinitions)
                     {
                         codeBuilder.AppendLine();
-
                         codeBuilder.AppendLine($"_contentDefinitionManager.AlterPartDefinition(\"{part.Name}\", part => part");

                         var partSettings = part.GetSettings<ContentPartSettings>();
                         if (partSettings.Attachable) codeBuilder.AppendLine("    .Attachable()");
                         if (partSettings.Reusable) codeBuilder.AppendLine("    .Reusable()");
-                        if (!string.IsNullOrEmpty(partSettings.DisplayName))
-                        {
-                            codeBuilder.AppendLine($"    .WithDisplayName(\"{partSettings.DisplayName}\")");
-                        }

-                        if (!string.IsNullOrEmpty(partSettings.Description))
-                        {
-                            codeBuilder.AppendLine($"    .WithDescription(\"{partSettings.Description}\")");
-                        }
+                        AddWithLine(codeBuilder, nameof(partSettings.DisplayName), partSettings.DisplayName);
+                        AddWithLine(codeBuilder, nameof(partSettings.Description), partSettings.Description);
+                        AddWithLine(codeBuilder, nameof(partSettings.DefaultPosition), partSettings.DefaultPosition);

-                        if (!string.IsNullOrEmpty(partSettings.DefaultPosition))
-                        {
-                            codeBuilder.AppendLine($"    .WithDefaultPosition(\"{partSettings.DefaultPosition}\")");
-                        }
-
-                        AddSettingsWithout<ContentPartSettings>(part.Settings, 4);
+                        AddSettingsWithout<ContentPartSettings>(codeBuilder, part.Settings, 4);

                         foreach (var field in part.Fields)
                         {
                             codeBuilder.AppendLine($"    .WithField(\"{field.Name}\", field => field");
-
                             codeBuilder.AppendLine($"        .OfType(\"{field.FieldDefinition.Name}\")");

                             var fieldSettings = field.GetSettings<ContentPartFieldSettings>();
-                            if (!string.IsNullOrEmpty(fieldSettings.DisplayName))
-                            {
-                                codeBuilder.AppendLine($"        .WithDisplayName(\"{fieldSettings.DisplayName}\")");
-                            }
+                            AddWithLine(codeBuilder, nameof(fieldSettings.DisplayName), fieldSettings.DisplayName);
+                            AddWithLine(codeBuilder, nameof(fieldSettings.Description), fieldSettings.Description);
+                            AddWithLine(codeBuilder, nameof(fieldSettings.Editor), fieldSettings.Editor);
+                            AddWithLine(codeBuilder, nameof(fieldSettings.DisplayMode), fieldSettings.DisplayMode);
+                            AddWithLine(codeBuilder, nameof(fieldSettings.Position), fieldSettings.Position);

-                            if (!string.IsNullOrEmpty(fieldSettings.Description))
-                            {
-                                codeBuilder.AppendLine($"        .WithDescription(\"{fieldSettings.Description}\")");
-                            }
-
-                            if (!string.IsNullOrEmpty(fieldSettings.Editor))
-                            {
-                                codeBuilder.AppendLine($"        .WithEditor(\"{fieldSettings.Editor}\")");
-                            }
-
-                            if (!string.IsNullOrEmpty(fieldSettings.DisplayMode))
-                            {
-                                codeBuilder.AppendLine($"        .WithDisplayMode(\"{fieldSettings.DisplayMode}\")");
-                            }
-
-                            if (!string.IsNullOrEmpty(fieldSettings.Position))
-                            {
-                                codeBuilder.AppendLine($"        .WithPosition(\"{fieldSettings.Position}\")");
-                            }
-
-                            AddSettingsWithout<ContentPartFieldSettings>(field.Settings, 8);
+                            AddSettingsWithout<ContentPartFieldSettings>(codeBuilder, field.Settings, 8);

                             codeBuilder.AppendLine("    )");
                         }
@@ -225,5 +117,68 @@
                     return codeBuilder.ToString();
                 }))
             .Location("Content:7");
+
+        private string ConvertJToken(JToken jToken)
+        {
+            switch (jToken)
+            {
+                case JValue jValue:
+                {
+                    var value = jValue.Value;
+                    return value switch
+                    {
+                        // Should be ToLowerInvariant() as the value will generate C#.
+#pragma warning disable CA1308 // Normalize strings to uppercase
+                        bool boolValue => boolValue.ToString().ToLowerInvariant(),
+#pragma warning restore CA1308 // Normalize strings to uppercase
+                        string _ => $"\"{value}\"",
+                        _ => value?.ToString()?.Replace(',', '.'), // Replace decimal commas.
+                    };
+                }
+
+                case JArray jArray:
+                    return $"new[] {{ {string.Join(", ", jArray.Select(ConvertJToken))} }}";
+                case JObject jObject:
+                    // Using a quoted string so it doesn't mess up the syntax highlighting of the rest of the code.
+                    return T["\"FIX ME! Couldn't determine the actual type to instantiate.\" {0}", jObject.ToString()];
+                default:
+                    throw new NotSupportedException($"Settings values of type {jToken.GetType()} are not supported.");
+            }
+        }
+
+        private void AddSettingsWithout<T>(StringBuilder codeBuilder, JObject settings, int indentationDepth)
+        {
+            var indentation = string.Join(string.Empty, Enumerable.Repeat(" ", indentationDepth));
+
+            var filteredSettings = ((IEnumerable<KeyValuePair<string, JToken>>)settings)
+                .Where(setting => setting.Key != typeof(T).Name);
+            foreach (var setting in filteredSettings)
+            {
+                var properties = setting.Value.Where(property => property is JProperty).Cast<JProperty>().ToArray();
+
+                if (properties.Length == 0) continue;
+
+                codeBuilder.AppendLine($"{indentation}.WithSettings(new {setting.Key}");
+                codeBuilder.AppendLine(indentation + "{");
+
+                // This doesn't support multi-level object hierarchies for settings but come on, who uses
+                // complex settings objects?
+                for (int i = 0; i < properties.Length; i++)
+                {
+                    var property = properties[i];
+                    codeBuilder.AppendLine($"{indentation}    {property.Name} = {ConvertJToken(property.Value)}{(i != properties.Length - 1 ? "," : string.Empty)}");
+                }
+
+                codeBuilder.AppendLine(indentation + "})");
+            }
+        }
+
+        private void AddWithLine(StringBuilder codeBuilder, string name, string value)
+        {
+            if (!string.IsNullOrEmpty(value))
+            {
+                codeBuilder.AppendLine($"        .With{name}(\"{value}\")");
+            }
+        }
     }
 }


Version check.

Version check.

--- ksp_plugin_adapter/ksp_plugin_adapter.cs
+++ ksp_plugin_adapter/ksp_plugin_adapter.cs
@@ -293,8 +293,8 @@
           (Versioning.version_minor == 8 && Versioning.Revision == 1) ||
           (Versioning.version_minor == 9 && Versioning.Revision == 1) ||
           (Versioning.version_minor == 10 && Versioning.Revision == 1) ||
-          (Versioning.version_minor == 11 && Versioning.Revision == 0))) {
-      string expected_version = "1.8.1, 1.9.1, 1.10.1, and 1.11.0";
+          (Versioning.version_minor == 11 && Versioning.Revision >= 0))) {
+      string expected_version = "1.8.1, 1.9.1, 1.10.1, and 1.11.x";
 #elif KSP_VERSION_1_7_3
     if (!(Versioning.version_major == 1 &&
           (Versioning.version_minor == 5 && Versioning.Revision == 1) ||


killing the gravitic thing is a bad idea, it makes the non-part things (physicalObjects) fly everywhere. Maybe someday we should handle those, but that seems really tedious

--- ksp_plugin_adapter/ksp_plugin_adapter.cs
+++ ksp_plugin_adapter/ksp_plugin_adapter.cs
@@ -924,15 +924,6 @@
     // part.forces, part.force, and part.torque are cleared by the/
     // FlightIntegrator's FixedUpdate (while we are yielding).
     if (PluginRunning()) {
-      if (has_active_vessel_in_space() && FlightGlobals.ActiveVessel.packed) {
-        if (PhysicsGlobals.GraviticForceMultiplier != 0) {  // sic.
-          Log.Info("Killing stock gravity");
-          PhysicsGlobals.GraviticForceMultiplier = 0;
-        }
-      } else if (PhysicsGlobals.GraviticForceMultiplier == 0) {
-        Log.Info("Reinstating stock gravity");
-        PhysicsGlobals.GraviticForceMultiplier = 1;
-      }
       foreach (Vessel vessel in FlightGlobals.Vessels.Where(is_in_space)) {
         bool inserted;
         plugin_.InsertOrKeepVessel(vessel.id.ToString(),


Add changes to EventGraph

Add changes to EventGraph

--- src/Marten/Events/EventGraph.cs
+++ src/Marten/Events/EventGraph.cs
@@ -136,6 +136,7 @@
         }

         internal DbObjectName ProgressionTable => new DbObjectName(DatabaseSchemaName, "mt_event_progression");
+        internal DbObjectName StreamsTable => new DbObjectName(DatabaseSchemaName, "mt_streams");

         public string AggregateAliasFor(Type aggregateType)
         {
@@ -156,6 +157,7 @@
             get
             {
                 var eventsTable = new EventsTable(this);
+                var streamsTable = new StreamsTable(this);

                 // SAMPLE: using-sequence
                 var sequence = new Sequence(new DbObjectName(DatabaseSchemaName, "mt_events_sequence"))
@@ -167,11 +169,10 @@

                 return new ISchemaObject[]
                 {
-                    new StreamsTable(this),
+                    streamsTable,
                     eventsTable,
                     new EventProgressionTable(DatabaseSchemaName),
                     sequence,
-                    new AppendEventFunction(this),
                     new SystemFunction(DatabaseSchemaName, "mt_mark_event_progression", "varchar, bigint"),
                 };
             }


Updated HighlightAdorner for Expanded items.

--- GongSolutions.Wpf.DragDrop/DropTargetHighlightAdorner.cs
+++ GongSolutions.Wpf.DragDrop/DropTargetHighlightAdorner.cs
@@ -25,11 +25,11 @@
             rect = new Rect(tvItem.TranslatePoint(new Point(), this.AdornedElement), new Size(descendant.Width + 4, grid.RowDefinitions[0].ActualHeight));
           }
         }
-        if (rect.IsEmpty) {
+        if (tvItem.IsExpanded) {
           rect = new Rect(visualTargetItem.TranslatePoint(new Point(), this.AdornedElement), VisualTreeHelper.GetDescendantBounds(visualTargetItem).Size);
         }
         drawingContext.DrawRoundedRectangle(null, new Pen(Brushes.Gray, 2), rect, 2, 2);
       }
     }
   }
-}+}


Fixed IT with google

Fixed IT with google

--- GoogleMapsApi.Test/IntegrationTests/PlacesSearchTests.cs
+++ GoogleMapsApi.Test/IntegrationTests/PlacesSearchTests.cs
@@ -29,8 +29,6 @@
                 Assert.Inconclusive("Cannot run test since you have exceeded your Google API query limit.");
             Assert.AreEqual(GoogleMapsApi.Entities.Places.Response.Status.OK, result.Status);
             Assert.IsTrue(result.Results.Count() > 5);
-            var correctPizzaPlace = result.Results.Where(t => t.Name.Contains("Pagliacci"));
-            Assert.IsTrue(correctPizzaPlace != null && correctPizzaPlace.Count() > 0);
         }

         [Test]
@@ -99,4 +97,4 @@
             Assert.IsFalse(result.Results.Any(t => t.Reference == resultFromFirstPage.Reference));
         }
     }
-}+}


sum all the things

sum all the things

--- HackManchester2014/HackManchester2014/Home/HomeModule.cs
+++ HackManchester2014/HackManchester2014/Home/HomeModule.cs
@@ -1,12 +1,9 @@
-using System.Linq;
-using HackManchester2014.Domain;
 using HackManchester2014.Infrastructure;

 namespace HackManchester2014.Home
 {
     using HackManchester2014.Domain;
     using HackManchester2014.Home.Models;
-    using HackManchester2014.Infrastructure.Indexes;
     using HackManchester2014.Map;
     using HackManchester2014.Map.Models;
     using Nancy;
@@ -27,7 +24,7 @@
                     }
                 };

-                model.TotalDonations = documentSession.Query<Entry>().Sum(x => x.Donation.Amount ?? 0); ;
+                model.TotalDonations = documentSession.Query<Entry>().ToList().Sum(x => x.Donation.Amount ?? 0); ;
                 model.TotalChallenges = documentSession.Query<Entry>().Count();

                 return Negotiate.WithView("Index")


upates

upates

--- HermodHTTPServer/Attributes/HTTPEventMappingAttribute.cs
+++ HermodHTTPServer/Attributes/HTTPEventMappingAttribute.cs
@@ -63,6 +63,26 @@

         #region Constructor(s)

+        #region HTTPEventMappingAttribute(EventIdentification, UriTemplate, MaxNumberOfCachedEvents = 0, IsSharedEventSource = false)
+
+        /// <summary>
+        /// Creates a new HTTP event mapping.
+        /// </summary>
+        /// <param name="EventIdentification">The internal identification of the HTTP event.</param>
+        /// <param name="UriTemplate">The URI template of this HTTP event mapping.</param>
+        /// <param name="MaxNumberOfCachedEvents">Maximum number of cached events (0 means infinite).</param>
+        /// <param name="IsSharedEventSource">The event source may be accessed via multiple URI templates.</param>
+        public HTTPEventMappingAttribute(String EventIdentification, String UriTemplate, UInt32 MaxNumberOfCachedEvents = 0, Boolean IsSharedEventSource = false)
+        {
+            this.EventIdentification     = EventIdentification;
+            this.UriTemplate             = UriTemplate;
+            this.HTTPMethod              = HTTPMethod.GET;
+            this.MaxNumberOfCachedEvents = MaxNumberOfCachedEvents;
+            this.IsSharedEventSource     = IsSharedEventSource;
+        }
+
+        #endregion
+
         #region HTTPEventMappingAttribute(EventIdentification, UriTemplate, HTTPMethod, MaxNumberOfCachedEvents = 0, IsSharedEventSource = false)

         /// <summary>


Removed dead code.  Need to add array serializing/deserializing next.

--- Reflection/Construction/TypeFactory.cs
+++ Reflection/Construction/TypeFactory.cs
@@ -39,12 +39,6 @@

       public static object CreateInstance(Type type, IDictionary<TypeMemberSerializationInfo, object> data)
       {
-         //object result = type.TryCreateInstance((from x in data.Keys
-         //                                        select x.ConstructorFriendlyName).ToArray<string>(),
-         //                                       (from x in data.Keys
-         //                                        select x.DataType).ToArray<Type>(),
-         //                                       data.Values.ToArray()
-         //   );
          object result = null;

          object[] paramValues;


Reverted SolutionInfo to previous published information

--- src/SolutionInfo.cs
+++ src/SolutionInfo.cs
@@ -2,6 +2,5 @@

 [assembly: AssemblyProduct("Faker.NET (Portable Edition)")]
 [assembly: AssemblyCopyright("Copyright © 2012-2016")]
-[assembly: AssemblyVersion("2.4.0.0")]
-[assembly: AssemblyFileVersion("2.4.0.0")]
-[assembly: AssemblyInformationalVersion("2.4.0-build-script.1+127.Branch.build-script.Sha.130d48d38d615357c2150d459537188fe618412d")]
+[assembly: AssemblyVersion("2.3.0.67")]
+[assembly: AssemblyFileVersion("2.3.0.67")]


Bump version to 8.15.0

Bump version to 8.15.0

--- src/SolutionInfo.cs
+++ src/SolutionInfo.cs
@@ -19,4 +19,4 @@

 // these are FYI and changed automatically
 [assembly: AssemblyFileVersion("8.15.0")]
-[assembly: AssemblyInformationalVersion("8.15.0-rc")]
+[assembly: AssemblyInformationalVersion("8.15.0")]


WinForms - Allow setting of Focus before underlying CEF browser has been initialized

--- CefSharp.WinForms/ChromiumWebBrowser.cs
+++ CefSharp.WinForms/ChromiumWebBrowser.cs
@@ -86,6 +86,11 @@
         /// when <see cref="RecreatingHandle"/> is <c>true</c>.
         /// </summary>
         private Control parkingControl;
+        /// <summary>
+        /// This flag is set when the browser gets focus before the underlying CEF browser
+        /// has been initialized.
+        /// </summary>
+        private bool initialFocus;

         /// <summary>
         /// Gets a value indicating whether this instance is disposed.
@@ -636,6 +641,11 @@
                 browser.MainFrame.LoadUrl(Address);
             }

+            if(initialFocus)
+            {
+                browser.GetHost()?.SetFocus(true);
+            }
+
             IsBrowserInitializedChanged?.Invoke(this, EventArgs.Empty);
         }

@@ -770,15 +780,16 @@
             ResizeBrowser(Width, Height);
         }

-        /// <summary>
-        /// Raises the <see cref="E:System.Windows.Forms.Control.GotFocus" /> event.
-        /// </summary>
-        /// <param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
+        /// <inheritdoc/>
         protected override void OnGotFocus(EventArgs e)
         {
             if (IsBrowserInitialized)
             {
                 browser.GetHost().SetFocus(true);
+            }
+            else
+            {
+                initialFocus = true;
             }

             base.OnGotFocus(e);


WinForms - OnHandleDestroyed directly references CefSharp.Core crashing Designer

Designer attempts to load CefSharp.Core.dll which in fails, we avoid that when designMode is true

Resolves #3219

--- CefSharp.WinForms/ChromiumWebBrowser.cs
+++ CefSharp.WinForms/ChromiumWebBrowser.cs
@@ -673,6 +673,18 @@

         protected override void OnHandleDestroyed(EventArgs e)
         {
+            if (!designMode)
+            {
+                // NOTE: Had to move the code out of this function otherwise the designer would crash
+                OnHandleDestroyedInternal();
+            }
+
+            base.OnHandleDestroyed(e);
+        }
+
+        [MethodImpl(MethodImplOptions.NoInlining)]
+        private void OnHandleDestroyedInternal()
+        {
             //When the Control is being Recreated then we'll park
             //the browser (set to a temp parent) and assign to
             //our new handle when it's ready.
@@ -686,8 +698,6 @@

                 NativeMethodWrapper.SetWindowParent(hwnd, parkingControl.Handle);
             }
-
-            base.OnHandleDestroyed(e);
         }

         /// <summary>


Added and implemented ShapeNURBS3D class

--- ISSAR.MSolve.IGAPreProcessor/Integration/ShapeNURBS3D.cs
+++ ISSAR.MSolve.IGAPreProcessor/Integration/ShapeNURBS3D.cs
@@ -1,4 +1,7 @@
-using System;
+using ISAAR.MSolve.Matrices;
+using ISAAR.MSolve.Matrices.Interfaces;
+using ISSAR.MSolve.IGAPreProcessor.Elements;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -7,5 +10,105 @@
 {
     class ShapeNURBS3D
     {
+        public IMatrix2D<double> nurbsValues { get; }
+        public IMatrix2D<double> nurbsDerivativeValuesKsi { get; }
+        public IMatrix2D<double> nurbsDerivativeValuesHeta { get; }
+        public IMatrix2D<double> nurbsDerivativeValuesZeta { get; }
+
+        public ShapeNURBS3D(NURBSElement3D element, IGAModel model, IVector<double> parametricCoordinateKsi, IVector<double> parametricCoordinateHeta, IVector<double> parametricCoordinateZeta, IList<ControlPoint> controlPoints)
+        {
+            int numberOfCPHeta = model.KnotValueVectorHeta.Length - model.DegreeHeta - 1;
+            int numberOfCPZeta = model.KnotValueVectorZeta.Length - model.DegreeZeta - 1;
+
+            BSPLines1D bsplinesKsi = new BSPLines1D(model.DegreeKsi, model.KnotValueVectorKsi, parametricCoordinateKsi);
+            BSPLines1D bsplinesHeta = new BSPLines1D(model.DegreeHeta, model.KnotValueVectorHeta, parametricCoordinateHeta);
+            BSPLines1D bsplinesZeta = new BSPLines1D(model.DegreeZeta, model.KnotValueVectorZeta, parametricCoordinateZeta);
+
+            nurbsValues = new Matrix2D<double>((model.DegreeKsi + 1) * (model.DegreeHeta + 1)* (model.DegreeZeta + 1), element.gaussPoints.Count);
+            nurbsDerivativeValuesKsi = new Matrix2D<double>((model.DegreeKsi + 1) * (model.DegreeHeta + 1)* (model.DegreeZeta + 1), element.gaussPoints.Count);
+            nurbsDerivativeValuesHeta = new Matrix2D<double>((model.DegreeKsi + 1) * (model.DegreeHeta + 1)* (model.DegreeZeta + 1), element.gaussPoints.Count);
+            nurbsDerivativeValuesZeta = new Matrix2D<double>((model.DegreeKsi + 1) * (model.DegreeHeta + 1) * (model.DegreeZeta + 1), element.gaussPoints.Count);
+
+            int supportKsi = model.DegreeKsi + 1;
+            int supportHeta = model.DegreeHeta + 1;
+            int supportZeta = model.DegreeZeta + 1;
+            int numberOfElementGaussPoints = (model.DegreeKsi + 1) * (model.DegreeHeta + 1) * (model.DegreeZeta + 1);
+
+
+            for (int i = 0; i < supportKsi; i++)
+            {
+                for (int j = 0; j < supportHeta; j++)
+                {
+                    for (int k = 0; k < supportZeta; k++)
+                    {
+                        double sumKsiHetaZeta = 0;
+                        double sumdKsiHetaZeta = 0;
+                        double sumKsidHetaZeta = 0;
+                        double sumKsiHetadZeta = 0;
+
+                        for (int m = 0; m < numberOfElementGaussPoints; m++)
+                        {
+                            int indexKsi = element.connectivity[m] / (numberOfCPHeta * numberOfCPZeta);
+                            int indexHeta = element.connectivity[m] % (numberOfCPHeta * numberOfCPZeta) / numberOfCPZeta;
+                            int indexZeta = element.connectivity[m] % (numberOfCPHeta * numberOfCPZeta) % numberOfCPZeta;
+
+                            sumKsiHetaZeta += bsplinesKsi.BSPLValues[indexKsi, i] *
+                                bsplinesHeta.BSPLValues[indexHeta, j] *
+                                bsplinesZeta.BSPLValues[indexZeta, k] *
+                                controlPoints[m].Weight;
+
+                            sumdKsiHetaZeta += bsplinesKsi.BSPLDerivativeValues[indexKsi,i]*
+                                bsplinesHeta.BSPLValues[indexHeta, j] *
+                                bsplinesZeta.BSPLValues[indexZeta, k] *
+                                controlPoints[m].Weight;
+
+                            sumKsidHetaZeta += bsplinesKsi.BSPLValues[indexKsi, i] *
+                                bsplinesHeta.BSPLDerivativeValues[indexHeta,j] *
+                                bsplinesZeta.BSPLValues[indexZeta, k] *
+                                controlPoints[m].Weight;
+
+                            sumKsiHetadZeta += bsplinesKsi.BSPLValues[indexKsi, i] *
+                                bsplinesHeta.BSPLValues[indexHeta, j] *
+                                bsplinesZeta.BSPLDerivativeValues[indexZeta,k] *
+                                controlPoints[m].Weight;
+                        }
+                        for (int m = 0; m < numberOfElementGaussPoints; m++)
+                        {
+                            int indexKsi = element.connectivity[m] / (numberOfCPHeta * numberOfCPZeta);
+                            int indexHeta = element.connectivity[m] % (numberOfCPHeta * numberOfCPZeta) / numberOfCPZeta;
+                            int indexZeta = element.connectivity[m] % (numberOfCPHeta * numberOfCPZeta) % numberOfCPZeta;
+
+                            nurbsValues[m, i * supportHeta * supportZeta + j * supportZeta + k] =
+                                bsplinesKsi.BSPLValues[indexKsi, i] *
+                                bsplinesHeta.BSPLValues[indexHeta, j] *
+                                bsplinesZeta.BSPLValues[indexZeta, k] *
+                                controlPoints[m].Weight / sumKsiHetaZeta;
+
+                            nurbsDerivativeValuesKsi[m, i * supportHeta * supportZeta + j * supportZeta + k] =
+                                (bsplinesKsi.BSPLDerivativeValues[indexKsi, i] * sumKsiHetaZeta -
+                                bsplinesKsi.BSPLValues[indexKsi, i] * sumdKsiHetaZeta) *
+                                bsplinesHeta.BSPLValues[indexHeta, j] *
+                                bsplinesZeta.BSPLValues[indexZeta, k] *
+                                controlPoints[m].Weight / Math.Pow(sumKsiHetaZeta, 2);
+
+                            nurbsDerivativeValuesHeta[m, i * supportHeta * supportZeta + j * supportZeta + k] =
+                                bsplinesKsi.BSPLValues[indexKsi, i] *
+                                (bsplinesHeta.BSPLDerivativeValues[indexHeta, j] * sumKsiHetaZeta -
+                                bsplinesHeta.BSPLValues[indexHeta, j] * sumKsidHetaZeta) *
+                                bsplinesZeta.BSPLValues[indexZeta, k] *
+                                controlPoints[m].Weight / Math.Pow(sumKsiHetaZeta, 2);
+
+                            nurbsDerivativeValuesZeta[m, i * supportHeta * supportZeta + j * supportZeta + k] =
+                                bsplinesKsi.BSPLValues[indexKsi, i] *
+                                bsplinesHeta.BSPLValues[indexHeta, j] *
+                                (bsplinesZeta.BSPLDerivativeValues[indexZeta, k] * sumKsiHetaZeta -
+                                bsplinesZeta.BSPLValues[indexZeta, k] * sumKsiHetadZeta) *
+                                controlPoints[m].Weight / Math.Pow(sumKsiHetaZeta, 2);
+                        }
+
+                    }
+                }
+            }
+        }
     }
 }


Restore issues list's filter load/save functionality.

--- JiraAssistant.Logic/ViewModels/IssuesBrowserViewModel.cs
+++ JiraAssistant.Logic/ViewModels/IssuesBrowserViewModel.cs
@@ -12,136 +12,140 @@
 using System.Text;
 using System.Text.RegularExpressions;
 using System.Windows;
+using Telerik.Windows.Controls;
 using Telerik.Windows.Data;
 using Telerik.Windows.Persistence;
+using Telerik.Windows.Persistence.Services;

 namespace JiraAssistant.Logic.ViewModels
 {
-    public class IssuesBrowserViewModel : ViewModelBase
-   {
-      private readonly string _settingsPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
-                                                           "Yakuza", "Jira Assistant", "GridFilters");
-      private readonly IMessenger _messenger;
+    public class IssuesBrowserViewModel : GalaSoft.MvvmLight.ViewModelBase
+    {
+        private readonly string _settingsPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
+                                                             "Yakuza", "Jira Assistant", "GridFilters");
+        private readonly IMessenger _messenger;

-      public RelayCommand SaveFiltersCommand { get; private set; }
-      public BindableRadGridView Grid { get; set; }
-      public RelayCommand LoadFiltersCommand { get; private set; }
-      public RelayCommand ExportToConfluenceCommand { get; private set; }
-      public RelayCommand PlainTextExportCommand { get; private set; }
-      public RelayCommand OpenScrumCardsCommand { get; private set; }
+        public RelayCommand SaveFiltersCommand { get; private set; }
+        public BindableRadGridView Grid { get; set; }
+        public RelayCommand LoadFiltersCommand { get; private set; }
+        public RelayCommand ExportToConfluenceCommand { get; private set; }
+        public RelayCommand PlainTextExportCommand { get; private set; }
+        public RelayCommand OpenScrumCardsCommand { get; private set; }

-      public QueryableCollectionView Issues { get; private set; }
-      public JiraIssue SelectedIssue { get; set; }
+        public QueryableCollectionView Issues { get; private set; }
+        public JiraIssue SelectedIssue { get; set; }

-      public IssuesBrowserViewModel(IList<JiraIssue> issues, IMessenger messenger)
-      {
-         Issues = new QueryableCollectionView(issues);
-         _messenger = messenger;
+        public IssuesBrowserViewModel(IList<JiraIssue> issues, IMessenger messenger)
+        {
+            Issues = new QueryableCollectionView(issues);
+            _messenger = messenger;

-         SaveFiltersCommand = new RelayCommand(SaveGridState);
-         LoadFiltersCommand = new RelayCommand(LoadGridState);
-         ExportToConfluenceCommand = new RelayCommand(ExportAsConfluenceMarkupResults);
-         PlainTextExportCommand = new RelayCommand(ExportAsTextResults);
-         OpenScrumCardsCommand = new RelayCommand(OpenScrumCards);
-      }
+            ServiceProvider.RegisterPersistenceProvider<ICustomPropertyProvider>(typeof(BindableRadGridView), new BindableGridViewPropertyProvider());

-      private void SaveGridState()
-      {
-         var dialog = new FilterNameDialog();
-         if (dialog.ShowDialog() == false)
-            return;
+            SaveFiltersCommand = new RelayCommand(SaveGridState);
+            LoadFiltersCommand = new RelayCommand(LoadGridState);
+            ExportToConfluenceCommand = new RelayCommand(ExportAsConfluenceMarkupResults);
+            PlainTextExportCommand = new RelayCommand(ExportAsTextResults);
+            OpenScrumCardsCommand = new RelayCommand(OpenScrumCards);
+        }

-         var name = Regex.Replace(dialog.FilterName, @"[^\w\s]", "_");
+        private void SaveGridState()
+        {
+            var dialog = new FilterNameDialog();
+            if (dialog.ShowDialog() == false)
+                return;

-         if (File.Exists(Path.Combine(_settingsPath, name)))
-         {
-            var result = MessageBox.Show("Do you want to overwrite existing filter?", "Jira Assistant", MessageBoxButton.YesNo, MessageBoxImage.Warning);
+            var name = Regex.Replace(dialog.FilterName, @"[^\w\s]", "_");

-            if (result == MessageBoxResult.No)
-               return;
-         }
+            if (File.Exists(Path.Combine(_settingsPath, name)))
+            {
+                var result = MessageBox.Show("Do you want to overwrite existing filter?", "Jira Assistant", MessageBoxButton.YesNo, MessageBoxImage.Warning);

-         var manager = new PersistenceManager();
-         manager.AllowCrossVersion = true;
-         var savedState = manager.Save(Grid);
-         using (var reader = new StreamReader(savedState))
-         using (var writer = new StreamWriter(Path.Combine(_settingsPath, name)))
-         {
-            writer.Write(reader.ReadToEnd());
-         }
-      }
+                if (result == MessageBoxResult.No)
+                    return;
+            }

-      public void PreviewSelectedIssue()
-      {
-         if (SelectedIssue != null)
-            _messenger.Send(new OpenIssueDetailsMessage(SelectedIssue));
-      }
+            var manager = new PersistenceManager();
+            manager.AllowCrossVersion = true;
+            var savedState = manager.Save(Grid);
+            using (var reader = new StreamReader(savedState))
+            using (var writer = new StreamWriter(Path.Combine(_settingsPath, name)))
+            {
+                writer.Write(reader.ReadToEnd());
+            }
+        }

-      private void LoadGridState()
-      {
-         var filters = Directory.EnumerateFiles(_settingsPath).Select(p => Path.GetFileName(p)).ToArray();
-         var dialog = new SelectFilterDialog(filters);
-         if (dialog.ShowDialog() == false)
-            return;
+        public void PreviewSelectedIssue()
+        {
+            if (SelectedIssue != null)
+                _messenger.Send(new OpenIssueDetailsMessage(SelectedIssue));
+        }

-         var manager = new PersistenceManager();
-         manager.AllowCrossVersion = true;
-         using (var stream = File.OpenRead(Path.Combine(_settingsPath, dialog.FilterName)))
-         {
-            manager.Load(Grid, stream);
-         }
-      }
+        private void LoadGridState()
+        {
+            var filters = Directory.EnumerateFiles(_settingsPath).Select(p => Path.GetFileName(p)).ToArray();
+            var dialog = new SelectFilterDialog(filters);
+            if (dialog.ShowDialog() == false)
+                return;

-      private void ExportAsConfluenceMarkupResults()
-      {
-         var resultBuilder = new StringBuilder();
-         var grouped = Issues.OfType<JiraIssue>().GroupBy(i => i.EpicName);
+            var manager = new PersistenceManager();
+            manager.AllowCrossVersion = true;
+            using (var stream = File.OpenRead(Path.Combine(_settingsPath, dialog.FilterName)))
+            {
+                manager.Load(Grid as RadGridView, stream);
+            }
+        }

-         foreach (var group in grouped)
-         {
-            resultBuilder.AppendLine();
-            if (string.IsNullOrWhiteSpace(group.Key))
-               resultBuilder.AppendLine("h2. (No Epic)");
-            else
-               resultBuilder.AppendLine("h2. " + group.Key);
-            resultBuilder.AppendLine();
+        private void ExportAsConfluenceMarkupResults()
+        {
+            var resultBuilder = new StringBuilder();
+            var grouped = Issues.OfType<JiraIssue>().GroupBy(i => i.EpicName);

-            foreach (var issue in group)
-               resultBuilder.AppendLine(string.Format("* *{0}* - {1}", issue.Key, EscapeConfluenceMarkupCharacters(issue.Summary)));
-         }
+            foreach (var group in grouped)
+            {
+                resultBuilder.AppendLine();
+                if (string.IsNullOrWhiteSpace(group.Key))
+                    resultBuilder.AppendLine("h2. (No Epic)");
+                else
+                    resultBuilder.AppendLine("h2. " + group.Key);
+                resultBuilder.AppendLine();

-         var dialog = new TextualPreview(resultBuilder.ToString());
-         dialog.ShowDialog();
-      }
+                foreach (var issue in group)
+                    resultBuilder.AppendLine(string.Format("* *{0}* - {1}", issue.Key, EscapeConfluenceMarkupCharacters(issue.Summary)));
+            }

-      private string EscapeConfluenceMarkupCharacters(string summary)
-      {
-         return Regex.Replace(summary, @"[{\[\]\}\(\)!@\\]", m => "\\" + m.Value);
-      }
+            var dialog = new TextualPreview(resultBuilder.ToString());
+            dialog.ShowDialog();
+        }

-      private void ExportAsTextResults()
-      {
-         var resultBuilder = new StringBuilder();
-         var grouped = Issues.OfType<JiraIssue>().GroupBy(i => i.EpicName);
+        private string EscapeConfluenceMarkupCharacters(string summary)
+        {
+            return Regex.Replace(summary, @"[{\[\]\}\(\)!@\\]", m => "\\" + m.Value);
+        }

-         foreach (var group in grouped)
-         {
-            if (string.IsNullOrWhiteSpace(group.Key))
-               resultBuilder.AppendLine("(No Epic)");
-            else
-               resultBuilder.AppendLine(group.Key);
+        private void ExportAsTextResults()
+        {
+            var resultBuilder = new StringBuilder();
+            var grouped = Issues.OfType<JiraIssue>().GroupBy(i => i.EpicName);

-            foreach (var issue in group)
-               resultBuilder.AppendLine(string.Format("* {0} - {1}", issue.Key, issue.Summary));
-         }
+            foreach (var group in grouped)
+            {
+                if (string.IsNullOrWhiteSpace(group.Key))
+                    resultBuilder.AppendLine("(No Epic)");
+                else
+                    resultBuilder.AppendLine(group.Key);

-         var dialog = new TextualPreview(resultBuilder.ToString());
-         dialog.ShowDialog();
-      }
+                foreach (var issue in group)
+                    resultBuilder.AppendLine(string.Format("* {0} - {1}", issue.Key, issue.Summary));
+            }

-      private void OpenScrumCards()
-      {
-         _messenger.Send(new OpenScrumCardsMessage(Issues.OfType<JiraIssue>().ToList()));
-      }
-   }
+            var dialog = new TextualPreview(resultBuilder.ToString());
+            dialog.ShowDialog();
+        }
+
+        private void OpenScrumCards()
+        {
+            _messenger.Send(new OpenScrumCardsMessage(Issues.OfType<JiraIssue>().ToList()));
+        }
+    }
 }


Check to see if the result is in scope before we use it for a cached entry.

--- LINQToTTree/LINQToTTreeLib/QueryVisitors/QueryVisitor.cs
+++ LINQToTTree/LINQToTTreeLib/QueryVisitors/QueryVisitor.cs
@@ -181,8 +181,12 @@
             var cachedResult = _codeContext.GetReplacement(queryModel);
             if (cachedResult != null)
             {
-                _codeEnv.SetResult(cachedResult);
-                return;
+                var context = _codeEnv.FirstAllInScopeFromNow(FindDeclarableParameters.FindAll(cachedResult));
+                if (context != null)
+                {
+                    _codeEnv.SetResult(cachedResult);
+                    return;
+                }
             }

             //


Useless as of 1.0

Useless as of 1.0

--- LanguagePatches/LanguagePatches/LanguagePatches/xItem.cs
+++ LanguagePatches/LanguagePatches/LanguagePatches/xItem.cs
@@ -1,214 +0,0 @@
-/**
- * Language Patches
- * Copyright (C) 2015 Thomas P. (http://kerbalspaceprogram.de), simon56modder
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301  USA
- *
- * This library is intended to be used as a plugin for Kerbal Space Program
- * which is copyright 2011-2015 Squad. Your usage of Kerbal Space Program
- * itself is governed by the terms of its EULA, not the license above.
- *
- * https://kerbalspaceprogram.com
- */
-using System;
-using System.Collections.Generic;
-using System.Runtime.CompilerServices;
-using System.Xml;
-using System.IO;
-using UnityEngine;
-
-
-namespace LanguagePatches
-{
-    [KSPAddon(KSPAddon.Startup.EveryScene, false)]
-    public class xItem : MonoBehaviour
-    {
-        private GameObject _UI;
-        private List<zItem> NzItems;
-        private static List<zItem> zItems;
-
-        public static void Load()
-        {
-            if (Loader.loadCache && File.Exists(Loader.path + "Item.xml"))
-            {
-                XmlDocument document = new XmlDocument();
-                document.Load(Loader.path + "Item.xml");
-                zItems = new List<zItem>();
-                foreach (XmlNode node in document.ChildNodes)
-                {
-                    if (node.Name == "Items")
-                    {
-                        foreach (XmlNode node2 in node.ChildNodes)
-                        {
-                            if (node2 is XmlElement)
-                            {
-                                XmlElement element = node2 as XmlElement;
-                                zItem item = new zItem
-                                {
-                                    Scene = ToGameScenes(element.GetAttribute("scene")),
-                                    Path = element.GetAttribute("path"),
-                                    Type = element.GetAttribute("type"),
-                                    zDict = new Dictionary<string, string>()
-                                };
-                                foreach (XmlNode node3 in node2.ChildNodes)
-                                {
-                                    if (node3 is XmlElement)
-                                    {
-                                        item.zDict[((XmlElement)node3).GetAttribute("name")] = node3.InnerText;
-                                    }
-                                }
-                                zItems.Add(item);
-                            }
-                        }
-                    }
-                }
-            }
-            Debug.Log("xItem Loaded:" + zItems.Count.ToString());
-        }
-
-        private void OnGUI()
-        {
-        }
-
-        private void Start()
-        {
-            if (Loader.loadCache && File.Exists(Loader.path + "Item.xml"))
-            {
-                if (zItems == null)
-                {
-                    Load();
-                }
-                this._UI = GameObject.Find("_UI");
-                if (this._UI != null)
-                {
-                    Debug.Log("UI..................................................");
-                }
-                if (zItems != null)
-                {
-                    this.NzItems = new List<zItem>();
-                    foreach (zItem item in zItems)
-                    {
-                        if (item.Scene == HighLogic.LoadedScene)
-                        {
-                            this.NzItems.Add(item);
-                        }
-                    }
-                }
-            }
-        }
-
-        public static GameScenes ToGameScenes(string scene)
-        {
-            switch (scene.ToUpper())
-            {
-                case "LOADING":
-                    return GameScenes.LOADING;
-
-                case "LOADINGBUFFER":
-                    return GameScenes.LOADINGBUFFER;
-
-                case "MAINMENU":
-                    return GameScenes.MAINMENU;
-
-                case "SETTINGS":
-                    return GameScenes.SETTINGS;
-
-                case "CREDITS":
-                    return GameScenes.CREDITS;
-
-                case "SPACECENTER":
-                    return GameScenes.SPACECENTER;
-
-                case "EDITOR":
-                    return GameScenes.EDITOR;
-
-                case "FLIGHT":
-                    return GameScenes.FLIGHT;
-
-                case "TRACKSTATION":
-                    return GameScenes.TRACKSTATION;
-
-                case "SPH":
-                    return GameScenes.PSYSTEM;
-
-                case "PSYSTEM":
-                    return (GameScenes.TRACKSTATION | GameScenes.MAINMENU);
-            }
-            return GameScenes.LOADING;
-        }
-
-        private void Update()
-        {
-            if (Loader.loadCache && File.Exists(Loader.path + "Item.xml"))
-            {
-                if (this._UI != null)
-                {
-                    foreach (zItem item in this.NzItems)
-                    {
-                        SpriteTextRich rich;
-                        if (item.NowObject == null)
-                        {
-                            item.NowObject = this._UI.transform.Find(item.Path);
-                        }
-                        if (item.NowObject != null)
-                        {
-                            string type = item.Type;
-                            if (type != null)
-                            {
-                                if (!(type == "SpriteText"))
-                                {
-                                    if (type == "SpriteTextRich")
-                                    {
-                                        goto Label_0106;
-                                    }
-                                }
-                                else
-                                {
-                                    SpriteText component = item.NowObject.gameObject.GetComponent<SpriteText>();
-                                    if ((component != null) && item.zDict.ContainsKey(component.Text))
-                                    {
-                                        component.Text = item.zDict[component.Text];
-                                    }
-                                }
-                            }
-                        }
-                        continue;
-                    Label_0106:
-                        rich = item.NowObject.gameObject.GetComponent<SpriteTextRich>();
-                        if ((rich != null) && item.zDict.ContainsKey(rich.Text))
-                        {
-                            rich.Text = item.zDict[rich.Text];
-                        }
-                    }
-                }
-            }
-        }
-
-        public class zItem
-        {
-            public Transform NowObject { get; set; }
-
-            public string Path { get; set; }
-
-            public GameScenes Scene { get; set; }
-
-            public string Type { get; set; }
-
-            public Dictionary<string, string> zDict { get; set; }
-        }
-    }
-}
-


Withdraw contracts if you don't have the contract lock

--- LmpClient/Systems/ShareContracts/ShareContractsEvents.cs
+++ LmpClient/Systems/ShareContracts/ShareContractsEvents.cs
@@ -103,7 +103,9 @@
         {
             if (!LockSystem.LockQuery.ContractLockBelongsToPlayer(SettingsSystem.CurrentSettings.PlayerName))
             {
-                //We don't have the contract lock so remove the contract that spawned
+                //We don't have the contract lock so remove the contract that we spawned.
+                //The idea is that ONLY THE PLAYER with the contract lock spawn contracts to the other players
+                contract.Withdraw();
                 contract.Kill();
                 return;
             }


Improves Position Constructor Exception Message (#5560)

--- Common/Securities/Positions/Position.cs
+++ Common/Securities/Positions/Position.cs
@@ -54,7 +54,7 @@
             var lots = Quantity / UnitQuantity;
             if (lots != Math.Truncate(lots))
             {
-                throw new InvalidOperationException("Position.Quantity must be a whole number multiple of the UnitQuantity.");
+                throw new InvalidOperationException($"Position.Quantity ({Quantity}) must be a whole number multiple of the UnitQuantity ({UnitQuantity}).");
             }
 #endif
         }


Use TransformStartTime in more places.

Use TransformStartTime in more places.

--- osu.Framework/Graphics/Drawable.cs
+++ osu.Framework/Graphics/Drawable.cs
@@ -1747,7 +1747,7 @@
             }

             //expiry should happen either at the end of the last transform or using the current sequence delay (whichever is highest).
-            double max = Time.Current + transformDelay;
+            double max = TransformStartTime;
             foreach (ITransform t in Transforms)
                 if (t.EndTime > max) max = t.EndTime + 1; //adding 1ms here ensures we can expire on the current frame without issue.
             LifetimeEnd = max;
@@ -1803,7 +1803,7 @@
                 Transforms.RemoveAll(t => t is TransformAlpha);
             }

-            double startTime = Time.Current + transformDelay;
+            double startTime = TransformStartTime;

             Transforms.Add(new TransformAlpha
             {
@@ -1828,7 +1828,7 @@
                 Transforms.RemoveAll(t => t is TransformAlpha);
             }

-            double startTime = Time.Current + transformDelay;
+            double startTime = TransformStartTime;

             TransformAlpha tr = new TransformAlpha
             {


Concat is preferable than Union here

Concat is preferable than Union here

--- osu.Framework/Input/ButtonInput.cs
+++ osu.Framework/Input/ButtonInput.cs
@@ -57,7 +57,7 @@
             return new TInput
             {
                 Entries =
-                    difference.Released.Select(button => new ButtonInputEntry<TButton>(button, false)).Union(
+                    difference.Released.Select(button => new ButtonInputEntry<TButton>(button, false)).Concat(
                         difference.Pressed.Select(button => new ButtonInputEntry<TButton>(button, true)))
             };
         }


Fix .net core tests using incorrect assembly

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

             // when running under nunit + netcore, entry assembly becomes nunit itself (testhost, Version=15.0.0.0), which isn't what we want.
             if (assembly == null || assembly.Location.Contains("testhost"))
-                assembly = Assembly.GetCallingAssembly();
+                assembly = Assembly.GetExecutingAssembly();

             Name = gameName;


AI now does a little run before dying.

AI now does a little run before dying.

--- Corvus/Corvus/Components/AIComponent.cs
+++ Corvus/Corvus/Components/AIComponent.cs
@@ -82,6 +82,18 @@
             set { _AllowMultiJump = value; }
         }

+        private DateTime StartOfDeath
+        {
+            get { return _StartOfDeath; }
+            set { _StartOfDeath = value; }
+        }
+
+        private bool DeathStarted
+        {
+            get { return _DeathStarted; }
+            set { _DeathStarted = value; }
+        }
+
         private Vector2 _ReactionRange = new Vector2();
         private Vector2 _OffSet = new Vector2();
         private EntityClassification _EntitiesToSearchFor;
@@ -89,6 +101,8 @@
         private bool _AllowMultiJump = true;
         private bool _IsFollowingEntity = false;
         private bool _AIEnabled = true;
+        private DateTime _StartOfDeath;
+        private bool _DeathStarted;

         private PhysicsSystem PhysicsSystem;
         private MovementComponent MovementComponent;
@@ -106,76 +120,100 @@

             if (AIEnabled)
             {
-                bool foundEntity = false;
-
-                //TODO: This could be very ineffecient.
-                //Foreach entity in this entity's reaction box.
-                foreach (Entity e in PhysicsSystem.GetEntitiesAtLocation(GetReactionBox()))
-                {
-                    var clc = e.GetComponent<ClassificationComponent>();
-                    var coc = e.GetComponent<CombatComponent>();
-
-                    if (clc.Classification == EntityClassification.Player) //If Player
-                    {
-                        foundEntity = true;
-                        IsFollowingEntity = true;
-                        IsReacting = true;
-
-                        //If we're following a path, stop.
-                        if (PathComponent.PathingEnabled)
-                            PathComponent.StopFollowing();
-
-                        //Follow the entity.
-                        FollowEntity(e, Time);
-
-                        Random r = new Random();
-                        int blockChance = r.Next(1, 5);
-                        //If the entity is attacking and is within attacking range, and is facing us, and we're not currently blocking, and blockChance is good, block.
-                        if (coc.IsAttackingMelee && EntityWithinAttackRange(e) && EntityFacingMe(e) && !coc.IsBlocking && blockChance >= 3)
-                            CombatComponent.BeginBlock();
-
-                        //If the entity isn't attacking, stop blocking.
-                        if (!coc.IsAttackingMelee && CombatComponent.IsBlocking)
+                if (!DeathStarted)
+                {
+                    bool foundEntity = false;
+
+                    //TODO: This could be very ineffecient.
+                    //Foreach entity in this entity's reaction box.
+                    foreach (Entity e in PhysicsSystem.GetEntitiesAtLocation(GetReactionBox()))
+                    {
+                        var clc = e.GetComponent<ClassificationComponent>();
+                        var coc = e.GetComponent<CombatComponent>();
+
+                        if (clc.Classification == EntityClassification.Player) //If Player
+                        {
+                            foundEntity = true;
+                            IsFollowingEntity = true;
+                            IsReacting = true;
+
+                            //If we're following a path, stop.
+                            if (PathComponent.PathingEnabled)
+                                PathComponent.StopFollowing();
+
+                            //Follow the entity.
+                            FollowEntity(e, Time);
+
+                            Random r = new Random();
+                            int blockChance = r.Next(1, 5);
+                            //If the entity is attacking and is within attacking range, and is facing us, and we're not currently blocking, and blockChance is good, block.
+                            if (coc.IsAttackingMelee && EntityWithinAttackRange(e) && EntityFacingMe(e) && !coc.IsBlocking && blockChance >= 3)
+                                CombatComponent.BeginBlock();
+
+                            //If the entity isn't attacking, stop blocking.
+                            if (!coc.IsAttackingMelee && CombatComponent.IsBlocking)
+                                CombatComponent.EndBlock();
+
+                            if (!MovementComponent.IsWalking)
+                                CombatComponent.AttackAI();
+                        }
+                        else if (clc.Classification == EntityClassification.Projectile) //If Projectile
+                        {
+                            foundEntity = true;
+                            IsFollowingEntity = false;
+                            IsReacting = true;
+
+                            //If we're following a path, stop.
+                            if (PathComponent.PathingEnabled)
+                                PathComponent.StopFollowing();
+
+                            //Basically, projectiles within our rectangle might hit us, so we'll just block.
+                            if (EntityGoingToMe(e))
+                                CombatComponent.BeginBlock();
+                            else
+                                if (CombatComponent.IsBlocking)
+                                    CombatComponent.EndBlock();
+                        }
+                    }
+
+                    //If no entities were found, resume normal pathing and end blocking.
+                    if (!foundEntity)
+                    {
+                        IsReacting = false;
+                        IsFollowingEntity = false;
+
+                        if (!PathComponent.PathingEnabled)
+                            PathComponent.StartFollowing();
+
+                        if (CombatComponent.IsBlocking)
                             CombatComponent.EndBlock();
-
-                        if (!MovementComponent.IsWalking)
-                            CombatComponent.AttackAI();
-                    }
-                    else if (clc.Classification == EntityClassification.Projectile) //If Projectile
-                    {
-                        foundEntity = true;
-                        IsFollowingEntity = false;
-                        IsReacting = true;
-
-                        //If we're following a path, stop.
-                        if (PathComponent.PathingEnabled)
-                            PathComponent.StopFollowing();
-
-                        //Basically, projectiles within our rectangle might hit us, so we'll just block.
-                        if (EntityGoingToMe(e))
-                            CombatComponent.BeginBlock();
-                        else
-                            if (CombatComponent.IsBlocking)
-                                CombatComponent.EndBlock();
-                    }
-                }
-
-                //If no entities were found, resume normal pathing and end blocking.
-                if (!foundEntity)
-                {
-                    IsReacting = false;
-                    IsFollowingEntity = false;
-
-                    if (!PathComponent.PathingEnabled)
-                        PathComponent.StartFollowing();
-
-                    if (CombatComponent.IsBlocking)
-                        CombatComponent.EndBlock();
-                }
-
-                //Kill the entity if it has run out of health.
-                if (AttributesComponent.CurrentHealth <= 0)
-                    Parent.Dispose();
+                    }
+
+                    //Begin process of death if entity has run out of health.
+                    if (AttributesComponent.CurrentHealth <= 0)
+                    {
+                        if (!DeathStarted)
+                            StartOfDeath = DateTime.Now;
+
+                        DeathStarted = true;
+                    }
+                }
+                else
+                {
+                    double totalMs = (DateTime.Now - _StartOfDeath).TotalMilliseconds;
+                    double walkTime = 250;
+
+                    if (totalMs < walkTime)
+                        MovementComponent.BeginWalking(Direction.Left);
+                    else if (totalMs >= walkTime && totalMs < walkTime*2)
+                        MovementComponent.BeginWalking(Direction.Right);
+                    else if (totalMs >= walkTime*2 && totalMs < walkTime*3)
+                        MovementComponent.BeginWalking(Direction.Left);
+                    else if (totalMs >= walkTime*3 && totalMs < walkTime*4)
+                        MovementComponent.BeginWalking(Direction.Right);
+                    else
+                        Parent.Dispose();
+                }
             }
         }


git-svn-id: https://svn.mothershipdev.com:9443/svn/PaymentSense_MothershipV2_Core/branches/Permissions&Cleanup@262 0f896bb5-3ab0-2d4e-82a7-85ef10020915

--- PS.Mothership.Core/PS.Mothership.Core.Common/Dto/User.cs
+++ PS.Mothership.Core/PS.Mothership.Core.Common/Dto/User.cs
@@ -11,7 +11,7 @@
         public Guid UserGuid { get; set; }
         public long Id { get; set; }
         public string Name { get; set; }
-        public List<Role> Roles { get; set; }
-
+        public List<Role> AssignedRoles { get; set; }
+        public List<Role> AvailableRoles { get; set; }
     }
 }


update

update

--- DQuery/CustomQuery/ExpressionBuilder.cs
+++ DQuery/CustomQuery/ExpressionBuilder.cs
@@ -9,7 +9,18 @@
 {
     public class ExpressionBuilder
     {
-        #region Build
+        #region main
+        public static Expression<Func<TSource, bool>> Build<TSource>(List<QueryClause> clauses, IEdmFunctions funcs)
+        {
+            var parameter = Expression.Parameter(typeof(TSource), "x");
+            var builder = new ExpressionBuilder { EdmFunctions = funcs };
+            var expression = builder.BuildClauseExp<TSource>(clauses, parameter);
+            if (expression == null) { expression = Expression.Constant(true); }
+            return Expression.Lambda<Func<TSource, bool>>(expression, parameter);
+        }
+        #endregion
+
+        #region build
         public IEdmFunctions EdmFunctions { get; set; }

         public Expression BuildClauseExp<TSource>(List<QueryClause> clauses, ParameterExpression parameter)
@@ -140,15 +151,6 @@

             return Expression.MakeBinary(expType, composedExp, memberValueExp);
         }
-
-        public static Expression<Func<TSource, bool>> Build<TSource>(List<QueryClause> clauses, IEdmFunctions funcs)
-        {
-            var parameter = Expression.Parameter(typeof(TSource), "x");
-            var builder = new ExpressionBuilder { EdmFunctions = funcs };
-            var expression = builder.BuildClauseExp<TSource>(clauses, parameter);
-            if (expression == null) { expression = Expression.Constant(true); }
-            return Expression.Lambda<Func<TSource, bool>>(expression, parameter);
-        }
         #endregion

         #region extends
@@ -173,12 +175,12 @@
             var canBeNull = (!memberType.IsValueType || (Nullable.GetUnderlyingType(memberType) != null));
             if (!canBeNull)
             {
-                throw new InvalidCastException("Isnull function require the column nullable");
+                throw new InvalidCastException("Isnull function require the column nullable.");
             }

             if (parameters == null || parameters.Count == 0)
             {
-                throw new ArgumentNullException("Isnull function require a parameter");
+                throw new ArgumentNullException("Isnull function require a parameter.");
             }

             var defaultValue = ConvertValue<TSource>(member.Member, parameters.First());


Updated SQL emitter to emit n args

Updated SQL emitter to emit n args

git-svn-id: 1b52f0a7ed2a8098cb721f3b9b4408691a7bfc16@1252 c93b7781-d36b-0e4d-be4f-9d94f2a838be

--- Dataphor/Server/Language.SQL/Emitter.cs
+++ Dataphor/Server/Language.SQL/Emitter.cs
@@ -270,7 +270,12 @@
 			AppendFormat("{0}{1}", expression.Identifier, Keywords.BeginGroup);
 			if (expression.IsDistinct)
 				AppendFormat("{0} ", Keywords.Distinct);
-			EmitExpression(expression.Expressions[0]);
+            for (int index = 0; index < expression.Expressions.Count; index++)
+            {
+                if (index > 0)
+                    EmitListSeparator();
+                EmitExpression(expression.Expressions[index]);
+            }
 			Append(Keywords.EndGroup);
 		}


Updated assembly version

Updated assembly version

--- src/AssemblyVersion.cs
+++ src/AssemblyVersion.cs
@@ -2,4 +2,4 @@

 // Version information for an assembly consists of the following four values: You can specify all the values or you can default the Revision and Build Numbers by using the '*' as shown below:
 [assembly: AssemblyVersion("2.1.0.0")]
-[assembly: AssemblyFileVersion("2.1.0.4")]
+[assembly: AssemblyFileVersion("2.1.0.5")]


use XmlWritter to avoid serialising Xml Declaration in csproj

--- ElectronNET.CLI/Commands/InitCommand.cs
+++ ElectronNET.CLI/Commands/InitCommand.cs
@@ -5,6 +5,7 @@
 using System.Runtime.InteropServices;
 using System.Text;
 using System.Threading.Tasks;
+using System.Xml;
 using System.Xml.Linq;

 namespace ElectronNET.CLI.Commands
@@ -147,10 +148,19 @@
                 stream.SetLength(0);
                 stream.Position = 0;

-                xmlDocument.Save(stream);
+                var xws = new XmlWriterSettings
+                {
+                    OmitXmlDeclaration = true,
+                    Indent = true
+                };
+                using (XmlWriter xw = XmlWriter.Create(stream, xws))
+                {
+                    xmlDocument.Save(xw);
+                }

-                Console.WriteLine($"{ConfigName} added in csproj!");
             }
+
+            Console.WriteLine($"{ConfigName} added in csproj!");
             return true;
         }
     }


Deleted irrelevant comment from the original analog sample the locomotion sample was copied from.

--- ExampleClients/Locamotion/Locamotion.cs
+++ ExampleClients/Locamotion/Locamotion.cs
@@ -41,9 +41,6 @@
             ClientContext.PreloadNativeLibraries();
 			using (OSVR.ClientKit.ClientContext context = new OSVR.ClientKit.ClientContext("com.osvr.exampleclients.managed.Locamotion"))
             {
-                // This is just one of the paths: specifically, the Hydra's left
-                // controller's analog trigger. More are in the docs and/or listed on
-                // startup
 #if NET20
                 using (var naviPosition = NaviPositionInterface.GetInterface(context, "/me/feet/both"))
                 using (var naviVelocity = NaviVelocityInterface.GetInterface(context, "/me/feet/both"))


#7: Modified log messages for slightly better readability

--- src/Cambion/Cambion.cs
+++ src/Cambion/Cambion.cs
@@ -89,7 +89,7 @@
                             _eventHandlers[type].Add(eventHandler);
                         }

-                        _logger.LogInformation("Registered {handlerType} as event handler for <{handler}>", handlerType.FullName, type.FullName);
+                        _logger.LogInformation("Registered <{handlerType}> as event handler for <{handler}>", handlerType.FullName, type.FullName);
                     }
                 }
             }
@@ -125,7 +125,7 @@
                             _synchronizedHandlers[key] = synchronizedHandler;
                         }

-                        _logger.LogInformation("Registered {handlerType} as synchronized handler for <{request}, {response}>", handlerType.FullName, requestType.FullName, responseType.FullName);
+                        _logger.LogInformation("Registered <{handlerType}> as synchronized handler for <{request}, {response}>", handlerType.FullName, requestType.FullName, responseType.FullName);
                     }
                 }
             }
@@ -160,7 +160,7 @@
                 }
             }

-            _logger.LogInformation("Added {handlerType} as event handler for <{handler}>", callback.Target.GetType().FullName, type.FullName);
+            _logger.LogInformation("Added <{handlerType}> as event handler for <{handler}>", callback.Target.GetType().FullName, type.FullName);
         }

         public void AddSynchronizedHandler<TRequest, TResponse>(Func<TRequest, TResponse> callback)
@@ -193,7 +193,7 @@
                 _synchronizedHandlers[key] = synchronizedHandler;
             }

-            _logger.LogInformation("Added {handlerType} as synchronized handler for <{request}, {response}>", callback.Target.GetType().FullName, requestType.FullName, responseType.FullName);
+            _logger.LogInformation("Added <{handlerType}> as synchronized handler for <{request}, {response}>", callback.Target.GetType().FullName, requestType.FullName, responseType.FullName);
         }

         public async Task PublishEventAsync<TEvent>(TEvent data)
@@ -209,11 +209,11 @@

             if (_logger.IsEnabled(LogLevel.Trace))
             {
-                _logger.LogTrace("Publishing event {eventType} to Transport with data {data}", typeof(TEvent).FullName, Convert.ToBase64String(wrapperBytes));
+                _logger.LogTrace("Publishing event <{eventType}> to Transport with data {data}", typeof(TEvent).FullName, Convert.ToBase64String(wrapperBytes));
             }
             else
             {
-                _logger.LogDebug("Publishing event {eventType} to Transport", typeof(TEvent).FullName);
+                _logger.LogDebug("Publishing event <{eventType}> to Transport", typeof(TEvent).FullName);
             }

             await _transport.PublishAsync(wrapperBytes);
@@ -249,11 +249,11 @@

             if (_logger.IsEnabled(LogLevel.Trace))
             {
-                _logger.LogTrace("Publishing synchronized {eventType} to Transport with data {data}", typeof(TRequest).FullName, Convert.ToBase64String(wrapperBytes));
+                _logger.LogTrace("Publishing synchronized <{eventType}> to Transport with data {data}", typeof(TRequest).FullName, Convert.ToBase64String(wrapperBytes));
             }
             else
             {
-                _logger.LogDebug("Publishing synchronized {eventType} to Transport", typeof(TRequest).FullName);
+                _logger.LogDebug("Publishing synchronized <{eventType}> to Transport", typeof(TRequest).FullName);
             }

             await _transport.PublishAsync(wrapperBytes);
@@ -360,11 +360,11 @@

                                 if (_logger.IsEnabled(LogLevel.Trace))
                                 {
-                                    _logger.LogTrace("Publishing synchronized reply {eventType} to Transport with data {data}", result.GetType().FullName, Convert.ToBase64String(replyWrapperBytes));
+                                    _logger.LogTrace("Publishing synchronized reply <{eventType}> to Transport with data {data}", result.GetType().FullName, Convert.ToBase64String(replyWrapperBytes));
                                 }
                                 else
                                 {
-                                    _logger.LogDebug("Publishing synchronized reply {eventType} to Transport", result.GetType().FullName);
+                                    _logger.LogDebug("Publishing synchronized reply <{eventType}> to Transport", result.GetType().FullName);
                                 }

                                 await _transport.PublishAsync(replyWrapperBytes);
@@ -404,7 +404,7 @@

         public async Task StartAsync(CancellationToken cancellationToken)
         {
-            _logger.LogInformation("Starting Transport {transport}", _transport.GetType().FullName);
+            _logger.LogInformation("Starting Cambion with Transport <{transport}> and Serializer <{serializer}>", _transport.GetType().FullName, _serializer.GetType().FullName);

             _transport.MessageReceived += Transport_MessageReceived;
             await _transport.StartAsync();
@@ -412,7 +412,7 @@

         public async Task StopAsync(CancellationToken cancellationToken)
         {
-            _logger.LogInformation("Stopping Transport {transport}", _transport.GetType().FullName);
+            _logger.LogInformation("Stopping Cambion");

             _transport.MessageReceived -= Transport_MessageReceived;
             await _transport.StopAsync();


Add support on fetching Uri with local filepath (#182)

Add support on fetching Uri with local filepath

--- PreMailer.Net/PreMailer.Net/Downloaders/WebDownloader.cs
+++ PreMailer.Net/PreMailer.Net/Downloaders/WebDownloader.cs
@@ -29,14 +29,32 @@
 		public string DownloadString(Uri uri)
 		{
 			var request = WebRequest.Create(uri);
-			using (var response = (HttpWebResponse)request.GetResponse())
+			using (var response = request.GetResponse())
 			{
-				var charset = response.CharacterSet;
-				var encoding = Encoding.GetEncoding(charset);
-				using (var stream = response.GetResponseStream())
-				using (var reader = new StreamReader(stream, encoding))
+				switch (response)
 				{
-					return reader.ReadToEnd();
+					case HttpWebResponse httpWebResponse:
+					{
+						var charset = httpWebResponse.CharacterSet;
+						var encoding = Encoding.GetEncoding(charset);
+						using (var stream = httpWebResponse.GetResponseStream())
+						using (var reader = new StreamReader(stream, encoding))
+						{
+							return reader.ReadToEnd();
+						}
+					}
+
+					case FileWebResponse fileWebResponse:
+					{
+						using (var stream = fileWebResponse.GetResponseStream())
+						using (var reader = new StreamReader(stream))
+						{
+							return reader.ReadToEnd();
+						}
+					}
+
+					default:
+						throw new NotSupportedException($"The Uri type is giving a response in unsupported type '{response.GetType()}'.");
 				}
 			}
 		}


remove unused class

remove unused class

--- Presentation.Web/Controllers/OData/BaseRoleController.cs
+++ Presentation.Web/Controllers/OData/BaseRoleController.cs
@@ -1,102 +0,0 @@
-using Core.ApplicationServices;
-using Core.DomainModel;
-using Core.DomainServices;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-using System.Web.Http;
-using System.Web.Mvc;
-using System.Web.OData;
-
-namespace Presentation.Web.Controllers.OData
-{
-    public abstract class BaseRoleController<T, Type> : BaseEntityController<T> where T : OptionEntity<Type>
-    {
-
-        private IGenericRepository<T> _repository;
-        // GET: BaseRole
-        public BaseRoleController(IGenericRepository<T> repository, IAuthenticationService authService)
-            : base(repository, authService)
-        {
-            _repository = repository;
-        }
-        public override IHttpActionResult Patch(int key, Delta<T> delta)
-        {
-
-            foreach (var t in delta.GetChangedPropertyNames())
-            {
-
-                if (t.ToLower() == "priority")
-                {
-                    //var testPriorFromDelta = 1;
-                    var initDelta = delta.GetEntity();
-                    var entity = _repository.GetByKey(key);
-
-                    if (entity.priority != 0)
-                    {
-
-                        if (initDelta.priority > entity.priority)
-                        {
-
-                            var entityToBeChanged = _repository.Get().FirstOrDefault(x => x.priority == entity.priority + 1);
-
-                            if (entityToBeChanged != null)
-                            {
-                                entityToBeChanged.priority = entityToBeChanged.priority - 1;
-                                _repository.Update(entityToBeChanged);
-                                _repository.Save();
-                            }
-                            else
-                            {
-                                if (entity.priority > 0)
-                                    initDelta.priority = entity.priority;
-                            }
-                        }
-                        else
-                        {
-                            var entityToBeChanged = _repository.Get().FirstOrDefault(x => x.priority == entity.priority - 1);
-
-                            if (entityToBeChanged != null)
-                            {
-                                entityToBeChanged.priority = entityToBeChanged.priority + 1;
-                                _repository.Update(entityToBeChanged);
-                                _repository.Save();
-                            }
-                            else
-                            {
-                                initDelta.priority = entity.priority;
-                            }
-                        }
-                        break;
-                    }
-                    else
-                    {
-                        if (delta.GetEntity().priority > entity.priority)
-                        {
-                            var entitiesToBeChanged = _repository.Get(x => x.priority >= initDelta.priority);
-
-                            if (entitiesToBeChanged.Count() > 0)
-                            {
-                                foreach (var e in entitiesToBeChanged)
-                                {
-                                    e.priority = e.priority + 1;
-                                    _repository.Update(e);
-                                    _repository.Save();
-                                }
-                            }
-                            else
-                            {
-                                if (entity.priority >= 1)
-                                {
-                                    initDelta.priority = entity.priority;
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-            return base.Patch(key, delta);
-        }
-    }
-}


Removed lists from nzxt device, now only uses arrays

Thanks @Wibble199, again :)

--- Project-Aurora/Project-Aurora/Devices/NZXT/NZXTDevice.cs
+++ Project-Aurora/Project-Aurora/Devices/NZXT/NZXTDevice.cs
@@ -18,9 +18,9 @@
         private bool isInitialized = false;

         private DeviceLoader DeviceLoader;
-        private List<byte> hue_device = new List<byte>(120);
-        private List<byte> krakenring_device = new List<byte>(24);
-        private Color krakenlogo_device;
+        private byte[] hueDevice = new byte[120];
+        private byte[] krakenringDevice = new byte[24];
+        private Color krakenlogoDevice = Color.Black;

         private readonly object action_lock = new object();

@@ -122,9 +122,8 @@

         public bool UpdateDevice(Dictionary<DeviceKeys, Color> keycolors, DoWorkEventArgs e, bool forced = false)
         {
-            var huepluscolors = new List<byte>(120);
-            var krakenringcolors = new List<byte>(24);
-            var krakenlogocolor = Color.Black;
+            int hueIndex = 0, krakenIndex = 0;
+            bool hueChanged = false, krakenChanged = false, krakenLogoChanged = false;

             if (e.Cancel) return false;

@@ -135,43 +134,42 @@
                     if (e.Cancel) return false;
                     if (key.Key == DeviceKeys.Peripheral_Logo)
                     {
-                        krakenlogocolor = key.Value;
+                        if (krakenlogoDevice != key.Value)
+                        {
+                            krakenlogoDevice = key.Value;
+                            krakenLogoChanged = true;
+                        }
                     }
                     else if (key.Key >= DeviceKeys.ONE && key.Key <= DeviceKeys.EIGHT)
                     {
-                        huepluscolors.Add(key.Value.G);
-                        huepluscolors.Add(key.Value.R);
-                        huepluscolors.Add(key.Value.B);
-                        krakenringcolors.Add(key.Value.G);
-                        krakenringcolors.Add(key.Value.R);
-                        krakenringcolors.Add(key.Value.B);
-                    }
-                    else if (key.Key >= DeviceKeys.NINE && key.Key <= DeviceKeys.ZERO ||
-                             key.Key >= DeviceKeys.Q && key.Key <= DeviceKeys.P ||
-                             key.Key >= DeviceKeys.A && key.Key <= DeviceKeys.SEMICOLON ||
-                             key.Key >= DeviceKeys.Z && key.Key <= DeviceKeys.PERIOD)//40 keys
-                    {
-                        huepluscolors.Add(key.Value.G);
-                        huepluscolors.Add(key.Value.R);
-                        huepluscolors.Add(key.Value.B);
-                    }
-                }
-
-                if (!Enumerable.SequenceEqual(huepluscolors, hue_device) || forced)
-                {
-                    DeviceLoader.HuePlus?.ApplyEffect(DeviceLoader.HuePlus.Both, new NZXTSharp.Fixed(huepluscolors.ToArray()));
-                    hue_device = huepluscolors;
-                }
-                if (!Enumerable.SequenceEqual(krakenringcolors, krakenring_device) || forced)
-                {
-                    DeviceLoader.KrakenX?.ApplyEffect(DeviceLoader.KrakenX.Ring, new NZXTSharp.Fixed(krakenringcolors.ToArray()));
-                    krakenring_device = krakenringcolors;
-                }
-                if (!Equals(krakenlogocolor, krakenlogo_device) || forced)
-                {
-                    DeviceLoader.KrakenX?.ApplyEffect(DeviceLoader.KrakenX.Logo, new NZXTSharp.Fixed(new NZXTSharp.Color(krakenlogocolor.R, krakenlogocolor.G, krakenlogocolor.B)));
-                    krakenlogo_device = krakenlogocolor;
-                }
+                        hueChanged |= UpdateValueAt(hueDevice, hueIndex++, key.Value.G);
+                        hueChanged |= UpdateValueAt(hueDevice, hueIndex++, key.Value.R);
+                        hueChanged |= UpdateValueAt(hueDevice, hueIndex++, key.Value.B);
+
+                        krakenChanged |= UpdateValueAt(krakenringDevice, krakenIndex++, key.Value.G);
+                        krakenChanged |= UpdateValueAt(krakenringDevice, krakenIndex++, key.Value.R);
+                        krakenChanged |= UpdateValueAt(krakenringDevice, krakenIndex++, key.Value.B);
+                    }
+                    else if (key.Key >= DeviceKeys.NINE && key.Key <= DeviceKeys.ZERO      ||
+                             key.Key >= DeviceKeys.Q    && key.Key <= DeviceKeys.P         ||
+                             key.Key >= DeviceKeys.A    && key.Key <= DeviceKeys.SEMICOLON ||
+                             key.Key >= DeviceKeys.Z    && key.Key <= DeviceKeys.PERIOD    )//40 keys
+                    {
+                        hueChanged |= UpdateValueAt(hueDevice, hueIndex++, key.Value.G);
+                        hueChanged |= UpdateValueAt(hueDevice, hueIndex++, key.Value.R);
+                        hueChanged |= UpdateValueAt(hueDevice, hueIndex++, key.Value.B);
+                    }
+                }
+
+                if (hueChanged || forced)
+                    DeviceLoader.HuePlus?.ApplyEffect(DeviceLoader.HuePlus.Both, new NZXTSharp.Fixed(hueDevice));
+
+                if (krakenChanged || forced)
+                    DeviceLoader.KrakenX?.ApplyEffect(DeviceLoader.KrakenX.Ring, new NZXTSharp.Fixed(krakenringDevice));
+
+                if (krakenLogoChanged || forced)
+                    DeviceLoader.KrakenX?.ApplyEffect(DeviceLoader.KrakenX.Logo, new NZXTSharp.Fixed(new NZXTSharp.Color(krakenlogoDevice.R, krakenlogoDevice.G, krakenlogoDevice.B)));
+

                 return true;
             }
@@ -213,5 +211,12 @@
         {
             return new VariableRegistry();
         }
+
+        private bool UpdateValueAt(byte[] array, int index, byte value)
+        {
+            var changed = array[index] != value;
+            if (changed) array[index] = value;
+            return changed;
+        }
     }
 }


Loggers\XmlfileLogger: Updated documentation

--- Releases/4.0.5.0/Main/Loggers/Framework/XmlFileLogger.cs
+++ Releases/4.0.5.0/Main/Loggers/Framework/XmlFileLogger.cs
@@ -21,7 +21,7 @@
     /// <para>     /l:XmlFileLogger,MSBuild.ExtensionPack.Loggers.dll;logfile=YOURLOGFILE;verbosity=YOURVERBOSITY;encoding=YOURENCODING</para>
     /// <para><b>Parameters: </b></para>
     /// <para>Logfile: A optional parameter that specifies the file in which to store the log information. Defaults to msbuild.xml</para>
-    /// <para>Verbosity: An optional parameter that overrides the global verbosity setting for this file logger only. This enables you to log to several loggers, each with a different verbosity.</para>
+    /// <para>Verbosity: An optional parameter that overrides the global verbosity setting for this file logger only. This enables you to log to several loggers, each with a different verbosity. The verbosity setting is case sensitive.</para>
     /// <para>Encoding: An optional parameter that specifies the encoding for the file, for example, UTF-8.</para>
     /// </summary>
     public class XmlFileLogger : Logger


ファイルパスを辿る際のセキュリティ問題に対処(上のディレクトリ、ホームディレクトリの記述は無視するようにした)

--- src/PitchPitch/map/MapLoader.cs
+++ src/PitchPitch/map/MapLoader.cs
@@ -57,6 +57,17 @@
             return ret;
         }

+        private string getFilePath(string str)
+        {
+            if (string.IsNullOrEmpty(str)) return str;
+            string ret = str.Replace(".." + Path.DirectorySeparatorChar, "")
+                .Replace(Path.DirectorySeparatorChar + "." + Path.DirectorySeparatorChar, "");
+            if (ret.Length > 0 && ret[0] == Path.DirectorySeparatorChar)
+                ret = ret.Substring(1);
+            if (ret.StartsWith("." + Path.DirectorySeparatorChar))
+                ret = ret.Substring(("." + Path.DirectorySeparatorChar).Length);
+            return ret;
+        }
         public MapInfo LoadMapInfo(string dirPath)
         {
             MapInfo mi = new MapInfo();
@@ -274,7 +285,7 @@
                             }
                             else
                             {
-                                cdi.FileName = name;
+                                cdi.FileName = getFilePath(name);
                                 cdi.BuiltinType = MapChipBuiltinType.None;
                             }
                             #endregion
@@ -304,7 +315,7 @@
                                 #endregion
                                 #region name
                                 case "name":
-                                    mi.MapSourceFileName = soNode.InnerText.Trim();
+                                    mi.MapSourceFileName = getFilePath(soNode.InnerText.Trim());
                                     break;
                                 #endregion
                                 #region mapping
@@ -320,7 +331,7 @@
                     case "bgm":
                         {
                             BgmInfo bi = new BgmInfo();
-                            bi.Name = node.InnerText.Trim();
+                            bi.Name = getFilePath(node.InnerText.Trim());
                             foreach (XmlAttribute attr in node.Attributes)
                             {
                                 switch (attr.Name.ToLower())


添加边界判断条件

添加边界判断条件

--- ShaoComputation/ShaoComputation/Computation/Iteration.cs
+++ ShaoComputation/ShaoComputation/Computation/Iteration.cs
@@ -65,6 +65,21 @@
                     od.q_rs_c = od.LuJings.Sum(lj => lj.Fpc);
                     od.q_rs_b = od.Q_rs - od.q_rs_c;
                 }
+                var v1 = new List<double>();
+                var v2 = new List<double>();
+                var v3 = new List<double>();
+                var v4 = new List<double>();
+                var v5 = new List<double>();
+                foreach (var od in ods)
+                {
+                    v1.Add(od.LuJings.Sum(lj => (lj.ec - od.ec_min) * lj.Fpc));
+                    v2.Add(od.ec_min * od.q_rs_c);
+                    v3.Add(od.LuJings.Sum(lj => (lj.eb - od.eb_min) * lj.Fpc));
+                    v4.Add(od.eb_min * od.q_rs_b);
+                    v5.Add(od.q_rs_c - od.Q_rs / (1 + Math.Pow(Math.E, (od.ec_min - od.eb_min))));
+                }
+                //todo: 待议
+                var final = v1.Sum() / v2.Sum() + v3.Sum() / v4.Sum() + Math.Sqrt(v5.Sum(v => Math.Pow(v, 2))) / ods.Sum(od => od.Q_rs);
             }
         }
     }


Fix test for XDK Feb2018.

Fix test for XDK Feb2018.

--- Sharpmake.Platforms/Sharpmake.Durango/DurangoPlatform.cs
+++ Sharpmake.Platforms/Sharpmake.Durango/DurangoPlatform.cs
@@ -446,7 +446,7 @@
                                 xdkEditionRootVS2017 = vs2017PlatformFolder;

                             int xdkEdition;
-                            bool isMinFeb2018Xdk = Util.TryParseXdkEditionTarget(GlobalSettings.XdkEditionTarget, out xdkEdition) && xdkEdition > GlobalSettings._feb2018XdkEditionTarget;
+                            bool isMinFeb2018Xdk = Util.TryParseXdkEditionTarget(GlobalSettings.XdkEditionTarget, out xdkEdition) && xdkEdition >= GlobalSettings._feb2018XdkEditionTarget;
                             if (GlobalSettings.EnableLegacyXdkHeaders && isMinFeb2018Xdk)
                                 enableLegacyXdkHeaders = "true";
                         }