Delete Register.aspx.designer.cs

Delete Register.aspx.designer.cs

--- Register.aspx.designer.cs
+++ Register.aspx.designer.cs
@@ -1,330 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace AABZGames {
-
-
-    public partial class Register {
-
-        /// <summary>
-        /// txtFname control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.TextBox txtFname;
-
-        /// <summary>
-        /// reqFname control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.RequiredFieldValidator reqFname;
-
-        /// <summary>
-        /// txtLastName control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.TextBox txtLastName;
-
-        /// <summary>
-        /// reqLname control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.RequiredFieldValidator reqLname;
-
-        /// <summary>
-        /// txtEmail control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.TextBox txtEmail;
-
-        /// <summary>
-        /// reqEmail control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.RequiredFieldValidator reqEmail;
-
-        /// <summary>
-        /// txtPass control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.TextBox txtPass;
-
-        /// <summary>
-        /// reqPass control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.RequiredFieldValidator reqPass;
-
-        /// <summary>
-        /// txtConf control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.TextBox txtConf;
-
-        /// <summary>
-        /// reqConf control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.RequiredFieldValidator reqConf;
-
-        /// <summary>
-        /// comparePass control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.CompareValidator comparePass;
-
-        /// <summary>
-        /// txtPhone control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.TextBox txtPhone;
-
-        /// <summary>
-        /// reqPhone control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.RequiredFieldValidator reqPhone;
-
-        /// <summary>
-        /// txtAdd control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.TextBox txtAdd;
-
-        /// <summary>
-        /// reqAdd control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.RequiredFieldValidator reqAdd;
-
-        /// <summary>
-        /// txtAdd2 control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.TextBox txtAdd2;
-
-        /// <summary>
-        /// txtCity control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.TextBox txtCity;
-
-        /// <summary>
-        /// reqCity control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.RequiredFieldValidator reqCity;
-
-        /// <summary>
-        /// txtState control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.TextBox txtState;
-
-        /// <summary>
-        /// reqState control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.RequiredFieldValidator reqState;
-
-        /// <summary>
-        /// txtZip control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.TextBox txtZip;
-
-        /// <summary>
-        /// reqZip control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.RequiredFieldValidator reqZip;
-
-        /// <summary>
-        /// chkBill control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.CheckBox chkBill;
-
-        /// <summary>
-        /// panelBilling control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.Panel panelBilling;
-
-        /// <summary>
-        /// txtBill1 control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.TextBox txtBill1;
-
-        /// <summary>
-        /// reqBill1 control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.RequiredFieldValidator reqBill1;
-
-        /// <summary>
-        /// txtBill2 control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.TextBox txtBill2;
-
-        /// <summary>
-        /// billcity control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.TextBox billcity;
-
-        /// <summary>
-        /// reqbillcity control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.RequiredFieldValidator reqbillcity;
-
-        /// <summary>
-        /// billstate control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.TextBox billstate;
-
-        /// <summary>
-        /// reqbillstate control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.RequiredFieldValidator reqbillstate;
-
-        /// <summary>
-        /// billzip control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.TextBox billzip;
-
-        /// <summary>
-        /// reqbillzip control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.RequiredFieldValidator reqbillzip;
-
-        /// <summary>
-        /// btnSubmit control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.Button btnSubmit;
-
-        /// <summary>
-        /// error control.
-        /// </summary>
-        /// <remarks>
-        /// Auto-generated field.
-        /// To modify move field declaration from designer file to code-behind file.
-        /// </remarks>
-        protected global::System.Web.UI.WebControls.Label error;
-    }
-}


Delete StartButton3.cs

Delete StartButton3.cs

--- PublicRelease/Assets/StartButton3.cs
+++ PublicRelease/Assets/StartButton3.cs
@@ -1,72 +0,0 @@
-using UnityEngine;
-using System.Collections;
-using LMWidgets;
-
-public class StartButton3 : ButtonToggleBase
-{
-    public ButtonGraphics onGraphics;
-    public ButtonGraphics offGraphics;
-    public ButtonGraphics midGraphics;
-    public ButtonGraphics botGraphics;
-
-    public Color MidGraphicsOnColor = new Color(0.0f, 0.5f, 0.5f, 1.0f);
-    public Color BotGraphicsOnColor = new Color(0.0f, 1.0f, 1.0f, 1.0f);
-    public Color MidGraphicsOffColor = new Color(0.0f, 0.5f, 0.5f, 0.1f);
-    public Color BotGraphicsOffColor = new Color(0.0f, 0.25f, 0.25f, 1.0f);
-
-
-    public override void ButtonTurnsOn()
-    {
-        TurnsOnGraphics();
-    }
-
-    public override void ButtonTurnsOff()
-    {
-        TurnsOffGraphics();
-    }
-
-    private void TurnsOnGraphics()
-    {
-        onGraphics.SetActive(true);
-        offGraphics.SetActive(false);
-        midGraphics.SetColor(MidGraphicsOnColor);
-        botGraphics.SetColor(BotGraphicsOnColor);
-        Application.LoadLevel("Main 2");
-
-    }
-
-    private void TurnsOffGraphics()
-    {
-        onGraphics.SetActive(false);
-        offGraphics.SetActive(true);
-        midGraphics.SetColor(MidGraphicsOffColor);
-        botGraphics.SetColor(BotGraphicsOffColor);
-    }
-
-    private void UpdateGraphics()
-    {
-        Vector3 position = transform.localPosition;
-        position.z = Mathf.Min(position.z, m_localTriggerDistance);
-        onGraphics.transform.localPosition = position;
-        offGraphics.transform.localPosition = position;
-        Vector3 bot_position = position;
-        bot_position.z = Mathf.Max(bot_position.z, m_localTriggerDistance - m_localCushionThickness);
-        botGraphics.transform.localPosition = bot_position;
-        Vector3 mid_position = position;
-        mid_position.z = (position.z + bot_position.z) / 2.0f;
-        midGraphics.transform.localPosition = mid_position;
-
-    }
-
-    protected override void Start()
-    {
-        base.Start();
-    }
-
-    protected override void FixedUpdate()
-    {
-        base.FixedUpdate();
-        UpdateGraphics();
-
-    }
-}


Initial unit test passes for non-concurrent use across several appdomains (http://rdotnet.codeplex.com/workitem/92)

--- RDotNet.Tests/REngineInstanceTest.cs
+++ RDotNet.Tests/REngineInstanceTest.cs
@@ -111,7 +111,7 @@
          private REngine InitREngine()
          {
             var engine = REngine.GetInstance(initialize: false);
-            engine.Initialize(null, new NullCharacterDevice());  // real char device?
+            engine.Initialize(null, new NullCharacterDevice(), setupMainLoop:false);  // real char device?
             //AppDomain.CurrentDomain.DomainUnload += (EventHandler)((o, e) => engine.Dispose());
             return engine;
          }
@@ -120,6 +120,7 @@
       [Test]
       public void TestMultipleAppDomains()
       {
+         var e = REngine.GetInstance(); // need to trigger the R main loop setup once, and it may as well be in the default appdomain
          TestAppDomain("test1");  // works
          TestAppDomain("test2");  // hangs at the last line in Job.Execute()
       }


+ Disparos player

+ Disparos player

--- GGJ2016/Assets/Scripts/Characters/Hero.cs
+++ GGJ2016/Assets/Scripts/Characters/Hero.cs
@@ -122,7 +122,6 @@
 				shotAngle *= lookDir.x;
 			}
 			currentAngle = shotAngle;
-			Debug.Log ("lookDir.x " + lookDir.x + " myAngle " + shotAngle + " currentAngle " + currentAngle);
 			shootSpawn.RotateAround (myTransform.position, Vector3.up, shotAngle);
             GameObject shootAux = shootsPool.getObject(false);
             Vector3 dir = (Vector3.right * shootAxis.x + Vector3.forward * shootAxis.y);


Fixed comment

Fixed comment

--- RdCamViewSysTray/FrontDoorControl.cs
+++ RdCamViewSysTray/FrontDoorControl.cs
@@ -330,7 +330,7 @@
 #if LISTEN_FOR_UDP_DOOR_STATUS
             _udpClientForDoorStatus = new UdpClient(_doorControlNotifyPort);
             _udpClientForDoorStatus.BeginReceive(new AsyncCallback(DoorStatusCallback), null);
-            logger.Info("Socket bound to camera movement port {0}", _doorControlNotifyPort);
+            logger.Info("Socket bound to RFID door lock port {0}", _doorControlNotifyPort);
 #endif

         }


Fix: Memory usage for Staging on intel platform

--- H3Control/Controllers/DeviceController.cs
+++ H3Control/Controllers/DeviceController.cs
@@ -26,7 +26,7 @@
                         : DeviceDataSource.GetLocal();

                 ret.VerInfo = NewVerListener.Info;
