Collapse Matrix assignment into initializer

--- MatterControlLib/DesignTools/SupportGenerator.cs
+++ MatterControlLib/DesignTools/SupportGenerator.cs
@@ -303,14 +303,15 @@
 				return;
 			}

-			var support = new GeneratedSupportObject3D()
-			{
-				Mesh = PlatonicSolids.CreateCube(1, 1, 1)
-			};
 			// make it just a bit small so they always overlap correctly
 			var reduceAmount = ColumnReduceAmount * .99;
-			support.Matrix = Matrix4X4.CreateScale(PillarSize - reduceAmount, PillarSize - reduceAmount, topZ - bottomZ)
-				* Matrix4X4.CreateTranslation(gridX, gridY, bottomZ + (topZ - bottomZ) / 2);
+
+			var support = new GeneratedSupportObject3D()
+			{
+				Mesh = PlatonicSolids.CreateCube(1, 1, 1),
+				Matrix = Matrix4X4.CreateScale(PillarSize - reduceAmount, PillarSize - reduceAmount, topZ - bottomZ)
+					* Matrix4X4.CreateTranslation(gridX, gridY, bottomZ + (topZ - bottomZ) / 2),
+			};

 			holder.Children.Add(support);
 		}


Updated docs

Updated docs

--- MimeKit/Cryptography/WindowsSecureMimeContext.cs
+++ MimeKit/Cryptography/WindowsSecureMimeContext.cs
@@ -638,11 +638,11 @@
 		/// <para>-or-</para>
 		/// <para><paramref name="signatureData"/> is <c>null</c>.</para>
 		/// </exception>
+		/// <exception cref="System.OperationCanceledException">
+		/// The operation was cancelled via the cancellation token.
+		/// </exception>
 		/// <exception cref="System.Security.Cryptography.CryptographicException">
 		/// An error occurred in the cryptographic message syntax subsystem.
