GetBooleanValue

GetBooleanValue

--- Extensions/AttributeCollectionExtensions.cs
+++ Extensions/AttributeCollectionExtensions.cs
@@ -4,217 +4,226 @@

 namespace KpdApps.Common.MsCrm2015.Extensions
 {
-    public static class AttributeCollectionExtensions
-    {
-        public static object GetValue(this AttributeCollection properties, string name)
-        {
-            if (!properties.Contains(name))
-                return null;
-
-            object crmValue = properties[name];
-            if (crmValue == null)
-                return null;
-
-            Type fieldType = crmValue.GetType();
-            Type[] endTypes = { typeof(DateTime), typeof(int), typeof(double) };
-
-            EntityReference reference = crmValue as EntityReference;
-            if (reference != null)
-                return reference.Id;
-
-            if (fieldType == typeof(OptionSetValue))
-            {
-                OptionSetValue field = (OptionSetValue)crmValue;
-                return field.Value;
-            }
-
-            if (fieldType == typeof(Money))
-            {
-                Money field = (Money)crmValue;
-                return field.Value;
-            }
-
-            if (endTypes.Contains(fieldType))
-                return crmValue;
-
-            if (fieldType == typeof(AliasedValue))
-                return ((AliasedValue)crmValue).Value;
-
-            return crmValue;
-        }
-
-        public static string GetStringValue(this AttributeCollection properties, string name)
-        {
-            if (!properties.Contains(name))
-                return null;
-
-            object property = properties[name];
-            return property?.ToString();
-        }
-
-        public static void SetStringValue(this AttributeCollection properties, string name, string value)
-        {
-            if (properties.Contains(name))
-                properties[name] = value;
-            else
-                properties.Add(name, value);
-        }
-
-        public static int GetStatusValue(this AttributeCollection properties)
-        {
-            return GetPicklistValue(properties, "statuscode");
-        }
-
-        public static int GetStateValue(this AttributeCollection properties)
-        {
-            return GetPicklistValue(properties, "statecode");
-        }
-
-        public static int GetPicklistValue(this AttributeCollection properties, string name)
-        {
-            return GetPicklistValue(properties, name, -1);
-        }
-
-        public static int GetPicklistValue(this AttributeCollection properties, string name, int defaultValue)
-        {
-            if (!properties.Contains(name))
-                return defaultValue;
-
-            OptionSetValue property = properties[name] as OptionSetValue;
-            return property?.Value ?? defaultValue;
-        }
-
-        public static void SetPicklistValue(this AttributeCollection properties, string name, int value)
-        {
-            if (properties.Contains(name))
-                properties[name] = new OptionSetValue(value);
-            else
-                properties.Add(name, new OptionSetValue(value));
-        }
-
-        public static void SetStatusValue(this AttributeCollection properties, int value)
-        {
-            SetPicklistValue(properties, "statuscode", value);
-        }
-
-        public static DateTime GetDateTimeValue(this AttributeCollection properties, string name)
-        {
-            if (!properties.Contains(name))
-                return DateTime.MinValue;
-
-            object property = properties[name];
-            if (property != null)
-                return Convert.ToDateTime(property);
-            return DateTime.MinValue;
-        }
-
-        public static void SetDateTimeValue(this AttributeCollection properties, string name, DateTime value)
-        {
-            if (properties.Contains(name))
-                properties[name] = value;
-            else
-                properties.Add(name, value);
-        }
-
-        public static EntityReference GetLookup(this AttributeCollection properties, string name)
-        {
-            if (!properties.Contains(name)) return null;
-
-            var @ref = properties[name];
-            if (@ref != null)
-                return (EntityReference)properties[name];
-
-            return null;
-        }
-
-        public static Guid GetLookupValue(this AttributeCollection properties, string name)
-        {
-            if (!properties.Contains(name))
-                return Guid.Empty;
-
-            object property = properties[name];
-            EntityReference @ref = property as EntityReference;
-            if (@ref != null)
-                return @ref.Id;
-
-            return Guid.Empty;
-        }
-
-        public static void SetLookupValue(this AttributeCollection properties, string name, string type, Guid value)
-        {
-            if (properties.Contains(name))
-                properties[name] = new EntityReference(type, value);
-            else
-                properties.Add(name, new EntityReference(type, value));
-        }
-
-        public static int GetNumberValue(this AttributeCollection properties, string name)
-        {
-            if (!properties.Contains(name))
-                return 0;
-
-            object property = properties[name];
-            return property != null ? Convert.ToInt32(property) : 0;
-        }
-
-        public static decimal GetMoneyValue(this AttributeCollection properties, string name)
-        {
-            if (!properties.Contains(name))
-                return 0;
-
-            object property = properties[name];
-            Money num = property as Money;
-            return num != null ? Convert.ToDecimal(num.Value) : 0;
-        }
-
-        public static double GetFloatValue(this AttributeCollection properties, string name)
-        {
-            if (!properties.Contains(name))
-                return 0;
-
-            object property = properties[name];
-            return property != null ? Convert.ToDouble(property) : 0;
-        }
-
-        public static decimal GetDecimalValue(this AttributeCollection properties, string name)
-        {
-            if (!properties.Contains(name))
-                return 0;
-
-            object property = properties[name];
-            return property != null ? Convert.ToDecimal(property) : 0;
-        }
-
-        public static void SetNumberValue(this AttributeCollection properties, string name, int value)
-        {
-            if (properties.Contains(name))
-                properties[name] = value;
-            else
-                properties.Add(name, value);
-        }
-
-        public static void SetMoneyValue(this AttributeCollection properties, string name, decimal value)
-        {
-            if (properties.Contains(name))
-                properties[name] = new Money(value);
-            else
-                properties.Add(name, new Money(value));
-        }
-
-        public static void SetDecimalValue(this AttributeCollection properties, string name, decimal value)
-        {
-            if (properties.Contains(name))
-                properties[name] = value;
-            else
-                properties.Add(name, value);
-        }
-
-        public static void SetFloatValue(this AttributeCollection properties, string name, double value)
-        {
-            if (properties.Contains(name))
-                properties[name] = value;
-            else
-                properties.Add(name, value);
-        }
-    }
+	public static class AttributeCollectionExtensions
+	{
+		public static object GetValue(this AttributeCollection properties, string name)
+		{
+			if (!properties.Contains(name))
+				return null;
+
+			object crmValue = properties[name];
+			if (crmValue == null)
+				return null;
+
+			Type fieldType = crmValue.GetType();
+			Type[] endTypes = { typeof(DateTime), typeof(int), typeof(double) };
+
+			EntityReference reference = crmValue as EntityReference;
+			if (reference != null)
+				return reference.Id;
+
+			if (fieldType == typeof(OptionSetValue))
+			{
+				OptionSetValue field = (OptionSetValue)crmValue;
+				return field.Value;
+			}
+
+			if (fieldType == typeof(Money))
+			{
+				Money field = (Money)crmValue;
+				return field.Value;
+			}
+
+			if (endTypes.Contains(fieldType))
+				return crmValue;
+
+			if (fieldType == typeof(AliasedValue))
+				return ((AliasedValue)crmValue).Value;
+
+			return crmValue;
+		}
+
+		public static string GetStringValue(this AttributeCollection properties, string name)
+		{
+			if (!properties.Contains(name))
+				return null;
+
+			object property = properties[name];
+			return property?.ToString();
+		}
+
+		public static void SetStringValue(this AttributeCollection properties, string name, string value)
+		{
+			if (properties.Contains(name))
+				properties[name] = value;
+			else
+				properties.Add(name, value);
+		}
+
+		public static int GetStatusValue(this AttributeCollection properties)
+		{
+			return GetPicklistValue(properties, "statuscode");
+		}
+
+		public static int GetStateValue(this AttributeCollection properties)
+		{
+			return GetPicklistValue(properties, "statecode");
+		}
+
+		public static int GetPicklistValue(this AttributeCollection properties, string name)
+		{
+			return GetPicklistValue(properties, name, -1);
+		}
+
+		public static int GetPicklistValue(this AttributeCollection properties, string name, int defaultValue)
+		{
+			if (!properties.Contains(name))
+				return defaultValue;
+
+			OptionSetValue property = properties[name] as OptionSetValue;
+			return property?.Value ?? defaultValue;
+		}
+
+		public static void SetPicklistValue(this AttributeCollection properties, string name, int value)
+		{
+			if (properties.Contains(name))
+				properties[name] = new OptionSetValue(value);
+			else
+				properties.Add(name, new OptionSetValue(value));
+		}
+
+		public static void SetStatusValue(this AttributeCollection properties, int value)
+		{
+			SetPicklistValue(properties, "statuscode", value);
+		}
+
+		public static DateTime GetDateTimeValue(this AttributeCollection properties, string name)
+		{
+			if (!properties.Contains(name))
+				return DateTime.MinValue;
+
+			object property = properties[name];
+			if (property != null)
+				return Convert.ToDateTime(property);
+			return DateTime.MinValue;
+		}
+
+		public static void SetDateTimeValue(this AttributeCollection properties, string name, DateTime value)
+		{
+			if (properties.Contains(name))
+				properties[name] = value;
+			else
+				properties.Add(name, value);
+		}
+
+		public static EntityReference GetLookup(this AttributeCollection properties, string name)
+		{
+			if (!properties.Contains(name)) return null;
+
+			var @ref = properties[name];
+			if (@ref != null)
+				return (EntityReference)properties[name];
+
+			return null;
+		}
+
+		public static Guid GetLookupValue(this AttributeCollection properties, string name)
+		{
+			if (!properties.Contains(name))
+				return Guid.Empty;
+
+			object property = properties[name];
+			EntityReference @ref = property as EntityReference;
+			if (@ref != null)
+				return @ref.Id;
+
+			return Guid.Empty;
+		}
+
+		public static void SetLookupValue(this AttributeCollection properties, string name, string type, Guid value)
+		{
+			if (properties.Contains(name))
+				properties[name] = new EntityReference(type, value);
+			else
+				properties.Add(name, new EntityReference(type, value));
+		}
+
+		public static int GetNumberValue(this AttributeCollection properties, string name)
+		{
+			if (!properties.Contains(name))
+				return 0;
+
+			object property = properties[name];
+			return property != null ? Convert.ToInt32(property) : 0;
+		}
+
+		public static decimal GetMoneyValue(this AttributeCollection properties, string name)
+		{
+			if (!properties.Contains(name))
+				return 0;
+
+			object property = properties[name];
+			Money num = property as Money;
+			return num != null ? Convert.ToDecimal(num.Value) : 0;
+		}
+
+		public static double GetFloatValue(this AttributeCollection properties, string name)
+		{
+			if (!properties.Contains(name))
+				return 0;
+
+			object property = properties[name];
+			return property != null ? Convert.ToDouble(property) : 0;
+		}
+
+		public static decimal GetDecimalValue(this AttributeCollection properties, string name)
+		{
+			if (!properties.Contains(name))
+				return 0;
+
+			object property = properties[name];
+			return property != null ? Convert.ToDecimal(property) : 0;
+		}
+
+		public static void SetNumberValue(this AttributeCollection properties, string name, int value)
+		{
+			if (properties.Contains(name))
+				properties[name] = value;
+			else
+				properties.Add(name, value);
+		}
+
+		public static void SetMoneyValue(this AttributeCollection properties, string name, decimal value)
+		{
+			if (properties.Contains(name))
+				properties[name] = new Money(value);
+			else
+				properties.Add(name, new Money(value));
+		}
+
+		public static void SetDecimalValue(this AttributeCollection properties, string name, decimal value)
+		{
+			if (properties.Contains(name))
+				properties[name] = value;
+			else
+				properties.Add(name, value);
+		}
+
+		public static void SetFloatValue(this AttributeCollection properties, string name, double value)
+		{
+			if (properties.Contains(name))
+				properties[name] = value;
+			else
+				properties.Add(name, value);
+		}
+
+		public static bool GetBooleanValue(this AttributeCollection properties, string name)
+		{
+			if (!properties.Contains(name))
+				return false;
+
+			object property = properties[name];
+			return property != null && Convert.ToBoolean(property);
+		}
+	}
 }