-                if (!H3Environment.IsH3)
+                if (ret.Mem == null || Environment.OSVersion.Platform == PlatformID.Win32NT)
                     ret.Mem = new MemInfo_OnLinix()
                     {
                         Total = 1234 * 1024,


Bugfixes...

Bugfixes...

--- HaCreator/MapEditor/Input/InputHandler.cs
+++ HaCreator/MapEditor/Input/InputHandler.cs
@@ -221,15 +221,34 @@
                         {
                             case MouseState.Selection:
                                 int selectedItemIndex = 0;
-                                while (selectedBoard.SelectedItems.Count > selectedItemIndex)
+                                bool askedVr = false, askedMm = false;
+                                List<BoardItem> selectedItems = selectedBoard.SelectedItems.ToList(); // Dupe the selection list
+                                foreach (BoardItem item in selectedItems)
                                 {
-                                    BoardItem item = selectedBoard.SelectedItems[selectedItemIndex];
                                     if (item is ToolTipDot || item is MiscDot)
-                                        selectedItemIndex++;
-                                    else if (item is VRDot && MessageBox.Show("This will remove the map's VR. This is not undoable, you must re-add VR from the map's main menu. Continue?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
-                                        selectedBoard.VRRectangle.RemoveItem(null);
-                                    else if (item is MinimapDot && MessageBox.Show("This will remove the map's minimap. This is not undoable, you must re-add the minimap from the map's main menu. Continue?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
-                                        selectedBoard.MinimapRectangle.RemoveItem(null);
+                                        continue;
+                                    else if (item is VRDot)
+                                    {
+                                        if (!askedVr)
+                                        {
+                                            askedVr = true;
+                                            if (MessageBox.Show("This will remove the map's VR. This is not undoable, you must re-add VR from the map's main menu. Continue?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
+                                            {
+                                                selectedBoard.VRRectangle.RemoveItem(null);
+                                            }
+                                        }
+                                    }
+                                    else if (item is MinimapDot)
+                                    {
+                                        if (!askedMm)
+                                        {
+                                            askedMm = true;
+                                            if (MessageBox.Show("This will remove the map's minimap. This is not undoable, you must re-add the minimap from the map's main menu. Continue?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
+                                            {
+                                                selectedBoard.MinimapRectangle.RemoveItem(null);
+                                            }
+                                        }
+                                    }
                                     else
                                         item.RemoveItem(actions);
                                 }


Update tests for logger

Update tests for logger

--- RockLib.Logging.Tests/LoggerTests.cs
+++ RockLib.Logging.Tests/LoggerTests.cs
@@ -1,9 +1,7 @@
 using FluentAssertions;
+using Moq;
+using RockLib.Logging.LogProcessing;
 using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Threading;
-using System.Threading.Tasks;
 using Xunit;

 namespace RockLib.Logging.Tests
@@ -45,28 +43,37 @@
         }

         [Fact]
-        public void IsSynchronousIsSetFromConstructor()
-        {
-            var logger = new Logger(isSynchronous: true);
-
-            logger.IsSynchronous.Should().Be(true);
-        }
-
-        [Fact]
-        public void NonOptionalConstructorSetsValues()
-        {
-            var name = "foo";
-            var level = LogLevel.Warn;
-            var logProviders = new ILogProvider[0];
-            var isDisabled = true;
-
-            var logger = new Logger(name, level, logProviders, isDisabled);
-
-            logger.Name.Should().Be(name);
-            logger.Level.Should().Be(level);
-            logger.LogProviders.Should().BeSameAs(logProviders);
-            logger.IsDisabled.Should().Be(isDisabled);
-            logger.IsSynchronous.Should().BeFalse();
+        public void LogProcessorIsSetFromConstructor()
+        {
+            var logProcessor = new Mock<ILogProcessor>().Object;
+
+            var logger = new Logger(logProcessor);
+
+            logger.LogProcessor.Should().BeSameAs(logProcessor);
+        }
+
+        [Fact]
+        public void LogProcessorUsesBackgroundLogProcessorWhenProcessingModeIsBackground()
+        {
+            var logger = new Logger(processingMode: ProcessingMode.Background);
+
+            logger.LogProcessor.Should().BeOfType<BackgroundLogProcessor>();
+        }
+
+        [Fact]
+        public void LogProcessorUsesSynchronousLogProcessorWhenProcessingModeIsSynchronous()
+        {
+            var logger = new Logger(processingMode: ProcessingMode.Synchronous);
+
+            logger.LogProcessor.Should().BeOfType<SynchronousLogProcessor>();
+        }
+
+        [Fact]
+        public void LogProcessorUsesFireAndForgetLogProcessorWhenProcessingModeIsFireAndForget()
+        {
+            var logger = new Logger(processingMode: ProcessingMode.FireAndForget);
+
+            logger.LogProcessor.Should().BeOfType<FireAndForgetLogProcessor>();
         }

         [Fact]
@@ -88,210 +95,120 @@
         }

         [Fact]
-        public void LogPassesTheLogEntryToEachLogProvider()
+        public void LogThrowsObjectDisposedExceptionAfterLogProcessorHasBeenDisposed()
+        {
+            var mockLogProcessor = new Mock<ILogProcessor>();
+            mockLogProcessor.Setup(m => m.IsDisposed).Returns(true);
+
+            var logger = new Logger(mockLogProcessor.Object);
+
+            Assert.Throws<ObjectDisposedException>(() => logger.Log(new LogEntry("Hello, world!", LogLevel.Info)));
+        }
+
+        [Fact]
+        public void LogCallsProcessLogEntryOnItsLogProcessor()
+        {
+            var mockLogProcessor = new Mock<ILogProcessor>();
+
+            var logger = new Logger(mockLogProcessor.Object, logProviders: new ILogProvider[] { new ConsoleLogProvider() });
+
+            var logEntry = new LogEntry();
+
+            logger.Log(logEntry);
+
+            mockLogProcessor.Verify(m => m.ProcessLogEntry(logger, logEntry, It.IsAny<Action<ErrorEventArgs>>()), Times.Once);
+        }
+
+        [Fact]
+        public void LogPassesANullErrorHandlerWhenThereAreNoEventHandlersForTheLogProviderErrorEvent()
+        {
+            var mockLogProcessor = new Mock<ILogProcessor>();
+
+            var logger = new Logger(mockLogProcessor.Object, logProviders: new ILogProvider[] { new ConsoleLogProvider() });
+
+            var logEntry = new LogEntry();
+
+            logger.Log(logEntry);
+
+            mockLogProcessor.Verify(m => m.ProcessLogEntry(logger, logEntry, null), Times.Once);
+        }
+
+        [Fact]
+        public void LogPassesANonNullErrorHandlerWhenThereAreEventHandlersForTheLogProviderErrorEvent()
+        {
+            var mockLogProcessor = new Mock<ILogProcessor>();
+
+            var logger = new Logger(mockLogProcessor.Object, logProviders: new ILogProvider[] { new ConsoleLogProvider() });
+
+            logger.LogProviderError += (s, e) => { };
+
+            var logEntry = new LogEntry();
+
+            logger.Log(logEntry);
+
+            mockLogProcessor.Verify(m => m.ProcessLogEntry(logger, logEntry, It.IsNotNull<Action<ErrorEventArgs>>()), Times.Once);
+        }
+
+        [Fact]
+        public void LogDoesNotCallLogProcessorWhenIsDisabledIsTrue()
+        {
+            var mockLogProcessor = new Mock<ILogProcessor>();
+
+            var logger = new Logger(mockLogProcessor.Object, isDisabled: true, logProviders: new ILogProvider[] { new ConsoleLogProvider() });
+
+            var logEntry = new LogEntry();
+
+            logger.Log(logEntry);
+
+            mockLogProcessor.Verify(m => m.ProcessLogEntry(It.IsAny<ILogger>(), It.IsAny<LogEntry>(), It.IsAny<Action<ErrorEventArgs>>()),
+                Times.Never);
+        }
+
+        [Fact]
+        public void LogDoesNotCallLogProcessorWhenThereAreNoLogProviders()
+        {
+            var mockLogProcessor = new Mock<ILogProcessor>();
+
+            var logger = new Logger(mockLogProcessor.Object, logProviders: new ILogProvider[0]);
+
+            var logEntry = new LogEntry();
+
+            logger.Log(logEntry);
+
+            mockLogProcessor.Verify(m => m.ProcessLogEntry(It.IsAny<ILogger>(), It.IsAny<LogEntry>(), It.IsAny<Action<ErrorEventArgs>>()),
+                Times.Never);
+        }
+
+        [Fact]
+        public void LogDoesNotCallLogProcessorWhenLevelIsHigherThanTheLogEntryLevel()
+        {
+            var mockLogProcessor = new Mock<ILogProcessor>();
+
+            var logger = new Logger(mockLogProcessor.Object, level: LogLevel.Error, logProviders: new ILogProvider[] { new ConsoleLogProvider() });
+
+            var logEntry = new LogEntry() { Level = LogLevel.Info };
+
+            logger.Log(logEntry);
+
+            mockLogProcessor.Verify(m => m.ProcessLogEntry(It.IsAny<ILogger>(), It.IsAny<LogEntry>(), It.IsAny<Action<ErrorEventArgs>>()),
+                Times.Never);
+        }
+
+        [Fact]
+        public void LogAddsCallerInfoToLogEntry()
         {
             var logProviders = new[]
             {
-                new SynchronousLogProvider(),
-                new SynchronousLogProvider()
+                new ConsoleLogProvider()
             };

-            var logger = new Logger(logProviders: logProviders, level: LogLevel.Info);
+            var logger = new Logger(logProviders: logProviders, level: LogLevel.Info, processingMode: ProcessingMode.Synchronous);

             var logEntry = new LogEntry("Hello, world!", LogLevel.Info);

             logger.Log(logEntry);
-            logger.Dispose();
-
-            foreach (var logProvider in logProviders)
-            {
-                logProvider.SentLogEntries.Count.Should().Be(1);
-                var sentLogEntry = logProvider.SentLogEntries[0];
-                sentLogEntry.Should().BeSameAs(logEntry);
-            }
-        }
-
-        [Fact]
-        public void LogDoesNotPassLogEntriesToLogProvidersWhenIsDisabledIsTrue()
-        {
-            var logProviders = new[]
-            {
-                new SynchronousLogProvider(),
-                new SynchronousLogProvider()
-            };
-
-            var logger = new Logger(logProviders: logProviders, level: LogLevel.Info, isDisabled: true);
-
-            var logEntry = new LogEntry("Hello, world!", LogLevel.Info);
-
-            logger.Log(logEntry);
-
-            foreach (var logProvider in logProviders)
-                logProvider.SentLogEntries.Count.Should().Be(0);
-        }
-
-        [Fact]
-        public void LogDoesNotPassLogEntriesToLogProvidersWhenLevelIsHigherThanTheLogEntryLevel()
-        {
-            var logProviders = new[]
-            {
-                new SynchronousLogProvider(),
-                new SynchronousLogProvider()
-            };
-
-            var logger = new Logger(logProviders: logProviders, level: LogLevel.Error);
-
-            var logEntry = new LogEntry("Hello, world!", LogLevel.Info);
-
-            logger.Log(logEntry);
-
-            foreach (var logProvider in logProviders)
-                logProvider.SentLogEntries.Count.Should().Be(0);
-        }
-
-        [Fact]
-        public void LogDoesNotPassLogEntriesToLogProvidersWithALevelHigherThanTheLogEntryLevel()
-        {
-            var synchronousLogProvider = new SynchronousLogProvider();
-            var auditLevelLogProvider = new AuditLevelLogProvider();
-
-            var logProviders = new[]
-            {
-                synchronousLogProvider,
-                auditLevelLogProvider,
-            };
-
-            var logger = new Logger(logProviders: logProviders, level: LogLevel.Info);
-
-            var logEntry = new LogEntry("Hello, world!", LogLevel.Info);
-
-            logger.Log(logEntry);
-            logger.Dispose();
-
-            synchronousLogProvider.SentLogEntries.Count.Should().Be(1);
-            auditLevelLogProvider.SentLogEntries.Count.Should().Be(0);
-        }
-
-        [Fact]
-        public void LogAddsCallerInfoToLogEntry()
-        {
-            var logProviders = new[]
-            {
-                new SynchronousLogProvider()
-            };
-
-            var logger = new Logger(logProviders: logProviders, level: LogLevel.Info);
-
-            var logEntry = new LogEntry("Hello, world!", LogLevel.Info);
-
-            logger.Log(logEntry);
-            logger.Dispose();

             logEntry.CallerInfo.Should().NotBeNullOrWhiteSpace();
-        }
-
-        [Fact]
-        public void DisposeBlocksUntilLogEntriesAreSent()
-        {
-            var logProvider = new SemaphoreDelayedLogProvider();
-
-            var logger = new Logger(logProviders: new[] { logProvider }, level: LogLevel.Info);
-
-            var logEntry = new LogEntry("Hello, world!", LogLevel.Info);
-
-            logger.Log(logEntry);
-
-            var disposeThread = new Thread(() => logger.Dispose());
-            disposeThread.Start();
-
-            Thread.Sleep(100); // (we could wait all day here)
-
-            logProvider.SentLogEntries.Count.Should().Be(0);
-
-            logProvider.Semaphore.Release(); // Unblock the logProvider's WriteAsync method...
-            disposeThread.Join(); // ...which unblocks the logger's Dispose method allowing the thread to complete.
-
-            logProvider.SentLogEntries.Count.Should().Be(1);
-        }
-
-        [Fact]
-        public void IsSynchronousLoggerDoesNotStartBackgroundThreads()
-        {
-            var logProviders = new[]
-            {
-                new SynchronousLogProvider()
-            };
-
-            var logger = new Logger(logProviders: logProviders, level: LogLevel.Info, isSynchronous: true);
-
-            var type = typeof(Logger);
-            var processingThreadField = type.GetField("_processingThread", BindingFlags.NonPublic | BindingFlags.Instance);
-            var trackingThreadField = type.GetField("_trackingThread", BindingFlags.NonPublic | BindingFlags.Instance);
-
-            processingThreadField.GetValue(logger).Should().BeNull();
-            trackingThreadField.GetValue(logger).Should().BeNull();
-        }
-
-        [Fact]
-        public void IsSynchronousLoggerSendsLogToProvidersWithoutNeedingToDispose()
-        {
-            var logProviders = new[]
-            {
-                new SynchronousLogProvider(),
-                new SynchronousLogProvider()
-            };
-
-            var logger = new Logger(logProviders: logProviders, level: LogLevel.Info, isSynchronous: true);
-
-            var logEntry = new LogEntry("Hello, world!", LogLevel.Info);
-
-            logger.Log(logEntry);
-
-            foreach (var logProvider in logProviders)
-            {
-                logProvider.SentLogEntries.Count.Should().Be(1);
-                var sentLogEntry = logProvider.SentLogEntries[0];
-                sentLogEntry.Should().BeSameAs(logEntry);
-            }
-
-            logger.Dispose();
-        }
-
-        private class SynchronousLogProvider : ILogProvider
-        {
-            public TimeSpan Timeout => TimeSpan.Zero;
-
-            public virtual LogLevel Level => LogLevel.NotSet;
-
-            public Task WriteAsync(LogEntry logEntry, CancellationToken cancellationToken)
-            {
-                SentLogEntries.Add(logEntry);
-                return Task.CompletedTask;
-            }
-
-            public List<LogEntry> SentLogEntries { get; } = new List<LogEntry>();
-        }
-
-        private class AuditLevelLogProvider : SynchronousLogProvider
-        {
-            public override LogLevel Level => LogLevel.Audit;
-        }
-
-        private class SemaphoreDelayedLogProvider : ILogProvider
-        {
-            public TimeSpan Timeout => TimeSpan.FromSeconds(30);
-
-            public LogLevel Level => LogLevel.NotSet;
-
-            public List<LogEntry> SentLogEntries { get; } = new List<LogEntry>();
-
-            public SemaphoreSlim Semaphore { get; } = new SemaphoreSlim(0, 1);
-
-            public async Task WriteAsync(LogEntry logEntry, CancellationToken cancellationToken)
-            {
-                await Semaphore.WaitAsync(cancellationToken);
-                SentLogEntries.Add(logEntry);
-            }
         }
     }
 }


Dispose writer when done

Dispose writer when done

--- SIL.TestUtilities/FluentAssertXml.cs
+++ SIL.TestUtilities/FluentAssertXml.cs
@@ -187,17 +187,18 @@

 		public static void PrintNodeToConsole(XmlNode node)
 		{
-			XmlWriterSettings settings = new XmlWriterSettings();
+			var settings = new XmlWriterSettings();
 			settings.Indent = true;
 			settings.ConformanceLevel = ConformanceLevel.Fragment;
-			XmlWriter writer = XmlWriter.Create(Console.Out, settings);
-			node.WriteContentTo(writer);
-			writer.Flush();
-			Console.WriteLine();
-		}
-
-
-		public  void HasNoMatchForXpath(string xpath, XmlNamespaceManager nameSpaceManager)
+			using (XmlWriter writer = XmlWriter.Create(Console.Out, settings))
+			{
+				node.WriteContentTo(writer);
+				writer.Flush();
+				Console.WriteLine();
+			}
+		}
+
+		public void HasNoMatchForXpath(string xpath, XmlNamespaceManager nameSpaceManager)
 		{
 			XmlNode node = GetNode( xpath, nameSpaceManager);
 			if (node != null)
@@ -221,7 +222,7 @@

 		private XmlNode GetNode(string xpath)
 		{
-#if MONO
+#if __MonoCS__
 			// Currently the method XmlNodeExtensions.GetPrefixedPath doesn't allow for / in a literal string
 			return NodeOrDom.SelectSingleNode(xpath);
 #else


InvariantCulture fix for SLProxy/legaxy/XmlRpcDeserializer (untested)

git-svn-id: c32cf1ecefca26b8770d7b0740bc0c5c174087e4@606 c754d5e9-d413-0410-bcdf-9574c9dba6b7

--- SLProxy/legacy/XmlRpcDeserializer.cs
+++ SLProxy/legacy/XmlRpcDeserializer.cs
@@ -92,7 +92,7 @@
 		_value = _text;
 		break;
 	      case DOUBLE:
-		_value = Double.Parse(_text);
+		_value = Double.Parse(_text, CultureInfo.InvariantCulture);
 		break;
 	      case INT:
 	      case ALT_INT:


KpSms: fix description

KpSms: fix description

--- ScadaComm/OpenKPs/KpSms/KpSmsView.cs
+++ ScadaComm/OpenKPs/KpSms/KpSmsView.cs
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Mikhail Shiryaev
+ * Copyright 2018 Mikhail Shiryaev
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
  *
  * Author   : Mikhail Shiryaev
  * Created  : 2009
- * Modified : 2017
+ * Modified : 2018
  */

 using Scada.Comm.Devices.AB;
@@ -83,7 +83,7 @@
                     "Sending SMS command text examples:\n" +
                     "group_name;message\n" +
                     "contact_name;message\n" +
-                    "email;message";
+                    "phone_number;message";
             }
         }


Update Translator.cs

Update Translator.cs

--- ScadaData/ScadaData/UI/Translator.cs
+++ ScadaData/ScadaData/UI/Translator.cs
@@ -1,5 +1,5 @@
 /*
- * Copyright 2020 Mikhail Shiryaev
+ * Copyright 2021 Mikhail Shiryaev
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
  *
  * Author   : Mikhail Shiryaev
  * Created  : 2015
- * Modified : 2020
+ * Modified : 2021
  */

 using System;
@@ -33,8 +33,8 @@
 namespace Scada.UI
 {
     /// <summary>
-    /// User interface translation
-    /// <para>Перевод пользовательского интерфейса</para>
+    /// User interface translation.
+    /// <para>Перевод пользовательского интерфейса.</para>
     /// </summary>
     public static class Translator
     {
@@ -333,7 +333,7 @@
                     {
                         if (controlInfo.Text != null)
                             hyperLink.Text = controlInfo.Text;
-                        if (controlInfo.Props != null &&
+                        if (controlInfo.Props != null &&
                             controlInfo.Props.TryGetValue("NavigateUrl", out string navigateUrl))
                             hyperLink.NavigateUrl = navigateUrl;
                     }
@@ -365,6 +365,20 @@
                     {
                         if (controlInfo.Text != null)
                             hiddenField.Value = controlInfo.Text;
+                    }
+                    else if (controlInfo.Items != null)
+                    {
+                        // control that may include items
+                        if (control is GridView gridView)
+                        {
+                            for (int i = 0, cnt = Math.Min(gridView.Columns.Count, controlInfo.Items.Count);
+                                i < cnt; i++)
+                            {
+                                string itemText = controlInfo.Items[i];
+                                if (itemText != null)
+                                    gridView.Columns[i].HeaderText = itemText;
+                            }
+                        }
                     }
                 }


got rid of compare

got rid of compare

--- ODiff/ObjectGraphDiff.cs
+++ ODiff/ObjectGraphDiff.cs
@@ -19,10 +19,10 @@

         public DiffReport Diff()
         {
-            return LookInto(leftRoot, rightRoot);
+            return VisitNode(leftRoot, rightRoot);
         }

-        private DiffReport LookInto(object leftObject, object rightObject)
+        private DiffReport VisitNode(object leftObject, object rightObject)
         {
             if (leftObject == null && rightObject == null) return NoDiffFound();
             if (leftObject == null || rightObject == null)
@@ -33,11 +33,16 @@
             }

             var report = new DiffReport();
-
+            if (leftObject.IsValueType() || rightObject.IsValueType() ||
+                leftObject.IsEnum() || rightObject.IsEnum())
+            {
+                if (!AreEqual(leftObject, rightObject))
+                    report.ReportDiff(currentMemberPath, leftObject, rightObject);
+                return report;
+            }
             if (leftObject.IsList() &&
                 rightObject.IsList())
                 report.Merge(CompareList(leftObject as IList, rightObject as IList));
-
             report.Merge(ComparePublicFields(leftObject, rightObject));
             report.Merge(CompareGetterProperties(leftObject, rightObject));
             return report;
@@ -69,7 +74,7 @@
                 }
                 else
                 {
-                    report.Merge(LookInto(leftValue, rightValue));
+                    report.Merge(VisitNode(leftValue, rightValue));
                 }
                 currentMemberPath = memberPathBeforeIteration;
             }
@@ -99,7 +104,11 @@
                 var leftValue = leftFields[i].GetValue(leftObject);
                 var rightValue = rightFields[i].GetValue(rightObject);

-                diffReport.Merge(Compare(leftValue, rightValue, fieldName));
+                var prev = currentMemberPath;
+                var prefixMember = (currentMemberPath != "") ? currentMemberPath + "." : "";
+                currentMemberPath = prefixMember + fieldName;
+                diffReport.Merge(VisitNode(leftValue, rightValue));
+                currentMemberPath = prev;
             }
             return diffReport;
         }
@@ -125,7 +134,7 @@
                 var previousMemberName = currentMemberPath;
                 var prefixMember = (currentMemberPath != "") ? currentMemberPath + "." : "";
                 currentMemberPath = prefixMember + fieldName;
-                report.Merge(LookInto(leftValue, rightValue));
+                report.Merge(VisitNode(leftValue, rightValue));
                 currentMemberPath = previousMemberName;
             }
             return report;
@@ -160,7 +169,11 @@
                     var leftValue = leftProperty.GetValue(leftObject);
                     var rightValue = rightProperty.GetValue(rightObject);

-                    diffReport.Merge(Compare(leftValue, rightValue, leftProperty.Name));
+                    var prev = currentMemberPath;
+                    var prefixMember = (currentMemberPath != "") ? currentMemberPath + "." : "";
+                    currentMemberPath = prefixMember + leftProperty.Name;
+                    diffReport.Merge(VisitNode(leftValue, rightValue));
+                    currentMemberPath = prev;
                 }
             }
             return diffReport;


Removed Old Comment

Removed Old Comment

--- OpenAI/OpenAI/Program.cs
+++ OpenAI/OpenAI/Program.cs
@@ -392,8 +392,6 @@
                             this.dontmultiactioncount++;
                         }
                         else this.doMultipleThingsAtATime = true;