-		/// </exception>
-		/// <exception cref="System.OperationCanceledException">
-		/// The operation was cancelled via the cancellation token.
 		/// </exception>
 		public override DigitalSignatureCollection Verify (Stream content, Stream signatureData, CancellationToken cancellationToken = default (CancellationToken))
 		{
@@ -675,11 +675,11 @@
 		/// <para>-or-</para>
 		/// <para><paramref name="signatureData"/> is <c>null</c>.</para>
 		/// </exception>
+		/// <exception cref="System.OperationCanceledException">
+		/// The operation was cancelled via the cancellation token.
+		/// </exception>
 		/// <exception cref="System.Security.Cryptography.CryptographicException">
 		/// An error occurred in the cryptographic message syntax subsystem.
-		/// </exception>
-		/// <exception cref="System.OperationCanceledException">
-		/// The operation was cancelled via the cancellation token.
 		/// </exception>
 		public override async Task<DigitalSignatureCollection> VerifyAsync (Stream content, Stream signatureData, CancellationToken cancellationToken = default (CancellationToken))
 		{
@@ -713,11 +713,11 @@
 		/// <exception cref="System.FormatException">
 		/// The extracted content could not be parsed as a MIME entity.
 		/// </exception>
+		/// <exception cref="System.OperationCanceledException">
+		/// The operation was cancelled via the cancellation token.
+		/// </exception>
 		/// <exception cref="System.Security.Cryptography.CryptographicException">
 		/// An error occurred in the cryptographic message syntax subsystem.
-		/// </exception>
-		/// <exception cref="System.OperationCanceledException">
-		/// The operation was cancelled via the cancellation token.
 		/// </exception>
 		public override DigitalSignatureCollection Verify (Stream signedData, out MimeEntity entity, CancellationToken cancellationToken = default (CancellationToken))
 		{
@@ -754,11 +754,11 @@
 		/// <exception cref="System.ArgumentNullException">
 		/// <paramref name="signedData"/> is <c>null</c>.
 		/// </exception>
-		/// <exception cref="Org.BouncyCastle.Cms.CmsException">
-		/// An error occurred in the cryptographic message syntax subsystem.
-		/// </exception>
 		/// <exception cref="System.OperationCanceledException">
 		/// The operation was cancelled via the cancellation token.
+		/// </exception>
+		/// <exception cref="System.Security.Cryptography.CryptographicException">
+		/// An error occurred in the cryptographic message syntax subsystem.
 		/// </exception>
 		public override Stream Verify (Stream signedData, out DigitalSignatureCollection signatures, CancellationToken cancellationToken = default (CancellationToken))
 		{
@@ -1173,7 +1173,7 @@
 		/// <exception cref="CertificateNotFoundException">
 		/// A certificate for one or more of the <paramref name="mailboxes"/> could not be found.
 		/// </exception>
-		/// <exception cref="Org.BouncyCastle.Cms.CmsException">
+		/// <exception cref="System.Security.Cryptography.CryptographicException">
 		/// An error occurred in the cryptographic message syntax subsystem.
 		/// </exception>
 		public override MimePart Export (IEnumerable<MailboxAddress> mailboxes)


Fixes the bug described in issue #22.

Fixes the bug described in issue #22.

--- Mono.Addins.Setup/Mono.Addins.Setup/SetupTool.cs
+++ Mono.Addins.Setup/Mono.Addins.Setup/SetupTool.cs
@@ -353,8 +353,8 @@
 			AddinRepositoryEntry[] addins = service.Repositories.GetAvailableAddins ();
 			bool found = false;
 			foreach (PackageRepositoryEntry addin in addins) {
-				Addin sinfo = registry.GetAddin (addin.Addin.Id);
-				if (!showAll && IsHidden (sinfo))
+				Addin sinfo = registry.GetAddin (addin.Addin.LocalId);
+                if (sinfo != null && !showAll && IsHidden(sinfo))
 					continue;
 				if (sinfo != null && Addin.CompareVersions (sinfo.Version, addin.Addin.Version) == 1) {
 					Console.WriteLine (" - " + addin.Addin.Id + " " + addin.Addin.Version + " (" + addin.Repository.Name + ")");
@@ -375,8 +375,8 @@
 			PackageCollection packs = new PackageCollection ();
 			AddinRepositoryEntry[] addins = service.Repositories.GetAvailableAddins ();
 			foreach (PackageRepositoryEntry addin in addins) {
-				Addin sinfo = registry.GetAddin (addin.Addin.Id);
-				if (!showAll && IsHidden (sinfo))
+				Addin sinfo = registry.GetAddin (addin.Addin.LocalId);
+                if (sinfo != null && !showAll && IsHidden(sinfo))
 					continue;
 				if (sinfo != null && Addin.CompareVersions (sinfo.Version, addin.Addin.Version) == 1)
 					packs.Add (AddinPackage.FromRepository (addin));


Another Attempt

Another Attempt

ok

--- MonopolyGame/MonopolyGame/Model/Engine/Engine.cs
+++ MonopolyGame/MonopolyGame/Model/Engine/Engine.cs
@@ -379,7 +379,7 @@
         {
             for (int i = 0; i < 70; i++)
             {
-                if (i < 12)
+                if (i < 7)
                 {
                     Console.SetCursorPosition(0, i);
                     Console.WriteLine(new string(' ', 49));


Fixed a weighted average issue with WideView. The theater count miner's weight was 1 so it was being averaged in.

--- MoviePicker.WebApp/Controllers/HomeController.cs
+++ MoviePicker.WebApp/Controllers/HomeController.cs
@@ -339,7 +339,7 @@

 			// Set the weights to 1 across the board. (treat all sources equal)

-			for (int minerIndex = MinerModel.MY_INDEX + 1; minerIndex < MinerModel.MOJO_LAST_INDEX; minerIndex++)
+			for (int minerIndex = MinerModel.MY_INDEX + 1; minerIndex < MinerModel.MOJO_THEATER_INDEX; minerIndex++)
 			{
 				_minerModel.Miners[minerIndex].Weight = 1;
 			}


Add test for bounding box around multiple objects (doesn't work yet)

--- Assets/MixedRealityToolkit.Examples/Demos/UX/BoundingBox/Scripts/BoundingBoxTest.cs
+++ Assets/MixedRealityToolkit.Examples/Demos/UX/BoundingBox/Scripts/BoundingBoxTest.cs
@@ -1,4 +1,7 @@
-using Microsoft.MixedReality.Toolkit.Input;
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+using Microsoft.MixedReality.Toolkit.Input;
 using Microsoft.MixedReality.Toolkit.UI;
 using System.Collections;
 using System.Collections.Generic;
@@ -28,65 +31,91 @@

     private IEnumerator Sequence()
     {
-        var cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
-        cube.GetComponent<MeshRenderer>().material.color = Color.black;
-        cube.transform.position = cubePosition;
+        {
+            var cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
+            cube.GetComponent<MeshRenderer>().material = LoadAsset<Material>("MRTK_Standard_DarkGray");
+            cube.transform.position = cubePosition;

-        SetStatus("Instantiate BoundingBox");
-        BoundingBox bbox = cube.AddComponent<BoundingBox>();
-        bbox.HideElementsInInspector = false;
-        bbox.BoundingBoxActivation = BoundingBox.BoundingBoxActivationType.ActivateOnStart;
-        var mh = cube.AddComponent<ManipulationHandler>();
-        yield return WaitForSpeechCommand();
+            SetStatus("Instantiate BoundingBox");
+            BoundingBox bbox = cube.AddComponent<BoundingBox>();
+            bbox.HideElementsInInspector = false;
+            bbox.BoundingBoxActivation = BoundingBox.BoundingBoxActivationType.ActivateOnStart;
+            var mh = cube.AddComponent<ManipulationHandler>();
+            yield return WaitForSpeechCommand();

-        SetStatus("FlattenX");
-        bbox.FlattenAxis = BoundingBox.FlattenModeType.FlattenX;
-        yield return WaitForSpeechCommand();
+            SetStatus("FlattenX");
+            bbox.FlattenAxis = BoundingBox.FlattenModeType.FlattenX;
+            yield return WaitForSpeechCommand();

-        SetStatus("FlattenY");
-        bbox.FlattenAxis = BoundingBox.FlattenModeType.FlattenY;
-        yield return WaitForSpeechCommand();
+            SetStatus("FlattenY");
+            bbox.FlattenAxis = BoundingBox.FlattenModeType.FlattenY;
+            yield return WaitForSpeechCommand();

-        SetStatus("FlattenNone");
-        bbox.FlattenAxis = BoundingBox.FlattenModeType.DoNotFlatten;
-        yield return WaitForSpeechCommand();
+            SetStatus("FlattenNone");
+            bbox.FlattenAxis = BoundingBox.FlattenModeType.DoNotFlatten;
+            yield return WaitForSpeechCommand();

-        SetStatus("BoxPadding 0.2f");
-        bbox.BoxPadding = new Vector3(0.2f, 0.2f, 0.2f);
-        yield return WaitForSpeechCommand();
+            SetStatus("BoxPadding 0.2f");
+            bbox.BoxPadding = new Vector3(0.2f, 0.2f, 0.2f);
+            yield return WaitForSpeechCommand();

-        SetStatus("BoxPadding 0");
-        bbox.BoxPadding = Vector3.zero;
-        yield return WaitForSpeechCommand();
+            SetStatus("BoxPadding 0");
+            bbox.BoxPadding = Vector3.zero;
+            yield return WaitForSpeechCommand();

-        SetStatus("Set scale handle widget prefab");
-        bbox.ScaleHandleSize = 0.03f;
-        bbox.ScaleHandlePrefab = LoadAsset<GameObject>("MRTK_BoundingBox_ScaleWidget");
-        yield return WaitForSpeechCommand();
+            SetStatus("Set scale handle widget prefab");
+            bbox.ScaleHandleSize = 0.03f;
+            bbox.ScaleHandlePrefab = LoadAsset<GameObject>("MRTK_BoundingBox_ScaleWidget");
+            yield return WaitForSpeechCommand();

-        SetStatus("Handles red");
-        bbox.HandleMaterial = LoadAsset<Material>("MRTK_Standard_Red");
-        yield return WaitForSpeechCommand();
+            SetStatus("Handles red");
+            bbox.HandleMaterial = LoadAsset<Material>("MRTK_Standard_Red");
+            yield return WaitForSpeechCommand();

-        SetStatus("BBox material cyan");
-        bbox.BoxMaterial = LoadAsset<Material>("MRTK_Standard_Cyan");
-        yield return WaitForSpeechCommand();
+            SetStatus("BBox material cyan");
+            bbox.BoxMaterial = LoadAsset<Material>("MRTK_Standard_Cyan");
+            yield return WaitForSpeechCommand();

-        SetStatus("BBox material none");
-        bbox.BoxMaterial = null;
-        yield return WaitForSpeechCommand();
+            SetStatus("BBox material none");
+            bbox.BoxMaterial = null;
+            yield return WaitForSpeechCommand();

-        SetStatus("BBox grabbed material green");
-        bbox.BoxGrabbedMaterial = LoadAsset<Material>("MRTK_Standard_Emerald");
-        yield return WaitForSpeechCommand();
+            SetStatus("BBox grabbed material green");
+            bbox.BoxGrabbedMaterial = LoadAsset<Material>("MRTK_Standard_Emerald");
+            yield return WaitForSpeechCommand();

-        SetStatus("Wireframe radius 0.1");
-        bbox.WireframeEdgeRadius = 0.1f;
-        yield return WaitForSpeechCommand();
+            SetStatus("Wireframe radius 0.1");
+            bbox.WireframeEdgeRadius = 0.1f;
+            yield return WaitForSpeechCommand();

-        SetStatus("Wireframe shape cylinder");
-        bbox.WireframeShape = BoundingBox.WireframeType.Cylindrical;
-        yield return WaitForSpeechCommand();
+            SetStatus("Wireframe shape cylinder");
+            bbox.WireframeShape = BoundingBox.WireframeType.Cylindrical;
+            yield return WaitForSpeechCommand();
+
+            GameObject.Destroy(cube);
+        }
+
+        {
+
+            SetStatus("Many children");
+
+            GameObject multiRoot = new GameObject();
+            multiRoot.name = "multiRoot";
+            multiRoot.transform.position = cubePosition;
+            int numCubes = 10;
+            for (int i = 0; i < numCubes; i++)
+            {
+                var cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
+                cube.transform.localScale = Vector3.one * 0.1f;
+                cube.transform.parent = multiRoot.transform;
+                cube.transform.localPosition = Random.insideUnitSphere;
+                cube.transform.rotation = Quaternion.Euler(Random.insideUnitSphere * 360f);
+            }
+            var bbox = multiRoot.AddComponent<BoundingBox>();
+            bbox.BoundingBoxActivation = BoundingBox.BoundingBoxActivationType.ActivateOnStart;
+            bbox.HideElementsInInspector = false;
+            multiRoot.AddComponent<ManipulationHandler>();
+        }
     }

     private T LoadAsset<T>(string s) where T : UnityEngine.Object


Bounding box test print min and max scale

--- Assets/MixedRealityToolkit.Examples/Demos/UX/BoundingBox/Scripts/BoundingBoxTest.cs
+++ Assets/MixedRealityToolkit.Examples/Demos/UX/BoundingBox/Scripts/BoundingBoxTest.cs
@@ -5,6 +5,7 @@
 using Microsoft.MixedReality.Toolkit.UI;
 using System.Collections;
 using System.Collections.Generic;
+using System.Text;
 using UnityEditor;
 using UnityEngine;

@@ -15,6 +16,7 @@

     private bool speechTriggeredFalg;
     private Vector3 cubePosition = new Vector3(0, 0, 2);
+    private BoundingBox bbox;

     // Start is called before the first frame update
     protected override void Start()
@@ -26,7 +28,14 @@
     private void SetStatus(string status)
     {
         Debug.Assert(statusText != null, "statusText on BoundingBoxTest should not be null");
-        statusText.text = $"Test {status}\nPress '1' or say 'select' to continue";
+        StringBuilder b = new StringBuilder();
+        b.AppendLine($"Test {status}");
+        if (bbox != null)
+        {
+            b.AppendLine($"minscale: {bbox.ScaleMinimum} maxscale: {bbox.ScaleMaximum}");
+        }
+        b.AppendLine($"Press '1' or say 'select' to continue");
+        statusText.text = b.ToString();
     }

     private IEnumerator Sequence()
@@ -37,7 +46,7 @@
             cube.transform.position = cubePosition;

             SetStatus("Instantiate BoundingBox");
-            BoundingBox bbox = cube.AddComponent<BoundingBox>();
+            bbox = cube.AddComponent<BoundingBox>();
             bbox.HideElementsInInspector = false;
             bbox.BoundingBoxActivation = BoundingBox.BoundingBoxActivationType.ActivateOnStart;
             var mh = cube.AddComponent<ManipulationHandler>();


Writing the correct number of hashes to be expected in a dictionary file, even if we're generating hashes for multiple directories.

--- Code/CapuchinSync.Core/GenerateSynchronizationDictionary/HashDictionaryGenerator.cs
+++ Code/CapuchinSync.Core/GenerateSynchronizationDictionary/HashDictionaryGenerator.cs
@@ -57,13 +57,13 @@
                 var backupLocation = HashDictionaryFilepath + ".old";
                 StringBuilder sb = new StringBuilder();
                 var now = dateTimeProvider.Now;
-                sb.AppendLine($"{hashedFiles.Count} files found in {rootDir} on {dateTimeProvider.GetDateString(now)} at {dateTimeProvider.GetTimeString(now)}");
                 var hashedFilesInRootDir = hashedFiles.Where(x =>
                     {
                         var result = pathUtility.IsSubPathOrEqualTo(rootDir, x.FullPath);
                         return result;
                     })
                     .OrderBy(x => x.FullPath).ToArray();
+                sb.AppendLine($"{hashedFilesInRootDir.Length} files found in {rootDir} on {dateTimeProvider.GetDateString(now)} at {dateTimeProvider.GetTimeString(now)}");
                 foreach (var hashed in hashedFilesInRootDir)
                 {
                     sb.AppendLine(hashed.GetDictionaryEntryString(rootDir));


Also extract ClientComponentID and ClientSideComponentProperties for user custom actions when working in Online

--- Core/OfficeDevPnP.Core/Framework/Provisioning/ObjectHandlers/ObjectCustomActions.cs
+++ Core/OfficeDevPnP.Core/Framework/Provisioning/ObjectHandlers/ObjectCustomActions.cs
@@ -418,6 +418,12 @@
             customAction.Url = userCustomAction.Url;
             customAction.RegistrationId = userCustomAction.RegistrationId;
             customAction.RegistrationType = userCustomAction.RegistrationType;
+
+#if !ONPREMISES
+            customAction.ClientSideComponentId = userCustomAction.ClientSideComponentId;
+            customAction.ClientSideComponentProperties = userCustomAction.ClientSideComponentProperties;
+#endif
+
             customAction.CommandUIExtension = !System.String.IsNullOrEmpty(userCustomAction.CommandUIExtension) ?
                 XElement.Parse(userCustomAction.CommandUIExtension) : null;


Remove Field fix...

Remove Field fix...

--- DotNetDatenbankProtokollerV2/ConfigurationTool/Windows/EditProtocolDatasets.xaml.cs
+++ DotNetDatenbankProtokollerV2/ConfigurationTool/Windows/EditProtocolDatasets.xaml.cs
@@ -186,11 +186,14 @@
         private void cmdRemoveDatasetRow_Click(object sender, RoutedEventArgs e)
         {
             DatasetConfig conf = grdDatasets.SelectedItem as DatasetConfig;
-            if (grdDatasetFields.SelectedItem != null)
-            {
-                if (grdDatasetFields.Visibility == System.Windows.Visibility.Visible)
+            if (grdDatasetFields.Visibility == System.Windows.Visibility.Visible)
+            {
+                if (grdDatasetFields.SelectedItem != null)
                     conf.DatasetConfigRows.Remove((DatasetConfigRow)grdDatasetFields.SelectedItem);
-                else
+            }
+            else
+            {
+                if (grdDatasetFieldsEthernet.SelectedItem != null)
                     conf.DatasetConfigRows.Remove((DatasetConfigRow) grdDatasetFieldsEthernet.SelectedItem);
             }


修复暂停无法拖动SV的bug

修复暂停无法拖动SV的bug

--- PA_VarTracer/Assets/PerfAssist/PAVarTracer/Editor/GraphIt/VarTracerGraphItWindow.cs
+++ PA_VarTracer/Assets/PerfAssist/PAVarTracer/Editor/GraphIt/VarTracerGraphItWindow.cs
@@ -569,7 +569,7 @@
                 }
                 else
                 {
-                    if (!EditorApplication.isPaused)
+                    if (!m_isPaused)
                         kv.Value.ScrollPos = new Vector2(width - mWidth, kv.Value.ScrollPos.y);
                 }

@@ -764,12 +764,13 @@
                             if (preEventRect.y > height + int.Parse(kv.Key) * (height + y_gap))
                                 tooltip_r = new Rect(x - buttonWidth / 2, startY, buttonWidth, VarTracerConst.EventButtonHeight);
                             else
-                                tooltip_r = new Rect(x - buttonWidth / 2, preEventRect.y + 20, buttonWidth, VarTracerConst.EventButtonHeight);
+                                tooltip_r = new Rect(x - buttonWidth / 2, preEventRect.y + VarTracerConst.EventButtonFixGap, buttonWidth, VarTracerConst.EventButtonHeight);
                         }
                         else
                             tooltip_r = new Rect(x - buttonWidth / 2, startY, buttonWidth, VarTracerConst.EventButtonHeight);
                         preEventRect = tooltip_r;

+                        GUI.backgroundColor = Color.green;
                         if (currentEvent.Duration == 0)
                             GUI.Button(tooltip_r, currentEvent.EventName, style);
                         else
@@ -815,7 +816,7 @@
             FracGS.alignment = TextAnchor.LowerLeft;

             EventInstantButtonStyle = new GUIStyle(EditorStyles.whiteBoldLabel);
-            EventInstantButtonStyle.normal.background = Resources.Load("instantButton") as Texture2D;
+            EventInstantButtonStyle.normal.background = Resources.Load("durationButton") as Texture2D;
             EventInstantButtonStyle.normal.textColor = Color.white;
             EventInstantButtonStyle.alignment = TextAnchor.MiddleCenter;


#106 Added to CustomNodeManager simulation of all supported data types. Tested. Now new values are generated by incrementing old values.

--- SemanticDataSolution/UANetworkingReferenceApplication/Producer/CustomNodeManager.cs
+++ SemanticDataSolution/UANetworkingReferenceApplication/Producer/CustomNodeManager.cs
@@ -1,5 +1,6 @@

 using System;
+using System.Collections.Generic;
 using System.Diagnostics;
 using System.Threading;
 using System.Xml;
@@ -21,8 +22,47 @@
     #region constructors
     public CustomNodeManager()
     {
-      Value1 = new ProducerBindingMonitoredValue<DateTime>(m_Variable1Name, BuiltInType.DateTime);
-      Value2 = new ProducerBindingMonitoredValue<double>(m_Variable2Name, BuiltInType.Double);
+      ValueBoolean = new ProducerBindingMonitoredValue<Boolean>(m_Variable1Name, BuiltInType.Boolean);
+      AddBinding(ValueBoolean, nameof(ValueBoolean), () => ValueBoolean.MonitoredValue = Inc(ValueBoolean.MonitoredValue));
+
+      ValueByte = new ProducerBindingMonitoredValue<Byte>(m_Variable1Name, BuiltInType.Byte);
+      AddBinding(ValueByte, nameof(ValueByte), () => ValueByte.MonitoredValue = Inc(ValueByte.MonitoredValue));
+
+      ValueDateTime = new ProducerBindingMonitoredValue<DateTime>(m_Variable1Name, BuiltInType.DateTime);
+      AddBinding(ValueDateTime, nameof(ValueDateTime), () => ValueDateTime.MonitoredValue = Inc(ValueDateTime.MonitoredValue));
+
+      ValueDouble = new ProducerBindingMonitoredValue<double>(m_Variable2Name, BuiltInType.Double);
+      AddBinding(ValueDouble, nameof(ValueDouble), () => ValueDouble.MonitoredValue = Inc(ValueDouble.MonitoredValue));
+
+      ValueFloat = new ProducerBindingMonitoredValue<float>(m_Variable1Name, BuiltInType.Float);
+      AddBinding(ValueFloat, nameof(ValueFloat), () => ValueFloat.MonitoredValue = Inc(ValueFloat.MonitoredValue));
+
+      ValueGuid = new ProducerBindingMonitoredValue<Guid>(m_Variable1Name, BuiltInType.Guid);
+      AddBinding(ValueGuid, nameof(ValueGuid), () => ValueGuid.MonitoredValue = Inc(ValueGuid.MonitoredValue));
+
+      ValueInt16 = new ProducerBindingMonitoredValue<Int16>(m_Variable1Name, BuiltInType.Int16);
+      AddBinding(ValueBoolean, nameof(ValueInt16), () => ValueInt16.MonitoredValue = Inc(ValueInt16.MonitoredValue));
+
+      ValueInt32 = new ProducerBindingMonitoredValue<Int32>(m_Variable1Name, BuiltInType.Int32);
+      AddBinding(ValueInt32, nameof(ValueInt32), () => ValueInt32.MonitoredValue = Inc(ValueInt32.MonitoredValue));
+
+      ValueInt64 = new ProducerBindingMonitoredValue<Int64>(m_Variable1Name, BuiltInType.Int64);
+      AddBinding(ValueInt64, nameof(ValueInt64), () => ValueInt64.MonitoredValue = Inc(ValueInt64.MonitoredValue));
+
+      ValueSByte = new ProducerBindingMonitoredValue<SByte>(m_Variable1Name, BuiltInType.SByte);
+      AddBinding(ValueSByte, nameof(ValueSByte), () => ValueSByte.MonitoredValue = Inc(ValueSByte.MonitoredValue));
+
+      ValueString = new ProducerBindingMonitoredValue<String>(m_Variable1Name, BuiltInType.String);
+      AddBinding(ValueString, nameof(ValueString), () => ValueString.MonitoredValue = Inc(ValueString.MonitoredValue));
+
+      ValueUInt16 = new ProducerBindingMonitoredValue<UInt16>(m_Variable1Name, BuiltInType.UInt16);
+      AddBinding(ValueUInt16, nameof(ValueUInt16), () => ValueUInt16.MonitoredValue = Inc(ValueUInt16.MonitoredValue));
+
+      ValueUInt32 = new ProducerBindingMonitoredValue<UInt32>(m_Variable1Name, BuiltInType.UInt32);
+      AddBinding(ValueUInt32, nameof(ValueUInt32), () => ValueUInt32.MonitoredValue = Inc(ValueUInt32.MonitoredValue));
+
+      ValueUInt64 = new ProducerBindingMonitoredValue<UInt32>(m_Variable1Name, BuiltInType.UInt64);
+      AddBinding(ValueUInt64, nameof(ValueUInt64), () => ValueUInt64.MonitoredValue = Inc(ValueUInt64.MonitoredValue));
     }
     #endregion

@@ -75,11 +115,11 @@
         throw new ArgumentNullException("repositoryGroup");
       if (variableName == m_Variable1Name)
       {
-        return Value1;
+        return ValueDateTime;
       }
       else if (variableName == m_Variable2Name)
       {
-        return Value2;
+        return ValueDouble;
       }
       else
         throw new ArgumentOutOfRangeException("variableName");
@@ -125,7 +165,6 @@
       {
         throw new NotImplementedException();
       }
-
       public override void Write(IBinaryEncoder encoder, IDataValue value)
       {
         throw new NotImplementedException();
@@ -165,22 +204,101 @@
       }
     }
     //simulator vars
-    private ProducerBindingMonitoredValue<DateTime> Value1 { get; set; }
-    private ProducerBindingMonitoredValue<double> Value2 { get; set; }
+    private ProducerBindingMonitoredValue<DateTime> ValueDateTime { get; set; }
+    private ProducerBindingMonitoredValue<bool> ValueBoolean { get; set; }
+    private ProducerBindingMonitoredValue<byte> ValueByte { get; set; }
+    private ProducerBindingMonitoredValue<float> ValueFloat { get; set; }
+    private ProducerBindingMonitoredValue<double> ValueDouble { get; set; }
+    private ProducerBindingMonitoredValue<Guid> ValueGuid { get; set; }
+    private ProducerBindingMonitoredValue<Int16> ValueInt16 { get; set; }
+    private ProducerBindingMonitoredValue<Int32> ValueInt32 { get; set; }
+    private ProducerBindingMonitoredValue<Int64> ValueInt64 { get; set; }
+    private ProducerBindingMonitoredValue<SByte> ValueSByte { get; set; }
+    private ProducerBindingMonitoredValue<String> ValueString { get; set; }
+    private ProducerBindingMonitoredValue<ushort> ValueUInt16 { get; set; }
+    private ProducerBindingMonitoredValue<uint> ValueUInt32 { get; set; }
+    private ProducerBindingMonitoredValue<uint> ValueUInt64 { get; set; }
     //vars
     private const string m_Variable1Name = "Value1";
     private const string m_Variable2Name = "Value2";
     private const string m_RepositoryGroup = "repositoryGroup";
     private Timer m_Timer;
-    private Random m_Random = new Random();
     private readonly IUAEncoder m_IUAEncoder = new UABinaryEncoderImplementation();
+    private event EventHandler m_TimeEven;
+    private Dictionary<string, IProducerBinding> m_NodesDictionary = new Dictionary<string, IProducerBinding>();
+
     //methods
+    #region Inc methods
+    private static string Inc(string monitoredValue)
+    {
+      return $"Hello World; Here now is: {DateTime.Now.ToShortDateString()}";
+    }
+    private static Guid Inc(Guid monitoredValue)
+    {
+      return Guid.NewGuid();
+    }
+    private static SByte Inc(SByte monitoredValue)
+    {
+      return monitoredValue == SByte.MaxValue ? SByte.MinValue : (SByte)(monitoredValue + 1);
+    }
+    private static UInt16 Inc(UInt16 monitoredValue)
+    {
+      return monitoredValue == UInt16.MaxValue ? UInt16.MinValue : (UInt16)(monitoredValue + 1);
+    }
+    private static UInt32 Inc(UInt32 monitoredValue)
+    {
+      return monitoredValue == UInt32.MaxValue ? UInt32.MinValue : (UInt32)(monitoredValue + 1);
+    }
+    private static UInt64 Inc(UInt64 monitoredValue)
+    {
+      return monitoredValue == UInt64.MaxValue ? UInt64.MinValue : (UInt64)(monitoredValue + 1);
+    }
+    private static Int64 Inc(Int64 monitoredValue)
+    {
+      return monitoredValue == Int64.MaxValue ? Int64.MinValue : (Int64)(monitoredValue + 1);
+    }
+    private static Int32 Inc(Int32 monitoredValue)
+    {
+      return monitoredValue == Int32.MaxValue ? Int32.MinValue : (Int32)(monitoredValue + 1);
+    }
+    private static Int16 Inc(Int16 monitoredValue)
+    {
+      return monitoredValue == Int16.MaxValue ? Int16.MinValue : (Int16)(monitoredValue + 1);
+    }
+    private static float Inc(float monitoredValue)
+    {
+      return monitoredValue + 1;
+    }
+    private static double Inc(double monitoredValue)
+    {
+      return monitoredValue + 1;
+    }
+    private static DateTime Inc(DateTime monitoredValue)
+    {
+      return DateTime.UtcNow;
+    }
+    private static byte Inc(byte monitoredValue)
+    {
+      return monitoredValue == byte.MaxValue ? byte.MinValue : (byte)(monitoredValue + 1);
+    }
+    private static bool Inc(bool monitoredValue)
+    {
+      return !monitoredValue;
+    }
+    #endregion
+
+    private void AddBinding(IProducerBinding binding, string key, Action increment)
+    {
+      m_NodesDictionary.Add(key, binding);
+      m_TimeEven += (x, y) => increment();
+    }
     private void TimerCallback(object state)
     {
-      if (Value1.HandlerState == HandlerState.Operational)
-        Value1.MonitoredValue = DateTime.Now;
-      if (Value2.HandlerState == HandlerState.Operational)
-        Value2.MonitoredValue = m_Random.NextDouble();
+      m_TimeEven?.Invoke(this, EventArgs.Empty);
+      //if (ValueDateTime.HandlerState == HandlerState.Operational)
+      //  ValueDateTime.MonitoredValue = DateTime.Now;
+      //if (Value2.HandlerState == HandlerState.Operational)
+      //  Value2.MonitoredValue = m_Random.NextDouble();
     }
     #endregion


更新微信支付Controller

更新微信支付Controller

--- Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample/Controllers/TenPayV3Controller.cs
+++ Senparc.Weixin.MP.Sample/Senparc.Weixin.MP.Sample/Controllers/TenPayV3Controller.cs
@@ -6,10 +6,12 @@

     创建标识：Senparc - 20150312
+
+    修改标识：Senparc - 20150419
+    修改描述：添加产品相关
 ----------------------------------------------------------------*/

 using System;
-using System.Collections.Generic;
 using System.Drawing.Imaging;
 using System.IO;
 using System.Linq;
@@ -17,15 +19,10 @@
 using System.Net.Security;
 using System.Security.Cryptography.X509Certificates;
 using System.Text;
-using System.Web;
 using System.Web.Mvc;
-using System.Web.UI;
 using System.Xml.Linq;
-using Microsoft.SqlServer.Server;
 using Senparc.Weixin.MP.AdvancedAPIs;
 using Senparc.Weixin.MP.AdvancedAPIs.OAuth;
-using Senparc.Weixin.MP.CommonAPIs;
-using Senparc.Weixin.MP.Entities;
 using Senparc.Weixin.MP.Sample.Models;
 using Senparc.Weixin.MP.TenPayLibV3;
 using ZXing;
@@ -40,6 +37,13 @@
     {
         private static TenPayV3Info _tenPayV3Info;

+        private static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
+        {
+            if (errors == SslPolicyErrors.None)
+                return true;
+            return false;
+        }
+
         public static TenPayV3Info TenPayV3Info
         {
             get
@@ -65,6 +69,8 @@

             return Redirect(url);
         }
+
+        #region JsApi支付

         public ActionResult JsApi(string code, string state)
         {
@@ -208,6 +214,10 @@

             return Content(xml, "text/xml");
         }
+
+        #endregion
+
+        #region 订单及退款

         /// <summary>
         /// 订单查询
@@ -317,13 +327,9 @@

             return Content(openid);
         }
-
-        private static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
-        {
-            if (errors == SslPolicyErrors.None)
-                return true;
-            return false;
-        }
+        #endregion
+
+        #region 红包

         /// <summary>
         /// 目前支持向指定微信用户的openid发放指定金额红包
@@ -389,7 +395,7 @@

             return Content(responseContent);
         }
-
+        #endregion

         #region 产品展示


get email address from token

get email address from token

--- Source/Actions/Microsoft.Deployment.Actions.AzureCustom/AzureToken/GetAzureToken.cs
+++ Source/Actions/Microsoft.Deployment.Actions.AzureCustom/AzureToken/GetAzureToken.cs
@@ -78,6 +78,12 @@
                 }
             }

+            var emailAddress = AzureUtility.GetEmailFromToken(primaryResponse);
+            if(emailAddress.Contains('#'))
+            {
+                emailAddress = emailAddress.Split('#')?[1];
+            }
+            request.DataStore.AddToDataStore("EmailAddress", emailAddress);

             switch (oauthType)
             {
@@ -91,12 +97,13 @@
                     break;
                 default:
                     request.DataStore.AddToDataStore("AzureToken", primaryResponse);
+
                     var tenantId = new JwtSecurityToken(primaryResponse["id_token"].ToString())
                                                       .Claims.First(e => e.Type.ToLowerInvariant() == "tid")
                                                       .Value;
-                    var directoryName = new JwtSecurityToken(primaryResponse["id_token"].ToString())
-                                                       .Claims.First(e => e.Type.ToLowerInvariant() == "unique_name")
-                                                       .Value.Split('@').Last();
+
+                    var directoryName = emailAddress.Split('@').Last();
+
                     request.DataStore.AddToDataStore("DirectoryName", directoryName);
                     request.DataStore.AddToDataStore("PowerBITenantId", tenantId);
                     break;


added istyping to translate command

added istyping to translate command

--- NadekoBot/Modules/Translator/TranslateCommand.cs
+++ NadekoBot/Modules/Translator/TranslateCommand.cs
@@ -23,6 +23,7 @@
         {
             try
             {
+                await e.Channel.SendIsTyping();
                 string from = e.GetArg("langs").Split('>')[0];
                 string to = e.GetArg("langs").Split('>')[1];


Made FileSystemWatcher readonly, as per code review feedback.

--- Nodejs/Product/Nodejs/Project/NodeModulesNode.cs
+++ Nodejs/Product/Nodejs/Project/NodeModulesNode.cs
@@ -47,7 +47,7 @@
         #region Member variables

         private readonly NodejsProjectNode _projectNode;
-        private FileSystemWatcher _watcher;
+        private readonly FileSystemWatcher _watcher;
         private Timer _fileSystemWatcherTimer;
         private INpmController _npmController; //  TODO: This is totally not the right place for this!!
         private readonly object _lock = new object();


LIBOMV-876: In AssetLandmark.cs, function Encode() decimal points are replaced by commas under OS Windows French language

git-svn-id: e915c4f8b2ea2a6e63cbe989b51c0994a698cc26@3507 52acb1d6-8a22-11de-b505-999d5b087335

--- OpenMetaverse/Assets/AssetTypes/AssetLandmark.cs
+++ OpenMetaverse/Assets/AssetTypes/AssetLandmark.cs
@@ -62,7 +62,7 @@
         {
             string temp = "Landmark version 2\n";
             temp += "region_id " + RegionID + "\n";
-            temp += String.Format("local_pos {0:0.00} {1:0.00} {2:0.00}\n", Position.X, Position.Y, Position.Z);
+            temp += String.Format(Utils.EnUsCulture, "local_pos {0:0.00} {1:0.00} {2:0.00}\n", Position.X, Position.Y, Position.Z);
             AssetData = Utils.StringToBytes(temp);
         }


still testing

still testing

--- OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1887,29 +1887,26 @@
                             m_log.DebugFormat(
                                 "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);

-                            // Resume scripts  this possible should also be moved down after sending the avatar to viewer ?
-                            foreach (SceneObjectGroup sog in m_attachments)
+                            foreach(SceneObjectGroup sog in m_attachments)
                             {
-                                SendFullUpdateToClient(ControllingClient);
-                                SendAttachmentFullUpdateToAgentNF(sog, this);
-
-                                if (!sog.HasPrivateAttachmentPoint)
-                                {
-                                    // sog.ScheduleGroupForFullUpdate();
-                                    foreach(ScenePresence p in allpresences)
-                                    {
-                                        if (p == this)
-                                            continue;
-
-                                        if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)
-                                            continue;
-
-                                        SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path
-                                        SendAttachmentFullUpdateToAgentNF(sog, p);
-                                    };
-                                }
                                 sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
                                 sog.ResumeScripts();
+                            }
+
+                            foreach (ScenePresence p in allpresences)
+                            {
+                                if (p == this)
+                                {
+                                    SendTerseUpdateToAgentNF(this);
+                                    SendAttachmentsToAgentNF(this);
+                                    continue;
+                                }
+
+                                if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)
+                                    continue;
+
+                                SendTerseUpdateToAgentNF(p);
+                                SendAttachmentsToAgentNF(p);
                             }
                         }
                     }
@@ -3428,7 +3425,9 @@
             if (remoteClient.IsActive)
             {
                 //m_log.DebugFormat("[SCENE PRESENCE]: " + Name + " sending TerseUpdate to " + remoteClient.Name + " : Pos={0} Rot={1} Vel={2}", m_pos, Rotation, m_velocity);
-                remoteClient.SendEntityUpdate(this, PrimUpdateFlags.FullUpdate);
+                remoteClient.SendEntityUpdate(this,
+                    PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity
+                    | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity);
                 m_scene.StatsReporter.AddAgentUpdates(1);
             }
         }
@@ -4761,8 +4760,8 @@
                         if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)
                             return;

+                        SendTerseUpdateToAgentNF(p);
                         SendAttachmentFullUpdateToAgentNF(sog, p);
-                        SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path
                     });
                 }
             }
@@ -4772,13 +4771,13 @@
         // for now they are checked in several places down the line...
         public void SendAttachmentsToAgentNF(ScenePresence p)
         {
+            SendTerseUpdateToAgentNF(p);
             lock (m_attachments)
             {
                 foreach (SceneObjectGroup sog in m_attachments)
                 {
                     SendAttachmentFullUpdateToAgentNF(sog, p);
-                }
-                SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path
+                }
             }
         }

@@ -5966,7 +5965,7 @@
         public void HasMovedAway()
         {
             List<ScenePresence> allpresences = m_scene.GetScenePresences();
- /*           foreach (ScenePresence p in allpresences)
+           foreach (ScenePresence p in allpresences)
             {
                 if (p == this)
                     continue;
@@ -5974,19 +5973,20 @@
                 if (!p.IsChildAgent)
                     p.SendKillTo(this);
             }
-  */
+
             if (Scene.AttachmentsModule != null)
                 Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true);
         }