Implemented QueuedPressableInput

Implemented QueuedPressableInput

--- ExternalInputShared/QueuedPressableInput.cs
+++ ExternalInputShared/QueuedPressableInput.cs
@@ -1,4 +1,5 @@
 using System;
+using Apache.NMS;
 using FlatRedBall.Input;

 namespace ExternalInputShared
@@ -7,15 +8,60 @@
     public class QueuedPressableInput : IPressableInput, IDisposable
     {
         private readonly QueueConsumer _queueConsumer;
+        private bool _previousDown;

         public QueuedPressableInput()
         {
             _queueConsumer = new QueueConsumer("IPressableInput");
+
+            _queueConsumer.Listener += QueueConsumerOnListener;
         }

-        public bool IsDown { get; }
-        public bool WasJustPressed { get; }
-        public bool WasJustReleased { get; }
+        private void QueueConsumerOnListener(IMessage message)
+        {
+            var bytesMessage = (IBytesMessage)message;
+
+            IsDown = bytesMessage.Content[0] == 1;
+        }
+
+        public bool IsDown { get; private set; }
+        public bool WasJustPressed
+        {
+            get
+            {
+                bool retValue;
+                if (!_previousDown && IsDown)
+                {
+                    retValue = true;
+                }
+                else
+                {
+                    retValue = false;
+                }
+
+                _previousDown = IsDown;
+
+                return retValue;
+            }
+        }
+        public bool WasJustReleased {
+            get
+            {
+                bool retValue;
+                if (_previousDown && !IsDown)
+                {
+                    retValue = true;
+                }
+                else
+                {
+                    retValue = false;
+                }
+
+                _previousDown = IsDown;
+
+                return retValue;
+            }
+        }

         public void Dispose()
         {


Parameter should be "address" instead of "location"

--- Framework.Core/System/Threading/ThreadEx.cs
+++ Framework.Core/System/Threading/ThreadEx.cs
@@ -22,12 +22,12 @@

         [MethodImpl(MethodImplOptionsEx.NoInlining)]
 #endif
-        public static bool VolatileRead(ref bool location)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            return Volatile.Read(ref location);
-#else
-            var flag = location;
+        public static bool VolatileRead(ref bool address)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            return Volatile.Read(ref address);
+#else
+            var flag = address;
             Thread.MemoryBarrier();
             return flag;
 #endif
@@ -35,148 +35,148 @@

         [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
         [CLSCompliant(false)]
-        public static sbyte VolatileRead(ref sbyte location)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            return Volatile.Read(ref location);
-#else
-            return Thread.VolatileRead(ref location);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        public static byte VolatileRead(ref byte location)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            return Volatile.Read(ref location);
-#else
-            return Thread.VolatileRead(ref location);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        public static void VolatileRead(ref short location)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            Volatile.Read(ref location);
-#else
-            Thread.VolatileRead(ref location);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        [CLSCompliant(false)]
-        public static ushort VolatileRead(ref ushort location)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            return Volatile.Read(ref location);
-#else
-            return Thread.VolatileRead(ref location);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        public static int VolatileRead(ref int location)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            return Volatile.Read(ref location);
-#else
-            return Thread.VolatileRead(ref location);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        [CLSCompliant(false)]
-        public static uint VolatileRead(ref uint location)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            return Volatile.Read(ref location);
-#else
-            return Thread.VolatileRead(ref location);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        public static long VolatileRead(ref long location)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            return Volatile.Read(ref location);
-#else
-            return Thread.VolatileRead(ref location);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        [CLSCompliant(false)]
-        public static ulong VolatileRead(ref ulong location)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            return Volatile.Read(ref location);
-#else
-            return Thread.VolatileRead(ref location);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        public static IntPtr VolatileRead(ref IntPtr location)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            return Volatile.Read(ref location);
-#else
-            return Thread.VolatileRead(ref location);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        [CLSCompliant(false)]
-        public static UIntPtr VolatileRead(ref UIntPtr location)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            return Volatile.Read(ref location);
-#else
-            return Thread.VolatileRead(ref location);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        public static float VolatileRead(ref float location)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            return Volatile.Read(ref location);
-#else
-            return Thread.VolatileRead(ref location);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        public static double VolatileRead(ref double location)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            return Volatile.Read(ref location);
-#else
-            return Thread.VolatileRead(ref location);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        public static T VolatileRead<T>(ref T location)
+        public static sbyte VolatileRead(ref sbyte address)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            return Volatile.Read(ref address);
+#else
+            return Thread.VolatileRead(ref address);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        public static byte VolatileRead(ref byte address)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            return Volatile.Read(ref address);
+#else
+            return Thread.VolatileRead(ref address);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        public static void VolatileRead(ref short address)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            Volatile.Read(ref address);
+#else
+            Thread.VolatileRead(ref address);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        [CLSCompliant(false)]
+        public static ushort VolatileRead(ref ushort address)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            return Volatile.Read(ref address);
+#else
+            return Thread.VolatileRead(ref address);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        public static int VolatileRead(ref int address)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            return Volatile.Read(ref address);
+#else
+            return Thread.VolatileRead(ref address);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        [CLSCompliant(false)]
+        public static uint VolatileRead(ref uint address)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            return Volatile.Read(ref address);
+#else
+            return Thread.VolatileRead(ref address);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        public static long VolatileRead(ref long address)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            return Volatile.Read(ref address);
+#else
+            return Thread.VolatileRead(ref address);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        [CLSCompliant(false)]
+        public static ulong VolatileRead(ref ulong address)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            return Volatile.Read(ref address);
+#else
+            return Thread.VolatileRead(ref address);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        public static IntPtr VolatileRead(ref IntPtr address)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            return Volatile.Read(ref address);
+#else
+            return Thread.VolatileRead(ref address);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        [CLSCompliant(false)]
+        public static UIntPtr VolatileRead(ref UIntPtr address)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            return Volatile.Read(ref address);
+#else
+            return Thread.VolatileRead(ref address);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        public static float VolatileRead(ref float address)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            return Volatile.Read(ref address);
+#else
+            return Thread.VolatileRead(ref address);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        public static double VolatileRead(ref double address)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            return Volatile.Read(ref address);
+#else
+            return Thread.VolatileRead(ref address);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        public static T VolatileRead<T>(ref T address)
             where T : class?
         {
 #if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            return Volatile.Read(ref location);
-#else
-            return Interlocked.CompareExchange(ref location, location, location);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        [return: NotNullIfNotNull("location")]
-        public static object? VolatileRead(ref object? location)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            return Volatile.Read(ref location);
-#else
-            return Thread.VolatileRead(ref location);
+            return Volatile.Read(ref address);
+#else
+            return Interlocked.CompareExchange(ref address, address, address);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        [return: NotNullIfNotNull("address")]
+        public static object? VolatileRead(ref object? address)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            return Volatile.Read(ref address);
+#else
+            return Thread.VolatileRead(ref address);
 #endif
         }

@@ -187,160 +187,160 @@

         [MethodImpl(MethodImplOptionsEx.NoInlining)]
 #endif
-        public static void VolatileWrite(ref bool location, bool value)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            Volatile.Write(ref location, value);
-#else
-            GC.KeepAlive(location);
+        public static void VolatileWrite(ref bool address, bool value)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            Volatile.Write(ref address, value);
+#else
+            GC.KeepAlive(address);
             Thread.MemoryBarrier();
-            location = value;
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        [CLSCompliant(false)]
-        public static void VolatileWrite(ref sbyte location, sbyte value)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            Volatile.Write(ref location, value);
-#else
-            Thread.VolatileWrite(ref location, value);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        public static void VolatileWrite(ref byte location, byte value)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            Volatile.Write(ref location, value);
-#else
-            Thread.VolatileWrite(ref location, value);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        public static void VolatileWrite(ref short location, short value)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            Volatile.Write(ref location, value);
-#else
-            Thread.VolatileWrite(ref location, value);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        [CLSCompliant(false)]
-        public static void VolatileWrite(ref ushort location, ushort value)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            Volatile.Write(ref location, value);
-#else
-            Thread.VolatileWrite(ref location, value);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        public static void VolatileWrite(ref int location, int value)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            Volatile.Write(ref location, value);
-#else
-            Thread.VolatileWrite(ref location, value);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        [CLSCompliant(false)]
-        public static void VolatileWrite(ref uint location, uint value)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            Volatile.Write(ref location, value);
-#else
-            Thread.VolatileWrite(ref location, value);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        public static void VolatileWrite(ref long location, long value)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            Volatile.Write(ref location, value);
-#else
-            Thread.VolatileWrite(ref location, value);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        [CLSCompliant(false)]
-        public static void VolatileWrite(ref ulong location, ulong value)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            Volatile.Write(ref location, value);
-#else
-            Thread.VolatileWrite(ref location, value);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        public static void VolatileWrite(ref IntPtr location, IntPtr value)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            Volatile.Write(ref location, value);
-#else
-            Thread.VolatileWrite(ref location, value);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        [CLSCompliant(false)]
-        public static void VolatileWrite(ref UIntPtr location, UIntPtr value)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            Volatile.Write(ref location, value);
-#else
-            Thread.VolatileWrite(ref location, value);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        public static void VolatileWrite(ref float location, float value)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            Volatile.Write(ref location, value);
-#else
-            Thread.VolatileWrite(ref location, value);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        public static void VolatileWrite(ref double location, double value)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            Volatile.Write(ref location, value);
-#else
-            Thread.VolatileWrite(ref location, value);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        public static void VolatileWrite<T>(ref T location, T value)
+            address = value;
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        [CLSCompliant(false)]
+        public static void VolatileWrite(ref sbyte address, sbyte value)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            Volatile.Write(ref address, value);
+#else
+            Thread.VolatileWrite(ref address, value);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        public static void VolatileWrite(ref byte address, byte value)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            Volatile.Write(ref address, value);
+#else
+            Thread.VolatileWrite(ref address, value);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        public static void VolatileWrite(ref short address, short value)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            Volatile.Write(ref address, value);
+#else
+            Thread.VolatileWrite(ref address, value);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        [CLSCompliant(false)]
+        public static void VolatileWrite(ref ushort address, ushort value)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            Volatile.Write(ref address, value);
+#else
+            Thread.VolatileWrite(ref address, value);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        public static void VolatileWrite(ref int address, int value)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            Volatile.Write(ref address, value);
+#else
+            Thread.VolatileWrite(ref address, value);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        [CLSCompliant(false)]
+        public static void VolatileWrite(ref uint address, uint value)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            Volatile.Write(ref address, value);
+#else
+            Thread.VolatileWrite(ref address, value);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        public static void VolatileWrite(ref long address, long value)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            Volatile.Write(ref address, value);
+#else
+            Thread.VolatileWrite(ref address, value);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        [CLSCompliant(false)]
+        public static void VolatileWrite(ref ulong address, ulong value)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            Volatile.Write(ref address, value);
+#else
+            Thread.VolatileWrite(ref address, value);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        public static void VolatileWrite(ref IntPtr address, IntPtr value)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            Volatile.Write(ref address, value);
+#else
+            Thread.VolatileWrite(ref address, value);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        [CLSCompliant(false)]
+        public static void VolatileWrite(ref UIntPtr address, UIntPtr value)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            Volatile.Write(ref address, value);
+#else
+            Thread.VolatileWrite(ref address, value);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        public static void VolatileWrite(ref float address, float value)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            Volatile.Write(ref address, value);
+#else
+            Thread.VolatileWrite(ref address, value);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        public static void VolatileWrite(ref double address, double value)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            Volatile.Write(ref address, value);
+#else
+            Thread.VolatileWrite(ref address, value);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        public static void VolatileWrite<T>(ref T address, T value)
             where T : class?
         {
 #if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            Volatile.Write(ref location, value);
-#else
-            Interlocked.Exchange(ref location, value);
-#endif
-        }
-
-        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
-        public static void VolatileWrite(ref object? location, object? value)
-        {
-#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
-            Volatile.Write(ref location, value);
-#else
-            Thread.VolatileWrite(ref location, value);
+            Volatile.Write(ref address, value);
+#else
+            Interlocked.Exchange(ref address, value);
+#endif
+        }
+
+        [MethodImpl(MethodImplOptionsEx.AggressiveInlining)]
+        public static void VolatileWrite(ref object? address, object? value)
+        {
+#if LESSTHAN_NETSTANDARD20 || LESSTHAN_NETCOREAPP20
+            Volatile.Write(ref address, value);
+#else
+            Thread.VolatileWrite(ref address, value);
 #endif
         }
     }


Fixed rod lumped mass matrix

Fixed rod lumped mass matrix

--- ISAAR.MSolve.PreProcessor/Elements/Rod2D.cs
+++ ISAAR.MSolve.PreProcessor/Elements/Rod2D.cs
@@ -86,23 +86,16 @@
             double x2 = Math.Pow(element.Nodes[1].X - element.Nodes[0].X, 2);
             double y2 = Math.Pow(element.Nodes[1].Y - element.Nodes[0].Y, 2);
             double L = Math.Sqrt(x2 + y2);
-            double L2 = L * L;
-            double c = (element.Nodes[1].X - element.Nodes[0].X) / L;
-            double c2 = c * c;
-            double s = (element.Nodes[1].Y - element.Nodes[0].Y) / L;
-            double s2 = s * s;
-            double dAL420 = Density * SectionArea * L / 420;
+
+            double totalMass = Density * SectionArea * L;

-            double totalMass = Density * SectionArea * L;
-            double totalMassOfDiagonalTerms = 2 * dAL420 * (140 * c2 + 156 * s2) + 2 * dAL420 * (140 * s2 + 156 * c2);
-            double scale = totalMass / totalMassOfDiagonalTerms;
-
-            return new SymmetricMatrix2D<double>(new double[] { dAL420*(140*c2+156*s2)*scale, 0, 0, 0, 0, 0,
-                dAL420*(140*s2+156*c2)*scale, 0, 0, 0, 0,
-                0, 0, 0, 0,
-                dAL420*(140*c2+156*s2)*scale, 0, 0,
-                dAL420*(140*s2+156*c2)*scale, 0,
-                0 });
+            return new Matrix2D<double>(new double[,]
+            {
+                { totalMass/2,0,0,0},
+                {0,totalMass/2,0,0 },
+                {0,0,totalMass/2,0 },
+                {0,0,0,totalMass/2 }
+            });
         }

         public IMatrix2D<double> DampingMatrix(Element element)


Bug fixed: Wiki削除時に関連するレコードが削除されない問題を解消。

--- Implem.Pleasanter/Models/Wikis/WikiModel.cs
+++ Implem.Pleasanter/Models/Wikis/WikiModel.cs
@@ -285,6 +285,9 @@
             return Error.Types.None;
         }