-
-                        //if (daum.bestmove.card.card.name == CardDB.cardName.barnes) POWERFULSINGLEACTION++;

                         switch (daum.bestmove.card.card.name)
                         {


Better explosion

Better explosion

--- SFX/WeaponFX/Explosion.cs
+++ SFX/WeaponFX/Explosion.cs
@@ -21,9 +21,9 @@
 			sparkDir = Matrix.RotationQuaternion(fxEvent.Rotation).Forward;

 			AddParticleStage("bulletSpark",		0.00f, 0.0f, 0.1f,  150, false, EmitSpark );
-			AddParticleStage("explosionSmoke",	0.10f, 0.1f, 1.0f,   15, false, EmitSmoke );
-			AddParticleStage("explosionSmoke2",	0.10f, 0.1f, 1.0f,   15, false, EmitSmoke );
-			AddParticleStage("explosionFire",	0.00f, 0.1f, 1.0f,   30, false, EmitFire );
+			AddParticleStage("explosionSmoke",	0.10f, 0.1f, 1.0f,  15*2, false, EmitSmoke );
+			AddParticleStage("explosionSmoke2",	0.10f, 0.1f, 1.0f,  15*2, false, EmitSmoke );
+			AddParticleStage("explosionFire",	0.00f, 0.1f, 1.0f,  30*2, false, EmitFire );

 			AddLightStage( fxEvent.Origin + sparkDir * 0.1f	, new Color4(200,150,100,1), 3, 100f, 3f );

@@ -57,13 +57,13 @@
 			SetupAngles		( ref p, 10 );
 			SetupColor		( ref p, 5, 5, 0, 1.0f );
 			SetupTiming		( ref p, time, 0.1f, 0.2f );
-			SetupSize		( ref p, 1.2f, 2 );
+			SetupSize		( ref p, 1.2f, 1.2f );
 		}

 		void EmitFire ( ref Particle p, FXEvent fxEvent )
 		{
-			var vel	=	rand.UniformRadialDistribution(0, 0.7f);
+			var vel	=	rand.UniformRadialDistribution(0, 0.9f);
 			var pos	=	fxEvent.Origin + rand.UniformRadialDistribution(1,1) * 0.25f;

 			float time	=	rand.NextFloat(0.3f, 0.5f);


Safely reimplement Dispose member so it can safely be run twice as well as prevent GC from cleaning up unmanaged objects

git-svn-id: 40dd595c6684d839db675001a64203a1457e7319@9115 67ed7778-7388-44ab-90cf-0a291f65f57c

--- bindings/csharp/Object.cs
+++ bindings/csharp/Object.cs
@@ -3,7 +3,8 @@

 namespace LibGPhoto2 {
 	public abstract class Object : System.IDisposable {
-		protected HandleRef handle;
+	    protected HandleRef handle;
+	    private bool disposed = false;

 		public HandleRef Handle {
 			get {
@@ -20,14 +21,30 @@

 		protected abstract void Cleanup ();

-		public void Dispose () {
-			Cleanup ();
+		public void Dispose ()
+		{
+		    Dispose (true);
 			System.GC.SuppressFinalize (this);
 		}

+        private void Dispose (bool disposing)
+        {
+            if (!disposed) {
+                if (disposing) {
+                    // clean up anything that's managed
+                    handle = null;
+                }
+                // clean up any unmanaged objects
+                Cleanup ();
+                disposed = true;
+            } else {
+                Console.WriteLine ("Saved us from doubly disposing an object!");
+            }
+        }
+
 		~Object ()
 		{
-			Cleanup ();
+			Dispose (false);
 		}
 	}
 }


Item gets clicked only when it has not been scrolled.

--- Joey/UI/Utils/SwipeDeleteTouchListener.cs
+++ Joey/UI/Utils/SwipeDeleteTouchListener.cs
@@ -108,17 +108,16 @@
                 float velocityX = velocityTracker.XVelocity;
                 float absVelocityX = Math.Abs (velocityX);
                 float absVelocityY = Math.Abs (velocityTracker.YVelocity);
-
                 if (Math.Abs (downView.ScrollX) > (downView.Width / 2) ||
-                        minFlingVelocity <= absVelocityX && absVelocityX <= maxFlingVelocity && absVelocityY < absVelocityX ) {
+                        minFlingVelocity <= absVelocityX && absVelocityX <= maxFlingVelocity && absVelocityY < absVelocityX) {
                     var swipeView = (ListItemSwipeable)downView;
                     swipeView.SlideAnimation (ListItemSwipeable.SwipeAction.Delete);
                     swipeView.SwipeAnimationEnd += OnItemDismissed;
-                } else if (absVelocityX > 10) {
+                } else if (absVelocityX > 10 || Math.Abs (downView.ScrollX) > 1) {
                     var swipeView = (ListItemSwipeable)downView;
                     swipeView.SlideAnimation (ListItemSwipeable.SwipeAction.Cancel);
-                } else if (absVelocityX < 10 && absVelocityY < 10) {
-                    OnItemTouched();
+                } else {
+                    OnItemTouched ();
                 }
                 downX = 0;
                 downY = 0;


saved state - set datum properties on submit

--- Sensus.Shared/SensusServiceHelper.cs
+++ Sensus.Shared/SensusServiceHelper.cs
@@ -2058,7 +2058,7 @@
 																				input.LocationUpdateTimestamp,
 																				script.RunTime.Value,
 																				input.CompletionRecords,
-																				input.SubmissionTimestamp.Value,
+																				DateTimeOffset.UtcNow, // save this now, but overwrite it when the script is actually submitted
 																				manualRun);
 							}
 						}
@@ -2126,6 +2126,11 @@
 							{
 								if (savedState.SavedInputs.TryGetValue($"{inputGroup.Id}.{input.Id}", out ScriptDatum savedInput))
 								{
+									savedInput.SubmissionTimestamp = input.SubmissionTimestamp ?? DateTimeOffset.UtcNow;
+									savedInput.Latitude = input.Latitude;
+									savedInput.Longitude = input.Longitude;
+									savedInput.LocationTimestamp = input.LocationUpdateTimestamp;
+
 									await script.Runner.Probe.StoreDatumAsync(savedInput, CancellationToken.None);
 								}
 							}


FunctionStackに明示的にFunctionStackを積む記述を廃止

FunctionStackに明示的にFunctionStackを積む記述を廃止

--- KelpNet/Common/Functions/FunctionStack.cs
+++ KelpNet/Common/Functions/FunctionStack.cs
@@ -18,21 +18,6 @@
         public FunctionStack(params Function[] functions) : base(FUNCTION_NAME)
         {
             this.Functions = functions;
-        }
-
-        public FunctionStack(params FunctionStack[] functionStacks) : base(FUNCTION_NAME)
-        {
-            List<Function> functionList = new List<Function>();
-
-            foreach (FunctionStack functionStack in functionStacks)
-            {
-                foreach (Function function in functionStack.Functions)
-                {
-                    functionList.Add(function);
-                }
-            }
-
-            this.Functions = functionList.ToArray();
         }

         public void Compress()


Add missing subdirectory from merge

Add missing subdirectory from merge

--- Keyczar/KeyczarTest/CreateDataToolTest.cs
+++ Keyczar/KeyczarTest/CreateDataToolTest.cs
@@ -150,7 +150,7 @@

             }