+
 //  kill with attachs root kills
         public void SendKillTo(ScenePresence p)
         {
             List<uint> ids = new List<uint>(m_attachments.Count + 1);
-//            foreach (SceneObjectGroup sog in m_attachments)
-//            {
-//                ids.Add(sog.RootPart.LocalId);
-//            }
+            foreach (SceneObjectGroup sog in m_attachments)
+            {
+                ids.Add(sog.RootPart.LocalId);
+            }

             ids.Add(LocalId);
             p.ControllingClient.SendKillObject(ids);


TEST more options to avnLocalTeleport

TEST more options to avnLocalTeleport

--- OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1099,7 +1099,7 @@
             SendTerseUpdateToAllClients();
         }

-        public void avnLocalTeleport(Vector3 newpos, Quaternion? newrot, bool Stopped)
+        public void avnLocalTeleport(Vector3 newpos, Quaternion? newrot,Vector3? v, bool Stopit)
         {
             CheckLandingPoint(ref newpos);
             AbsolutePosition = newpos;
@@ -1109,11 +1109,16 @@
                 // TODO
             }

-            if (Stopped)
-            {
-                if (PhysicsActor != null) // speed up physics stop
+            if (v.HasValue)
+            {
+                if (PhysicsActor != null)
+                    PhysicsActor.SetMomentum((Vector3)v);
+            }
+            else if (Stopit)
+            {
+                if (PhysicsActor != null) // speedup
                     PhysicsActor.SetMomentum(Vector3.Zero);
-                Velocity = Vector3.Zero;
+                Velocity = Vector3.Zero; // zero any velocity request
             }

             SendTerseUpdateToAllClients();


Fixed h/hh conflict in VCCV vs arpabet + moved base phoneme check so that [-v] is used if there's no sound

--- OpenUtau.Plugin.Builtin/EnglishVCCVPhonemizer.cs
+++ OpenUtau.Plugin.Builtin/EnglishVCCVPhonemizer.cs
@@ -245,14 +245,16 @@
             }