+        /// <summary>
+        /// Fixed:
+        /// </summary>
         public Error.Types Delete(bool notice = false)
         {
             Rds.ExecuteNonQuery(
@@ -294,7 +297,11 @@
                     Rds.DeleteItems(
                         where: Rds.ItemsWhere().ReferenceId(WikiId)),
                     Rds.DeleteWikis(
-                        where: Rds.WikisWhere().SiteId(SiteId).WikiId(WikiId))
+                        where: Rds.WikisWhere().SiteId(SiteId).WikiId(WikiId)),
+                    Rds.DeleteItems(
+                        where: Rds.ItemsWhere().ReferenceId(SiteId)),
+                    Rds.DeleteSites(
+                        where: Rds.SitesWhere().SiteId(SiteId))
                 });
             if (notice) Notice("Deleted");
             return Error.Types.None;
@@ -486,26 +493,5 @@
                 Title.DisplayValue = WikiUtilities.TitleDisplayValue(SiteSettings, this);
             }
         }
-
-        /// <summary>
-        /// Fixed:
-        /// </summary>
-        public Error.Types Delete()
-        {
-            Rds.ExecuteNonQuery(
-                transactional: true,
-                statements: new SqlStatement[]
-                {
-                    Rds.DeleteItems(
-                        where: Rds.ItemsWhere().ReferenceId(WikiId)),
-                    Rds.DeleteWikis(
-                        where: Rds.WikisWhere().SiteId(SiteId).WikiId(WikiId)),
-                    Rds.DeleteItems(
-                        where: Rds.ItemsWhere().ReferenceId(SiteId)),
-                    Rds.DeleteSites(
-                        where: Rds.SitesWhere().SiteId(SiteId))
-                });
-            return Error.Types.None;
-        }
     }
 }


implement setting customer group

implement setting customer group

--- InvisibleCollectorLib/InvisibleCollector.cs
+++ InvisibleCollectorLib/InvisibleCollector.cs
@@ -427,6 +427,20 @@
             return ret;
         }

+        public async Task<Group> SetCustomerToGroup(string customerId, string groupId)
+        {
+            _logger.LogDebug($"Making request to get set customer ({customerId}) to group ({groupId})");
+
+            var requestUri = _uriBuilder.Clone()
+                .WithPath("groups", groupId, "customers", customerId)
+                .BuildUri();
+            var json = await _apiFacade.CallUrlEncodedToJsonApi(requestUri, "POST");
+            var ret = _jsonFacade.JsonToObject<Group>(json);
+
+            _logger.LogDebug("Added customer {Customer} to group: {Models}",  customerId, ret);
+            return ret;
+        }
+
         public async Task<IList<Customer>> GetFindCustomers(FindCustomers findCustomers)
         {
             _logger.LogDebug("Making request to find customers with the following info: {Model}", findCustomers);


Upgraded PHP Diag to match PHP Manager.

Upgraded PHP Diag to match PHP Manager.

--- JexusManager/Features/Main/PhpDiagDialog.cs
+++ JexusManager/Features/Main/PhpDiagDialog.cs
@@ -27,15 +27,15 @@
     {
         private struct PhpVersion
         {
-            public PhpVersion(string version, bool recommended, Version cppVersion)
+            public PhpVersion(string version, DateTime expiringDate, Version cppVersion)
             {
                 Version = version;
-                Recommended = recommended;
+                ExpiringDate = expiringDate;
                 CppVersion = cppVersion;
             }

             public string Version { get; set; }
-            public bool Recommended { get; set; }
+            public DateTime ExpiringDate { get; set; }
             public Version CppVersion { get; set; }
         }

@@ -46,10 +46,10 @@

             var knownPhpVersions = new Dictionary<string, PhpVersion>
             {
-                { "5.6", new PhpVersion("5.6", false, new Version(11, 0)) },
-                { "7.0", new PhpVersion("7.0", false, new Version(14, 0)) },
-                { "7.1", new PhpVersion("7.1", true, new Version(14, 0)) },
-                { "7.2", new PhpVersion("7.2", true, new Version(14, 11)) }
+                { "5.6", new PhpVersion("5.6", new DateTime(2018, 12, 31), new Version(11, 0)) },
+                { "7.0", new PhpVersion("7.0", new DateTime(2018, 12, 3), new Version(14, 0)) },
+                { "7.1", new PhpVersion("7.1", new DateTime(2019, 12, 1), new Version(14, 0)) },
+                { "7.2", new PhpVersion("7.2", new DateTime(2020, 11, 30), new Version(14, 11)) }
             };

             var container = new CompositeDisposable();
@@ -96,12 +96,6 @@
                                 Debug($"* Found FastCGI handler as {{ Name: {item.Name}, Path: {item.Path}, State: {item.GetState(handlers.AccessPolicy)}, Handler: {item.TypeString}, Entry Type: {item.Flag} }}.");
                                 foundPhpHandler.Add(item);
                             }
-
-                            //if (string.Equals(item.Path, "*.php", StringComparison.OrdinalIgnoreCase))
-                            //{
-                            //    Debug($"* Found PHP handler as {{ Name: {item.Name}, Path: {item.Path}, State: {item.GetState(handlers.AccessPolicy)}, Handler: {item.TypeString}, Entry Type: {item.Flag} }}.");
-                            //    foundPhpHandler = true;
-                            //}
                         }

                         if (foundPhpHandler.Count == 0)