-            var path = Util.TestDataPath(WRITE_DATA, topDir);
+            var path = Util.TestDataPath(WRITE_DATA, topDir, subDir);

             if (Directory.Exists(path))
                 Directory.Delete(path,recursive:true);


Refactor TileSet IsValid to use MultiTile

--- Src/WangTiles/TileSet.cs
+++ Src/WangTiles/TileSet.cs
@@ -18,14 +18,9 @@

         public bool IsValid()
         {
-            foreach (var tile in this.tiles)
-                if (!this.tiles.Any(t => tile.TryEast(t)) ||
-                    !this.tiles.Any(t => tile.TryNorth(t)) ||
-                    !this.tiles.Any(t => tile.TryWest(t)) ||
-                    !this.tiles.Any(t => tile.TrySouth(t)))
-                    return false;
+            var mtile = new MultiTile(this.tiles);

-            return true;
+            return mtile.East == mtile.West && mtile.North == mtile.South;
         }
     }
 }


Delete migration source if no files exist after completion

--- osu.Game/IO/OsuStorage.cs
+++ osu.Game/IO/OsuStorage.cs
@@ -87,6 +87,9 @@

                 dir.Delete(true);
             }
+
+            if (target.GetFiles().Length == 0 && target.GetDirectories().Length == 0)
+                target.Delete();
         }

         private static void copyRecursive(DirectoryInfo source, DirectoryInfo destination, bool topLevelExcludes = true)


Refactoring hashing methods

Refactoring hashing methods

--- plugins/extras/p5.crypto/Hash.cs
+++ plugins/extras/p5.crypto/Hash.cs
@@ -45,28 +45,11 @@
             // Making sure we clean up and remove all arguments passed in after execution.
             using (new ArgsRemover (e.Args)) {

-                // Retrieving value to hash as a single string.
-                var whatToHash = XUtil.Single<byte []> (context, e.Args);
-
-                // Creating Sha256 hash, and returning as value of args.
+                // Creating SHA1 hasher.
                 using (var sha1 = SHA1.Create ()) {

-                    // Checking if caller wants "raw bytes".
-                    if (e.Args.GetExChildValue ("raw", context, false)) {
-
-                        // Returning Sha256 hash as raw bytes.
-                        e.Args.Value = sha1.ComputeHash (whatToHash);
-
-                    } else if (e.Args.GetExChildValue ("hex", context, false)) {
-
-                        // Returning value as hexadecimal string.
-                        e.Args.Value = BitConverter.ToString (sha1.ComputeHash (whatToHash)).Replace ("-", string.Empty);
-
-                    } else {
-
-                        // Returning Sha256 hash as base64 encoded string.
-                        e.Args.Value = Convert.ToBase64String (sha1.ComputeHash (whatToHash));
-                    }
+                    // Invoking worker method.
+                    CreateHash (context, sha1, e.Args);
                 }
             }
         }