-
-            if (!HasOto(basePhoneme, syllable.tone)) {
-                basePhoneme = $"-{v}";
-            }
-
             //remove _CV if C is the first consonant of the word
             if (cc.Length > 1 && cc.Length == syllable.prevWordConsonantsCount + 1) {
                 basePhoneme = $"{cc.Last()}{v}";
+            }
+
+            if (!HasOto(basePhoneme, syllable.tone)) {
+                // TODO: clean h/hh conflict
+                if ($"{cc.Last()}" == "h") {
+                    basePhoneme = $"hh{v}";
+                } else basePhoneme = $"-{v}";
             }

             phonemes.Add(basePhoneme);
@@ -271,17 +273,16 @@
                 TryAddPhoneme(phonemes, ending.tone, $"{v}-");

             } else {
+                var vc = $"{v}{cc[0]}";
                 // --------------------------- ENDING VC ------------------------------- //
                 if (ending.IsEndingVCWithOneConsonant) {
-                    var vc = $"{v}{cc[0]}";

                     vc = CheckVCExceptions(vc);
                     vc += "-";
                     phonemes.Add(vc);

                 } else {
-                    var vc = $"{v} {cc[0]}";
-
+                    vc = $"{v} {cc[0]}";
                     vc = CheckVCExceptions(vc);
                     // "1nks" exception, start CC loop later
                     var startingC = 0;
@@ -333,6 +334,7 @@
             return phonemes;
         }

+        // TODO: See if it can be implemented in a nice way but default sounds better for now.
         //protected override double GetTransitionBasicLengthMs(string alias = "") {
         //    return GetTransitionBasicLengthMsByOto(alias);
         //}


Revert commit

Revert commit

--- OpenUtau.Plugin.Builtin/ItalianCVVCPhonemizer.cs
+++ OpenUtau.Plugin.Builtin/ItalianCVVCPhonemizer.cs
@@ -87,7 +87,7 @@

             if (prevNeighbour == null) {
                 // Use "- V" or "- CV" if present in voicebank
-                var initial = $"- {currentLyric}";
+                var initial = $"-{currentLyric}";
                 if (singer.TryGetMappedOto(initial, note.tone + attr0.toneShift, attr0.voiceColor, out var oto)) {
                     currentLyric = oto.Alias;
                 }


refactor: improves the test for teardown using file system.

--- test/Experiment.XunitUnitTest/TestAttributeTest.cs
+++ test/Experiment.XunitUnitTest/TestAttributeTest.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Reflection;
 using System.Threading;
@@ -357,7 +358,7 @@
             Assert.Equal(1, SpyFixtureConfig.SetupCount);
         }

-        [Fact(Skip = "Run on debug mode. I have no idea about why the DomainUnload event is only raised on debug mode.")]
+        [Fact]
         public void CreateTestCommandsRegistersTearDownToDomainUnloadEvent()
         {
             // Fixture setup
@@ -369,19 +370,30 @@
                 AppDomain.CurrentDomain.Evidence,
                 AppDomain.CurrentDomain.SetupInformation);

+            var invoker = (TestInvoker)appDomain.CreateInstanceAndUnwrap(
+                Assembly.GetExecutingAssembly().FullName,
+                typeof(TestInvoker).FullName);
+
+            // Exercise system
+            invoker.Invoke(method.MethodInfo);
+
+            // Verify outcome
+            appDomain.DomainUnload += (s, e) =>
+            {
+                if (SpyFixtureConfig.TearDownCount != 1)
+                    File.Create("Fail.tmp");
+            };
+            AppDomain.Unload(appDomain);
+
+            var exists = File.Exists("Fail.tmp");
             try
             {
-                // Exercise system
-                var invoker = (TestInvoker)appDomain.CreateInstanceAndUnwrap(
-                    Assembly.GetExecutingAssembly().FullName,
-                    typeof(TestInvoker).FullName);
-                invoker.Invoke(method.MethodInfo);
+                Assert.False(exists, "Teardown");
             }
             finally
             {
-                // Verify outcome
-                appDomain.DomainUnload += (s, e) => Assert.Equal(1, SpyFixtureConfig.TearDownCount);
-                AppDomain.Unload(appDomain);
+                if (exists)
+                    File.Delete("Fail.tmp");
             }
         }