@@ -151,32 +145,39 @@
                                 var version = $"{info.FileMajorPart}.{info.FileMinorPart}";
                                 if (knownPhpVersions.ContainsKey(version))
                                 {
-                                    var php = knownPhpVersions[version];
-                                    if (php.Recommended)
+                                    var matched = knownPhpVersions[version];
+                                    if (matched.ExpiringDate <= DateTime.Now)
+                                    {
+                                        Error($"* PHP {info.FileVersion} ({path}) is unknown or obsolete. Please refer to http://php.net/supported-versions.php for more details.");
+                                    }
+                                    else if (matched.ExpiringDate > DateTime.Now && (matched.ExpiringDate - DateTime.Now).TotalDays < 180)
+                                    {
+                                        Warn($"* PHP {version} ({path}) will soon be obsolete. Please refer to http://php.net/supported-versions.php for more details.");
+                                    }
+                                    else
                                     {
                                         Debug($"* PHP {version} ({path}) is supported.");
                                     }
-                                    else
-                                    {
-                                        Warn($"* PHP {version} ({path}) will soon be obsolete. Please refer to http://php.net/supported-versions.php for more details.");
-                                    }
-
-                                    var cppFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), $"msvcp{php.CppVersion.Major}0.dll");
+
+                                    var x86 = new PeNet.PeFile(path).Is32Bit;
+                                    var cppFile = Path.Combine(
+                                        Environment.GetFolderPath(x86 ? Environment.SpecialFolder.SystemX86 : Environment.SpecialFolder.System),
+                                        $"msvcp{matched.CppVersion.Major}0.dll");
                                     if (File.Exists(cppFile))
                                     {
                                         var cpp = FileVersionInfo.GetVersionInfo(cppFile);
-                                        if (cpp.FileMinorPart >= php.CppVersion.Minor)
+                                        if (cpp.FileMinorPart >= matched.CppVersion.Minor)
                                         {
-                                            Debug($"  Visual C++ runtime is detected (expected: {php.CppVersion}, detected: {cpp.FileVersion}).");
+                                            Debug($"  Visual C++ runtime is detected (expected: {matched.CppVersion}, detected: {cpp.FileVersion}).");
                                         }
                                         else
                                         {
-                                            Error($"  Visual C++ runtime {php.CppVersion} is not detected. Please install it following the tips on https://windows.php.net/download/.");
+                                            Error($"  Visual C++ runtime {matched.CppVersion} is not detected. Please install it following the tips on https://windows.php.net/download/.");
                                         }
                                     }
                                     else
                                     {
-                                        Error($"  Visual C++ {php.CppVersion} runtime is not detected. Please install it following the tips on https://windows.php.net/download/.");
+                                        Error($"  Visual C++ {matched.CppVersion} runtime is not detected. Please install it following the tips on https://windows.php.net/download/.");
                                     }
                                 }
                                 else


usings

usings

--- King.Service/Data/StorageQueueAutoScaler.cs
+++ King.Service/Data/StorageQueueAutoScaler.cs
@@ -1,10 +1,10 @@
 namespace King.Service.Data
 {
+    using System;
+    using System.Collections.Generic;
     using King.Azure.Data;
     using King.Service.Scalability;
     using King.Service.Timing;
-    using System;
-    using System.Collections.Generic;

     /// <summary>
     /// Storage Queue AutoScaler


Added an important .

Added an important .

--- FormFactory/FormHelperExtension.cs
+++ FormFactory/FormHelperExtension.cs
@@ -108,7 +108,7 @@
         public static IList<Func<Type, string>> SearchPathRules = new List<Func<Type, string>>()
         {
             t => t.FullName,
-            t => t.FullName.Substring(0, t.Assembly.FullName.Split(',')[0].Length),
+            t => t.FullName.Substring(0, t.Assembly.FullName.Split(',')[0].Length + 1),
             t => t.Name
         };
         public static string BestViewName(this ControllerContext cc, Type type, string prefix = null)


Library was updated

Library was updated

for "API has been refactored to optimize traffic"

--- src/device/HttpClient/HttpClient.cs
+++ src/device/HttpClient/HttpClient.cs
@@ -206,7 +206,7 @@
                 PutMethod,
                 device.id.ToString(),
                 device.key) as HttpWebResponse;
-            return  resp.StatusCode == HttpStatusCode.OK;
+            return resp.StatusCode == HttpStatusCode.OK || resp.StatusCode == HttpStatusCode.NoContent;
         }

         /// <summary>
@@ -387,8 +387,8 @@
                 PutMethod,
                 device.id.ToString(),
                 device.key) as HttpWebResponse;
-
-            return resp.StatusCode == HttpStatusCode.OK;
+
+            return resp.StatusCode == HttpStatusCode.OK || resp.StatusCode == HttpStatusCode.NoContent;
         }
     }
 }


Ajout commentaire fonction

Ajout commentaire fonction

--- projTut/Fonction.cs
+++ projTut/Fonction.cs
@@ -8,8 +8,18 @@
 {
     class Fonction : Procedure
     {
+        /// <summary>
+        /// Une fonction est une procédure ou la seul différence est qu'elle a une sortie
+        /// </summary>
         private Variable retour;

+        /// <summary>
+        /// Constructeur par défaut, reprise du constructeur de procédure avec ajout de variable de retour
+        /// </summary>
+        /// <param name="listeParametre">liste param lors de l'appel</param>
+        /// <param name="listeInstruction">liste instruction executé dans fonction</param>
+        /// <param name="nom">nom de la fonction</param>
+        /// <param name="retour">variable de retour</param>
         public Fonction(List<Parametre> listeParametre, List<Instruction> listeInstruction, string nom, Variable retour)
             :base(listeParametre, listeInstruction, nom)
         {


NaN vector

NaN vector

--- Fusion/Core/Mathematics/Vector3.cs
+++ Fusion/Core/Mathematics/Vector3.cs
@@ -128,6 +128,11 @@
         /// </summary>
         public static readonly Vector3 BackwardLH = new Vector3(0.0f, 0.0f, -1.0f);

+		/// <summary>
+		/// A NaN <see cref="Vector3"/>.
+		/// </summary>
+		public static readonly Vector3 NaN = new Vector3( float.NaN, float.NaN, float.NaN );
+
         /// <summary>
         /// The X component of the vector.
         /// </summary>
@@ -211,6 +216,14 @@
         public bool IsZero
         {
             get { return X == 0 && Y == 0 && Z == 0; }
+        }
+
+        /// <summary>
+        /// Gets a value indicting whether this vector is zero
+        /// </summary>
+        public bool IsNaN
+        {
+            get { return float.IsNaN(X) || float.IsNaN(Y) || float.IsNaN(Z); }
         }

         /// <summary>


Catch gameinfo deserializer exceptions

Catch gameinfo deserializer exceptions

--- GUI/Utils/AdvancedGuiFileLoader.cs
+++ GUI/Utils/AdvancedGuiFileLoader.cs
@@ -157,7 +157,15 @@

             using (var stream = new FileStream(gameinfoPath, FileMode.Open, FileAccess.Read))
             {
-                gameInfo = KVSerializer.Create(KVSerializationFormat.KeyValues1Text).Deserialize(stream);
+                try
+                {
+                    gameInfo = KVSerializer.Create(KVSerializationFormat.KeyValues1Text).Deserialize(stream);
+                }
+                catch (Exception e)
+                {
+                    Console.Error.WriteLine(e);
+                    return;
+                }
             }

             Console.WriteLine($"Found \"{gameInfo["game"]}\" from \"{gameinfoPath}\"");


configure a low metric for the TAP device, to ensure its DNS servers are used

--- tools/OutlineService/OutlineService/OutlineService.cs
+++ tools/OutlineService/OutlineService/OutlineService.cs
@@ -224,6 +224,25 @@
       }
       eventLog.WriteEntry($"Got system gateway IP {systemGatewayIp.ToString()}");

+      // Set a low device metric for the TAP device, to ensure the system
+      // favours the (non-filtered) DNS server(s) associated with the TAP
+      // device:
+      //   https://github.com/Jigsaw-Code/outline-client/issues/191
+      //
+      // Note:
+      //  - This is *not* necessary to ensure that traffic is routed via the
+      //    proxy (though it does make the output of "route print" easier to
+      //    grok).
+      //  - We could, on disconnection, reset the device metric to auto but
+      //    since the TAP device is essentially unused unless the VPN
+      //    connection is active, there doesn't seem to be a big reason to do
+      //    so. To do it manually:
+      //      netsh interface ip set interface outline-tap0 metric=auto
+      //  - To show the metrics of all interfaces:
+      //      netsh interface ip show interface
+      RunCommand(CMD_NETSH, string.Format("interface ip set interface {0} metric=0", TAP_DEVICE_NAME));
+      eventLog.WriteEntry("Configured low TAP device metric", EventLogEntryType.Information);
+
       // Proxy routing: the proxy's IP address should be the only one that bypasses the router.
       // Save the best interface index for the proxy's address before we add the route. This
       // is necessary for updating the proxy route when the network changes; otherwise we get the


Added SelectMany proxies

Added SelectMany proxies

--- LordJZ/Linq/Enumerable.SystemLinqProxies.cs
+++ LordJZ/Linq/Enumerable.SystemLinqProxies.cs
@@ -140,5 +140,25 @@
         {
             return System.Linq.Enumerable.ThenByDescending(source, keySelector, comparer);
         }
+
+	    public static IEnumerable<TResult> SelectMany<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, int, IEnumerable<TResult>> selector)
+	    {
+		    return System.Linq.Enumerable.SelectMany(source, selector);
+	    }
+
+        public static IEnumerable<TResult> SelectMany<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, IEnumerable<TResult>> selector)
+        {
+            return System.Linq.Enumerable.SelectMany(source, selector);
+        }
+        public static IEnumerable<TResult> SelectMany<TSource, TCollection, TResult>(this IEnumerable<TSource> source, Func<TSource, IEnumerable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)
+        {
+            return System.Linq.Enumerable.SelectMany(source, collectionSelector, resultSelector);
+
+        }
+
+        public static IEnumerable<TResult> SelectMany<TSource, TCollection, TResult>(this IEnumerable<TSource> source, Func<TSource, int, IEnumerable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)
+	    {
+		    return System.Linq.Enumerable.SelectMany(source, collectionSelector, resultSelector);
+	    }
     }
 }


Changes directions

Changes directions

--- ML.TypingClassifier/Views/Home/Index.cshtml
+++ ML.TypingClassifier/Views/Home/Index.cshtml
@@ -153,7 +153,7 @@
     <input id="email" type="email" />

-
Please submit the following input into our Freudian Psychoanalyzer:

+
Please submit the following input exactly as written into our Freudian Psychoanalyzer:

       @Model.Text


calling Test RussiaPolyline via Triangulation

--- GraphLayout/Test/Test01/Program.cs
+++ GraphLayout/Test/Test01/Program.cs
@@ -89,6 +89,8 @@
 #if DEBUG
             DisplayGeometryGraph.SetShowFunctions();
 #endif
+
+						Triangulation(true);//FR
             ArgsParser.ArgsParser argsParser = SetArgsParser(args);

             if (argsParser.OptionIsUsed(PolygonDistanceTestOption))


Synchronized test assembly version.

Synchronized test assembly version.

--- MigSharpSQL.Test/Properties/AssemblyInfo.cs
+++ MigSharpSQL.Test/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("0.1.0.0")]
+[assembly: AssemblyFileVersion("0.1.0.0")]


resized fonts for browser diagnostics

resized fonts for browser diagnostics

--- MileageStats.Web/Views/Browser/Index.cshtml
+++ MileageStats.Web/Views/Browser/Index.cshtml
@@ -12,22 +12,22 @@

         <title>Browser Capabilities</title>
+

-

-

-                    Capability
-                    Value
-

+

                 @foreach (var key in keysList)
                 {
-

-                    @key
-                    @Model[key]
-

+
@key:@Model[key]

                 }
-

+


"Back to List" link will be only  shown for "physician" role.

--- MyClinic/MyClinic/Views/Patient/File.cshtml
+++ MyClinic/MyClinic/Views/Patient/File.cshtml
@@ -13,7 +13,10 @@