@@ -82,10 +65,137 @@
             // Making sure we clean up and remove all arguments passed in after execution.
             using (new ArgsRemover (e.Args)) {

+                // Creating SHA1 hasher.
+                using (var sha1 = SHA1.Create ()) {
+
+                    // Invoking worker method.
+                    CreateHashFromFile (context, sha1, e.Args);
+                }
+            }
+        }
+
+        /// <summary>
+        ///     Creates a Sha256 hash of input given
+        /// </summary>
+        /// <param name="context">Application Context</param>
+        /// <param name="e">Parameters passed into Active Event</param>
+        [ActiveEvent (Name = "p5.crypto.hash.create-sha256")]
+        public static void p5_crypto_hash_create_sha256 (ApplicationContext context, ActiveEventArgs e)
+        {
+            // Making sure we clean up and remove all arguments passed in after execution.
+            using (new ArgsRemover (e.Args)) {
+
+                // Creating SHA256 hasher.
+                using (var sha1 = SHA256.Create ()) {
+
+                    // Invoking worker method.
+                    CreateHash (context, sha1, e.Args);
+                }
+            }
+        }
+
+        /// <summary>
+        ///     Creates a Sha256 hash of given filename
+        /// </summary>
+        /// <param name="context">Application Context</param>
+        /// <param name="e">Parameters passed into Active Event</param>
+        [ActiveEvent (Name = "p5.crypto.hash.create-sha256-file")]
+        public static void p5_crypto_hash_create_sha256_file (ApplicationContext context, ActiveEventArgs e)
+        {
+            // Making sure we clean up and remove all arguments passed in after execution.
+            using (new ArgsRemover (e.Args)) {
+
+                // Creating SHA256 hasher.
+                using (var sha1 = SHA256.Create ()) {
+
+                    // Invoking worker method.
+                    CreateHashFromFile (context, sha1, e.Args);
+                }
+            }
+        }
+
+        /// <summary>
+        ///     Creates a SHA512 hash of input given
+        /// </summary>
+        /// <param name="context">Application Context</param>
+        /// <param name="e">Parameters passed into Active Event</param>
+        [ActiveEvent (Name = "p5.crypto.hash.create-sha512")]
+        public static void p5_crypto_hash_create_sha512 (ApplicationContext context, ActiveEventArgs e)
+        {
+            // Making sure we clean up and remove all arguments passed in after execution.
+            using (new ArgsRemover (e.Args)) {
+
+                // Creating SHA512 hasher.
+                using (var sha1 = SHA512.Create ()) {
+
+                    // Invoking worker method.
+                    CreateHash (context, sha1, e.Args);
+                }
+            }
+        }
+
+        /// <summary>
+        ///     Creates a Sha256 hash of given filename
+        /// </summary>
+        /// <param name="context">Application Context</param>
+        /// <param name="e">Parameters passed into Active Event</param>
+        [ActiveEvent (Name = "p5.crypto.hash.create-sha512-file")]
+        public static void p5_crypto_hash_create_sha512_file (ApplicationContext context, ActiveEventArgs e)
+        {
+            // Making sure we clean up and remove all arguments passed in after execution.
+            using (new ArgsRemover (e.Args)) {
+
+                // Creating SHA512 hasher.
+                using (var sha1 = SHA512.Create ()) {
+
+                    // Invoking worker method.
+                    CreateHashFromFile (context, sha1, e.Args);
+                }
+            }
+        }
+
+        /*
+         * Helper methods for above.
+         */
+        static void CreateHash (ApplicationContext context, HashAlgorithm hasher, Node args)
+        {
+            // Making sure we clean up and remove all arguments passed in after execution.
+            using (new ArgsRemover (args)) {
+
+                // Retrieving value to hash as a blob.
+                var whatToHash = XUtil.Single<byte []> (context, args);
+
+                // Checking if caller wants "raw bytes".
+                if (args.GetExChildValue ("raw", context, false)) {
+
+                    // Returning hash as raw bytes.
+                    args.Value = hasher.ComputeHash (whatToHash);
+
+                } else if (args.GetExChildValue ("hex", context, false)) {
+
+                    // Returning value as hexadecimal string.
+                    args.Value = BitConverter.ToString (hasher.ComputeHash (whatToHash)).Replace ("-", string.Empty);
+
+                } else {
+
+                    // Returning hash as base64 encoded string.
+                    args.Value = Convert.ToBase64String (hasher.ComputeHash (whatToHash));
+                }
+            }
+        }
+
+        /*
+         * Helper method for above.
+         */
+        static void CreateHashFromFile (ApplicationContext context, HashAlgorithm hasher, Node args)
+        {
+            // Making sure we clean up and remove all arguments passed in after execution.
+            using (new ArgsRemover (args)) {
+
                 // Retrieving filename user wants to hash, unrolling filename, and making sure user has read access to the file.
-                var filename = e.Args.GetExValue (context, "");
-                filename = context.RaiseEvent ("p5.io.unroll-path", new Node ("", filename).Add ("args", e.Args)).Get<string> (context);
-                context.RaiseEvent (".p5.io.authorize.read-file", new Node ("", filename).Add ("args", e.Args));
+                var filename = args.GetExValue (context, "");
+                filename = context.RaiseEvent ("p5.io.unroll-path", new Node ("", filename).Add ("args", args)).Get<string> (context);
+                context.RaiseEvent (".p5.io.authorize.read-file", new Node ("", filename).Add ("args", args));

                 // Retrieving root folder of P5.
                 var rootFolder = context.RaiseEvent (".p5.core.application-folder").Get<string> (context);
@@ -93,192 +203,21 @@
                 // Opening file for read access, making sure we dispose it afterwards.
                 using (var stream = File.OpenRead (rootFolder + filename)) {

-                    // Creating Sha256 hash, and returning hash of file as value of args.
-                    using (var sha1 = SHA1.Create ()) {
-
-                        // Checking if caller wants "raw bytes".
-                        if (e.Args.GetExChildValue ("raw", context, false)) {
-
-                            // Returning Sha256 hash as raw bytes.
-                            e.Args.Value = sha1.ComputeHash (stream);
-
-                        } else if (e.Args.GetExChildValue ("hex", context, false)) {
-
-                            // Returning value as hexadecimal string.
-                            e.Args.Value = BitConverter.ToString (sha1.ComputeHash (stream)).Replace ("-", string.Empty);
-
-                        } else {
-
-                            // Returning Sha256 hash as base64 encoded string.
-                            e.Args.Value = Convert.ToBase64String (sha1.ComputeHash (stream));
-                        }
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        ///     Creates a Sha256 hash of input given
-        /// </summary>
-        /// <param name="context">Application Context</param>
-        /// <param name="e">Parameters passed into Active Event</param>
-        [ActiveEvent (Name = "p5.crypto.hash.create-sha256")]
-        public static void p5_crypto_hash_create_sha256 (ApplicationContext context, ActiveEventArgs e)
-        {
-            // Making sure we clean up and remove all arguments passed in after execution.
-            using (new ArgsRemover (e.Args)) {
-
-                // Retrieving value to hash as a single string.
-                var whatToHash = XUtil.Single<byte []> (context, e.Args);
-
-                // Creating Sha256 hash, and returning as value of args.
-                using (var sha256 = SHA256.Create ()) {
-
                     // Checking if caller wants "raw bytes".
-                    if (e.Args.GetExChildValue ("raw", context, false)) {
-
-                        // Returning Sha256 hash as raw bytes.
-                        e.Args.Value = sha256.ComputeHash (whatToHash);
-
-                    } else if (e.Args.GetExChildValue ("hex", context, false)) {
+                    if (args.GetExChildValue ("raw", context, false)) {
+
+                        // Returning hash as raw bytes.
+                        args.Value = hasher.ComputeHash (stream);
+
+                    } else if (args.GetExChildValue ("hex", context, false)) {

                         // Returning value as hexadecimal string.
-                        e.Args.Value = BitConverter.ToString (sha256.ComputeHash (whatToHash)).Replace ("-", string.Empty);
+                        args.Value = BitConverter.ToString (hasher.ComputeHash (stream)).Replace ("-", string.Empty);

                     } else {

-                        // Returning Sha256 hash as base64 encoded string.
-                        e.Args.Value = Convert.ToBase64String (sha256.ComputeHash (whatToHash));
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        ///     Creates a Sha256 hash of given filename
-        /// </summary>
-        /// <param name="context">Application Context</param>
-        /// <param name="e">Parameters passed into Active Event</param>
-        [ActiveEvent (Name = "p5.crypto.hash.create-sha256-file")]
-        public static void p5_crypto_hash_create_sha256_file (ApplicationContext context, ActiveEventArgs e)
-        {
-            // Making sure we clean up and remove all arguments passed in after execution.
-            using (new ArgsRemover (e.Args)) {
-
-                // Retrieving filename user wants to hash, unrolling filename, and making sure user has read access to the file.
-                var filename = e.Args.GetExValue (context, "");
-                filename = context.RaiseEvent ("p5.io.unroll-path", new Node ("", filename).Add ("args", e.Args)).Get<string> (context);
-                context.RaiseEvent (".p5.io.authorize.read-file", new Node ("", filename).Add ("args", e.Args));
-
-                // Retrieving root folder of P5.
-                var rootFolder = context.RaiseEvent (".p5.core.application-folder").Get<string> (context);
-
-                // Opening file for read access, making sure we dispose it afterwards.
-                using (var stream = File.OpenRead (rootFolder + filename)) {
-
-                    // Creating Sha256 hash, and returning hash of file as value of args.
-                    using (var sha256 = SHA256.Create ()) {
-
-                        // Checking if caller wants "raw bytes".
-                        if (e.Args.GetExChildValue ("raw", context, false)) {
-
-                            // Returning Sha256 hash as raw bytes.
-                            e.Args.Value = sha256.ComputeHash (stream);
-
-                        } else if (e.Args.GetExChildValue ("hex", context, false)) {
-
-                            // Returning value as hexadecimal string.
-                            e.Args.Value = BitConverter.ToString (sha256.ComputeHash (stream)).Replace ("-", string.Empty);
-
-                        } else {
-
-                            // Returning Sha256 hash as base64 encoded string.
-                            e.Args.Value = Convert.ToBase64String (sha256.ComputeHash (stream));
-                        }
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        ///     Creates a Sha256 hash of input given
-        /// </summary>
-        /// <param name="context">Application Context</param>
-        /// <param name="e">Parameters passed into Active Event</param>
-        [ActiveEvent (Name = "p5.crypto.hash.create-sha512")]
-        public static void p5_crypto_hash_create_sha512 (ApplicationContext context, ActiveEventArgs e)
-        {
-            // Making sure we clean up and remove all arguments passed in after execution.
-            using (new ArgsRemover (e.Args)) {
-
-                // Retrieving value to hash as a single string.
-                var whatToHash = XUtil.Single<byte []> (context, e.Args);
-
-                // Creating Sha256 hash, and returning as value of args.
-                using (var sha512 = SHA512.Create ()) {
-
-                    // Checking if caller wants "raw bytes".
-                    if (e.Args.GetExChildValue ("raw", context, false)) {
-
-                        // Returning Sha512 hash as raw bytes.
-                        e.Args.Value = sha512.ComputeHash (whatToHash);
-
-                    } else if (e.Args.GetExChildValue ("hex", context, false)) {
-
-                        // Returning value as hexadecimal string.
-                        e.Args.Value = BitConverter.ToString (sha512.ComputeHash (whatToHash)).Replace ("-", string.Empty);
-
-
-                    } else {
-
-                        // Returning Sha512 hash as base64 encoded string.
-                        e.Args.Value = Convert.ToBase64String (sha512.ComputeHash (whatToHash));
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        ///     Creates a Sha256 hash of given filename
-        /// </summary>
-        /// <param name="context">Application Context</param>
-        /// <param name="e">Parameters passed into Active Event</param>
-        [ActiveEvent (Name = "p5.crypto.hash.create-sha512-file")]
-        public static void p5_crypto_hash_create_sha512_file (ApplicationContext context, ActiveEventArgs e)
-        {
-            // Making sure we clean up and remove all arguments passed in after execution.
-            using (new ArgsRemover (e.Args)) {
-
-                // Retrieving filename user wants to hash, unrolling filename, and making sure user has read access to the file.
-                var filename = e.Args.GetExValue (context, "");
-                filename = context.RaiseEvent ("p5.io.unroll-path", new Node ("", filename).Add ("args", e.Args)).Get<string> (context);
-                context.RaiseEvent (".p5.io.authorize.read-file", new Node ("", filename).Add ("args", e.Args));
-
-                // Retrieving root folder of P5.
-                var rootFolder = context.RaiseEvent (".p5.core.application-folder").Get<string> (context);
-
-                // Opening file for read access, making sure we dispose it afterwards.
-                using (var stream = File.OpenRead (rootFolder + filename)) {
-
-                    // Creating Sha512 hash, and returning hash of file as value of args.
-                    using (var sha512 = SHA512.Create ()) {
-
-                        // Checking if caller wants "raw bytes".
-                        if (e.Args.GetExChildValue ("raw", context, false)) {
-
-                            // Returning Sha512 hash as raw bytes.
-                            e.Args.Value = sha512.ComputeHash (stream);
-
-                        } else if (e.Args.GetExChildValue ("hex", context, false)) {
-
-                            // Returning value as hexadecimal string.
-                            e.Args.Value = BitConverter.ToString (sha512.ComputeHash (stream)).Replace ("-", string.Empty);
-
-                        } else {
-
-                            // Returning Sha256 hash as base64 encoded string.
-                            e.Args.Value = Convert.ToBase64String (sha512.ComputeHash (stream));
-                        }
+                        // Returning hash as base64 encoded string.
+                        args.Value = Convert.ToBase64String (hasher.ComputeHash (stream));
                     }
                 }
             }


Cleanup of private "event" elements.

Cleanup of private "event" elements.

--- Source/Eto/Forms/Controls/Control.cs
+++ Source/Eto/Forms/Controls/Control.cs
@@ -51,7 +51,7 @@

 		public const string SizeChangedEvent = "Control.SizeChanged";

-		event EventHandler<EventArgs> sizeChanged;
+		EventHandler<EventArgs> sizeChanged;

 		public event EventHandler<EventArgs> SizeChanged {
 			add {
@@ -69,7 +69,7 @@

 		public const string KeyDownEvent = "Control.KeyDown";

-		event EventHandler<KeyPressEventArgs> keyDown;
+		EventHandler<KeyPressEventArgs> keyDown;

 		public event EventHandler<KeyPressEventArgs> KeyDown {
 			add {
@@ -108,7 +108,7 @@

 		public const string MouseDownEvent = "Control.MouseDown";

-		event EventHandler<MouseEventArgs> mouseDown;
+		EventHandler<MouseEventArgs> mouseDown;

 		public event EventHandler<MouseEventArgs> MouseDown {
 			add {
@@ -126,7 +126,7 @@

 		public const string MouseUpEvent = "Control.MouseUp";

-		event EventHandler<MouseEventArgs> mouseUp;
+		EventHandler<MouseEventArgs> mouseUp;

 		public event EventHandler<MouseEventArgs> MouseUp {
 			add {
@@ -144,7 +144,7 @@

 		public const string MouseMoveEvent = "Control.MouseMove";

-		event EventHandler<MouseEventArgs> mouseMove;
+		EventHandler<MouseEventArgs> mouseMove;

 		public event EventHandler<MouseEventArgs> MouseMove {
 			add {
@@ -162,7 +162,7 @@

 		public const string MouseLeaveEvent = "Control.MouseLeave";

-		event EventHandler<MouseEventArgs> mouseLeave;
+		EventHandler<MouseEventArgs> mouseLeave;

 		public event EventHandler<MouseEventArgs> MouseLeave {
 			add {
@@ -180,7 +180,7 @@

 		public const string MouseEnterEvent = "Control.MouseEnter";

-		event EventHandler<MouseEventArgs> mouseEnter;
+		EventHandler<MouseEventArgs> mouseEnter;

 		public event EventHandler<MouseEventArgs> MouseEnter {
 			add {
@@ -198,7 +198,7 @@

 		public const string MouseDoubleClickEvent = "Control.MouseDoubleClick";

-		event EventHandler<MouseEventArgs> mouseDoubleClick;
+		EventHandler<MouseEventArgs> mouseDoubleClick;

 		public event EventHandler<MouseEventArgs> MouseDoubleClick {
 			add {
@@ -216,7 +216,7 @@

 		public const string GotFocusEvent = "Control.GotFocus";

-		event EventHandler<EventArgs> gotFocus;
+		EventHandler<EventArgs> gotFocus;

 		public event EventHandler<EventArgs> GotFocus {
 			add {
@@ -234,7 +234,7 @@

 		public const string LostFocusEvent = "Control.LostFocus";

-		event EventHandler<EventArgs> lostFocus;
+		EventHandler<EventArgs> lostFocus;

 		public event EventHandler<EventArgs> LostFocus {
 			add {
@@ -252,7 +252,7 @@

 		public const string ShownEvent = "Control.Shown";

-		event EventHandler<EventArgs> shown;
+		EventHandler<EventArgs> shown;

 		public event EventHandler<EventArgs> Shown {
 			add {
@@ -270,7 +270,7 @@

 		public const string HiddenEvent = "Control.Hidden";

-		event EventHandler<EventArgs> hidden;
+		EventHandler<EventArgs> hidden;

 		public event EventHandler<EventArgs> Hidden {
 			add {


ITabPage2 can be implemented in application-specific code

--- Source/Eto/Forms/Controls/TabPage.cs
+++ Source/Eto/Forms/Controls/TabPage.cs
@@ -10,20 +10,6 @@
 		string Text { get; set; }

 		Image Image { get; set; }
-	}
-
-	/// <summary>
-	/// Enhanced tab pages that support
-	/// additional functionality
-	/// </summary>
-	public interface ITabPage2 : ITabPage
-	{
-		/// <summary>
-		/// If true, a dirty indicator is displayed
-		/// so that the user knows the contents of the page
-		/// are dirty, i.e. need saving.
-		/// </summary>
-		bool Dirty { get; set; }
 	}

 	public class TabPage : Container, IImageListItem


renamings

renamings

--- source/Appccelerate.StateMachine.Specs/Async/EntryActions.cs
+++ source/Appccelerate.StateMachine.Specs/Async/EntryActions.cs
@@ -54,7 +54,7 @@
                     await machine.Start();
                 });

-            "it should execute the entry action"._(()
+            "it should execute the synchronous entry action"._(()
                 => entryActionExecuted.Should().BeTrue());

             "it should execute the asynchronous entry action"._(()
@@ -90,10 +90,10 @@
                 await machine.Start();
             });

-            "it should execute the entry action"._(()
+            "it should execute the entry synchronous action"._(()
                 => receivedParameter.Should().NotBeNull());

-            "it should pass parameter to the entry action"._(()
+            "it should pass parameter to the synchronous entry action"._(()
                 => receivedParameter.Should().Be(parameter));

             "it should execute the asynchronous entry action"._(()
@@ -238,7 +238,7 @@
                 machine.Fire(Event, argument);
             });

-            "it should pass event argument to entry action"._(()
+            "it should pass event argument to synchronousentry action"._(()
                 => passedArgument.Should().Be(argument));

             "it should pass event argument to asynchronous entry action"._(()


Override Path property on Templates to reflect the TreePath for deep linking

--- umbraco/cms/businesslogic/template/Template.cs
+++ umbraco/cms/businesslogic/template/Template.cs
@@ -159,6 +159,41 @@
             return masterpageContent;
         }

+        public new string Path
+        {
+            get
+            {
+                List<int> path = new List<int>();
+                Template working = this;
+                while (working != null)
+                {
+                    path.Add(working.Id);
+                    try
+                    {
+                        if (working.MasterTemplate != 0)
+                        {
+                            working = new Template(working.MasterTemplate);
+                        }
+                        else
+                        {
+                            working = null;
+                        }
+                    }
+                    catch (ArgumentException)
+                    {
+                        working = null;
+                    }
+                }
+                path.Add(-1);
+                path.Reverse();
+                string sPath = string.Join(",", path.ConvertAll(item => item.ToString()).ToArray());
+                return sPath;
+            }
+            set
+            {
+                base.Path = value;
+            }
+        }

         public string Alias
         {


Hide CPU utilization approximation.

Hide CPU utilization approximation.

When render device is something other than CPU
we shouldn't show the approximation.

--- Settings/DeviceSection.cs
+++ Settings/DeviceSection.cs
@@ -271,6 +271,7 @@
 				ActivateDevicePage(vud);
 				m_lb_threadcount.Visible = m_currentDevice.IsCpu;
 				m_threadcount.Visible = m_currentDevice.IsCpu;
+				m_lb_threadcount_currentval.Visible = m_currentDevice.IsCpu;
 				int utilPerc = (int)((float)Settings.Threads / Environment.ProcessorCount * 100.0f);
 				m_lb_threadcount_currentval.Text = $"(~{utilPerc} %)";
 				m_threadcount.Value = Settings.Threads;
@@ -303,6 +304,7 @@
 				SetupDeviceData(e.AllSettings, m_tabpage_opencl.Collection, ccl.DeviceType.OpenCL);
 				ActivateDevicePage(e.AllSettings);
 				m_lb_threadcount.Visible = m_currentDevice.IsCpu;
+				m_lb_threadcount_currentval.Visible = m_currentDevice.IsCpu;
 				m_threadcount.Visible = m_currentDevice.IsCpu;
 				m_threadcount.Value = e.AllSettings.Threads;
 				int utilPerc = (int)((float)e.AllSettings.Threads / Environment.ProcessorCount * 100.0f);


Added constructor w/ position to Ellipse.cs

--- Sharpex2D/Math/Ellipse.cs
+++ Sharpex2D/Math/Ellipse.cs
@@ -34,14 +34,25 @@
         /// </summary>
         /// <param name="radiusX">The X-Radius.</param>
         /// <param name="radiusY">The Y-Radius.</param>
-        public Ellipse(float radiusX, float radiusY) : this()
+        /// <param name="Position">The position.</param>
+        public Ellipse(float radiusX, float radiusY, Vector2 Position)
+            : this()
         {
             RadiusX = radiusX;
             RadiusY = radiusY;
-            _position = new Vector2(0, 0);
+            _position = Position;
             _polygon = new Polygon();
             UpdateEllipse();
         }
+
+        /// <summary>
+        /// Initializes a new Ellipse class.
+        /// </summary>
+        /// <param name="radiusX">The X-Radius.</param>
+        /// <param name="radiusY">The Y-Radius.</param>
+        public Ellipse(float radiusX, float radiusY)
+            : this(radiusX, radiusY, Vector2.Zero)
+        { }

         /// <summary>
         /// Sets or gets the Position.


GetToStr Remove old ToString

GetToStr Remove old ToString

--- Signum.Engine/Database.cs
+++ Signum.Engine/Database.cs
@@ -207,7 +207,7 @@
                 {
                     var cc = CanUseCache<T>();
                     if (cc != null)
-                        return cc.GetToString(id).ToString();
+                        return cc.GetToString(id);

                     return Database.Query<T>().Where(a => a.Id == id).Select(a => a.ToString()).FirstEx();
                 }


Fixed COMExceptions crashing loading of services

--- source/UninstallTools/Startup/Service/ServiceEntryFactory.cs
+++ source/UninstallTools/Startup/Service/ServiceEntryFactory.cs
@@ -7,6 +7,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Management;
+using System.Runtime.InteropServices;
 using System.Security;
 using Klocman.Extensions;
 using Klocman.Native;
@@ -39,28 +40,36 @@
                 "SELECT * FROM Win32_Service");

             var results = new List<ServiceEntry>();
-            foreach (var queryObj in searcher.Get())
+            try
             {
-                // Skip drivers and adapters
-                var serviceType = queryObj["ServiceType"] as string;
-                if (serviceType == null || !serviceType.Contains("Process"))
-                    continue;
+                foreach (var queryObj in searcher.Get())
+                {
+                    // Skip drivers and adapters
+                    var serviceType = queryObj["ServiceType"] as string;
+                    if (serviceType == null || !serviceType.Contains("Process"))
+                        continue;

-                var filename = queryObj["PathName"] as string;
-                // Don't show system services
-                if (filename == null || filename.Contains(
-                    WindowsTools.GetEnvironmentPath(CSIDL.CSIDL_WINDOWS),
-                    StringComparison.InvariantCultureIgnoreCase))
-                    continue;
+                    var filename = queryObj["PathName"] as string;
+                    // Don't show system services
+                    if (filename == null || filename.Contains(
+                        WindowsTools.GetEnvironmentPath(CSIDL.CSIDL_WINDOWS),
+                        StringComparison.InvariantCultureIgnoreCase))
+                        continue;

-                var e = new ServiceEntry((string)queryObj["Name"],
-                    queryObj["DisplayName"] as string, filename);
+                    var e = new ServiceEntry((string)queryObj["Name"],
+                        queryObj["DisplayName"] as string, filename);

-                //queryObj["Caption"]);
-                //queryObj["Description"]);
-                //queryObj["ProcessId"]
+                    //queryObj["Caption"]);
+                    //queryObj["Description"]);
+                    //queryObj["ProcessId"]

-                results.Add(e);
+                    results.Add(e);
+                }
+            }
+            catch (COMException ex)
+            {
+                Console.WriteLine(@"Error while gathering services");
+                Console.WriteLine(ex);
             }

             return results.ToArray();


Minor change in a way we search the netcdf.dll file on Windows.

We expected any subdirectory under ProgramFilesX86 containing "netcdf"
in its name being a standard NetCDF install. This might not be the case.

--- Madingley/SDSlite/NetCDFInterop/NetCDF.cs
+++ Madingley/SDSlite/NetCDFInterop/NetCDF.cs
@@ -541,18 +541,22 @@
             {
                 case PlatformID.Win32NT:
                     var name = "netcdf.dll";
+                    // try find the file in current directory and then in directories from PATH environmental variable.
                     var path = Enumerable.Repeat(Environment.CurrentDirectory, 1)
                         .Concat(Environment.GetEnvironmentVariable("PATH").Split(';'))
                         .FirstOrDefault(d => File.Exists(Path.Combine(d, name)));
                     if (null == path)
                     {
+                        // alternatively try standard install paths.
                         var ncdir = Directory.GetDirectories(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86))
                             .Reverse() // last version first
-                            .FirstOrDefault(d => 0 < d.IndexOf("netcdf", StringComparison.InvariantCultureIgnoreCase));
+                            .Where(d => 0 < d.IndexOf("netcdf", StringComparison.InvariantCultureIgnoreCase))
+                            .Select(d => Path.Combine(d, "bin"))
+                            .FirstOrDefault(d => File.Exists(Path.Combine(d, name)));
                         if (null != ncdir)
                         {
-                            ncdir = Path.Combine(ncdir, "bin");
-                            if (File.Exists(Path.Combine(ncdir, name))) path = ncdir;
+                            // if found we need to add the file location to PATH environmental variable to load dependent DLLs.
+                            path = ncdir;
                             Environment.SetEnvironmentVariable("PATH",
                                 Environment.GetEnvironmentVariable("PATH") + ";" + ncdir);
                         }


Refactor creation of generic list into single method.

--- src/Arango/Arango.Client/API/Queries/ArangoQueryOperation.cs
+++ src/Arango/Arango.Client/API/Queries/ArangoQueryOperation.cs
@@ -658,8 +658,25 @@
         /// <param name="count">Variable where will be stored total number of result objects available after execution.</param>
         public List<T> ToList<T>(out int count) where T: class, new()
         {
+            var items = _cursorOperation.Post(ToString(false), true, out count, _batchSize, _bindVars);
+
+            return ToGenericList<T>(items);
+        }
+
+        /// <summary>
+        /// Executes AQL query and returns list of objects.
+        /// </summary>
+        public List<T> ToList<T>()
+        {
+            var count = 0;
+            var items = _cursorOperation.Post(ToString(false), false, out count, _batchSize, _bindVars);
+
+            return ToGenericList<T>(items);
+        }
+
+        private List<T> ToGenericList<T>(List<object> items)
+        {
             var type = typeof(T);
-            var items = _cursorOperation.Post(ToString(false), true, out count, _batchSize, _bindVars);
             var genericCollection = new List<T>();

             if (type.IsPrimitive ||
@@ -682,55 +699,14 @@
                 {
                     var document = (Document)item;
                     var genericObject = Activator.CreateInstance(type);
-
+
                     document.ToObject(genericObject);
                     document.MapAttributesTo(genericObject);
-
+
                     genericCollection.Add((T)genericObject);
                 }
             }
-
-            return genericCollection;
-        }
-
-        /// <summary>
-        /// Executes AQL query and returns list of objects.
-        /// </summary>
-        public List<T> ToList<T>()
-        {
-            var type = typeof(T);
-            var count = 0;
-            var items = _cursorOperation.Post(ToString(false), false, out count, _batchSize, _bindVars);
-            var genericCollection = new List<T>();
-
-            if (type.IsPrimitive ||
-                (type == typeof(string)) ||
-                (type == typeof(DateTime)) ||
-                (type == typeof(decimal)))
-            {
-                foreach (object item in items)
-                {
-                    genericCollection.Add((T)Convert.ChangeType(item, type));
-                }
-            }
-            else if (type == typeof(Document))
-            {
-                genericCollection = items.Cast<T>().ToList();
-            }
-            else
-            {
-                foreach (object item in items)
-                {
-                    var document = (Document)item;
-                    var genericObject = Activator.CreateInstance(type);
-
-                    document.ToObject(genericObject);
-                    document.MapAttributesTo(genericObject);
-
-                    genericCollection.Add((T)genericObject);
-                }
-            }
-
+
             return genericCollection;
         }


Annotations

Annotations

--- Main/src/String/StringExtensions.Infix.cs
+++ Main/src/String/StringExtensions.Infix.cs
@@ -12,24 +12,28 @@
 		/// Infix form of <see cref="string.IsNullOrEmpty"/>.
 		/// </summary>
 		[Pure]
+		[ContractAnnotation("str:null => true")]
 		public static bool IsNullOrEmpty([CanBeNull] this string str) => string.IsNullOrEmpty(str);

 		/// <summary>
 		/// Returns true if argument is not null nor empty.
 		/// </summary>
 		[Pure]
+		[ContractAnnotation("str:null => false")]
 		public static bool NotNullNorEmpty([CanBeNull] this string str) => !string.IsNullOrEmpty(str);

 		/// <summary>
 		/// Infix form of <see cref="string.IsNullOrWhiteSpace"/>.
 		/// </summary>
 		[Pure]
+		[ContractAnnotation("str:null => true")]
 		public static bool IsNullOrWhiteSpace([CanBeNull] this string str) => string.IsNullOrWhiteSpace(str);

 		/// <summary>
 		/// Returns true if argument is not null nor whitespace.
 		/// </summary>
 		[Pure]
+		[ContractAnnotation("str:null => false")]
 		public static bool NotNullNorWhiteSpace([CanBeNull] this string str) => !string.IsNullOrWhiteSpace(str);

 		/// <summary>
@@ -40,7 +44,8 @@
 		/// <returns>
 		/// A copy of <paramref name="format"/> in which any format items are replaced by the string representation of <paramref name="arg"/>.
 		/// </returns>
-		[NotNull, Pure]
+		[NotNull]
+		[Pure]
 		[StringFormatMethod("format")]
 		public static string FormatWith([NotNull] this string format, object arg) => string.Format(format, arg);


[util] Shorten temp paths to avoid MAX_PATH

--- Util/BuildScripts/ValidateComponents/build.cake
+++ Util/BuildScripts/ValidateComponents/build.cake
@@ -51,15 +51,21 @@
     // We want to keep track of all the apps we need to validate
 	var appInfos = new List<AppInfo> ();

+    var tempProjNum = 0;
+
     // Inspect each .xam file we find
 	foreach (var xamFile in xamFiles) {
+        tempProjNum++;
+
 		Information ("{0}", xamFile);

         // .xam files are just zip files, unzip to work with it
 		Unzip (xamFile, temp);

         // Get the path to the extracted contents
-		var componentPath = new DirectoryPath (temp + "/" + xamFile.GetFilenameWithoutExtension ());
+		//var componentPath = new DirectoryPath (temp + "/" + xamFile.GetFilenameWithoutExtension ());
+        // Switch to using a number for the temp directory to save some characters and avoid MAX_PATH issues
+        var componentPath = new DirectoryPath (temp + "/" + tempProjNum);

         // Ensure a manifest exists for the component
 		if (!FileExists (componentPath + "/component/Manifest.xml"))


trademargin test

trademargin test

--- src/CIAPI.IntegrationTests/Streaming/DefaultPricesFixture.cs
+++ src/CIAPI.IntegrationTests/Streaming/DefaultPricesFixture.cs
@@ -48,4 +48,34 @@
             Assert.Greater(tableOfPrices.Values.Count, 1, "We're expecting at least one price");
         }
     }
+
+    [TestFixture]
+    public class ClientAccountFixture : RpcFixtureBase
+    {
+
+
+        [Test]
+        public void CanConsumeDefaultPricesStream()
+        {
+            var streamingClient = BuildStreamingClient();
+
+            var priceListener = streamingClient.BuildTradeMarginListener();
+
+
+
+            var gate = new AutoResetEvent(false);
+            priceListener.MessageReceived += (s, e) =>
+            {
+
+                Console.WriteLine(e.Data.OrderId);
+                gate.Set();
+            };
+
+            gate.WaitOne(15000);
+
+            streamingClient.TearDownListener(priceListener);
+            streamingClient.Dispose();
+
+        }
+    }
 }


Implement ICollection for ImageLayerCollection

--- Mappy/UI/Controls/ImageLayerCollection.cs
+++ Mappy/UI/Controls/ImageLayerCollection.cs
@@ -1,5 +1,6 @@
 namespace Mappy.UI.Controls
 {
+    using System.Collections;
     using System.Collections.Generic;
     using System.Collections.Specialized;
     using System.Drawing;
@@ -10,7 +11,7 @@

     using Util;

-    public class ImageLayerCollection : INotifyCollectionChanged
+    public class ImageLayerCollection : ICollection<ImageLayerCollection.Item>, INotifyCollectionChanged
     {
         private QuadTree<Item> items;

@@ -21,12 +22,33 @@

         public event NotifyCollectionChangedEventHandler CollectionChanged;

+        public int Count
+        {
+            get
+            {
+                return this.items.Count;
+            }
+        }
+
+        public bool IsReadOnly
+        {
+            get
+            {
+                return false;
+            }
+        }
+
         public void Add(Item item)
         {
             this.items.Add(item);
             this.OnAdd(item);
         }

+        public void CopyTo(Item[] array, int arrayIndex)
+        {
+            this.items.CopyTo(array, arrayIndex);
+        }
+
         public bool Remove(Item item)
         {
             bool success = this.items.Remove(item);
@@ -43,6 +65,11 @@
         {
             this.items.Clear();
             this.OnClear();
+        }
+
+        public bool Contains(Item item)
+        {
+            return this.items.Contains(item);
         }

         public IEnumerable<Item> EnumerateIntersecting(Rectangle rect)
@@ -62,6 +89,16 @@
         public void Resize(int newWidth, int newHeight)
         {
             this.items = new QuadTree<Item>(new Rectangle(0, 0, newWidth, newHeight), this.items);
+        }
+
+        public IEnumerator<Item> GetEnumerator()
+        {
+            return this.items.GetEnumerator();
+        }
+
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return this.GetEnumerator();
         }

         protected virtual void OnAdd(Item item)


Removed unneccessary condition.

Removed unneccessary condition.

--- WPPMM/PhoneApp/DataModel/ApplicationSettings.cs
+++ WPPMM/PhoneApp/DataModel/ApplicationSettings.cs
@@ -59,7 +59,7 @@
                     if (value)
                     {
                         IsPostviewTransferEnabled = false;
-                        if (manager.cameraStatus.IsAvailable("setSelfTimer") && ApplicationSettings.GetInstance().IsIntervalShootingEnabled)
+                        if (manager.cameraStatus.IsAvailable("setSelfTimer") && manager.IntervalManager != null)
                         {
                             manager.SetSelfTimer(RemoteApi.ApiParams.SelfTimerOff);
                         }


Make NotifyPropertyChangedBase abstract

Make NotifyPropertyChangedBase abstract

--- WalletWasabi/Bases/NotifyPropertyChangedBase.cs
+++ WalletWasabi/Bases/NotifyPropertyChangedBase.cs
@@ -6,7 +6,7 @@

 namespace WalletWasabi.Bases
 {
-	public class NotifyPropertyChangedBase : INotifyPropertyChanged
+	public abstract class NotifyPropertyChangedBase : INotifyPropertyChanged
 	{
 		#region Events


Removed one line

Removed one line

--- WarframeMarketClient/GUI/Tabs/Tab_Chats.xaml.cs
+++ WarframeMarketClient/GUI/Tabs/Tab_Chats.xaml.cs
@@ -99,7 +99,7 @@
         {

             // Only focus if a char was pressed (yes, thats hacky... ... and it doesn't work for -_ etc...)
-            Console.WriteLine("Key down: "+e.Key+" "+e.Key.IsPrintable() );
+            //Console.WriteLine("Key down: "+e.Key+" "+e.Key.IsPrintable() );
             if (e.Key.IsPrintable() && chatTabs.SelectedContent != null)
                 ((chatTabs.SelectedContent as ContentControl).Content as ChatTabContentViewModel).Focus();
         }


Refactored code a bit for reuse.

Refactored code a bit for reuse.

--- MimeKit/Cryptography/SecureMimeContext.cs
+++ MimeKit/Cryptography/SecureMimeContext.cs
@@ -236,6 +236,56 @@
 			}
 		}

+		Stream Sign (CmsSigner signer, byte[] content, bool encapsulate)
+		{
+			var cms = new CmsSignedDataStreamGenerator ();
+
+			cms.AddSigner (signer.PrivateKey, signer.Certificate, GetOid (signer.DigestAlgorithm),
+				signer.SignedAttributes, signer.UnsignedAttributes);
+
+			var memory = new MemoryStream ();
+
+			using (var stream = cms.Open (memory, encapsulate)) {
+				stream.Write (content, 0, content.Length);
+			}
+
+			memory.Position = 0;
+
+			return memory;
+		}
+
+		/// <summary>
+		/// Sign the content using the specified signer.
+		/// </summary>
+		/// <returns>A new <see cref="MimeKit.Cryptography.ApplicationPkcs7Signature"/> instance
+		/// containing the detached signature data.</returns>
+		/// <param name="signer">The signer.</param>
+		/// <param name="content">The content.</param>
+		/// <exception cref="System.ArgumentNullException">
+		/// <para><paramref name="signer"/> is <c>null</c>.</para>
+		/// <para>-or-</para>
+		/// <para><paramref name="content"/> is <c>null</c>.</para>
+		/// </exception>
+		/// <exception cref="System.Security.Cryptography.CryptographicException">
+		/// An error occurred while signing.
+		/// </exception>
+		public ApplicationPkcs7Signature Sign (CmsSigner signer, byte[] content)
+		{
+			if (signer == null)
+				throw new ArgumentNullException ("signer");
+
+			if (signer.Certificate == null)
+				throw new ArgumentException ("No signer certificate specified.", "signer");
+
+			if (signer.PrivateKey == null)
+				throw new ArgumentException ("No private key specified.", "signer");
+
+			if (content == null)
+				throw new ArgumentNullException ("content");
+
+			return new ApplicationPkcs7Signature (Sign (signer, content, false));
+		}
+
 		/// <summary>
 		/// Sign the content using the specified signer.
 		/// </summary>
@@ -272,50 +322,6 @@
 			var cmsSigner = GetCmsSigner (signer, digestAlgo);

 			return Sign (cmsSigner, content);
-		}
-
-		/// <summary>
-		/// Sign the content using the specified signer.
-		/// </summary>
-		/// <returns>A new <see cref="MimeKit.Cryptography.ApplicationPkcs7Signature"/> instance
-		/// containing the detached signature data.</returns>
-		/// <param name="signer">The signer.</param>
-		/// <param name="content">The content.</param>
-		/// <exception cref="System.ArgumentNullException">
-		/// <para><paramref name="signer"/> is <c>null</c>.</para>
-		/// <para>-or-</para>
-		/// <para><paramref name="content"/> is <c>null</c>.</para>
-		/// </exception>
-		/// <exception cref="System.Security.Cryptography.CryptographicException">
-		/// An error occurred while signing.
-		/// </exception>
-		public ApplicationPkcs7Signature Sign (CmsSigner signer, byte[] content)
-		{
-			if (signer == null)
-				throw new ArgumentNullException ("signer");
-
-			if (signer.Certificate == null)
-				throw new ArgumentException ("No signer certificate specified.", "signer");
-
-			if (signer.PrivateKey == null)
-				throw new ArgumentException ("No private key specified.", "signer");
-
-			if (content == null)
-				throw new ArgumentNullException ("content");
-
-			var generator = new CmsSignedDataStreamGenerator ();
-			generator.AddSigner (signer.PrivateKey, signer.Certificate, GetOid (signer.DigestAlgorithm),
-				signer.SignedAttributes, signer.UnsignedAttributes);
-
-			var memory = new MemoryStream ();
-
-			using (var stream = generator.Open (memory)) {
-				stream.Write (content, 0, content.Length);
-			}
-
-			memory.Position = 0;
-
-			return new ApplicationPkcs7Signature (memory);
 		}

 		X509Certificate GetCertificate (IX509Store store, SignerID signer)
@@ -428,6 +434,26 @@
 			return GetDigitalSignatures (signers, certificates);
 		}

+		Stream Encrypt (CmsRecipientCollection recipients, Stream content)
+		{
+			var cms = new CmsEnvelopedDataGenerator ();
+			int count = 0;
+
+			foreach (var recipient in recipients) {
+				cms.AddKeyTransRecipient (recipient.Certificate);
+				count++;
+			}
+
+			if (count == 0)
+				throw new ArgumentException ("No recipients specified.", "recipients");
+
+			// FIXME: how to decide which algorithm to use?
+			var input = new CmsProcessableInputStream (content);
+			var envelopedData = cms.Generate (input, CmsEnvelopedGenerator.DesEde3Cbc);
+
+			return new MemoryStream (envelopedData.GetEncoded (), false);
+		}
+
 		/// <summary>
 		/// Encrypt the specified content for the specified recipients.
 		/// </summary>
@@ -451,22 +477,9 @@
 			if (content == null)
 				throw new ArgumentNullException ("content");

-			var generator = new CmsEnvelopedDataGenerator ();
-			int count = 0;
-
-			foreach (var recipient in recipients) {
-				generator.AddKeyTransRecipient (recipient.Certificate);
-				count++;
-			}
-
-			if (count == 0)
-				throw new ArgumentException ("No recipients specified.", "recipients");
-
-			// FIXME: how to decide which algorithm to use?
-			var envelope = generator.Generate (new CmsProcessableByteArray (content), CmsEnvelopedGenerator.DesEde3Cbc);
-			var data = envelope.GetEncoded ();
-
-			return new ApplicationPkcs7Mime (SecureMimeType.EnvelopedData, new MemoryStream (data, false));
+			using (var memory = new MemoryStream (content, false)) {
+				return new ApplicationPkcs7Mime (SecureMimeType.EnvelopedData, Encrypt (recipients, memory));
+			}
 		}

 		/// <summary>
@@ -528,26 +541,9 @@
 			if (content == null)
 				throw new ArgumentNullException ("content");

-			var generator = new CmsSignedDataGenerator ();
-			generator.AddSigner (signer.PrivateKey, signer.Certificate, GetOid (signer.DigestAlgorithm),
-				signer.SignedAttributes, signer.UnsignedAttributes);
-			var signedData = generator.Generate (new CmsProcessableByteArray (content), true);
-
-			var cms = new CmsEnvelopedDataGenerator ();
-			int count = 0;
-
-			foreach (var recipient in recipients) {
-				cms.AddKeyTransRecipient (recipient.Certificate);
-				count++;
-			}
-
-			if (count == 0)
-				throw new ArgumentException ("No recipients specified.", "recipients");
-
-			var envelopedData = cms.Generate (signedData.SignedContent, CmsEnvelopedGenerator.DesEde3Cbc);
-			var data = envelopedData.GetEncoded ();
-
-			return new ApplicationPkcs7Mime (SecureMimeType.EnvelopedData, new MemoryStream (data, false));
+			using (var signed = Sign (signer, content, true)) {
+				return new ApplicationPkcs7Mime (SecureMimeType.EnvelopedData, Encrypt (recipients, signed));
+			}
 		}

 		/// <summary>


Removed a redundant Null Guard.

Removed a redundant Null Guard.

--- Src/Albedo/AssemblyElementMaterializer.cs
+++ Src/Albedo/AssemblyElementMaterializer.cs
@@ -38,9 +38,6 @@
         /// <seealso cref="IReflectionElementMaterializer{T}" />
         public IEnumerable<IReflectionElement> Materialize(IEnumerable<T> source)
         {
-            if (source == null)
-                throw new ArgumentNullException("source");
-
             return source
                 .OfType<Assembly>()
                 .Select(a => new AssemblyElement(a))