internal error cleanup (#1709)

internal error cleanup (#1709)

--- WEB/Src/DependencyCollector/Shared/Implementation/DependencyCollectorEventSource.cs
+++ WEB/Src/DependencyCollector/Shared/Implementation/DependencyCollectorEventSource.cs
@@ -147,10 +147,22 @@
         [NonEvent]
         public void CallbackError(long id, string callbackName, Exception exception)
         {
-            if (this.IsEnabled(EventLevel.Error, Keywords.RddEventKeywords))
+            string idString = null;
+
+            if (this.IsEnabled(EventLevel.Verbose, Keywords.RddEventKeywords))
             {
-                this.CallbackError(id.ToString(CultureInfo.InvariantCulture), callbackName ?? string.Empty, exception == null ? "null" : exception.ToInvariantString());
+                idString = id.ToString(CultureInfo.InvariantCulture);
             }
+            else if (this.IsEnabled(EventLevel.Error, Keywords.RddEventKeywords))
+            {
+                idString = "_";
+            }
+            else
+            {
+                return;
+            }
+
+            this.CallbackError(idString, callbackName ?? string.Empty, exception == null ? "null" : exception.ToInvariantString());
         }

         [Event(


updates parser to omit duplicate lexer rules

--- libraries/Pliant/Parser.cs
+++ libraries/Pliant/Parser.cs
@@ -34,11 +34,10 @@
             var currentEarleySet = earleySets[currentIndex];
             var scanStates = currentEarleySet.Scans;

-            foreach (var scanState in scanStates)
-                yield return scanState
-                    .DottedRule
-                    .PostDotSymbol
-                    .Value as ILexerRule;
+            return from scanState in scanStates
+                   let lexerRule = scanState.DottedRule.PostDotSymbol.Value as ILexerRule
+                   group lexerRule by lexerRule.TokenType into rulesByTokenType
+                   select rulesByTokenType.First();
         }

         public void Reset()


1204: fix typo

1204: fix typo

--- a_mini/projects/PixelFarm/PixelFarm.DrawingGL/DrawingGL/GLCanvas/GLCanvasPainter.cs
+++ a_mini/projects/PixelFarm/PixelFarm.DrawingGL/DrawingGL/GLCanvas/GLCanvasPainter.cs
@@ -25,7 +25,7 @@
         Ellipse ellipse = new Ellipse();
         Stroke _aggStroke = new Stroke(1);
         RequestFont _requestFont;
-        ITextPrinter _textPriner;
+        ITextPrinter _textPrinter;

         SmoothingMode _smoothingMode; //smoothing mode of this  painter
         public GLCanvasPainter(CanvasGL2d canvas, int w, int h)
@@ -52,9 +52,9 @@
             set
             {
                 _requestFont = value;
-                if (_textPriner != null)
-                {
-                    _textPriner.ChangeFont(value);
+                if (_textPrinter != null)
+                {
+                    _textPrinter.ChangeFont(value);
                 }
             }
         }
@@ -93,13 +93,13 @@
         }
         public ITextPrinter TextPrinter
         {
-            get { return _textPriner; }
+            get { return _textPrinter; }
             set
             {
-                _textPriner = value;
+                _textPrinter = value;
                 if (value != null && _requestFont != null)
                 {
-                    _textPriner.ChangeFont(this._requestFont);
+                    _textPrinter.ChangeFont(this._requestFont);
                 }
             }
         }
@@ -112,9 +112,9 @@
             set
             {
                 _fillColor = value;
-                if (_textPriner != null)
-                {
-                    _textPriner.ChangeFontColor(value);
+                if (_textPrinter != null)
+                {
+                    _textPrinter.ChangeFontColor(value);
                 }
             }
         }
@@ -255,18 +255,18 @@
         }
         public override void DrawString(string text, double x, double y)
         {
-            if (_textPriner != null)
-            {
-                _textPriner.DrawString(text, x, y);
+            if (_textPrinter != null)
+            {
+                _textPrinter.DrawString(text, x, y);
             }
         }
         public override RenderVxFormattedString CreateRenderVx(string textspan)
         {
             var renderVxFmtStr = new GLRenderVxFormattedString(textspan);
-            if (_textPriner != null)
+            if (_textPrinter != null)
             {
                 char[] buffer = textspan.ToCharArray();
-                _textPriner.PrepareStringForRenderVx(renderVxFmtStr, buffer, 0, buffer.Length);
+                _textPrinter.PrepareStringForRenderVx(renderVxFmtStr, buffer, 0, buffer.Length);

             }
             return renderVxFmtStr;
@@ -274,9 +274,9 @@
         public override void DrawString(RenderVxFormattedString renderVx, double x, double y)
         {
             //
-            if (_textPriner != null)
-            {
-                _textPriner.DrawString(renderVx, x, y);
+            if (_textPrinter != null)
+            {
+                _textPrinter.DrawString(renderVx, x, y);
             }
         }
         public override void Fill(VertexStore vxs)


Fix whitespace to trigger CI

Fix whitespace to trigger CI

--- Platforms/NGraphics.Net/SystemDrawingPlatform.cs
+++ Platforms/NGraphics.Net/SystemDrawingPlatform.cs
@@ -1,168 +1,168 @@
-using System;
-using System.Drawing;
-using System.Drawing.Imaging;
-using System.Collections.Generic;
-using System.Drawing.Drawing2D;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace NGraphics
-{
-	public class SystemDrawingPlatform : IPlatform
-	{
-		public string Name { get { return "Net"; } }
-
-		public Task<Stream> OpenFileStreamForWritingAsync (string path)
-		{
-			return Task.FromResult ((Stream)new FileStream (path, FileMode.Create, FileAccess.Write, FileShare.Read));
-		}
-
-		public IImageCanvas CreateImageCanvas (Size size, double scale = 1.0, bool transparency = true)
-		{
-			var pixelWidth = (int)Math.Ceiling (size.Width * scale);
-			var pixelHeight = (int)Math.Ceiling (size.Height * scale);
-			var format = transparency ? PixelFormat.Format32bppPArgb : PixelFormat.Format24bppRgb;
-			var bitmap = new Bitmap (pixelWidth, pixelHeight, format);
-			return new BitmapCanvas (bitmap, scale);
-		}
-
-		public IImage LoadImage (Stream stream)
-		{
-			var image = Image.FromStream (stream);
-			return new ImageImage (image);
-		}
-
-		public IImage LoadImage (string path)
-		{
-			var image = Image.FromFile (path);
-			return new ImageImage (image);
-		}
-
-		public IImage CreateImage (Color[] colors, int width, double scale = 1.0)
-		{
-			var pixelWidth = width;
-			var pixelHeight = colors.Length / width;
-			var format = PixelFormat.Format32bppArgb;
-			Bitmap bitmap;
-			unsafe {
-				fixed (Color *c = colors) {
-					bitmap = new Bitmap (pixelWidth, pixelHeight, pixelWidth*4, format, new IntPtr (c));
-				}
-			}
-			return new ImageImage (bitmap);
-		}
-
-		public static TextMetrics GlobalMeasureText (Graphics graphics, string text, Font font)
-		{
-			using (var netFont = new System.Drawing.Font(font.Name, (float)font.Size, FontStyle.Regular, GraphicsUnit.Pixel))
-			{
-				var result = graphics.MeasureString(text, netFont);
-                var resultUnit = graphics.PageUnit;
-                var asc = netFont.FontFamily.GetCellAscent(netFont.Style);
-                var desc = netFont.FontFamily.GetCellDescent(netFont.Style);
-                var ascale = result.Height / (asc + desc);
-                return new TextMetrics {
-					Width = result.Width,
-					Ascent = asc * ascale,
+using System;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.Collections.Generic;
+using System.Drawing.Drawing2D;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace NGraphics
+{
+	public class SystemDrawingPlatform : IPlatform
+	{
+		public string Name { get { return "Net"; } }
+
+		public Task<Stream> OpenFileStreamForWritingAsync (string path)
+		{
+			return Task.FromResult ((Stream)new FileStream (path, FileMode.Create, FileAccess.Write, FileShare.Read));
+		}
+
+		public IImageCanvas CreateImageCanvas (Size size, double scale = 1.0, bool transparency = true)
+		{
+			var pixelWidth = (int)Math.Ceiling (size.Width * scale);
+			var pixelHeight = (int)Math.Ceiling (size.Height * scale);
+			var format = transparency ? PixelFormat.Format32bppPArgb : PixelFormat.Format24bppRgb;
+			var bitmap = new Bitmap (pixelWidth, pixelHeight, format);
+			return new BitmapCanvas (bitmap, scale);
+		}
+
+		public IImage LoadImage (Stream stream)
+		{
+			var image = Image.FromStream (stream);
+			return new ImageImage (image);
+		}
+
+		public IImage LoadImage (string path)
+		{
+			var image = Image.FromFile (path);
+			return new ImageImage (image);
+		}
+
+		public IImage CreateImage (Color[] colors, int width, double scale = 1.0)
+		{
+			var pixelWidth = width;
+			var pixelHeight = colors.Length / width;
+			var format = PixelFormat.Format32bppArgb;
+			Bitmap bitmap;
+			unsafe {
+				fixed (Color *c = colors) {
+					bitmap = new Bitmap (pixelWidth, pixelHeight, pixelWidth*4, format, new IntPtr (c));
+				}
+			}
+			return new ImageImage (bitmap);
+		}
+
+		public static TextMetrics GlobalMeasureText (Graphics graphics, string text, Font font)
+		{
+			using (var netFont = new System.Drawing.Font(font.Name, (float)font.Size, FontStyle.Regular, GraphicsUnit.Pixel))
+			{
+				var result = graphics.MeasureString(text, netFont);
+                var resultUnit = graphics.PageUnit;
+                var asc = netFont.FontFamily.GetCellAscent(netFont.Style);
+                var desc = netFont.FontFamily.GetCellDescent(netFont.Style);
+                var ascale = result.Height / (asc + desc);
+                return new TextMetrics {
+					Width = result.Width,
+					Ascent = asc * ascale,
 					Descent = desc * ascale,
-                };
-			}
-		}
-
-		Graphics measureGraphics = Graphics.FromImage (new Bitmap (1, 1));
-
-		public TextMetrics MeasureText (string text, Font font)
-		{
-			return GlobalMeasureText (measureGraphics, text, font);
-		}
-
-	}
-
-	public class ImageImage : IImage
-	{
-		readonly Image image;
-
-		public Image Image {
-			get {
-				return image;
-			}
-		}
-
-		public ImageImage (Image image)
-		{
-			this.image = image;
-		}
-
-		public void SaveAsPng (string path)
-		{
-			image.Save (path, ImageFormat.Png);
+                };
+			}
+		}
+
+		Graphics measureGraphics = Graphics.FromImage (new Bitmap (1, 1));
+
+		public TextMetrics MeasureText (string text, Font font)
+		{
+			return GlobalMeasureText (measureGraphics, text, font);
+		}
+
+	}
+
+	public class ImageImage : IImage
+	{
+		readonly Image image;
+
+		public Image Image {
+			get {
+				return image;
+			}
+		}
+
+		public ImageImage (Image image)
+		{
+			this.image = image;
+		}
+
+		public void SaveAsPng (string path)
+		{
+			image.Save (path, ImageFormat.Png);
 		}

 		public void SaveAsPng (Stream stream)
 		{
 			image.Save (stream, ImageFormat.Png);
-		}
-
-		public Size Size
-		{
-			get
-			{
-				return new Size(image.Width, image.Height);
-			}
-		}
-
-		public double Scale
-		{
-			get
-			{
-				return 1;
-			}
-		}
-	}
-
-	public class BitmapCanvas : GraphicsCanvas, IImageCanvas
-	{
-		readonly Bitmap bitmap;
-		readonly double scale;
-
-		public Size Size { get { return new Size (bitmap.Width / scale, bitmap.Height / scale); } }
-		public double Scale { get { return scale; } }
-
-		public BitmapCanvas (Bitmap bitmap, double scale = 1.0)
-			: base (Graphics.FromImage (bitmap))
-		{
-			this.bitmap = bitmap;
-			this.scale = scale;
-
-			graphics.ScaleTransform ((float)scale, (float)scale);
-		}
-
-		public IImage GetImage ()
-		{
-			return new ImageImage (bitmap);
-		}
-	}
-
-	public class GraphicsCanvas : ICanvas
-	{
-		protected readonly Graphics graphics;
-		readonly Stack<GraphicsState> stateStack = new Stack<GraphicsState> ();
-
-		public GraphicsCanvas (Graphics graphics)
-		{
+		}
+
+		public Size Size
+		{
+			get
+			{
+				return new Size(image.Width, image.Height);
+			}
+		}
+
+		public double Scale
+		{
+			get
+			{
+				return 1;
+			}
+		}
+	}
+
+	public class BitmapCanvas : GraphicsCanvas, IImageCanvas
+	{
+		readonly Bitmap bitmap;
+		readonly double scale;
+
+		public Size Size { get { return new Size (bitmap.Width / scale, bitmap.Height / scale); } }
+		public double Scale { get { return scale; } }
+
+		public BitmapCanvas (Bitmap bitmap, double scale = 1.0)
+			: base (Graphics.FromImage (bitmap))
+		{
+			this.bitmap = bitmap;
+			this.scale = scale;
+
+			graphics.ScaleTransform ((float)scale, (float)scale);
+		}
+
+		public IImage GetImage ()
+		{
+			return new ImageImage (bitmap);
+		}
+	}
+
+	public class GraphicsCanvas : ICanvas
+	{
+		protected readonly Graphics graphics;
+		readonly Stack<GraphicsState> stateStack = new Stack<GraphicsState> ();
+
+		public GraphicsCanvas (Graphics graphics)
+		{
 			this.graphics = graphics;

-            graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
-			graphics.SmoothingMode = SmoothingMode.HighQuality;
-		}
-
-		public void SaveState ()
-		{
-			var s = graphics.Save ();
-			stateStack.Push (s);
-		}
-		public void Transform (Transform transform)
+            graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
+			graphics.SmoothingMode = SmoothingMode.HighQuality;
+		}
+
+		public void SaveState ()
+		{
+			var s = graphics.Save ();
+			stateStack.Push (s);
+		}
+		public void Transform (Transform transform)
 		{
 			try {
 				graphics.MultiplyTransform (new Matrix (
@@ -172,119 +172,119 @@
 			}
 			catch (Exception ex) {
 				Console.WriteLine (ex);
-			}
-		}
-		public void RestoreState ()
-		{
-			if (stateStack.Count > 0) {
-				var s = stateStack.Pop ();
-				graphics.Restore (s);
-			}
-		}
-
-		public TextMetrics MeasureText(string text, Font font)
-		{
-			return SystemDrawingPlatform.GlobalMeasureText (graphics, text, font);
-		}
-
-		public void DrawText (string text, Rect frame, Font font, TextAlignment alignment = TextAlignment.Left, Pen pen = null, Brush brush = null)
-		{
-			if (brush == null)
-				return;
-			var netFont = new System.Drawing.Font (font.Family, (float)font.Size, FontStyle.Regular, GraphicsUnit.Pixel);
-			var sz = graphics.MeasureString (text, netFont);
+			}
+		}
+		public void RestoreState ()
+		{
+			if (stateStack.Count > 0) {
+				var s = stateStack.Pop ();
+				graphics.Restore (s);
+			}
+		}
+
+		public TextMetrics MeasureText(string text, Font font)
+		{
+			return SystemDrawingPlatform.GlobalMeasureText (graphics, text, font);
+		}
+
+		public void DrawText (string text, Rect frame, Font font, TextAlignment alignment = TextAlignment.Left, Pen pen = null, Brush brush = null)
+		{
+			if (brush == null)
+				return;
+			var netFont = new System.Drawing.Font (font.Family, (float)font.Size, FontStyle.Regular, GraphicsUnit.Pixel);
+			var sz = graphics.MeasureString (text, netFont);
             var asc = netFont.FontFamily.GetCellAscent(netFont.Style);
             var desc = netFont.FontFamily.GetCellDescent(netFont.Style);
             var ascale = sz.Height / (asc + desc);
             var point = frame.Position;
             var fr = new Rect (point, new Size (sz.Width, sz.Height));
-            graphics.DrawString (text, netFont, Conversions.GetBrush (brush, fr), Conversions.GetPointF (point - new Point (0, sz.Height - desc * ascale)));
-		}
-		public void DrawPath (IEnumerable<PathOp> ops, Pen pen = null, Brush brush = null)
-		{
+            graphics.DrawString (text, netFont, Conversions.GetBrush (brush, fr), Conversions.GetPointF (point - new Point (0, sz.Height - desc * ascale)));
+		}
+		public void DrawPath (IEnumerable<PathOp> ops, Pen pen = null, Brush brush = null)
+		{
 			using (var path = new GraphicsPath ()) {

-                var bb = new BoundingBoxBuilder ();
-
-				var position = Point.Zero;
-
-				foreach (var op in ops) {
-					var mt = op as MoveTo;
-					if (mt != null) {
-						var p = mt.Point;
-						position = p;
-                        bb.Add (p);
-						continue;
-					}
-					var lt = op as LineTo;
-					if (lt != null) {
-						var p = lt.Point;
-						path.AddLine (Conversions.GetPointF (position), Conversions.GetPointF (p));
+                var bb = new BoundingBoxBuilder ();
+
+				var position = Point.Zero;
+
+				foreach (var op in ops) {
+					var mt = op as MoveTo;
+					if (mt != null) {
+						var p = mt.Point;
 						position = p;
                         bb.Add (p);
-                        continue;
-					}
-					var at = op as ArcTo;
-                    if (at != null) {
-						var p = at.Point;
-
-						Point c1, c2;
-						at.GetCircles (position, out c1, out c2);
-
-						var circleCenter = (at.LargeArc ^ at.SweepClockwise) ? c1 : c2;
-						var rect = new Rect (circleCenter - at.Radius, at.Radius * 2);
-
-						var startAngle = Conversions.RadToDeg ((float)Math.Atan2 (position.Y - circleCenter.Y, position.X - circleCenter.X));
-						var endAngle = Conversions.RadToDeg ((float)Math.Atan2 (p.Y - circleCenter.Y, p.X - circleCenter.X));
-
-						var sweepAngle = endAngle - startAngle;
-
-						if (at.SweepClockwise && sweepAngle < 0) {
-							// If we want to go CW, sweepAngle needs to be positive
-							sweepAngle += 360.0f;
-						}
-						else if (!at.SweepClockwise && sweepAngle > 0) {
-							// If we want to go CCW, sweepAngle needs to be negative
-							sweepAngle -= 360.0f;
-						}
-
-						path.AddArc (Conversions.GetRectangleF(rect), startAngle, sweepAngle);
-						position = p;
-						bb.Add (p);
-						continue;
-                    }
-                    var ct = op as CurveTo;
-                    if (ct != null) {
-                        var p = ct.Point;
-                        var c1 = ct.Control1;
-                        var c2 = ct.Control2;
-                        path.AddBezier (Conversions.GetPointF (position), Conversions.GetPointF (c1),
-                            Conversions.GetPointF (c2), Conversions.GetPointF (p));
-                        position = p;
-                        bb.Add (p);
-                        bb.Add (c1);
-                        bb.Add (c2);
-                        continue;
-                    }
-                    var cp = op as ClosePath;
-					if (cp != null) {
-						path.CloseFigure ();
-						continue;
-					}
-
-					throw new NotSupportedException ("Path Op " + op);
-				}
-
-				var frame = bb.BoundingBox;
-				if (brush != null) {
-					graphics.FillPath (brush.GetBrush (frame), path);
-				}
-				if (pen != null) {
-					graphics.DrawPath (pen.GetPen (), path);
-				}
-			}
-		}
-		public void DrawRectangle (Rect frame, Size corner, Pen pen = null, Brush brush = null)
+						continue;
+					}
+					var lt = op as LineTo;
+					if (lt != null) {
+						var p = lt.Point;
+						path.AddLine (Conversions.GetPointF (position), Conversions.GetPointF (p));
+						position = p;
+                        bb.Add (p);
+                        continue;
+					}
+					var at = op as ArcTo;
+                    if (at != null) {
+						var p = at.Point;
+
+						Point c1, c2;
+						at.GetCircles (position, out c1, out c2);
+
+						var circleCenter = (at.LargeArc ^ at.SweepClockwise) ? c1 : c2;
+						var rect = new Rect (circleCenter - at.Radius, at.Radius * 2);
+
+						var startAngle = Conversions.RadToDeg ((float)Math.Atan2 (position.Y - circleCenter.Y, position.X - circleCenter.X));
+						var endAngle = Conversions.RadToDeg ((float)Math.Atan2 (p.Y - circleCenter.Y, p.X - circleCenter.X));
+
+						var sweepAngle = endAngle - startAngle;
+
+						if (at.SweepClockwise && sweepAngle < 0) {
+							// If we want to go CW, sweepAngle needs to be positive
+							sweepAngle += 360.0f;
+						}
+						else if (!at.SweepClockwise && sweepAngle > 0) {
+							// If we want to go CCW, sweepAngle needs to be negative
+							sweepAngle -= 360.0f;
+						}
+
+						path.AddArc (Conversions.GetRectangleF(rect), startAngle, sweepAngle);
+						position = p;
+						bb.Add (p);
+						continue;
+                    }
+                    var ct = op as CurveTo;
+                    if (ct != null) {
+                        var p = ct.Point;
+                        var c1 = ct.Control1;
+                        var c2 = ct.Control2;
+                        path.AddBezier (Conversions.GetPointF (position), Conversions.GetPointF (c1),
+                            Conversions.GetPointF (c2), Conversions.GetPointF (p));
+                        position = p;
+                        bb.Add (p);
+                        bb.Add (c1);
+                        bb.Add (c2);
+                        continue;
+                    }
+                    var cp = op as ClosePath;
+					if (cp != null) {
+						path.CloseFigure ();
+						continue;
+					}
+
+					throw new NotSupportedException ("Path Op " + op);
+				}
+
+				var frame = bb.BoundingBox;
+				if (brush != null) {
+					graphics.FillPath (brush.GetBrush (frame), path);
+				}
+				if (pen != null) {
+					graphics.DrawPath (pen.GetPen (), path);
+				}
+			}
+		}
+		public void DrawRectangle (Rect frame, Size corner, Pen pen = null, Brush brush = null)
 		{
 			if (corner.Width > 0 || corner.Height > 0) {
 				using (var path = new GraphicsPath ()) {
@@ -329,49 +329,49 @@
 					var r = Conversions.GetRectangleF (frame);
 					graphics.DrawRectangle (pen.GetPen (), r.X, r.Y, r.Width, r.Height);
 				}
-			}
-		}
-		public void DrawEllipse (Rect frame, Pen pen = null, Brush brush = null)
-		{
-			if (brush != null) {
-				graphics.FillEllipse (brush.GetBrush (frame), Conversions.GetRectangleF (frame));
-			}
-			if (pen != null) {
-				graphics.DrawEllipse (pen.GetPen (), Conversions.GetRectangleF (frame));
-			}
-		}
-		public void DrawImage (IImage image, Rect frame, double alpha = 1.0)
-		{
-			var ii = image as ImageImage;
-			if (ii != null) {
-				if (alpha < 0.999) {
-					var i = new ImageAttributes ();
-					var mat = new ColorMatrix (new float[][] {
-						new[] { 1.0f, 0.0f, 0.0f, 0.0f, 0.0f },
-						new[] { 0.0f, 1.0f, 0.0f, 0.0f, 0.0f },
-						new[] { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f },
-						new[] { 0.0f, 0.0f, 0.0f, (float)alpha, 0.0f },
-						new[] { 0.0f, 0.0f, 0.0f, 0.0f, 1.0f }
-					});
-					i.SetColorMatrix (mat);
-					var size = ii.Image.Size;
-					graphics.DrawImage (ii.Image, Conversions.GetRectangle (frame),
-						0, 0, size.Width, size.Height, GraphicsUnit.Pixel, i);
-				} else {
-					graphics.DrawImage (ii.Image, Conversions.GetRectangleF (frame));
-				}
-			}
-		}
-	}
-
-	public static class Conversions
-	{
-		public static System.Drawing.Color GetColor (this Color color)
-		{
-			return System.Drawing.Color.FromArgb (color.A, color.R, color.G, color.B);
-		}
-
-		public static System.Drawing.Pen GetPen (this Pen pen)
+			}
+		}
+		public void DrawEllipse (Rect frame, Pen pen = null, Brush brush = null)
+		{
+			if (brush != null) {
+				graphics.FillEllipse (brush.GetBrush (frame), Conversions.GetRectangleF (frame));
+			}
+			if (pen != null) {
+				graphics.DrawEllipse (pen.GetPen (), Conversions.GetRectangleF (frame));
+			}
+		}
+		public void DrawImage (IImage image, Rect frame, double alpha = 1.0)
+		{
+			var ii = image as ImageImage;
+			if (ii != null) {
+				if (alpha < 0.999) {
+					var i = new ImageAttributes ();
+					var mat = new ColorMatrix (new float[][] {
+						new[] { 1.0f, 0.0f, 0.0f, 0.0f, 0.0f },
+						new[] { 0.0f, 1.0f, 0.0f, 0.0f, 0.0f },
+						new[] { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f },
+						new[] { 0.0f, 0.0f, 0.0f, (float)alpha, 0.0f },
+						new[] { 0.0f, 0.0f, 0.0f, 0.0f, 1.0f }
+					});
+					i.SetColorMatrix (mat);
+					var size = ii.Image.Size;
+					graphics.DrawImage (ii.Image, Conversions.GetRectangle (frame),
+						0, 0, size.Width, size.Height, GraphicsUnit.Pixel, i);
+				} else {
+					graphics.DrawImage (ii.Image, Conversions.GetRectangleF (frame));
+				}
+			}
+		}
+	}
+
+	public static class Conversions
+	{
+		public static System.Drawing.Color GetColor (this Color color)
+		{
+			return System.Drawing.Color.FromArgb (color.A, color.R, color.G, color.B);
+		}
+
+		public static System.Drawing.Pen GetPen (this Pen pen)
 		{
             var drawingPen = new System.Drawing.Pen(GetColor(pen.Color), (float)pen.Width);

@@ -425,13 +425,13 @@
             }

             return blend;
-        }
-
-		public static System.Drawing.Brush GetBrush (this Brush brush, Rect frame)
-		{
-			var cb = brush as SolidBrush;
-			if (cb != null) {
-				return new System.Drawing.SolidBrush (cb.Color.GetColor ());
+        }
+
+		public static System.Drawing.Brush GetBrush (this Brush brush, Rect frame)
+		{
+			var cb = brush as SolidBrush;
+			if (cb != null) {
+				return new System.Drawing.SolidBrush (cb.Color.GetColor ());
 			}

             var lgb = brush as LinearGradientBrush;
@@ -458,30 +458,30 @@
                     b.InterpolationColors = bb;
                 }
                 return b;
-            }
-
-			throw new NotImplementedException ("Brush " + brush);
+            }
+
+			throw new NotImplementedException ("Brush " + brush);
 		}

         public static PointF GetPointF (this Point point)
         {
             return new PointF ((float)point.X, (float)point.Y);
-        }
-
-		public static RectangleF GetRectangleF (this Rect frame)
-		{
-			return new RectangleF ((float)frame.X, (float)frame.Y, (float)frame.Width, (float)frame.Height);
-		}
-
-		public static System.Drawing.Rectangle GetRectangle (this Rect frame)
-		{
-			return new System.Drawing.Rectangle ((int)frame.X, (int)frame.Y, (int)frame.Width, (int)frame.Height);
-		}
-
-		public static float RadToDeg (float rad)
-		{
-			return rad * (float) (180.0 / Math.PI);
-		}
-	}
-}
-
+        }
+
+		public static RectangleF GetRectangleF (this Rect frame)
+		{
+			return new RectangleF ((float)frame.X, (float)frame.Y, (float)frame.Width, (float)frame.Height);
+		}
+
+		public static System.Drawing.Rectangle GetRectangle (this Rect frame)
+		{
+			return new System.Drawing.Rectangle ((int)frame.X, (int)frame.Y, (int)frame.Width, (int)frame.Height);
+		}
+
+		public static float RadToDeg (float rad)
+		{
+			return rad * (float)(180.0 / Math.PI);
+		}
+	}
+}
+