-        @Html.ActionLink("Back to List", "Index")
+        @if (User.IsInRole("physician"))
+        {
+            @Html.ActionLink("Back to List", "Index")
+        }


Return the correct amount of data

Return the correct amount of data

--- NET/API/Treehopper.Desktop/UsbConnection.cs
+++ NET/API/Treehopper.Desktop/UsbConnection.cs
@@ -181,7 +181,8 @@
             int transferLength;
             if (peripheralReceive != null)
                 peripheralReceive.Read(returnVal, 1000, out transferLength);
-            return returnVal;
+            Array.Copy(returnVal, retVal, bytesToRead);
+            return retVal;
         }

         internal void Disconnect()


library: increment minor version

library: increment minor version

--- unity/library/UtyMap.Unity/Properties/AssemblyInfo.cs
+++ unity/library/UtyMap.Unity/Properties/AssemblyInfo.cs
@@ -5,8 +5,8 @@
 [assembly: AssemblyTitle("UtyMap.Unity")]
 [assembly: AssemblyDescription("UtyMap for Unity3D")]
 [assembly: AssemblyProduct("UtyMap.Unity")]
-[assembly: AssemblyCopyright("Copyright © Ilya Builuk, 2014-2016")]
-[assembly: AssemblyVersion("2.1.*")]
+[assembly: AssemblyCopyright("Copyright © Ilya Builuk, 2014-2017")]
+[assembly: AssemblyVersion("2.2.*")]

 [assembly: ComVisible(false)]


Add breadcrumb level mappings

Add breadcrumb level mappings

--- osu.Game/Utils/SentryLogger.cs
+++ osu.Game/Utils/SentryLogger.cs
@@ -95,10 +95,31 @@
                 });
             }
             else
-                SentrySdk.AddBreadcrumb(entry.Message, entry.Target.ToString(), "navigation");
+                SentrySdk.AddBreadcrumb(entry.Message, entry.Target.ToString(), "navigation", level: getBreadcrumbLevel(entry.Level));
         }

-        private SentryLevel? getSentryLevel(LogLevel entryLevel)
+        private BreadcrumbLevel getBreadcrumbLevel(LogLevel entryLevel)
+        {
+            switch (entryLevel)
+            {
+                case LogLevel.Debug:
+                    return BreadcrumbLevel.Debug;
+
+                case LogLevel.Verbose:
+                    return BreadcrumbLevel.Info;
+
+                case LogLevel.Important:
+                    return BreadcrumbLevel.Warning;
+
+                case LogLevel.Error:
+                    return BreadcrumbLevel.Error;
+
+                default:
+                    throw new ArgumentOutOfRangeException(nameof(entryLevel), entryLevel, null);
+            }
+        }
+
+        private SentryLevel getSentryLevel(LogLevel entryLevel)
         {
             switch (entryLevel)
             {


Centralized string encoding in WalletType.

--- wrappers/dotnet/indy-sdk-dotnet/Wrapper/WalletType.cs
+++ wrappers/dotnet/indy-sdk-dotnet/Wrapper/WalletType.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Runtime.InteropServices;
+using System.Text;
 using static Indy.Sdk.Dotnet.IndyNativeMethods;

 namespace Indy.Sdk.Dotnet.Wrapper
@@ -157,7 +158,7 @@
                 if (result != ErrorCode.Success)
                     return result;

-                valuePtr = Marshal.StringToHGlobalAnsi(value);
+                valuePtr = MarshalToUnmanaged(value);
                 wallet.ValuePointers.Add(valuePtr);

                 return ErrorCode.Success;
@@ -187,7 +188,7 @@
                 if (result != ErrorCode.Success)
                     return result;

-                valuePtr = Marshal.StringToHGlobalAnsi(value);
+                valuePtr = MarshalToUnmanaged(value);
                 wallet.ValuePointers.Add(valuePtr);

                 return ErrorCode.Success;
@@ -217,7 +218,7 @@
                 if (result != ErrorCode.Success)
                     return result;

-                valuesJsonPtr = Marshal.StringToHGlobalAnsi(value);
+                valuesJsonPtr = MarshalToUnmanaged(value);
                 wallet.ValuePointers.Add(valuesJsonPtr);

                 return ErrorCode.Success;
@@ -285,6 +286,21 @@
                 return ErrorCode.CommonInvalidState;
             }

+        }
+
+        /// <summary>
+        /// Marshals a string to unmanaged memory.
+        /// </summary>
+        /// <param name="value">The string value to marshal.</param>
+        /// <returns>A pointer to the unmanaged memory.</returns>
+        private IntPtr MarshalToUnmanaged(string value)
+        {
+            byte[] buffer = Encoding.UTF8.GetBytes(value); // not null terminated
+            Array.Resize(ref buffer, buffer.Length + 1);
+            buffer[buffer.Length - 1] = 0; // terminating 0
+            IntPtr unmanagedMemoryPtr = Marshal.AllocHGlobal(buffer.Length);
+            Marshal.Copy(buffer, 0, unmanagedMemoryPtr, buffer.Length);
+            return unmanagedMemoryPtr;
         }

         /// <summary>


Possibly finished form layout

Possibly finished form layout

--- ANN_Traffic/ANN_Traffic-Presentation/Form1.Designer.cs
+++ ANN_Traffic/ANN_Traffic-Presentation/Form1.Designer.cs
@@ -47,9 +47,20 @@
             this.comboBoxSimulationSpeed = new System.Windows.Forms.ComboBox();
             this.groupBox2 = new System.Windows.Forms.GroupBox();
             this.checkBoxDraw = new System.Windows.Forms.CheckBox();
-            this.panelTrafficDraw = new System.Windows.Forms.Panel();
+            this.panelTrafficDrawArea = new System.Windows.Forms.Panel();
+            this.groupBoxANN = new System.Windows.Forms.GroupBox();
+            this.labelBestFitness = new System.Windows.Forms.Label();
+            this.labelValBestFitness = new System.Windows.Forms.Label();
+            this.labelAchieved = new System.Windows.Forms.Label();
+            this.labelValAchieved = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.labelValCurrentGen = new System.Windows.Forms.Label();
+            this.labelValOrganismInGen = new System.Windows.Forms.Label();
+            this.labelOrganismInGen = new System.Windows.Forms.Label();
+            this.panelANNDrawArea = new System.Windows.Forms.Panel();
             this.groupBox1.SuspendLayout();
             this.groupBox2.SuspendLayout();
+            this.groupBoxANN.SuspendLayout();
             this.SuspendLayout();
             //
             // buttonStop
@@ -259,7 +270,7 @@
             //
             // groupBox2
             //
-            this.groupBox2.Controls.Add(this.panelTrafficDraw);
+            this.groupBox2.Controls.Add(this.panelTrafficDrawArea);
             this.groupBox2.Location = new System.Drawing.Point(313, 12);
             this.groupBox2.Name = "groupBox2";
             this.groupBox2.Size = new System.Drawing.Size(457, 317);
@@ -279,20 +290,123 @@
             this.checkBoxDraw.Text = "Draw?";
             this.checkBoxDraw.UseVisualStyleBackColor = true;
             //
-            // panelTrafficDraw
-            //
-            this.panelTrafficDraw.BackColor = System.Drawing.Color.Green;
-            this.panelTrafficDraw.Location = new System.Drawing.Point(7, 22);
-            this.panelTrafficDraw.Name = "panelTrafficDraw";
-            this.panelTrafficDraw.Size = new System.Drawing.Size(444, 289);
-            this.panelTrafficDraw.TabIndex = 0;
+            // panelTrafficDrawArea
+            //
+            this.panelTrafficDrawArea.BackColor = System.Drawing.Color.Green;
+            this.panelTrafficDrawArea.Location = new System.Drawing.Point(7, 22);
+            this.panelTrafficDrawArea.Name = "panelTrafficDrawArea";
+            this.panelTrafficDrawArea.Size = new System.Drawing.Size(444, 289);
+            this.panelTrafficDrawArea.TabIndex = 0;
+            //
+            // groupBoxANN
+            //
+            this.groupBoxANN.Controls.Add(this.panelANNDrawArea);
+            this.groupBoxANN.Controls.Add(this.labelValOrganismInGen);
+            this.groupBoxANN.Controls.Add(this.labelOrganismInGen);
+            this.groupBoxANN.Controls.Add(this.labelValCurrentGen);
+            this.groupBoxANN.Controls.Add(this.label1);
+            this.groupBoxANN.Controls.Add(this.labelValAchieved);
+            this.groupBoxANN.Controls.Add(this.labelAchieved);
+            this.groupBoxANN.Controls.Add(this.labelValBestFitness);
+            this.groupBoxANN.Controls.Add(this.labelBestFitness);
+            this.groupBoxANN.Location = new System.Drawing.Point(12, 335);
+            this.groupBoxANN.Name = "groupBoxANN";
+            this.groupBoxANN.Size = new System.Drawing.Size(757, 354);
+            this.groupBoxANN.TabIndex = 6;
+            this.groupBoxANN.TabStop = false;
+            this.groupBoxANN.Text = "ANN";
+            //
+            // labelBestFitness
+            //
+            this.labelBestFitness.AutoSize = true;
+            this.labelBestFitness.Location = new System.Drawing.Point(366, 18);
+            this.labelBestFitness.Name = "labelBestFitness";
+            this.labelBestFitness.Size = new System.Drawing.Size(89, 17);
+            this.labelBestFitness.TabIndex = 0;
+            this.labelBestFitness.Text = "Best Fitness:";
+            //
+            // labelValBestFitness
+            //
+            this.labelValBestFitness.AutoSize = true;
+            this.labelValBestFitness.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.labelValBestFitness.Location = new System.Drawing.Point(461, 18);
+            this.labelValBestFitness.Name = "labelValBestFitness";
+            this.labelValBestFitness.Size = new System.Drawing.Size(35, 17);
+            this.labelValBestFitness.TabIndex = 1;
+            this.labelValBestFitness.Text = "100";
+            //
+            // labelAchieved
+            //
+            this.labelAchieved.AutoSize = true;
+            this.labelAchieved.Location = new System.Drawing.Point(539, 18);
+            this.labelAchieved.Name = "labelAchieved";
+            this.labelAchieved.Size = new System.Drawing.Size(116, 17);
+            this.labelAchieved.TabIndex = 2;
+            this.labelAchieved.Text = "Achieved in Gen:";
+            //
+            // labelValAchieved
+            //
+            this.labelValAchieved.AutoSize = true;
+            this.labelValAchieved.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.labelValAchieved.Location = new System.Drawing.Point(661, 18);
+            this.labelValAchieved.Name = "labelValAchieved";
+            this.labelValAchieved.Size = new System.Drawing.Size(26, 17);
+            this.labelValAchieved.TabIndex = 3;
+            this.labelValAchieved.Text = "34";
+            //
+            // label1
+            //
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(16, 18);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(90, 17);
+            this.label1.TabIndex = 4;
+            this.label1.Text = "Current Gen:";
+            //
+            // labelValCurrentGen
+            //
+            this.labelValCurrentGen.AutoSize = true;
+            this.labelValCurrentGen.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.labelValCurrentGen.Location = new System.Drawing.Point(112, 18);
+            this.labelValCurrentGen.Name = "labelValCurrentGen";
+            this.labelValCurrentGen.Size = new System.Drawing.Size(26, 17);
+            this.labelValCurrentGen.TabIndex = 5;
+            this.labelValCurrentGen.Text = "45";
+            //
+            // labelValOrganismInGen
+            //
+            this.labelValOrganismInGen.AutoSize = true;
+            this.labelValOrganismInGen.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.labelValOrganismInGen.Location = new System.Drawing.Point(305, 18);
+            this.labelValOrganismInGen.Name = "labelValOrganismInGen";
+            this.labelValOrganismInGen.Size = new System.Drawing.Size(17, 17);
+            this.labelValOrganismInGen.TabIndex = 7;
+            this.labelValOrganismInGen.Text = "6";
+            //
+            // labelOrganismInGen
+            //
+            this.labelOrganismInGen.AutoSize = true;
+            this.labelOrganismInGen.Location = new System.Drawing.Point(180, 18);
+            this.labelOrganismInGen.Name = "labelOrganismInGen";
+            this.labelOrganismInGen.Size = new System.Drawing.Size(119, 17);
+            this.labelOrganismInGen.TabIndex = 6;
+            this.labelOrganismInGen.Text = "Organism in Gen:";
+            //
+            // panelANNDrawArea
+            //
+            this.panelANNDrawArea.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(128)))));
+            this.panelANNDrawArea.Location = new System.Drawing.Point(9, 39);
+            this.panelANNDrawArea.Name = "panelANNDrawArea";
+            this.panelANNDrawArea.Size = new System.Drawing.Size(742, 309);
+            this.panelANNDrawArea.TabIndex = 8;
             //
             // FormAnnTrafficMain
             //
             this.AcceptButton = this.buttonStart;
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(781, 514);
+            this.ClientSize = new System.Drawing.Size(781, 694);
+            this.Controls.Add(this.groupBoxANN);
             this.Controls.Add(this.groupBox2);
             this.Controls.Add(this.groupBox1);
             this.Name = "FormAnnTrafficMain";
@@ -300,6 +414,8 @@
             this.groupBox1.ResumeLayout(false);
             this.groupBox1.PerformLayout();
             this.groupBox2.ResumeLayout(false);
+            this.groupBoxANN.ResumeLayout(false);
+            this.groupBoxANN.PerformLayout();
             this.ResumeLayout(false);

         }
@@ -325,7 +441,17 @@
         private System.Windows.Forms.ComboBox comboBoxCarSpeed;
         private System.Windows.Forms.CheckBox checkBoxDraw;
         private System.Windows.Forms.GroupBox groupBox2;
-        private System.Windows.Forms.Panel panelTrafficDraw;
+        private System.Windows.Forms.Panel panelTrafficDrawArea;
+        private System.Windows.Forms.GroupBox groupBoxANN;
+        private System.Windows.Forms.Label labelValOrganismInGen;
+        private System.Windows.Forms.Label labelOrganismInGen;
+        private System.Windows.Forms.Label labelValCurrentGen;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label labelValAchieved;
+        private System.Windows.Forms.Label labelAchieved;
+        private System.Windows.Forms.Label labelValBestFitness;
+        private System.Windows.Forms.Label labelBestFitness;
+        private System.Windows.Forms.Panel panelANNDrawArea;
     }
 }


Update

Update

--- Assets/[0]Framework/Processings/ProcessingSceneLoad.cs
+++ Assets/[0]Framework/Processings/ProcessingSceneLoad.cs
@@ -72,8 +72,7 @@

 		IEnumerator<float> _Load(string name)
 		{
-			Timing.KillCoroutines();
-
+
 			Toolbox.changingScene = true;

 			Toolbox.Instance.ClearSessionData();
@@ -110,13 +109,16 @@
 		{
 			var processing = Toolbox.Get<ProcessingSceneLoad>();
 			var name = processing.GetFromList(id);
-
+			Timing.KillCoroutines();
+
 			Timing.RunCoroutine(processing._Load(name));
 		}

 		public static void To(string name)
 		{
 			var processing = Toolbox.Get<ProcessingSceneLoad>();
+			Timing.KillCoroutines();
+
 			Timing.RunCoroutine(processing._Load(name));
 		}
 	}


Remove RC1 only code

Remove RC1 only code

--- Audiotica.Data.Collection/RunTime/CollectionService.cs
+++ Audiotica.Data.Collection/RunTime/CollectionService.cs
@@ -68,15 +68,9 @@
                 album.PrimaryArtist = artists.FirstOrDefault(p => p.Id == album.PrimaryArtistId);

                 if (isForeground)
-                    _dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
+                    _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                     {
                         var artworkPath = string.Format(CollectionConstant.ArtworkPath, album.Id);
-                        if (BetaChangelogHelper.JustUpdated)
-                        {
-                            album.HasArtwork = await StorageHelper.FileExistsAsync(artworkPath);
-                            await _sqlService.UpdateItemAsync(album);
-                        }
-
                         album.Artwork = album.HasArtwork
                             ? new BitmapImage(new Uri(CollectionConstant.LocalStorageAppPath + artworkPath))
                             : CollectionConstant.MissingArtworkImage;


Try another form handling

Try another form handling

--- Battery-Commander.Web/Controllers/ReportsController.cs
+++ Battery-Commander.Web/Controllers/ReportsController.cs
@@ -71,6 +71,7 @@
             return RedirectToAction(nameof(Index), new { unitId });
         }