Made a mistake on Moveset Four-Loop

Made a mistake on Moveset Four-Loop


Fixing an issue with the project property pages.

--- PowerShellTools/Project/PowerShellProjectNode.cs
+++ PowerShellTools/Project/PowerShellProjectNode.cs
@@ -13,8 +13,8 @@
             : base(package, Utilities.GetImageList(typeof(PowerShellProjectNode).Assembly.GetManifestResourceStream("PowerShellTools.Project.Resources.ProjectIcon.bmp")))
         {
             _package = package;
-            AddCATIDMapping(typeof(PowerShellDebugPropertyPage), typeof(PowerShellDebugPropertyPage).GUID);
-            AddCATIDMapping(typeof (PowerShellModulePropertyPage), typeof (PowerShellModulePropertyPage).GUID);
+            // TODO: Temporary!! AddCATIDMapping(typeof(PowerShellDebugPropertyPage), typeof(PowerShellDebugPropertyPage).GUID);
+            //TODO: Temporary!!  AddCATIDMapping(typeof (PowerShellModulePropertyPage), typeof (PowerShellModulePropertyPage).GUID);
         }

         public override Type GetProjectFactoryType()
@@ -39,12 +39,14 @@

         public override Type GetGeneralPropertyPageType()
         {
-            return typeof (PowerShellGeneralPropertyPage);
+            //TODO: Temporary!!  return typeof (PowerShellGeneralPropertyPage);
+            return typeof (PowerShellDebugPropertyPage);
         }

         protected override Guid[] GetConfigurationIndependentPropertyPages()
         {
-            return new[] { typeof(PowerShellGeneralPropertyPage).GUID, typeof(PowerShellDebugPropertyPage).GUID, typeof(PowerShellModulePropertyPage).GUID };
+           //TODO: Temporary!! return new[] { typeof(PowerShellGeneralPropertyPage).GUID, typeof(PowerShellDebugPropertyPage).GUID, typeof(PowerShellModulePropertyPage).GUID };
+           return new[] { typeof(PowerShellDebugPropertyPage).GUID };
         }

         public override Type GetLibraryManagerType()