+        [HttpPost]
         public async Task<IActionResult> Save(int unitId, ReportSettings settings)
         {
             // Remove any if existing


User Username instead of Id when getting permission

Remove a Replace \\ to !

--- Bonobo.Git.Server/Owin/WindowsAuthenticationHandler.cs
+++ Bonobo.Git.Server/Owin/WindowsAuthenticationHandler.cs
@@ -43,7 +43,7 @@
                         if (handshake.IsClientResponseValid(token))
                         {
                             properties = handshake.AuthenticationProperties;
-                            var uid = handshake.AuthenticatedUsername.Replace("\\", "!").ToLowerInvariant();
+                            var uid = handshake.AuthenticatedUsername;
                             var claimdelegate = Options.GetClaimsForUser(uid);


use generic FirstOrDefault algorithm

use generic FirstOrDefault algorithm

--- BuildingCoder/BuildingCoder/CmdCollectorPerformance.cs
+++ BuildingCoder/BuildingCoder/CmdCollectorPerformance.cs
@@ -699,16 +699,24 @@
         //  }
         //}

-        foreach( Level l in sorted_levels )
-        {
-          if( Util.IsLessOrEqual(
-            l.Elevation, element_z ) )
-          {
-            level = l;
-            break;
-          }
-        }
-        if( level == null )
+        // Improved algorithm picking
+        // closest level below or equal
+
+        //foreach( Level l in sorted_levels )
+        //{
+        //  if( Util.IsLessOrEqual(
+        //    l.Elevation, element_z ) )
+        //  {
+        //    level = l;
+        //    break;
+        //  }
+        //}
+
+        level = sorted_levels.FirstOrDefault(
+          l => Util.IsLessOrEqual(
+            l.Elevation, element_z ) );
+
+        if( null == level )
         {
           level = sorted_levels.Last();
         }


incremented version number

incremented version number

--- BuildingCoder/BuildingCoder/Properties/AssemblyInfo.cs
+++ BuildingCoder/BuildingCoder/Properties/AssemblyInfo.cs
@@ -228,5 +228,5 @@
 // 2018-04-05 2018.0.138.3 implemented RetrieveEdges for https://stackoverflow.com/questions/49651399/revit-api-filtering-elements-by-edges
 // 2018-04-05 2018.0.138.4 added GetFamilyXmlData by Håvard Dagsvik
 //
-[assembly: AssemblyVersion( "2018.0.138.3" )]
-[assembly: AssemblyFileVersion( "2018.0.138.3" )]
+[assembly: AssemblyVersion( "2018.0.138.4" )]
+[assembly: AssemblyFileVersion( "2018.0.138.4" )]


Fixed null reference exception loading calculation properties

--- ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook_Load.cs
+++ ClosedXML/ClosedXML/ClosedXML/Excel/XLWorkbook_Load.cs
@@ -87,13 +87,17 @@
             var date1904 = dSpreadsheet.WorkbookPart.Workbook.WorkbookProperties.Date1904;
             Use1904DateSystem = date1904 != null && date1904.Value;

-            var referenceMode = dSpreadsheet.WorkbookPart.Workbook.CalculationProperties.ReferenceMode;
-            if (referenceMode != null)
-                ReferenceStyle = referenceMode.Value.ToClosedXml();
-
-            var calculateMode = dSpreadsheet.WorkbookPart.Workbook.CalculationProperties.CalculationMode;
-            if (calculateMode != null)
-                CalculateMode = calculateMode.Value.ToClosedXml();
+            var calculationProperties = dSpreadsheet.WorkbookPart.Workbook.CalculationProperties;
+            if (calculationProperties != null)
+            {
+                var referenceMode = calculationProperties.ReferenceMode;
+                if (referenceMode != null)
+                    ReferenceStyle = referenceMode.Value.ToClosedXml();
+
+                var calculateMode = calculationProperties.CalculationMode;
+                if (calculateMode != null)
+                    CalculateMode = calculateMode.Value.ToClosedXml();
+            }

             if (dSpreadsheet.ExtendedFilePropertiesPart.Properties.Elements<Company>().Count() > 0)
                 Properties.Company = dSpreadsheet.ExtendedFilePropertiesPart.Properties.GetFirstChild<Company>().Text;


Bugfix in paging and help text fix

Bugfix in paging and help text fix

--- Core/OfficeDevPnP.Core/Framework/Graph/UsersUtility.cs
+++ Core/OfficeDevPnP.Core/Framework/Graph/UsersUtility.cs
@@ -21,7 +21,7 @@
         /// <param name="endIndex">Last item in the results returned by Microsoft Graph to return</param>
         /// <param name="retryCount">Number of times to retry the request in case of throttling</param>
         /// <param name="delay">Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry.</param>
-        /// <returns>List with User objects</returns>
+        /// <returns>User object</returns>
         public static Model.User GetUser(string accessToken, Guid userId, int startIndex = 0, int endIndex = 999, int retryCount = 10, int delay = 500)
         {
             return ListUsers(accessToken, $"id eq '{userId}'", null, startIndex, endIndex, retryCount, delay).FirstOrDefault();
@@ -105,7 +105,7 @@
                             }
                         }

-                        if (pagedUsers.NextPageRequest != null && users.Count < endIndex)
+                        if (pagedUsers.NextPageRequest != null && currentIndex < endIndex)
                         {
                             pagedUsers = await pagedUsers.NextPageRequest.GetAsync();
                         }


fixed path issue

fixed path issue

--- Cowboy.Sockets.WebSockets/WebSocketClientHandshaker.cs
+++ Cowboy.Sockets.WebSockets/WebSocketClientHandshaker.cs
@@ -36,7 +36,7 @@

             var sb = new StringBuilder();

-            sb.AppendFormatWithCrCf("GET {0} HTTP/1.1", client.Uri.Query);
+            sb.AppendFormatWithCrCf("GET {0} HTTP/1.1", !string.IsNullOrEmpty(client.Uri.PathAndQuery) ? client.Uri.PathAndQuery : "/");
             sb.AppendFormatWithCrCf("Host: {0}", client.Uri.Host);

             sb.AppendFormatWithCrCf("Upgrade: {0}", WebSocketUpgradeToken);


Verb fix

Verb fix

Setting properties directly works, but doesn't trigger the IDE to
update. Need to use transactions and tell the IDE we're changing stuff.

--- Cyotek.Windows.Forms.TabList/Design/TabListDesigner.cs
+++ Cyotek.Windows.Forms.TabList/Design/TabListDesigner.cs
@@ -194,7 +194,7 @@
             MemberDescriptor controlsProperty;

             page = (TabListPage)host.CreateComponent(typeof(TabListPage));
-            controlsProperty = TypeDescriptor.GetProperties(control)["Controls"];
+            controlsProperty = TypeDescriptor.GetProperties(control)[nameof(control.Controls)];

             // tell the designer we're about to start making changes
             this.RaiseComponentChanging(controlsProperty);
@@ -353,7 +353,7 @@
             {
               MemberDescriptor controlsProperty;

-              controlsProperty = TypeDescriptor.GetProperties(control)["Controls"];
+              controlsProperty = TypeDescriptor.GetProperties(control)[nameof(control.Controls)];

               // inform the designer we're about to make changes
               this.RaiseComponentChanging(controlsProperty);
@@ -361,7 +361,7 @@
               // remove the tab page
               host.DestroyComponent(control.SelectedPage);

-              // tell the designer w're finished making changes
+              // tell the designer we're finished making changes
               this.RaiseComponentChanged(controlsProperty, null, null);

               // commit the transaction
@@ -413,7 +413,7 @@

     private void DockVerbHandler(object sender, EventArgs e)
     {
-      this.Control.Dock = DockStyle.Fill;
+      this.SetDock(DockStyle.Fill);
     }

     /// <summary>
@@ -466,6 +466,7 @@
         IDesignerHost host;

         host = (IDesignerHost)this.GetService(typeof(IDesignerHost));
+
         if (host != null)
         {
           designer = host.GetDesigner(selectedPage) as TabListPageDesigner;
@@ -496,7 +497,7 @@
       if (_dockVerb != null && _undockVerb != null)
       {
         _dockVerb.Visible = control.Dock != DockStyle.Fill;
-        _undockVerb.Visible = !_dockVerb.Visible;
+        _undockVerb.Visible = control.Dock == DockStyle.Fill;
       }
     }

@@ -565,9 +566,53 @@
       this.RemoveSelectedTabListPage();
     }

+    private void SetDock(DockStyle style)
+    {
+      Control control;
+
+      control = this.Control;
+
+      if (control != null)
+      {
+        IDesignerHost host;
+
+        host = (IDesignerHost)this.GetService(typeof(IDesignerHost));
+
+        if (host != null)
+        {
+          using (DesignerTransaction transaction = host.CreateTransaction($"Update dock mode for '{control.Name}'"))
+          {
+            try
+            {
+              MemberDescriptor dockProperty;
+
+              dockProperty = TypeDescriptor.GetProperties(control)[nameof(control.Dock)];
+
+              // inform the designer we're about to make changes
+              this.RaiseComponentChanging(dockProperty);
+
+              // apply the change
+              control.Dock = style;
+
+              // tell the designer we're finished making changes
+              this.RaiseComponentChanged(dockProperty, null, null);
+
+              // commit the transaction
+              transaction.Commit();
+            }
+            catch
+            {
+              transaction.Cancel();
+              throw;
+            }
+          }
+        }
+      }
+    }
+
     private void UndockVerbHandler(object sender, EventArgs e)
     {
-      this.Control.Dock = DockStyle.None;
+      this.SetDock(DockStyle.None);
     }

     #endregion


update

update

--- Demos/BasicTessellationShader/BasicTessellationNode.cs
+++ Demos/BasicTessellationShader/BasicTessellationNode.cs
@@ -35,7 +35,30 @@

         public override void RenderBeforeChildren(RenderEventArgs arg)
         {
-            throw new NotImplementedException();
+            ICamera camera = arg.CameraStack.Peek();
+            mat4 projection = camera.GetProjectionMatrix();
+            mat4 view = camera.GetViewMatrix();
+            mat4 model = this.GetModelMatrix();
+
+            RenderUnit unit = this.RenderUnits[0];
+            ShaderProgram program = unit.Program;
+            //program.SetUniform()
+            //uniform mat4 gWorld;
+            //uniform vec3 gEyeWorldPos;
+            //uniform mat4 gVP;
+            //uniform sampler2D gDisplacementMap;
+            //uniform float gDispFactor;
+            //uniform int gNumPointLights;
+            //uniform int gNumSpotLights;
+            //uniform DirectionalLight gDirectionalLight;
+            //uniform PointLight gPointLights[MAX_POINT_LIGHTS];
+            //uniform SpotLight gSpotLights[MAX_SPOT_LIGHTS];
+            //uniform sampler2D gColorMap;
+            //uniform vec3 gEyeWorldPos;
+            //uniform float gMatSpecularIntensity;
+            //uniform float gSpecularPower;
+
+            unit.Render();
         }

         public override void RenderAfterChildren(RenderEventArgs arg)


This was accidentally added

This was accidentally added

--- binding/Binding/Definitions.cs
+++ binding/Binding/Definitions.cs
@@ -29,7 +29,6 @@
 		RightTop = 6,
 		RightBottom = 7,
 		LeftBottom = 8,
-		Default = TopLeft,
 	}

 	public enum SKEncodedOrigin {


Reword HD scale multiplier comment

Reword HD scale multiplier comment

--- osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs
+++ osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs
@@ -19,13 +19,16 @@
         public override string Description => @"Beats fade out before you hit them!";
         public override double ScoreMultiplier => 1.06;

-        // In stable Taiko, hit position is 160, so playfield is essentially 160 pixels shorter
-        // than actual screen width. Normalized screen height is 480, so on a 4:3 screen the
-        // playfield ratio will actually be (640 - 160) / 480 = 1
-        // For custom resolutions (x:y), screen width with normalized height becomes 480 * x / y instead,
-        // and the playfield ratio becomes (480 * x / y - 160) / 480 = x / y - 1/3
-        // The following is 4:3 playfield ratio divided by 16:9 playfield ratio
+        /// <summary>
+        /// In stable taiko, the hit position is 160, so the active playfield is essentially 160 pixels shorter
+        /// than the actual screen width. The normalized playfield height is 480, so on a 4:3 screen the
+        /// playfield ratio of the active area up to the hit position will actually be (640 - 160) / 480 = 1.
+        /// For custom resolutions/aspect ratios (x:y), the screen width given the normalized height becomes 480 * x / y instead,
+        /// and the playfield ratio becomes (480 * x / y - 160) / 480 = x / y - 1/3.
+        /// This constant is equal to the playfield ratio on 4:3 screens divided by the playfield ratio on 16:9 screens.
+        /// </summary>
         private const double hd_sv_scale = (4.0 / 3.0 - 1.0 / 3.0) / (16.0 / 9.0 - 1.0 / 3.0);
+
         private BeatmapDifficulty difficulty;
         private ControlPointInfo controlPointInfo;


added the test to verify

added the test to verify

--- Hashids.net.test/Hashids_issues.cs
+++ Hashids.net.test/Hashids_issues.cs
@@ -17,19 +17,27 @@
             var numbers = hashids.Decode("NgAzADEANAA=");
         }

+        // This issue came from downcasting to int at the wrong place,
+        // seems to happen when you are encoding A LOT of longs at the same time.
+        // see if it is possible to make this a faster test (or remove it since it is unlikely that it will reapper).
         [Fact]
-        void issue_12_should_not_throw_out_of_range_exception_when_downcasting()
+        void issue_12_should_not_throw_out_of_range_exception()
         {
-            var hashids = new Hashids();
-            var random = new Random();
-            for (var i = 0; i < 1000000; i++)
+            var hash = new Hashids("zXZVFf2N38uV");
+            var longs = new List<long>();
+            var rand = new Random();
+            var valueBuffer = new byte[8];
+            var randLong = 0L;
+            for (var i = 0; i < 100000; i++)
             {
-                var l = (long)random.Next(1, Int32.MaxValue);
-                var lo = l * random.Next(1, Int32.MaxValue);
-                var hash = hashids.EncodeLong(lo);
-                var val = hashids.DecodeLong(hash);
-                val.First().Should().Be(lo);
+                rand.NextBytes(valueBuffer);
+                randLong = BitConverter.ToInt64(valueBuffer, 0);
+                longs.Add(Math.Abs(randLong));
             }
+
+            var encoded = hash.EncodeLong(longs);
+            var decoded = hash.DecodeLong(encoded);
+            decoded.Should().Equal(longs.ToArray());
         }
     }
 }


qfe for tests

qfe for tests

--- Functions/Code/Facebook/FacebookUtilityTest/Program.cs
+++ Functions/Code/Facebook/FacebookUtilityTest/Program.cs
@@ -26,7 +26,7 @@
             string schema = "";
             string until = DateTime.UtcNow.AddDays(-2).ToString();

-            PageAnalyticsETL.PopulateMeasures(page, accessToken, sqlConn, schema, until);
+            var test = PageAnalyticsETL.PopulateMeasures(page, accessToken, sqlConn, schema, until).Result;
         }
     }
 }


--- GE.WebUI/Areas/Admin/Controllers/ArticlesController.cs
+++ GE.WebUI/Areas/Admin/Controllers/ArticlesController.cs
@@ -29,7 +29,7 @@

         public override ActionResult Edit(int? id = null)
         {
-            ViewBag.Scripts = "$('#GameId').sx_gvl()";
+            ViewBag.Scripts = "var gvlGames=new SxGridLookup('#GameId');";
             ViewBag.Title = _title;
             return base.Edit(id);
         }


Updated the yarn runner for the publish settings

--- src/Cake.Yarn/YarnRunner.cs
+++ src/Cake.Yarn/YarnRunner.cs
@@ -1,9 +1,9 @@
-using System;
+using Cake.Core;
+using Cake.Core.IO;
+using Cake.Core.Tooling;
+using System;
 using System.Collections.Generic;
 using System.IO;
-using Cake.Core;
-using Cake.Core.IO;
-using Cake.Core.Tooling;

 namespace Cake.Yarn
 {
@@ -453,6 +453,67 @@
         }

         #endregion