Hide filter that is not used on the orderAdmin page

--- Purchasing.Web/Views/History/_OrderFilter.cshtml
+++ Purchasing.Web/Views/History/_OrderFilter.cshtml
@@ -28,19 +28,22 @@
                         {
                             isChecked = "checked=\"checked\"";
                         }
-                      }
+                    }
                     @*<input type="checkbox" value="true" @isChecked name="ShowPending"/>
*@

                     @Html.CheckBox("ShowPending", Model.ShowPending)

-

-
Your Orders

-

-                    @Html.CheckBox("ShowCreated", Model.ShowCreated)
-

-

+            @if ((string)ViewBag.GetMethod != "AdminOrders")
+            {
+

+
Your Orders

+

+                        @Html.CheckBox("ShowCreated", Model.ShowCreated)
+

+

+            }

                     @Html.LabelFor(model => model.StartDate)


added option to suppress all exception messages if deleting files by logfile

--- RelicModManager/InstallerComponents/Installer.cs
+++ RelicModManager/InstallerComponents/Installer.cs
@@ -387,7 +387,7 @@
             }
         }

-        private void DeleteFilesByList(List<string> list, bool reportProgress = false, TextWriter tw = null)
+        private void DeleteFilesByList(List<string> list, bool reportProgress = false, TextWriter tw = null, bool suppressException = false)
         {
             foreach (string line in list)
             {
@@ -430,21 +430,10 @@
                             }
                         }
                     }
-                    catch (DirectoryNotFoundException)
-                    {
-                        //
-                    }
-                    catch (FileNotFoundException)
-                    {
-                        //
-                    }
-                    catch (UnauthorizedAccessException)
-                    {
-                        //
-                    }
                     catch (Exception ex)    // here is another problem, so logging it
                     {
-                        Utils.ExceptionLog("DeleteFilesByList", "delete file: " + line, ex);
+                        if (!suppressException)
+                            Utils.ExceptionLog("DeleteFilesByList", "delete file: " + line, ex);
                     }
                 }
                 if (tw != null)
@@ -513,7 +502,7 @@
                     }
                     try
                     {
-                        DeleteFilesByList(lines, true, tw);
+                        DeleteFilesByList(lines, true, tw, true);
                     }
                     catch (Exception ex)
                     {


added check if duplicated extraction assignment to atlas file

--- RelicModManager/InstallerComponents/Installer.cs
+++ RelicModManager/InstallerComponents/Installer.cs
@@ -1239,7 +1239,6 @@
                                 }
                                 zip.Dispose();
                             }
-
                         }
                     }
                     catch (Exception ex)
@@ -1698,7 +1697,18 @@
                         }
                         atlases.workingFolder = Path.Combine(Application.StartupPath, "RelHaxTemp", Path.GetFileNameWithoutExtension(atlases.atlasFile));
                         if (atlases.mapFile.Equals("")) atlases.mapFile = Path.GetFileNameWithoutExtension(atlases.atlasFile) + ".xml";
-                        atlasesList.Add(atlases);
+                        bool duplicateFound = false;
+                        foreach (Atlases check in atlasesList)
+                        {
+                            if (check.pkg.ToLower().Equals(atlases.pkg.ToLower()) && check.directoryInArchive.Replace(@"\", "").Replace(@"/","").ToLower().Equals(atlases.directoryInArchive.Replace(@"\", "").Replace(@"/", "").ToLower()) && check.atlasFile.ToLower().Equals(atlases.atlasFile.ToLower()) && check.atlasSaveDirectory.ToLower().Equals(atlases.atlasSaveDirectory.ToLower()))
+                            {
+                                // if the parameters abouve are matching, then a user added maybe additional files to add in a different folder
+                                check.imageFolderList.AddRange(atlases.imageFolderList);
+                                duplicateFound = true;
+                            }
+                        }
+                        if (!duplicateFound)
+                            atlasesList.Add(atlases);
                     }
                     catch (Exception ex)
                     {


Update ModelBinderUtils.cs

Update ModelBinderUtils.cs

--- Rest/NakedObjects.Rest/Model/ModelBinderUtils.cs
+++ Rest/NakedObjects.Rest/Model/ModelBinderUtils.cs
@@ -42,14 +42,11 @@
             return name.StartsWith(RestControlFlags.ReservedPrefix);
         }

-        public static Task<JObject> DeserializeJsonStreamAsync(Stream stream) {
-            if (!stream.CanRead) {
-                return new Task<JObject>(() => new JObject());
-            }
+        public static async Task<JObject> DeserializeJsonStreamAsync(Stream stream) {

             using var streamReader = new StreamReader(stream, new UTF8Encoding(false, true));
             using var jsonTextReader = new JsonTextReader(streamReader);
-            return JObject.LoadAsync(jsonTextReader);
+            return await JObject.LoadAsync(jsonTextReader);
         }

         public static byte[] DeserializeBinaryStream(Stream stream) {


Move the call to AfterGetAccessToken to the end of QueryAccessToken to allow the client to override the TokenType (e.g.)

--- RestSharp.Portable.OAuth2/OAuth2/OAuth2Client.cs
+++ RestSharp.Portable.OAuth2/OAuth2/OAuth2Client.cs
@@ -215,12 +215,6 @@

             var response = await client.ExecuteAndVerify(request);

-            AfterGetAccessToken(new BeforeAfterRequestArgs
-            {
-                Response = response,
-                Parameters = parameters
-            });
-
             var content = response.GetContent();
             AccessToken = ParseAccessTokenResponse(content);

@@ -230,6 +224,12 @@

             var expiresIn = ParseStringResponse(content, new[] { ExpiresKey })[ExpiresKey].Select(x => Convert.ToInt32(x, 10)).FirstOrDefault();
             ExpiresAt = (expiresIn != 0 ? (DateTime?)DateTime.Now.AddSeconds(expiresIn) : null);
+
+            AfterGetAccessToken(new BeforeAfterRequestArgs
+            {
+                Response = response,
+                Parameters = parameters
+            });
         }

         /// <summary>


動画が何らかの理由で読み込めなかった時にシークバーを動かすとクラッシュする不具合を修正

--- SRNicoNico/ViewModels/Video/VideoHtml5Handler.cs
+++ SRNicoNico/ViewModels/Video/VideoHtml5Handler.cs
@@ -184,6 +184,11 @@

         protected internal void Seek(double pos) {

+            if(Owner.ApiData == null) {
+
+                return;
+            }
+
             if(pos < 0) {

                 pos = 0;


connect loading

connect loading

--- Samples/Samples/ViewModels/Le/DeviceViewModel.cs
+++ Samples/Samples/ViewModels/Le/DeviceViewModel.cs
@@ -2,6 +2,8 @@
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Reactive.Linq;
+using System.Reactive.Threading.Tasks;
+using System.Threading;
 using System.Windows.Input;
 using Plugin.BluetoothLE;
 using Acr.UserDialogs;
@@ -32,7 +34,13 @@
                     // don't cleanup connection - force user to d/c
                     if (this.device.Status == ConnectionStatus.Disconnected)
                     {
-                        await this.device.Connect();
+                        using (var cancelSrc = new CancellationTokenSource())
+                        {
+                            using (this.Dialogs.Loading("Connecting", cancelSrc.Cancel, "Cancel"))
+                            {
+                                await this.device.Connect().ToTask(cancelSrc.Token);
+                            }
+                        }
                     }
                     else
                     {


fix gatt server demo

fix gatt server demo

--- Samples/Samples/ViewModels/Le/ServerViewModel.cs
+++ Samples/Samples/ViewModels/Le/ServerViewModel.cs
@@ -8,7 +8,7 @@
 using Samples.Services;
 using Device = Xamarin.Forms.Device;
 using Command = Xamarin.Forms.Command;
-
+using ReactiveUI.Fody.Helpers;

 namespace Samples.ViewModels.Le
 {
@@ -59,11 +59,11 @@
         }

-        public string ServerText { get; set; } = "Start Server";
-        public string CharacteristicValue { get; set; }
-        public string DescriptorValue { get; set; }
-        public string Output { get; private set; }
-        public AdapterStatus Status { get; set; }
+        [Reactive] public string ServerText { get; set; } = "Start Server";
+        [Reactive] public string CharacteristicValue { get; set; }
+        [Reactive] public string DescriptorValue { get; set; }
+        [Reactive] public string Output { get; private set; }
+        [Reactive] public AdapterStatus Status { get; set; }
         public ICommand ToggleServer { get; }
         public ICommand Clear { get; }

@@ -149,7 +149,7 @@
                         this.Dialogs.Alert("Error Starting GATT Server - " + ex);
                         return Observable.Return(false);
                     })
-                    .Subscribe(started =>
+                    .Subscribe(started => Device.BeginInvokeOnMainThread(() =>
                     {
                         if (!started)
                         {
@@ -172,7 +172,7 @@
                                 }
                             }
                         }
-                    });
+                    }));

                 this.server
                     .WhenAnyCharacteristicSubscriptionChanged()


add Assembly.GetEntryAssembly to register automatic services

--- SignalGo.Server/ServiceManager/ServerProvider.cs
+++ SignalGo.Server/ServiceManager/ServerProvider.cs
@@ -49,6 +49,8 @@
         {
             Start(url);
             var assembly = Assembly.GetEntryAssembly();
+            if (assemblies == null)
+                assemblies = new List<Assembly>() { assembly };
             AutoRegisterServices(assemblies);

         }
@@ -158,7 +160,7 @@
                         RegisterClientServiceInterface(item);
                     else
 #endif
-                        RegisterClientService(item);
+                    RegisterClientService(item);
                     Console.WriteLine(item.FullName);
                 }
             }


handle Void gets

handle Void gets

--- Signum.React.Extensions/RestLog/RestLogFilter.cs
+++ Signum.React.Extensions/RestLog/RestLogFilter.cs
@@ -55,7 +55,7 @@

             if (actionExecutedContext.Exception==null)
             {
-                request.ResponseBody = actionExecutedContext.Response.Content.ReadAsStringAsync().Result;
+                request.ResponseBody = actionExecutedContext.Response.Content?.ReadAsStringAsync()?.Result;
             }

             if (actionExecutedContext.Exception != null)


gracefully handle deserializing DateTime objects that are no probably formatted.

--- Simpl.Serialization/Types/Scalar/DateTimeType.cs
+++ Simpl.Serialization/Types/Scalar/DateTimeType.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Reflection;
 using System.Text;