+
+        #region yarn publish
+
+        ///
+        /// execute 'yarn publish' with options
+        ///
+        /// <param name="publishSettings">options when running 'yarn publish'</param>
+        /// <example>
+        /// <para>Run 'yarn publish'</para>
+        ///
+        /// <![CDATA[
+        /// Task("Yarn-Publish")
+        ///     .Does(() =>
+        /// {
+        ///     Yarn.Publish();
+        /// });
+        /// ]]>
+        ///
+        /// </example>
+        /// <example>
+        /// <para>Run 'yarn publish --new-version 1.2.3'</para>
+        ///
+        /// <![CDATA[
+        /// Task("Yarn-Publish-With-New-Version")
+        ///     .Does(() =>
+        /// {
+        ///     Yarn.Publish(settings => settings.NewVersion(1, 2, 3));
+        /// });
+        /// ]]>
+        ///
+        /// </example>
+        /// <example>
+        /// <para>Run 'yarn publish --tag beta'</para>
+        ///
+        /// <![CDATA[
+        /// Task("Yarn-Publish-With-Tag")
+        ///     .Does(() =>
+        /// {
+        ///     Yarn.Publish(settings => settings.Tag("beta"));
+        /// });
+        /// ]]>
+        ///
+        /// </example>
+        public IYarnRunnerCommands Publish(Action<YarnPublishSettings> publishSettings = null)
+        {
+            var settings = new YarnPublishSettings();
+            publishSettings?.Invoke(settings);
+            var args = GetYarnPublishArguments(settings);
+
+            Run(settings, args);
+            return this;
+        }
+
+        private static ProcessArgumentBuilder GetYarnPublishArguments(YarnPublishSettings settings)
+        {
+            var args = new ProcessArgumentBuilder();
+            settings?.Evaluate(args);
+            return args;
+        }
+
+        #endregion

         ///
         /// Gets the name of the tool


Refactoring of tests to make them more intelligible.

--- GlyssenTests/Dialogs/CastSizePlanningViewModelTests.cs
+++ GlyssenTests/Dialogs/CastSizePlanningViewModelTests.cs
@@ -10,8 +10,36 @@
 	[TestFixture]
 	class CastSizePlanningViewModelTests
 	{
-		private int m_maleNarratorsValue = -1;
-		private int m_femaleNarratorsValue = -1;
+		private class MockCastSizePlanningDialog
+		{
+			// The model should never send a value of -1 (as asserted in the event handlers below), so when the test
+			// if the value of either of these is still -1, it means that the corresponding event never fired.
+			private int m_maleNarratorsValue = -1;
+			private int m_femaleNarratorsValue = -1;
+
+			public int MaleNarratorsValue => m_maleNarratorsValue;
+			public int FemaleNarratorsValue => m_femaleNarratorsValue;
+			public bool MaleNarratorsValueChangedEventNeverFired => m_maleNarratorsValue == -1;
+			public bool FemaleNarratorsValueChangedEventNeverFired => m_femaleNarratorsValue == -1;
+
+			public MockCastSizePlanningDialog(CastSizePlanningViewModel model)
+			{
+				model.MaleNarratorsValueChanged += model_MaleNarratorsValueChanged;
+				model.FemaleNarratorsValueChanged += model_FemaleNarratorsValueChanged;
+			}
+
+			private void model_MaleNarratorsValueChanged(object sender, int newValue)
+			{
+				Assert.That(newValue >= 0);
+				m_maleNarratorsValue = newValue;
+			}
+
+			private void model_FemaleNarratorsValueChanged(object sender, int newValue)
+			{
+				Assert.That(newValue >= 0);
+				m_femaleNarratorsValue = newValue;
+			}
+		}

 		[TestFixtureSetUp]
 		public void TestFixtureSetUp()
@@ -27,83 +55,93 @@
 			TestProject.DeleteTestProjectFolder();
 		}

+		private CastSizePlanningViewModel CreateModelWithInitialCustomValues(Glyssen.Project project, int maleNarrators, int femaleNarrators)
+		{
+			var model = new CastSizePlanningViewModel(project);
+			model.NarratorOption = NarratorsOption.Custom;
+			model.MaleNarrators = maleNarrators;
+			model.FemaleNarrators = femaleNarrators;
+			return model;
+		}
+
+		private void VerifyThatModelAndDlgAreInSync(CastSizePlanningViewModel model, MockCastSizePlanningDialog dlg)
+		{
+			Assert.AreEqual(model.MaleNarrators, dlg.MaleNarratorsValue);
+			Assert.AreEqual(model.FemaleNarrators, dlg.FemaleNarratorsValue);
+		}
+
 		[Test]
 		public void SetNarratorOption_NarrationByAuthorForTwoBooksWrittenBySameAuthor_DefaultsToOneNarrator()
 		{
+			// Setup
 			var testProject = TestProject.CreateTestProject(TestProject.TestBook.REV, TestProject.TestBook.IIIJN);
-			CastSizePlanningViewModel model = new CastSizePlanningViewModel(testProject);
-			model.MaleNarratorsValueChanged += model_MaleNarratorsValueChanged;
-			model.FemaleNarratorsValueChanged += model_FemaleNarratorsValueChanged;
-			model.NarratorOption = NarratorsOption.Custom;
-			model.MaleNarrators = 2;
-			model.FemaleNarrators = 0;
-			m_femaleNarratorsValue = 0;
-			model.NarratorOption = NarratorsOption.NarrationByAuthor;
-			Assert.AreEqual(1, m_maleNarratorsValue);
-			Assert.AreEqual(0, m_femaleNarratorsValue);
+			var model = CreateModelWithInitialCustomValues(testProject, 2, 0);
+			var dlg = new MockCastSizePlanningDialog(model);
+			// Test
+			model.NarratorOption = NarratorsOption.NarrationByAuthor;
+			// Verify results
+			Assert.AreEqual(1, dlg.MaleNarratorsValue);
+			Assert.That(dlg.FemaleNarratorsValueChangedEventNeverFired);
 		}

 		[Test]
 		public void SetNarratorOption_NarrationByAuthorForThreeBooksWrittenByNonSpeakingAuthors_DefaultsToOneNarrator()
 		{
+			// Setup
 			var testProject = TestProject.CreateTestProject(TestProject.TestBook.RUT, TestProject.TestBook.ACT, TestProject.TestBook.HEB);
-			CastSizePlanningViewModel model = new CastSizePlanningViewModel(testProject);
-			model.MaleNarratorsValueChanged += model_MaleNarratorsValueChanged;
-			model.FemaleNarratorsValueChanged += model_FemaleNarratorsValueChanged;
-			model.NarratorOption = NarratorsOption.Custom;
-			model.MaleNarrators = 2;
-			model.FemaleNarrators = 1;
-			m_femaleNarratorsValue = 0;
-			model.NarratorOption = NarratorsOption.NarrationByAuthor;
-			Assert.AreEqual(1, m_maleNarratorsValue);
-			Assert.AreEqual(0, m_femaleNarratorsValue);
+			var model = CreateModelWithInitialCustomValues(testProject, 2, 1);
+			var dlg = new MockCastSizePlanningDialog(model);
+			// Test
+			model.NarratorOption = NarratorsOption.NarrationByAuthor;
+			// Verify results
+			Assert.AreEqual(1, dlg.MaleNarratorsValue);
+			Assert.AreEqual(0, dlg.FemaleNarratorsValue);
+			VerifyThatModelAndDlgAreInSync(model, dlg);
 		}

 		[Test]
 		public void SetNarratorOption_NarrationByAuthorForTwoBooksWrittenBySameSpeakingAuthorAndTwoBooksWrittenByDifferentNonSpeakingAuthors_DefaultsToTwoNarrators()
 		{
+			// Setup
 			var testProject = TestProject.CreateTestProject(TestProject.TestBook.RUT, TestProject.TestBook.ACT, TestProject.TestBook.GAL, TestProject.TestBook.EPH);
-			CastSizePlanningViewModel model = new CastSizePlanningViewModel(testProject);
-			model.MaleNarratorsValueChanged += model_MaleNarratorsValueChanged;
-			model.FemaleNarratorsValueChanged += model_FemaleNarratorsValueChanged;
-			model.NarratorOption = NarratorsOption.Custom;
-			model.MaleNarrators = 3;
-			model.FemaleNarrators = 1;
-			m_femaleNarratorsValue = 0;
-			model.NarratorOption = NarratorsOption.NarrationByAuthor;
-			Assert.AreEqual(2, m_maleNarratorsValue);
-			Assert.AreEqual(0, m_femaleNarratorsValue);
+			var model = CreateModelWithInitialCustomValues(testProject, 3, 1);
+			var dlg = new MockCastSizePlanningDialog(model);
+			// Test
+			model.NarratorOption = NarratorsOption.NarrationByAuthor;
+			// Verify results
+			Assert.AreEqual(2, dlg.MaleNarratorsValue);
+			Assert.AreEqual(0, dlg.FemaleNarratorsValue);
+			VerifyThatModelAndDlgAreInSync(model, dlg);
 		}

 		[Test]
 		public void SetNarratorOption_CallbackPublishesValues()
 		{
+			// Setup
 			var testProject = TestProject.CreateTestProject(TestProject.TestBook.GAL, TestProject.TestBook.IIIJN);
-			CastSizePlanningViewModel model = new CastSizePlanningViewModel(testProject);
-			model.MaleNarratorsValueChanged += model_MaleNarratorsValueChanged;
-			model.FemaleNarratorsValueChanged += model_FemaleNarratorsValueChanged;
-			model.NarratorOption = NarratorsOption.Custom;
-			model.MaleNarrators = 1;
-			model.FemaleNarrators = 1;
-			model.NarratorOption = NarratorsOption.NarrationByAuthor;
-			Assert.AreEqual(2, m_maleNarratorsValue);
-			Assert.AreEqual(0, m_femaleNarratorsValue);
+			var model = CreateModelWithInitialCustomValues(testProject, 1, 1);
+			var dlg = new MockCastSizePlanningDialog(model);
+
+			// Test - Part 1
+			model.NarratorOption = NarratorsOption.NarrationByAuthor;
+			// Verify results
+			Assert.AreEqual(2, dlg.MaleNarratorsValue);
+			Assert.AreEqual(0, dlg.FemaleNarratorsValue);
+			VerifyThatModelAndDlgAreInSync(model, dlg);
+
+			// Test - Part 2
 			model.NarratorOption = NarratorsOption.SingleNarrator;
-			Assert.AreEqual(1, m_maleNarratorsValue);
-			Assert.AreEqual(0, m_femaleNarratorsValue);
-			model.NarratorOption = NarratorsOption.Custom;
-			Assert.AreEqual(2, m_maleNarratorsValue);
-			Assert.AreEqual(1, m_femaleNarratorsValue);
-		}
-
-		private void model_MaleNarratorsValueChanged(object sender, int newValue)
-		{
-			m_maleNarratorsValue = newValue;
-		}
-
-		private void model_FemaleNarratorsValueChanged(object sender, int newValue)
-		{
-			m_femaleNarratorsValue = newValue;
+			// Verify results
+			Assert.AreEqual(1, dlg.MaleNarratorsValue);
+			Assert.AreEqual(0, dlg.FemaleNarratorsValue);
+			VerifyThatModelAndDlgAreInSync(model, dlg);
+
+			// Test - Part 3
+			model.NarratorOption = NarratorsOption.Custom;
+			// Verify results
+			Assert.AreEqual(2, dlg.MaleNarratorsValue);
+			Assert.AreEqual(1, dlg.FemaleNarratorsValue);
+			VerifyThatModelAndDlgAreInSync(model, dlg);
 		}

 		[Test]