@@ -38,14 +39,22 @@
         {
             try
             {
-                DateTime result;
+                DateTime? result = null;
                 try
                 {
-                   result = Convert.ToDateTime(value);
+                   result = UtcEpoch.AddMilliseconds(Convert.ToInt64(value));
                 }
-                catch (FormatException e)
+                catch (FormatException notUTC)
                 {
-                    result = UtcEpoch.AddMilliseconds(Convert.ToInt64(value));
+                   Debug.WriteLine("date not in UTC epoch. trying builtin DateTime conversion.");
+                    try
+                    {
+                        result = Convert.ToDateTime(value);
+                    }
+                    catch (FormatException notDateTime)
+                    {
+                        Debug.WriteLine("Date not properly formated. Skipping. Value = " + value.ToString());
+                    }
                 }

                 return result;


Set the bulk PUT helper function multipart upload threshold to 32 petabytes since we're waiting for server support.

--- Ds3/Helpers/Job.cs
+++ Ds3/Helpers/Job.cs
@@ -28,7 +28,10 @@
         private readonly IDs3Client _client;
         protected readonly JobResponse _bulkResponse;
         protected int _maxParallelRequests = 0;
-        protected long _partSize = 32L * 1024L * 1024L;
+        protected long _partSize = 32L * 1024L * 1024L
+            //TODO: Until the server supports multipart upload properly we don't want to use it.
+            // For now we'll just set the threshold to something ridiculous.
+            * 1024L * 1024L * 1024L;

         protected Job(IDs3Client client, JobResponse bulkResponse)
         {


Fix build

Fix build

--- Source/HelixToolkit.Wpf/Exporters/StlExporter.cs
+++ Source/HelixToolkit.Wpf/Exporters/StlExporter.cs
@@ -13,6 +13,7 @@
 {
     using System.IO;
     using System.Text;
+    using System.Windows.Media;
     using System.Windows.Media.Media3D;

     /// <summary>


GSF.Core: Modified IsamDataFileBase.WriteToDisk to write all records sequentially to the stream rather than seeking between each write operation.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/gsf/Main;C81693

--- Source/Libraries/GSF.Core/IO/IsamDataFileBase.cs
+++ Source/Libraries/GSF.Core/IO/IsamDataFileBase.cs
@@ -1269,13 +1269,11 @@
                 if ((object)record != null)
                 {
                     int lastRecordIndex = (object)m_fileRecords == null ? RecordsOnDisk : RecordsInMemory;
-                    if (recordIndex > lastRecordIndex + 1)
+
+                    // Write missing intermediate records.
+                    for (int i = lastRecordIndex + 1; i < recordIndex; i++)
                     {
-                        // Write missing intermediate records.
-                        for (int i = lastRecordIndex + 1; i < recordIndex; i++)
-                        {
-                            Write(i, CreateNewRecord(i));
-                        }
+                        Write(i, CreateNewRecord(i));
                     }

                     if ((object)m_fileRecords == null)
@@ -1287,6 +1285,7 @@
                     {
                         // Update in-memory record list.
                         lastRecordIndex = RecordsInMemory;
+
                         if (recordIndex == lastRecordIndex + 1)
                         {
                             // Add new record.
@@ -1491,17 +1490,23 @@
         private void WriteToDisk(IEnumerable<T> records)
         {
             // Write all records to disk.
-            int index = 0;
-
-            foreach (T item in records)
-            {
-                WriteToDisk(++index, item);
+            int count = 0;
+
+            lock (m_fileData)
+            {
+                m_fileData.Seek(0L, SeekOrigin.Begin);
+
+                foreach (T item in records)
+                {
+                    item.CopyBinaryImageToStream(m_fileData);
+                    count++;
+                }
             }

             // Discard previously existing records that were not written.
             lock (m_fileData)
             {
-                m_fileData.SetLength(index * m_recordBuffer.Length);
+                m_fileData.SetLength(count * m_recordBuffer.Length);
             }
         }


openPDC.UI: Added regular expression for Longitude and Latitude in Device.cs.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/openpdc/Synchrophasor/Current Version;C70813

--- Source/Libraries/openPDC.UI/DataModels/Device.cs
+++ Source/Libraries/openPDC.UI/DataModels/Device.cs
@@ -368,6 +368,7 @@
         ///  Gets or sets <see cref="Device"/> Latitude.
         /// </summary>
         // Because of database design, no validation attributes are applied.
+        [RegularExpression(@"^[-]?([0-9]{1,3})?([.][0-9]{1,2})?$", ErrorMessage = "Invalid value. Please provide value in decimal(9,6) format.")]
         public decimal? Latitude
         {
             get


Cloud: periodic services no longer overwrite state & configuration when releasing a lease, resolving known bug in #92

--- Source/Lokad.Cloud.Framework/ScheduledService.cs
+++ Source/Lokad.Cloud.Framework/ScheduledService.cs
@@ -76,61 +76,65 @@
 	{
 		internal const string ScheduleStateContainer = "lokad-cloud-schedule-state";

-		DateTimeOffset _lastExecutedOnThisWorker;
 		readonly bool _scheduledPerWorker;
+		readonly string _workerKey;
 		readonly TimeSpan _leaseTimeout;
-		readonly Maybe<TimeSpan> _defaultTriggerPeriod;
-		readonly string _workerKey;
+		readonly TimeSpan _defaultTriggerPeriod;
+
+		DateTimeOffset _workerScopeLastExecuted;

 		/// <summary>
 		/// Constructor
 		/// </summary>
 		protected ScheduledService()
 		{
-			_leaseTimeout = ExecutionTimeout + new TimeSpan(0, 5, 0);
-
+			// runtime fixed settings
+			_leaseTimeout = ExecutionTimeout + 5.Minutes();
+			_workerKey = CloudEnvironment.PartitionKey;
+
+			// default setting
+			_scheduledPerWorker = false;
+			_defaultTriggerPeriod = 1.Hours();
+
+			// overwrite settings with config in the attribute - if available
 			var settings = GetType().GetAttribute<ScheduledServiceSettingsAttribute>(true);
-			if (settings == null)
-			{
-				_scheduledPerWorker = false;
-				_defaultTriggerPeriod = Maybe<TimeSpan>.Empty;
-				return;
-			}
-
-			_scheduledPerWorker = settings.SchedulePerWorker;
-			_defaultTriggerPeriod = settings.TriggerInterval.Seconds();
-			_workerKey = CloudEnvironment.PartitionKey;
+			if (settings != null)
+			{
+				_scheduledPerWorker = settings.SchedulePerWorker;
+
+				if (settings.TriggerInterval > 0)
+				{
+					_defaultTriggerPeriod = settings.TriggerInterval.Seconds();
+				}
+			}
 		}

 		/// <seealso cref="CloudService.StartImpl"/>
 		protected sealed override bool StartImpl()
 		{
 			var stateName = new ScheduledServiceStateName(Name);
-			ScheduledServiceState state = null;
+
+			// 1. SIMPLE WORKER-SCOPED SCHEDULING CASE

 			// per-worker scheduling does not need any write request to be made toward the storage
 			if (_scheduledPerWorker)
 			{
 				// if no state can be found in the storage, then use default state instead
 				var blobState = BlobStorage.GetBlob(stateName);
-				var stateIfAvailable = blobState.HasValue ? blobState.Value : GetDefaultState();
-
-				// skip execution if no trigger information is available.
-				if (!stateIfAvailable.HasValue)
+				var state = blobState.HasValue ? blobState.Value : GetDefaultState();
+
+				var now = DateTimeOffset.Now;
+				if (now.Subtract(_workerScopeLastExecuted) < state.TriggerInterval)
 				{
-					return false;
-				}
-
-				var now = DateTimeOffset.Now;
-				if (now.Subtract(_lastExecutedOnThisWorker) < stateIfAvailable.Value.TriggerInterval)
-				{
-					_lastExecutedOnThisWorker = now;
+					_workerScopeLastExecuted = now;
 					StartOnSchedule();
 					return true;
 				}

 				return false;
 			}
+
+			// 2. CHECK WHETHER WE SHOULD EXECUTE NOW, ACQUIRE LEASE IF SO

 			// checking if the last update is not too recent, and eventually
 			// update this value if it's old enough. When the update fails,
@@ -144,25 +148,16 @@

 						if (!currentState.HasValue)
 						{
-							// Initialize State
+							// initialize default state
 							var newState = GetDefaultState();
-							if (!newState.HasValue)
-							{
-								return Result<ScheduledServiceState>.CreateError("No settings available, service skipped.");
-							}
-
-							// state is a local variable
-							state = newState.Value;

 							// create lease and execute
-							state.LastExecuted = now;
-							state.Lease = CreateLease(now);
-							return Result.CreateSuccess(state);
+							newState.LastExecuted = now;
+							newState.Lease = CreateLease(now);
+							return Result.CreateSuccess(newState);
 						}

-						// state is a local variable
-						state = currentState.Value;
-
+						var state = currentState.Value;
 						if (now.Subtract(state.LastExecuted) < state.TriggerInterval)
 						{
 							return Result<ScheduledServiceState>.CreateError("No need to update.");
@@ -179,6 +174,8 @@
 						return Result.CreateSuccess(state);
 					});

+			// 3. IF WE SHOULD NOT EXECUTE NOW, SKIP
+
 			if (!updated)
 			{
 				return false;
@@ -186,13 +183,42 @@

 			try
 			{
+				// 4. ACTUAL EXECUTION
+
 				StartOnSchedule();
 				return true;
 			}
 			finally
 			{
-				state.Lease = null;
-				BlobStorage.PutBlob(stateName, state, true);
+				// 5. RELEASE THE LEASE
+
+				// we need a full update here (instead of just uploading the cached blob)
+				// to ensure we do not overwrite changes made in the console in the meantime
+				// (e.g. changed trigger interval), and to resolve the edge case when
+				// a lease has been forcefully removed from the console and another service
+				// has taken a lease in the meantime.
+
+				ScheduledServiceState result;
+				BlobStorage.AtomicUpdate(
+					stateName,
+					currentState =>
+						{
+							if (!currentState.HasValue)
+							{
+								return GetDefaultState();
+							}
+
+							var state = currentState.Value;
+							if (state.Lease == null || state.Lease.Owner != _workerKey)
+							{
+								return state;
+							}
+
+							// remove lease
+							state.Lease = null;
+							return state;
+						},
+					out result);
 			}
 		}

@@ -200,20 +226,14 @@
 		/// Prepares this service's default state based on its settings attribute.
 		/// In case no attribute is found then Maybe.Empty is returned.
 		/// </summary>
-		private Maybe<ScheduledServiceState> GetDefaultState()
-		{
-			// skip execution if no trigger information is available.
-			if(!_defaultTriggerPeriod.HasValue)
-			{
-				return Maybe<ScheduledServiceState>.Empty;
-			}
-
+		private ScheduledServiceState GetDefaultState()
+		{
 			return new ScheduledServiceState
-				{
-					LastExecuted = DateTimeOffset.MinValue,
-					TriggerInterval = _defaultTriggerPeriod.Value,
-					SchedulePerWorker = _scheduledPerWorker
-				};
+			{
+				LastExecuted = DateTimeOffset.MinValue,
+				TriggerInterval = _defaultTriggerPeriod,
+				SchedulePerWorker = _scheduledPerWorker
+			};
 		}

 		/// <summary>


Update src/AutoUI/Annotations/SelectionAttribute.cs

Co-authored-by: Stanislav Lukeš <8644bb09ff40d55dfe9cdfa05bb2e6c183755de7@outlook.cz>


convenience method on StructureMapConfiguration

--- Source/StructureMap/StructureMapConfiguration.cs
+++ Source/StructureMap/StructureMapConfiguration.cs
@@ -6,6 +6,7 @@
 using StructureMap.Configuration.DSL;
 using StructureMap.Configuration.DSL.Expressions;
 using StructureMap.Graph;
+using StructureMap.Interceptors;
 using StructureMap.Verification;

 namespace StructureMap
@@ -87,6 +88,11 @@
             IgnoreStructureMapConfig = false;
         }

+        public static void RegisterInterceptor(TypeInterceptor interceptor)
+        {
+            _registry.RegisterInterceptor(interceptor);
+        }
+
         /// <summary>
         /// Builds a PluginGraph object for the current configuration.  Used by ObjectFactory.
         /// </summary>


registered DbRepository as IDbRepository in AutofacConfig

--- Source/Web/SciHub.Web/App_Start/AutofacConfig.cs
+++ Source/Web/SciHub.Web/App_Start/AutofacConfig.cs
@@ -6,6 +6,7 @@
     using Autofac;
     using Autofac.Integration.Mvc;
     using Data;
+    using Data.Common.Repositories;

     public static class AutofacConfig
     {
@@ -42,6 +43,10 @@
             builder.Register(x => new SciHubDbContext())
                 .As<DbContext>()
                 .InstancePerRequest();
+
+            builder.RegisterGeneric(typeof(DbRepository<>))
+                .As(typeof(IDbRepository<>))
+                .InstancePerRequest();
         }
     }
 }