Added a duplicate call checker

Added a duplicate call checker

Now objects are registered with Juice, making sure that you don't call a
juice effect once, and then override it right away (Ex: Juice Fade to 1,
and then Fade to 0 at the same time. Usually the object gets stuck at
0.5 that way with two never-ending CoRoutines).

--- Juice.cs
+++ Juice.cs
@@ -34,12 +34,15 @@
 public class Juice : MonoBehaviour {
     public static Juice Instance;
     public List<System.Action> mCallbacks;
-
+
+    [SerializeField]
+    private List<Component> mComponents;

     void Awake()
     {
         Instance = this;
         mCallbacks = new List<System.Action>();
+        mComponents = new List<Component>();
     }

     void Update()
@@ -62,8 +65,10 @@
     /// <param name="aTime">The time it should take to complete</param>
     /// <param name="aDistance">A distance: Vector2(width,height)</param>
     /// <param name="aTweenType">The type of tween (Linear, Exponential, Etc)</param>
-	public Coroutine Tween(RectTransform aRect, float aTime, Vector2 aDistance, TweenType aTweenType = TweenType.Linear, System.Action aCallback = null){
-		switch (aTweenType) {
+	public void Tween(RectTransform aRect, float aTime, Vector2 aDistance, TweenType aTweenType = TweenType.Linear, System.Action aCallback = null){
+        if (!RegisterObject(aRect))
+            return;
+        switch (aTweenType) {
 		case TweenType.Linear:
             StartCoroutine(CoLinearTween(aRect, aTime, aDistance, aCallback));
 			break;
@@ -88,27 +93,19 @@
             Debug.LogWarning("TweenType " + aTweenType.ToString() + " isn't implemented yet!");
 			break;
 		}
-        return null;
+        return;
 	}

-	/// <summary>
-	/// Fades a CanvasGroup in and then back out.
-	/// </summary>
-	/// <param name="aGroup">The CanvasGroup</param>
-    /// <param name="aTime">The time each part of the fade (fading in and fading out) should take.</param>
-    /// <param name="aStayTime">How long should the object stay visible before fading back out?</param>
-    public void FadeGroupInOut(CanvasGroup aGroup, float aTime, float aStayTime = 0, System.Action aCallback = null)
-    {
-        StartCoroutine(CoFadeGroupInOut(aGroup,aTime,false,aStayTime, aCallback));
-    }
-
     /// <summary>
     /// Fades a CanvasGroup to a target alpha.
     /// </summary>
     /// <param name="aGroup">The CanvasGroup</param>
     /// <param name="aTime">The time it should take</param>
     /// <param name="aTarget">The end alpha</param>
+    /// <param name="aScaledTime">Should this be scaled with Time.TimeScale?</param>
+    /// <param name="aCallback">Any logic to execute once the target state is reached</param>
     public void FadeGroup(CanvasGroup aGroup, float aTime, float aTarget, bool aScaledTime = true, System.Action aCallback = null){
+        if (!RegisterObject(aGroup)) return;
         StartCoroutine(CoFadeGroup(aGroup, aTime, aTarget, aScaledTime, aCallback: aCallback));
     }

@@ -117,9 +114,11 @@
     /// </summary>
     /// <param name="aGroup">The CanvasGroup</param>
     /// <param name="aTime">The time it should take</param>
-    public void FadeOutGroup(CanvasGroup aGroup, float aTime)
-    {
-        StartCoroutine(CoFadeGroup(aGroup, aTime, 0));
+    /// <param name="aScaledTime">Should this be scaled with Time.TimeScale?</param>
+    /// <param name="aCallback">Any logic to execute once the target state is reached</param>
+    public void FadeOutGroup(CanvasGroup aGroup, float aTime, bool aScaledTime = true, System.Action aCallback = null)
+    {
+        FadeGroup(aGroup, aTime, 0, aScaledTime, aCallback);
     }

     /// <summary>
@@ -127,9 +126,12 @@
     /// </summary>
     /// <param name="aGroup">The CanvasGroup</param>
     /// <param name="aTime">The time it should take</param>
-    public void FadeInGroup(CanvasGroup aGroup, float aTime)
-    {
-        StartCoroutine(CoFadeGroup(aGroup, aTime, 1));
+    /// <param name="aScaledTime">Should this be scaled with Time.TimeScale?</param>
+    /// <param name="aCallback">Any logic to execute once the target state is reached</param>
+    public void FadeInGroup(CanvasGroup aGroup, float aTime, bool aScaledTime = true, System.Action aCallback = null)
+    {
+        if (!RegisterObject(aGroup)) return;
+        FadeGroup(aGroup, aTime, 1, aScaledTime, aCallback);
     }

     /// <summary>
@@ -142,7 +144,8 @@
     /// <param name="aUp"></param>
     /// <param name="aTime">How long do we pulse for?</param>
 	public void PulseGroup(CanvasGroup aGroup, float aRepeatTime, float aLowAlpha, float aHighAlpha, bool aUp = true, float aTime = 0){
-		aLowAlpha = aLowAlpha < 0f ? 0f : (aLowAlpha > 1f ? 1f : aLowAlpha);
+        if (!RegisterObject(aGroup)) return;
+        aLowAlpha = aLowAlpha < 0f ? 0f : (aLowAlpha > 1f ? 1f : aLowAlpha);
 		aHighAlpha = aHighAlpha < 0f ? 0f : (aHighAlpha > 1f ? 1f : aHighAlpha);
 		StartCoroutine(CoPulseGroup(aGroup, aRepeatTime, aLowAlpha, aHighAlpha, aUp, aTime < 0f ? 0f : aTime));
 	}
@@ -161,6 +164,7 @@
     /// <param name="aTarget">The end alpha</param>
     public void FadeSprite(SpriteRenderer aSprite, float aTime, float aTarget, bool aScaledTime = true, System.Action aCallback = null)
     {
+        if (!RegisterObject(aSprite)) return;
         StartCoroutine(CoFadeSprite(aSprite, aTime, aTarget, aScaledTime, aCallback: aCallback));
     }

@@ -171,6 +175,7 @@
     /// <param name="aTime">The time it should take</param>
     public void FadeOutSprite(SpriteRenderer aSprite, float aTime, System.Action aCallback = null)
     {
+        if (!RegisterObject(aSprite)) return;
         StartCoroutine(CoFadeSprite(aSprite, aTime, 0, true, aCallback));
     }

@@ -181,6 +186,7 @@
     /// <param name="aTime">The time it should take</param>
     public void FadeInSprite(SpriteRenderer aSprite, float aTime)
     {
+        if (!RegisterObject(aSprite)) return;
         StartCoroutine(CoFadeSprite(aSprite, aTime, 1));
     }

@@ -194,6 +200,7 @@
     /// <param name="aCallback">Now what?</param>
     public void LerpSpriteColor(SpriteRenderer aSprite, float aTime, Color aTarget, bool aScaledTime = true, System.Action aCallback = null)
     {
+        if (!RegisterObject(aSprite)) return;
         StartCoroutine(CoLerpSpriteColor(aSprite, aTime, aTarget, aScaledTime, aCallback: aCallback));
     }
     #endregion
@@ -204,16 +211,22 @@

     #region UI Objects
     IEnumerator CoPulseGroup(CanvasGroup aGroup, float aRepeatTime, float aLowAlpha, float aHighAlpha, bool aUp, float aTime){
-		if(aGroup != null && aLowAlpha < aHighAlpha){
+		if(aLowAlpha < aHighAlpha){
 			aGroup.alpha = aUp ? aLowAlpha : aHighAlpha;
 			float timePassed = 0f;
 			while(timePassed < aTime || aTime == 0f){ //TODO: break on some flag
 				aGroup.alpha = Mathf.Sin ((timePassed + (aUp ? -1f : 1f)*aRepeatTime/4f)*2f*Mathf.PI/aRepeatTime)*((aHighAlpha-aLowAlpha)/2f)+((aHighAlpha+aLowAlpha)/2f);
 				timePassed += Time.deltaTime;
 				yield return new WaitForEndOfFrame();
-			}
-		}
-		yield break;
+                if (aGroup == null)
+                {
+                    DeregisterObject(aGroup);
+                    yield break;
+                }
+            }
+        }
+        DeregisterObject(aGroup);
+        yield break;
 	}

     IEnumerator CoWobble(RectTransform aRect, float aDuration, Vector2 aDistance, System.Action aCallback = null){
@@ -256,7 +269,7 @@

     IEnumerator CoLinearTween(RectTransform aRect, float aTime, Vector2 aDistance, System.Action aCallback = null)
     {
-		float startTime = Time.time;
+        float startTime = Time.time;
 		Vector2 targetPos = aRect.anchoredPosition + aDistance;
 		float percentCompleted = 0;
         Vector2 startPos = aRect.anchoredPosition;
@@ -264,7 +277,13 @@
 			percentCompleted = (Time.time - startTime) / aTime;
 			aRect.anchoredPosition = Vector2.Lerp (startPos, targetPos, percentCompleted);
 			yield return new WaitForEndOfFrame();
-		}
+            if (aRect == null)
+            {
+                DeregisterObject(aRect);
+                yield break;
+            }
+        }
+        DeregisterObject(aRect);
         mCallbacks.Add(aCallback);
 		yield break;
 	}
@@ -283,85 +302,45 @@
             else
                 aRect.anchoredPosition = Vector2.Lerp(startPos, targetPos, Mathf.Pow(percentCompleted,2));
             yield return new WaitForEndOfFrame();
-        }
+            if (aRect == null)
+            {
+                DeregisterObject(aRect);
+                yield break;
+            }
+        }
+        DeregisterObject(aRect);
         mCallbacks.Add(aCallback);
         yield break;
     }

-    IEnumerator CoFadeGroupInOut(CanvasGroup aGroup, float aFadeTime, bool aFadeOut = false, float aStayTime = 0, System.Action aCallback = null)
-    {
-        if (aFadeTime <= 0)
-            aFadeTime = .1f;
-        if (aStayTime == 0)
-            aStayTime = aFadeTime;
-        float stayTimer = 0;
-        if (aFadeOut)
-        {
-            while (aGroup.alpha > 0)
+    IEnumerator CoFadeGroup(CanvasGroup aGroup, float aTime, float targetAlpha, bool scaledTime = true, System.Action aCallback = null)
+    {
+        if (aTime != 0)
+        {
+            if (targetAlpha > 1) targetAlpha = 1;
+            if (targetAlpha < 0) targetAlpha = 0;
+            if (aTime <= 0) aTime = .1f;
+
+            float timePassed = 0f;
+            float m = (targetAlpha - aGroup.alpha) / (aTime);
+            float b = aGroup.alpha;
+            while (timePassed < aTime)
             {
-                aGroup.alpha -= Time.deltaTime / aFadeTime;
+                aGroup.alpha = m * timePassed + b;
+                timePassed += scaledTime ? Time.deltaTime : Time.unscaledDeltaTime;
                 yield return new WaitForEndOfFrame();
-            }
-        }
-        else
-        {
-            while (aGroup.alpha < .95)
-            {
-                aGroup.alpha += Time.deltaTime / aFadeTime;
-                yield return new WaitForEndOfFrame();
-            }
-            if (aGroup.alpha > .95)
-                aGroup.alpha = 1;
-        }
-        if (!aFadeOut)
-        {
-            while (stayTimer < aStayTime)
-            {
-                stayTimer += Time.deltaTime;
-                yield return new WaitForEndOfFrame();
-            }
-            StartCoroutine(CoFadeGroupInOut(aGroup, aFadeTime, true));
-        }
+                if (aGroup == null)
+                {
+                    DeregisterObject(aGroup);
+                    yield break;
+                }
+            }
+        }
+        aGroup.alpha = targetAlpha;
+        DeregisterObject(aGroup);
         mCallbacks.Add(aCallback);
         yield break;
-
-    }
-
-    IEnumerator CoFadeGroup(CanvasGroup aGroup, float aTime, float targetAlpha, bool scaledTime = true, System.Action aCallback = null)
-    {
-        if (aTime == 0)
-        {
-            aGroup.alpha = targetAlpha;
-            mCallbacks.Add(aCallback);
-            yield break;
-        }
-        if (targetAlpha > 1) targetAlpha = 1;
-        if (targetAlpha < 0) targetAlpha = 0;
-        if (aTime <= 0)
-            aTime = .1f;
-
-        if (aGroup != null)
-        {
-			float timePassed = 0f;
-			float m = (targetAlpha - aGroup.alpha)/(aTime);
-			float b = aGroup.alpha;
-            while (timePassed < aTime){
-                try
-                {
-                    aGroup.alpha = m * timePassed + b;
-                    timePassed += scaledTime ? Time.deltaTime : Time.unscaledDeltaTime;
-                }
-                catch { yield break; }
-				yield return new WaitForEndOfFrame();
-			}
-            try
-            {
-                aGroup.alpha = targetAlpha;
-                mCallbacks.Add(aCallback);
-            }
-            catch { yield break; }
-            yield break;
-        }
+
     }
     #endregion

@@ -369,62 +348,81 @@
     IEnumerator CoFadeSprite(SpriteRenderer aSprite, float aTime, float targetAlpha, bool scaledTime = true, System.Action aCallback = null)
     {
         Color target = new Color(aSprite.color.r, aSprite.color.b, aSprite.color.g, targetAlpha);
-        if (aTime == 0)
-        {
-            aSprite.color = target;
-            mCallbacks.Add(aCallback);
-            yield break;
-        }
-        if (targetAlpha > 1) targetAlpha = 1;
-        if (targetAlpha < 0) targetAlpha = 0;
-        if (aTime <= 0)
-            aTime = .1f;
-
-        if (aSprite != null)
-        {
+        if (aTime != 0)
+        {
+            if (targetAlpha > 1) targetAlpha = 1;
+            if (targetAlpha < 0) targetAlpha = 0;
+            if (aTime <= 0)
+                aTime = .1f;
+
             float timePassed = 0f;
             float m = (targetAlpha - aSprite.color.a) / (aTime);
             float b = aSprite.color.a;
             while (timePassed < aTime)
             {
-                if(aSprite != null)
-                    aSprite.color = new Color(aSprite.color.r, aSprite.color.b, aSprite.color.g,  m * timePassed + b);
+                aSprite.color = new Color(aSprite.color.r, aSprite.color.b, aSprite.color.g, m * timePassed + b);
                 timePassed += scaledTime ? Time.deltaTime : Time.unscaledDeltaTime;
                 yield return new WaitForEndOfFrame();
-            }
-            if (aSprite != null)
-                aSprite.color = target;
-            mCallbacks.Add(aCallback);
-            yield break;
-        }
+                if (aSprite == null)
+                {
+                    DeregisterObject(aSprite);
+                    yield break;
+                }
+            }
+        }
+        aSprite.color = target;
+        DeregisterObject(aSprite);
+        mCallbacks.Add(aCallback);
+        yield break;
+
     }

     IEnumerator CoLerpSpriteColor(SpriteRenderer aSprite, float aTime, Color aTargetColor, bool scaledTime = true, System.Action aCallback = null)
     {
         Color target = aTargetColor;
-        if (aTime == 0)
-        {
-            aSprite.color = target;
-            mCallbacks.Add(aCallback);
-            yield break;
-        }
-
-        if (aSprite != null)
+        if (aTime != 0)
         {
             float timePassed = 0f;
             while (timePassed < aTime)
             {
                 float lerpAmount = scaledTime ? Time.deltaTime / aTime : Time.unscaledDeltaTime / aTime;
-                if(aSprite != null)
-                    aSprite.color = Color.Lerp(aSprite.color, aTargetColor, lerpAmount);
+                aSprite.color = Color.Lerp(aSprite.color, aTargetColor, lerpAmount);
                 timePassed += scaledTime ? Time.deltaTime : Time.unscaledDeltaTime;
                 yield return new WaitForEndOfFrame();
-            }
-            if (aSprite != null)
-                aSprite.color = target;
-            mCallbacks.Add(aCallback);
-            yield break;
-        }
+                if (aSprite == null)
+                {
+                    DeregisterObject(aSprite);
+                    yield break;
+                }
+            }
+        }
+        aSprite.color = target;
+        DeregisterObject(aSprite);
+        mCallbacks.Add(aCallback);
+        yield break;
+    }
+    #endregion
+
+    #region Helper Methods
+    public bool RegisterObject(Component aObject)
+    {
+        if (mComponents.Contains(aObject)) {
+            //Debug.LogWarning("Component " + aObject.name + " is already being Juiced.");
+            return false; }
+        else { mComponents.Add(aObject); return true; }
+    }
+
+    public bool DeregisterObject(Component aObject)
+    {
+        if (mComponents.Contains(aObject)) { mComponents.Remove(aObject); return true; }
+        else
+        {
+            //Cleanup
+            for (int i = 0; i < mComponents.Count; i++)
+                if (mComponents[i] == null) mComponents.RemoveAt(i);
+            return false;
+        }
+
     }
     #endregion


Added ze pop-up window to congratulate ze winner

--- Logic.cs
+++ Logic.cs
@@ -3,6 +3,7 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows;

 namespace SpeechToTextWPFSample
 {
@@ -12,6 +13,7 @@
         public static char currentToken;
         public void DoWork()
         {
+
             //*********************** LOGIC STARTS

             const int numPlayers = 2; // default number of players is 2
@@ -108,6 +110,18 @@
                         {
                             Console.WriteLine(g);
                             Console.WriteLine(players[i].getName() + " is the winner!");
+
+                            //call pop-up from here
+                            if (Application.Current.Dispatcher.CheckAccess())
+                            {
+                                MessageBox.Show("Congratulations " + players[i].getName() + " !!", "AWWWWW YEAHHHHHH");
+                            }
+                            else {
+                                Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() => {
+                                    MessageBox.Show("Congratulations " + players[i].getName() + " !!", "AWWWWW YEAHHHHHH");
+                                }));
+                            }
+
                             TTSSample.Program.sayThis(players[i].getName() + " is the winner!");
                             winner = true;
                             answer = "n";


Code Quality; Added vSync option

Code Quality; Added vSync option

--- Karl/KarlGame.cs
+++ Karl/KarlGame.cs
@@ -15,7 +15,7 @@
         /// <summary>
         /// GraphicsDeviceManager instance. Must be created in the constructor in order to be available as a service.
         /// </summary>
-        private GraphicsDeviceManager _graphics;
+        private readonly GraphicsDeviceManager _graphics;

         private readonly EasyStorageAdapter _storageProvider;

@@ -54,13 +54,14 @@
             var windowWidth = _videoSettings.GetInt("Window.Width");
             var windowHeight = _videoSettings.GetInt("Window.Height");
             var fullscreen = windowMode == "fullscreen";
+            var vSync = _videoSettings.GetBool("VSync");

             if (windowMode == "borderless")
             {
                 windowWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
                 windowHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;

-                var hWnd = this.Window.Handle;
+                var hWnd = Window.Handle;
                 var control = System.Windows.Forms.Control.FromHandle(hWnd);
                 var form = control.FindForm();
                 if (form != null) form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
@@ -69,6 +70,7 @@
             _graphics.PreferredBackBufferWidth = windowWidth;
             _graphics.PreferredBackBufferHeight = windowHeight;
             _graphics.IsFullScreen = fullscreen;
+            _graphics.SynchronizeWithVerticalRetrace = vSync;

             _graphics.ApplyChanges();
         }


处理写异常

处理写异常

--- BcpIO.cs
+++ BcpIO.cs
@@ -1,4 +1,4 @@
-/*
+/*
  * csharp-bcp
  * Copyright 2014 深圳岂凡网络有限公司 (Shenzhen QiFun Network Corp., LTD)
  *
@@ -34,7 +34,7 @@
         private static void ReadUnsignedVarint(
             Stream stream,
             Bcp.ReadState readState,
-            ProcessReadVarint processReadVarint,
+            ProcessReadVarint processReadVarint,
             BcpDelegate.ExceptionHandler exceptionHandler)
         {
             var buffer = new byte[1];
@@ -97,51 +97,100 @@

         public static void Write(Stream stream, Bcp.Acknowledge packet)
         {
-            stream.WriteByte(Bcp.Acknowledge.HeadByte);
+            try
+            {
+                stream.WriteByte(Bcp.Acknowledge.HeadByte);
+            }
+            catch
+            {
+                stream.Close();
+            }
         }

         public static void Write(Stream stream, Bcp.Finish packet)
         {
-            stream.WriteByte(Bcp.Finish.HeadByte);
+            try
+            {
+                stream.WriteByte(Bcp.Finish.HeadByte);
+            }
+            catch
+            {
+                stream.Close();
+            }
         }

         public static void Write(Stream stream, Bcp.RetransmissionFinish packet)
         {
-            stream.WriteByte(Bcp.RetransmissionFinish.HeadByte);
-            WriteUnsignedVarint(stream, packet.ConnectionId);
-            WriteUnsignedVarint(stream, packet.PackId);
+            try
+            {
+                stream.WriteByte(Bcp.RetransmissionFinish.HeadByte);
+                WriteUnsignedVarint(stream, packet.ConnectionId);
+                WriteUnsignedVarint(stream, packet.PackId);
+            }
+            catch
+            {
+                stream.Close();
+            }
         }

         public static void Write(Stream stream, Bcp.RetransmissionData packet)
         {
-            stream.WriteByte(Bcp.RetransmissionData.HeadByte);
-            WriteUnsignedVarint(stream, packet.ConnectionId);
-            WriteUnsignedVarint(stream, packet.PackId);
-            WriteUnsignedVarint(stream, (uint)packet.Buffers.Sum(buffer => buffer.Count));
-            foreach (var buffer in packet.Buffers)
-            {
-                stream.Write(buffer.Array, buffer.Offset, buffer.Count);
+            try
+            {
+                stream.WriteByte(Bcp.RetransmissionData.HeadByte);
+                WriteUnsignedVarint(stream, packet.ConnectionId);
+                WriteUnsignedVarint(stream, packet.PackId);
+                WriteUnsignedVarint(stream, (uint)packet.Buffers.Sum(buffer => buffer.Count));
+                foreach (var buffer in packet.Buffers)
+                {
+                    stream.Write(buffer.Array, buffer.Offset, buffer.Count);
+                }
+            }
+            catch
+            {
+                stream.Close();
             }
         }

         public static void Write(Stream stream, Bcp.Data packet)
         {
-            stream.WriteByte(Bcp.Data.HeadByte);
-            WriteUnsignedVarint(stream, (uint)packet.Buffers.Sum(buffer => buffer.Count));
-            foreach (var buffer in packet.Buffers)
-            {
-                stream.Write(buffer.Array, buffer.Offset, buffer.Count);
+            try
+            {
+                stream.WriteByte(Bcp.Data.HeadByte);
+                WriteUnsignedVarint(stream, (uint)packet.Buffers.Sum(buffer => buffer.Count));
+                foreach (var buffer in packet.Buffers)
+                {
+                    stream.Write(buffer.Array, buffer.Offset, buffer.Count);
+                }
+            }
+            catch
+            {
+                stream.Close();
             }
         }

         public static void Write(Stream stream, Bcp.ShutDown packet)
         {
-            stream.WriteByte(Bcp.ShutDown.HeadByte);
+            try
+            {
+                stream.WriteByte(Bcp.ShutDown.HeadByte);
+            }
+            catch
+            {
+                stream.Close();
+            }
         }

         public static void Write(Stream stream, Bcp.HeartBeat packet)
         {
-            stream.WriteByte(Bcp.HeartBeat.HeadByte);
+            try
+            {
+                stream.WriteByte(Bcp.HeartBeat.HeadByte);
+            }
+            catch
+            {
+                stream.Close();
+            }
         }

         private static Dictionary<Type, Action<Stream, Bcp.IPacket>> InitializeWriteCallbacks()
@@ -170,6 +219,7 @@
             }
             catch
             {
+                stream.Close();
             }
         }

@@ -325,9 +375,9 @@
             }
         }

-        public static void ReadHead(Stream stream,
-            Bcp.ReadState readState,
-            BcpDelegate.ProcessReadHead processReadHead,
+        public static void ReadHead(Stream stream,
+            Bcp.ReadState readState,
+            BcpDelegate.ProcessReadHead processReadHead,
             BcpDelegate.ExceptionHandler exceptionHandler)
         {
             var sessionId = new byte[Bcp.NumBytesSessionId];


関数の記述方法簡略化

関数の記述方法簡略化


Delete IEncryptor.cs

Delete IEncryptor.cs

--- src/Data/IEncryptor.cs
+++ src/Data/IEncryptor.cs
@@ -1,37 +0,0 @@
-/****************************************************************************/
-/*                                                                          */
-/*    The Mondo Libraries  							                        */
-/*                                                                          */
-/*        Namespace: Mondo.Common							                */
-/*             File: IEncryptor.cs					    		            */
-/*        Class(es): IEncryptor				         		                */
-/*          Purpose: Interface for encryption and decryption                */
-/*                                                                          */
-/*  Original Author: Jim Lightfoot                                          */
-/*    Creation Date: 5 Jul 2015                                             */
-/*                                                                          */
-/*   Copyright (c) 2005-2016 - Jim Lightfoot, All rights reserved           */
-/*                                                                          */
-/*  Licensed under the MIT license:                                         */
-/*    http://www.opensource.org/licenses/mit-license.php                    */
-/*                                                                          */
-/****************************************************************************/
-
-using System;
-using System.IO;
-using System.Text;
-using System.Security;
-using System.Security.Cryptography;
-using System.Runtime.InteropServices;
-using Mondo.Common;
-
-namespace Mondo.Common
-{
-    /****************************************************************************/
-    /****************************************************************************/
-	public interface IEncryptor
-	{
-        byte[] Encrypt(byte[] aData);
-        byte[] Decrypt(byte[] aEncrypted, int offset = 0, int length = -1);
-    }
-}


Add Format(xml|json) property on RedmineManager

--- src/redmine-net-api/RedmineManager.cs
+++ src/redmine-net-api/RedmineManager.cs
@@ -1,4 +1,4 @@
-/*
+/*
    Copyright 2011 - 2019 Adrian Popescu.

    Licensed under the Apache License, Version 2.0 (the "License");
@@ -106,6 +106,7 @@

             Host = host;
             MimeFormat = mimeFormat;
+            Format = mimeFormat == MimeFormat.Xml ? "xml" : "json";
             Proxy = proxy;
             SecurityProtocolType = securityProtocolType;

@@ -187,6 +188,11 @@
             get { return routes; }
         }

+        /// <summary>
+        ///
+        /// </summary>
+        public string Format { get; }
+
         /// <summary>
         ///     Gets the host.
         /// </summary>


excluding augs from SkillAlterationDevice spec count (#1866)

--- Source/ACE.Server/WorldObjects/SkillAlterationDevice.cs
+++ Source/ACE.Server/WorldObjects/SkillAlterationDevice.cs
@@ -203,6 +203,17 @@
             {
                 if (kvp.Value.AdvancementClass == SkillAdvancementClass.Specialized)
                 {
+                    // exclude aug specs
+                    switch (kvp.Key)
+                    {
+                        case Skill.ArmorTinkering:
+                        case Skill.ItemTinkering:
+                        case Skill.MagicItemTinkering:
+                        case Skill.WeaponTinkering:
+                        case Skill.Salvaging:
+                            continue;
+                    }
+
                     var skill = DatManager.PortalDat.SkillTable.SkillBaseHash[(uint)kvp.Key];

                     specializedCreditsTotal += skill.UpgradeCostFromTrainedToSpecialized;


Removed unnecessary debug info from main gateway code

--- AfricasTalkingCS/AfricasTalkingGateway.cs
+++ AfricasTalkingCS/AfricasTalkingGateway.cs
@@ -43,7 +43,7 @@
         {
             try
             {
-                Hashtable data = new Hashtable
+                var data = new Hashtable
                 {
                     ["username"] = _username,
                     ["to"] = to,
@@ -59,20 +59,16 @@
                         {
                             data["keyword"] = options["keyword"];
                         }
-
                         if (options.Contains("linkId"))
                         {
                             data["linkId"] = options["linkId"];
                         }
-
                         if (options.Contains("enqueue"))
                         {
                             data["enqueue"] = options["enqueue"];
                         }
-
                         if (options.Contains("retryDurationInHours"))
                             data["retryDurationInHours"] = options["retryDurationInHours"];
-
                     }
                 }
                 var response = SendPostRequest(data, SmsUrl);
@@ -125,7 +121,6 @@
                 ["shortCode"] = shortCode,
                 ["keyword"] = keyWord
             };
-
             var url = SubscriptionUrl + "/create";
             var response = SendPostRequest(data, url);
             if (_responseCode != (int) HttpStatusCode.Created) throw new AfricasTalkingGatewayException(response);
@@ -138,7 +133,6 @@
             if (phoneNumber.Length == 0 || shortCode.Length == 0 || keyWord.Length == 0)
             {
                 throw new AfricasTalkingGatewayException("Some Parameters are missing!");
-
             }
             var data = new Hashtable
             {
@@ -194,7 +188,6 @@
                 return json["entries"];
             }
             throw new AfricasTalkingGatewayException(json["errorMessage"]);
-
         }

         public dynamic SendAirtime(string recepients)
@@ -259,16 +252,12 @@
                 webRequest.Method = "GET";
                 webRequest.Accept = "application/json";
                 webRequest.Headers.Add("apiKey", _apikey);
-
                 var httpResponse = (HttpWebResponse)webRequest.GetResponse();
                 _responseCode = (int)httpResponse.StatusCode;
                 var webpageReader = new StreamReader(httpResponse.GetResponseStream() ?? throw new InvalidOperationException());
-
                 var response = webpageReader.ReadToEnd();
-
                 if (_debug)
                     Console.WriteLine("Full response: " + response);
-
                 return response;

             }
@@ -277,7 +266,6 @@
             {
                 if (ex.Response == null)
                     throw new AfricasTalkingGatewayException(ex.Message);
-
                 using (var stream = ex.Response.GetResponseStream())
                 using (var reader = new StreamReader(stream ?? throw new InvalidOperationException()))
                 {
@@ -285,7 +273,6 @@

                     if (_debug)
                         Console.WriteLine("Full response: " + response);
-
                     return response;
                 }
             }
@@ -305,10 +292,8 @@
                     var value = (string) data[key];
                     dataStr += HttpUtility.UrlEncode(key, Encoding.UTF8);
                     dataStr += "=" + HttpUtility.UrlEncode(value, Encoding.UTF8);
-
                 }
                 var byteArray = Encoding.UTF8.GetBytes(dataStr);
-
                 ServicePointManager.ServerCertificateValidationCallback =
                     RemoteCertificateValidationCallback;
                 var webRequest = (HttpWebRequest) WebRequest.Create(urlString);
@@ -383,10 +368,6 @@
             var stringResult = result.Content.ReadAsStringAsync().Result;
             return stringResult;
         }
-
-        //Not Sending Username...
-        //todo fix username issue...
-
         public dynamic MobileB2B(string product, string providerChannel, string transfer, string currency,
             decimal transferAmount, string channelReceiving, string accountReceiving,dynamic b2Bmetadata)
         {
@@ -402,15 +383,14 @@
                 destinationChannel = channelReceiving,
                 metadata = b2Bmetadata
             };
-
-            try
-            {
+            try
+            {
+                Console.WriteLine(bTob);
                 var response = PostB2BJson(bTob, B2BPaymentsUrl);
                 return response;
             }
             catch (Exception e)
             {
-
                 throw new AfricasTalkingGatewayException(e);
             }
         }
@@ -423,7 +403,6 @@
                 username = _username,
                 recepients = recepients.ToList()
             };
-            Console.WriteLine("Request Body: "+requestBody);
             var response = Post(requestBody,B2CPaymentsUrl);
             return response;
         }


Cycle debugging- added printouts

Cycle debugging- added printouts

--- Source/Engine/AGS.Engine/Graphics/Logic/SortDebugger.cs
+++ Source/Engine/AGS.Engine/Graphics/Logic/SortDebugger.cs
@@ -112,9 +112,11 @@
 				List<string> chain = findCycle(item.ID, map, visited, recStack);
 				if (chain != null)
 				{
-					Debug.WriteLine(string.Join("=>", chain));
+                    Debug.WriteLine(string.Format("Cycle detected: {0}", string.Join("=>", chain)));
+                    return;
 				}
 			}
+            Debug.WriteLine("No cycles detected.");
 		}

 		private static List<string> findCycle(string id, Dictionary<string, List<string>> map,


master-patch_01 Update media upload method

--- AfricasTalkingCS/AfricasTalkingGateway.cs
+++ AfricasTalkingCS/AfricasTalkingGateway.cs
@@ -1,4 +1,4 @@
-// --------------------------------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------------------------------
 // <copyright file="AfricasTalkingGateway.cs" company="Africa's Talking">
 //   2018
 // </copyright>
@@ -203,27 +203,27 @@
         /// <exception cref="AfricasTalkingGatewayException">
         /// Errors from our gateway class
         /// </exception>
-        public void UploadMediaFile(string url)
+        public dynamic UploadMediaFile(string url, string phoneNumber)
         {
             var isUrl = Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute);
-            if (!isUrl)
-            {
-              throw new AfricasTalkingGatewayException("Malformed Url");
+            string[] numbers = phoneNumber.Split(separator: new[] {','}, options: StringSplitOptions.RemoveEmptyEntries);
+            var isPhoneNumber = IsPhoneNumber(numbers);
+
+            if (!(isUrl || isPhoneNumber))
+            {
+              throw new AfricasTalkingGatewayException("Malformed Url or Invalid Phone Number");
             }
             else
             {
                 var data = new Hashtable
                                {
                                    ["username"] = this._username,
-                                   ["url"] = url
+                                   ["url"] = url,
+                                   ["phoneNumber"] = phoneNumber
                                };
                 var urlString = this.VoiceUrl + "/mediaUpload";
-                var response = this.SendPostRequest(data, urlString);
-                dynamic json = JObject.Parse(response);
-                if ((string)json["errorMesage"] != "None")
-                {
-                    throw new AfricasTalkingGatewayException(json["errorMessage"]);
-                }
+                var response = this.SendPostRequest(data, urlString);
+                return response;
             }
         }

@@ -362,7 +362,7 @@
         /// <exception cref="AfricasTalkingGatewayException">
         /// Errors from our gateway
         /// </exception>
-        public dynamic Call(string from, string to)
+        public dynamic Call(string from, string to, string requestId = null)
         {
             var numbersFrom = from.Split(separator: new[] {','}, options: StringSplitOptions.RemoveEmptyEntries);
             var numbersTo = to.Split(separator: new[] {','}, options: StringSplitOptions.RemoveEmptyEntries);


GSF.TimeSeries: Fixed shutdown issue in Iaon session with filter adapters collection being null.

--- Source/Libraries/GSF.TimeSeries/Adapters/IaonSession.cs
+++ Source/Libraries/GSF.TimeSeries/Adapters/IaonSession.cs
@@ -883,7 +883,7 @@
         /// <param name="e">Event arguments for event that contains references to the new measurements.</param>
         public virtual void NewMeasurementsHandler(object sender, EventArgs<ICollection<IMeasurement>> e)
         {
-            m_filterAdapters.HandleNewMeasurements(e.Argument);
+            m_filterAdapters?.HandleNewMeasurements(e.Argument);
         }

         /// <summary>


Переделал логику InvasionViewModel

Переделал логику InvasionViewModel

--- Agent/Core/ViewModel/InvasionViewModel.cs
+++ Agent/Core/ViewModel/InvasionViewModel.cs
@@ -20,15 +20,13 @@
             isDefenderFactionInfestation = invasion.DefenderMissionInfo.Faction == "FC_INFESTATION";
             AttackerFaction = invasion.AttackerMissionInfo.Faction.GetFilter(Model.Filters.FilterType.Fraction).FirstOrDefault().Key;
             DefenderFaction = invasion.DefenderMissionInfo.Faction.GetFilter(Model.Filters.FilterType.Fraction).FirstOrDefault().Key;
-            AttackerFactionDefault = invasion.AttackerMissionInfo.Faction;
-            DefenderFactionDefault = invasion.DefenderMissionInfo.Faction;
             Faction = invasion.Faction.GetFilter(Model.Filters.FilterType.Fraction).FirstOrDefault().Key;
             NodeArray = invasion.Node.GetFilter(Model.Filters.FilterType.Planet).FirstOrDefault().Key.ToUpper().Split('|');
             LocTag = invasion.LocTag.GetFilter(Model.Filters.FilterType.Mission).FirstOrDefault().Key;
-            DefenderReward = invasion.DefenderReward?.CountedItems[0]?.ItemType.GetFilter(Model.Filters.FilterType.Item).FirstOrDefault().Key;
-            DefenderRewardCount = invasion.DefenderReward?.CountedItems[0]?.ItemCount;
-            //AttackerReward = invasion.AttackerReward?.CountedItems[0]?.ItemType.GetFilter(Model.Filters.FilterType.Item).FirstOrDefault().Key;
-            //AttackerRewardCount = invasion.AttackerReward?.CountedItems[0]?.ItemCount;
+            DefenderReward = GetRewardString(invasion.DefenderReward);
+            //AttackerReward = GetRewardString(invasion.AttackerReward);
+            AttackerColor = GetFactionColor(invasion.AttackerMissionInfo.Faction);
+            DefenderColor = GetFactionColor(invasion.DefenderMissionInfo.Faction);
             Update();
         }

@@ -37,8 +35,6 @@
             Count = invasion.Count;
             Goal = invasion.Goal;
             UpdatePercent();
-            UpdateColor();
-            UpdateReward();
         }

         public Id Id { get; }
@@ -47,14 +43,10 @@
         public string[] NodeArray { get; }
         public string DefenderFaction { get; }
         public string AttackerFaction { get; }
-        public string DefenderFactionDefault { get; }
-        public string AttackerFactionDefault { get; }
-        public Brush DefenderColor { get; set; }
-        public Brush AttackerColor { get; set; }
-        public string DefenderReward { get; set; }
-        public string AttackerReward { get; set; }
-        public int? DefenderRewardCount { get; }
-        public int? AttackerRewardCount { get; }
+        public Brush DefenderColor { get; }
+        public Brush AttackerColor { get; }
+        public string DefenderReward { get; }
+        public string AttackerReward { get; }

         private readonly bool isDefenderFactionInfestation;

@@ -72,6 +64,24 @@
             private set => Set(ref _goal, value);
         }

+        static Dictionary<string, Brush> _factionColors = new Dictionary<string, Brush>()
+        {
+            ["FC_GRINEER"]     = new SolidColorBrush(Color.FromRgb(r: 0xbd, g: 0x58, b: 0x57)), //FFbd5857
+            ["FC_CORPUS"]      = new SolidColorBrush(Color.FromRgb(r: 0x3f, g: 0x85, b: 0xca)), //FF3f85ca
+            ["FC_INFESTATION"] = new SolidColorBrush(Color.FromRgb(r: 0x1f, g: 0x97, b: 0x45))  //FF1F9745
+        };
+        static Brush GetFactionColor(string faction) =>
+            _factionColors.TryGetValue(faction, out var brush) ? brush : null;
+
+        static string GetRewardString(InvasionReward reward)
+        {
+            var rewardString = reward?.CountedItems[0]?.ItemType.GetFilter(Model.Filters.FilterType.Item).FirstOrDefault().Key;
+            var count = reward?.CountedItems[0]?.ItemCount;
+            if (count > 1)
+                rewardString += $" [{count}]";
+            return rewardString;
+        }
+
         void UpdatePercent()
         {
             var val = isDefenderFactionInfestation
@@ -82,49 +92,6 @@
             PercentOut = 100 - val;
         }

-        void UpdateColor()
-        {
-            switch (DefenderFactionDefault)
-            {
-                case "FC_GRINEER":
-                    DefenderColor = new SolidColorBrush(Color.FromRgb(r: 0xbd, g: 0x58, b: 0x57)); //FFbd5857
-                    break;
-                case "FC_CORPUS":
-                    DefenderColor = new SolidColorBrush(Color.FromRgb(r: 0x3f, g: 0x85, b: 0xca)); //FF3f85ca
-                    break;
-                case "FC_INFESTATION":
-                    DefenderColor = new SolidColorBrush(Color.FromRgb(r: 0x1f, g: 0x97, b: 0x45)); //FF1F9745
-                    break;
-            }
-
-            switch (AttackerFactionDefault)
-            {
-                case "FC_GRINEER":
-                    AttackerColor = new SolidColorBrush(Color.FromRgb(r: 0xbd, g: 0x58, b: 0x57)); //FFbd5857
-                    break;
-                case "FC_CORPUS":
-                    AttackerColor = new SolidColorBrush(Color.FromRgb(r: 0x3f, g: 0x85, b: 0xca)); //FF3f85ca
-                    break;
-                case "FC_INFESTATION":
-                    AttackerColor = new SolidColorBrush(Color.FromRgb(r: 0x1f, g: 0x97, b: 0x45)); //FF1F9745
-                    break;
-            }
-        }
-
-        void UpdateReward()
-        {
-            if (DefenderReward != null)
-            {
-                if (DefenderRewardCount != null && DefenderRewardCount > 1)
-                    DefenderReward += $" [{DefenderRewardCount}]";
-            }
-            if (AttackerReward != null)
-            {
-                if (AttackerRewardCount != null && AttackerRewardCount > 1)
-                    AttackerReward += $" [{AttackerRewardCount}]";
-            }
-        }
-
         private double _percentOut;
         public double PercentOut
         {
@@ -133,7 +100,6 @@
         }

         private double _percent;
-
         public double Percent
         {
             get => _percent;


Version 1.15

Version 1.15

--- z80DotNet/Program.cs
+++ z80DotNet/Program.cs
@@ -179,7 +179,7 @@
                 else
                 {
                     string error = string.Format("Unknown architecture specified '{0}'", arch);
-                    throw new System.CommandLine.ArgumentSyntaxException(error);
+                    throw new Exception(error);
                 }
                 return ms.ToArray();
             }


Fix ShrineRoom to always be current spawner

--- Source/MTW_AncestorSpirits/RoomRoleWorker_ShrineRoom.cs
+++ Source/MTW_AncestorSpirits/RoomRoleWorker_ShrineRoom.cs
@@ -16,14 +16,14 @@
             // a Shrine - if you Shrine room wall gets broken down by a bug, this will probably push all the attached
             // rooms into the "Shrine Room" - is that a desired behaviour?

-            Thing shrine = room.AllContainedThings.FirstOrDefault<Thing>(t => t is Building_Shrine);
-            if (shrine == null)
+            var shrine = Find.Map.GetComponent<MapComponent_AncestorTicker>().CurrentSpawner;
+            if (room.AllContainedThings.Contains<Thing>(shrine))
             {
-                return 0.0f;
+                return 9999.0f;
             }
             else
             {
-                return 9999.0f;
+                return 0.0f;
             }
         }
     }


namespace fix

namespace fix

--- AkkaCodeAnalyzer/ClassReferenceCounter.cs
+++ AkkaCodeAnalyzer/ClassReferenceCounter.cs
@@ -45,7 +45,7 @@
                 if (semanticClass.Name.Contains("Test") || semanticClass.BaseType != null && semanticClass.BaseType.Name.Contains("Test"))
                     continue;

-                if (semanticClass.ContainingNamespace.Name.Contains("Test") || semanticClass.ContainingNamespace.Name.Contains("Spec"))
+                if (semanticClass.ContainingNamespace.ToDisplayString().Contains("Test") || semanticClass.ContainingNamespace.ToDisplayString().Contains("Spec"))
                     continue;

                 var references = await SymbolFinder.FindReferencesAsync(semanticClass, document.Project.Solution);


Commit 628d5601 fixes.

Commit 628d5601 fixes.

--- Algo/Strategies/Testing/BatchEmulation.cs
+++ Algo/Strategies/Testing/BatchEmulation.cs
@@ -511,8 +511,25 @@
 		private void OnEmulationStopped()
 		{
 			foreach (var strategy in _batch)
-			{
 				strategy.Stop();
+		}
+
+		private void DisposeAdapters()
+		{
+			var adapter = EmulationConnector.Adapter;
+
+			foreach (var strategy in _batch)
+			{
+				var strategyAdapter = adapter.AdapterProvider.GetAdapter(strategy.Portfolio);
+
+				if (strategyAdapter != null)
+				{
+					adapter.InnerAdapters.Remove(strategyAdapter);
+
+					adapter
+						.AdapterProvider
+						.RemoveAssociation(strategy.Portfolio.Name);
+				}

 				var tuple = _strategyInfo.TryGetValue(strategy);

@@ -522,31 +539,9 @@
 				strategy.Security = tuple.Item2;
 				strategy.Portfolio = tuple.Item1;
 			}
-
+
+			_batch = ArrayHelper.Empty<Strategy>();
 			_strategyInfo.Clear();
-		}
-
-		private void DisposeAdapters()
-		{
-			var adapter = EmulationConnector.Adapter;
-
-			foreach (var strategy in _batch)
-			{
-				strategy.Stop();
-
-				var strategyAdapter = adapter.AdapterProvider.GetAdapter(strategy.Portfolio);
-
-				if (strategyAdapter == null)
-					continue;
-
-				adapter.InnerAdapters.Remove(strategyAdapter);
-
-				adapter
-					.AdapterProvider
-					.RemoveAssociation(strategy.Portfolio.Name);
-			}
-
-			_batch = ArrayHelper.Empty<Strategy>();
 		}

 		/// <summary>


HistEmulationConnector. Process state and disconnect fixes.

--- Algo/Testing/HistoryEmulationConnector.cs
+++ Algo/Testing/HistoryEmulationConnector.cs
@@ -302,7 +302,7 @@
 						break;
 					case EmulationStates.Stopping:
 						throwError = (_state != EmulationStates.Started && _state != EmulationStates.Suspended
-							&& State == EmulationStates.Starting);  // при ошибках при запуске эмуляции состояние может быть Starting
+							&& State != EmulationStates.Starting);  // при ошибках при запуске эмуляции состояние может быть Starting
 						break;
 					case EmulationStates.Starting:
 						throwError = (_state != EmulationStates.Stopped && _state != EmulationStates.Suspended);
@@ -370,7 +370,8 @@
 		/// </summary>
 		protected override void OnDisconnect()
 		{
-			SendEmulationState(EmulationStates.Stopping);
+			if (State != EmulationStates.Stopped && State != EmulationStates.Stopping)
+				SendEmulationState(EmulationStates.Stopping);
 		}

 		/// <summary>


Two dictionaries to separate longhand from shorthand

--- AngleSharp/DOM/Factories/CssPropertyFactory.cs
+++ AngleSharp/DOM/Factories/CssPropertyFactory.cs
@@ -8,161 +8,162 @@
     /// </summary>
     static class CssPropertyFactory
     {
-        static readonly Dictionary<String, Func<CSSStyleDeclaration, CSSProperty>> properties = new Dictionary<String, Func<CSSStyleDeclaration, CSSProperty>>(StringComparer.OrdinalIgnoreCase);
+        static readonly Dictionary<String, Func<CSSStyleDeclaration, CSSProperty>> longhands = new Dictionary<String, Func<CSSStyleDeclaration, CSSProperty>>(StringComparer.OrdinalIgnoreCase);
+        static readonly Dictionary<String, Func<CSSStyleDeclaration, CSSProperty>> shorthands = new Dictionary<String, Func<CSSStyleDeclaration, CSSProperty>>(StringComparer.OrdinalIgnoreCase);

         static CssPropertyFactory()
         {
-            properties.Add(PropertyNames.Animation, style => new CSSAnimationProperty(style));
-            properties.Add(PropertyNames.AnimationDelay, style => new CSSAnimationDelayProperty(style));
-            properties.Add(PropertyNames.AnimationDirection, style => new CSSAnimationDirectionProperty(style));
-            properties.Add(PropertyNames.AnimationDuration, style => new CSSAnimationDurationProperty(style));
-            properties.Add(PropertyNames.AnimationFillMode, style => new CSSAnimationFillModeProperty(style));
-            properties.Add(PropertyNames.AnimationIterationCount, style => new CSSAnimationIterationCountProperty(style));
-            properties.Add(PropertyNames.AnimationName, style => new CSSAnimationNameProperty(style));
-            properties.Add(PropertyNames.AnimationPlayState, style => new CSSAnimationPlayStateProperty(style));
-            properties.Add(PropertyNames.AnimationTimingFunction, style => new CSSAnimationTimingFunctionProperty(style));
-            properties.Add(PropertyNames.BackgroundAttachment, style => new CSSBackgroundAttachmentProperty(style));
-            properties.Add(PropertyNames.BackgroundColor, style => new CSSBackgroundColorProperty(style));
-            properties.Add(PropertyNames.BackgroundClip, style => new CSSBackgroundClipProperty(style));
-            properties.Add(PropertyNames.BackgroundOrigin, style => new CSSBackgroundOriginProperty(style));
-            properties.Add(PropertyNames.BackgroundSize, style => new CSSBackgroundSizeProperty(style));
-            properties.Add(PropertyNames.BackgroundImage, style => new CSSBackgroundImageProperty(style));
-            properties.Add(PropertyNames.BackgroundPosition, style => new CSSBackgroundPositionProperty(style));
-            properties.Add(PropertyNames.BackgroundRepeat, style => new CSSBackgroundRepeatProperty(style));
-            properties.Add(PropertyNames.Background, style => new CSSBackgroundProperty(style));
-            properties.Add(PropertyNames.BorderColor, style => new CSSBorderColorProperty(style));
-            properties.Add(PropertyNames.BorderSpacing, style => new CSSBorderSpacingProperty(style));
-            properties.Add(PropertyNames.BorderCollapse, style => new CSSBorderCollapseProperty(style));
-            properties.Add(PropertyNames.BorderStyle, style => new CSSBorderStyleProperty(style));
-            properties.Add(PropertyNames.BoxShadow, style => new CSSBoxShadowProperty(style));
-            properties.Add(PropertyNames.BoxDecorationBreak, style => new CSSBoxDecorationBreak(style));
-            properties.Add(PropertyNames.BreakAfter, style => new CSSBreakAfterProperty(style));
-            properties.Add(PropertyNames.BreakBefore, style => new CSSBreakBeforeProperty(style));
-            properties.Add(PropertyNames.BreakInside, style => new CSSBreakInsideProperty(style));
-            properties.Add(PropertyNames.BackfaceVisibility, style => new CSSBackfaceVisibilityProperty(style));
-            properties.Add(PropertyNames.BorderTopLeftRadius, style => new CSSBorderTopLeftRadiusProperty(style));
-            properties.Add(PropertyNames.BorderTopRightRadius, style => new CSSBorderTopRightRadiusProperty(style));
-            properties.Add(PropertyNames.BorderBottomLeftRadius, style => new CSSBorderBottomLeftRadiusProperty(style));
-            properties.Add(PropertyNames.BorderBottomRightRadius, style => new CSSBorderBottomRightRadiusProperty(style));
-            properties.Add(PropertyNames.BorderRadius, style => new CSSBorderRadiusProperty(style));
-            properties.Add(PropertyNames.BorderImage, style => new CSSBorderImageProperty(style));
-            properties.Add(PropertyNames.BorderImageOutset, style => new CSSBorderImageOutsetProperty(style));
-            properties.Add(PropertyNames.BorderImageRepeat, style => new CSSBorderImageRepeatProperty(style));
-            properties.Add(PropertyNames.BorderImageSource, style => new CSSBorderImageSourceProperty(style));
-            properties.Add(PropertyNames.BorderImageSlice, style => new CSSBorderImageSliceProperty(style));
-            properties.Add(PropertyNames.BorderImageWidth, style => new CSSBorderImageWidthProperty(style));
-            properties.Add(PropertyNames.BorderTopColor, style => new CSSBorderTopColorProperty(style));
-            properties.Add(PropertyNames.BorderLeftColor, style => new CSSBorderLeftColorProperty(style));
-            properties.Add(PropertyNames.BorderRightColor, style => new CSSBorderRightColorProperty(style));
-            properties.Add(PropertyNames.BorderBottomColor, style => new CSSBorderBottomColorProperty(style));
-            properties.Add(PropertyNames.BorderTopStyle, style => new CSSBorderTopStyleProperty(style));
-            properties.Add(PropertyNames.BorderLeftStyle, style => new CSSBorderLeftStyleProperty(style));
-            properties.Add(PropertyNames.BorderRightStyle, style => new CSSBorderRightStyleProperty(style));
-            properties.Add(PropertyNames.BorderBottomStyle, style => new CSSBorderBottomStyleProperty(style));
-            properties.Add(PropertyNames.BorderTopWidth, style => new CSSBorderTopWidthProperty(style));
-            properties.Add(PropertyNames.BorderLeftWidth, style => new CSSBorderLeftWidthProperty(style));
-            properties.Add(PropertyNames.BorderRightWidth, style => new CSSBorderRightWidthProperty(style));
-            properties.Add(PropertyNames.BorderBottomWidth, style => new CSSBorderBottomWidthProperty(style));
-            properties.Add(PropertyNames.BorderWidth, style => new CSSBorderWidthProperty(style));
-            properties.Add(PropertyNames.BorderTop, style => new CSSBorderTopProperty(style));
-            properties.Add(PropertyNames.BorderRight, style => new CSSBorderRightProperty(style));
-            properties.Add(PropertyNames.BorderBottom, style => new CSSBorderBottomProperty(style));
-            properties.Add(PropertyNames.BorderLeft, style => new CSSBorderLeftProperty(style));
-            properties.Add(PropertyNames.Border, style => new CSSBorderProperty(style));
-            properties.Add(PropertyNames.Bottom, style => new CSSBottomProperty(style));
-            properties.Add(PropertyNames.Columns, style => new CSSColumnsProperty(style));
-            properties.Add(PropertyNames.ColumnCount, style => new CSSColumnCountProperty(style));
-            properties.Add(PropertyNames.ColumnWidth, style => new CSSColumnWidthProperty(style));
-            properties.Add(PropertyNames.ColumnFill, style => new CSSColumnFillProperty(style));
-            properties.Add(PropertyNames.ColumnGap, style => new CSSColumnGapProperty(style));
-            properties.Add(PropertyNames.ColumnSpan, style => new CSSColumnSpanProperty(style));
-            properties.Add(PropertyNames.ColumnRule, style => new CSSColumnRuleProperty(style));
-            properties.Add(PropertyNames.ColumnRuleColor, style => new CSSColumnRuleColorProperty(style));
-            properties.Add(PropertyNames.ColumnRuleStyle, style => new CSSColumnRuleStyleProperty(style));
-            properties.Add(PropertyNames.ColumnRuleWidth, style => new CSSColumnRuleWidthProperty(style));
-            properties.Add(PropertyNames.CaptionSide, style => new CSSCaptionSideProperty(style));
-            properties.Add(PropertyNames.Clear, style => new CSSClearProperty(style));
-            properties.Add(PropertyNames.Clip, style => new CSSClipProperty(style));
-            properties.Add(PropertyNames.Color, style => new CSSColorProperty(style));
-            properties.Add(PropertyNames.Content, style => new CSSContentProperty(style));
-            properties.Add(PropertyNames.CounterIncrement, style => new CSSCounterIncrementProperty(style));
-            properties.Add(PropertyNames.CounterReset, style => new CSSCounterResetProperty(style));
-            properties.Add(PropertyNames.Cursor, style => new CSSCursorProperty(style));
-            properties.Add(PropertyNames.Direction, style => new CSSDirectionProperty(style));
-            properties.Add(PropertyNames.Display, style => new CSSDisplayProperty(style));
-            properties.Add(PropertyNames.EmptyCells, style => new CSSEmptyCellsProperty(style));
-            properties.Add(PropertyNames.Float, style => new CSSFloatProperty(style));
-            properties.Add(PropertyNames.FontFamily, style => new CSSFontFamilyProperty(style));
-            properties.Add(PropertyNames.FontSize, style => new CSSFontSizeProperty(style));
-            properties.Add(PropertyNames.FontSizeAdjust, style => new CSSFontSizeAdjustProperty(style));
-            properties.Add(PropertyNames.FontStyle, style => new CSSFontStyleProperty(style));
-            properties.Add(PropertyNames.FontVariant, style => new CSSFontVariantProperty(style));
-            properties.Add(PropertyNames.FontWeight, style => new CSSFontWeightProperty(style));
-            properties.Add(PropertyNames.FontStretch, style => new CSSFontStretchProperty(style));
-            properties.Add(PropertyNames.Font, style => new CSSFontProperty(style));
-            properties.Add(PropertyNames.Height, style => new CSSHeightProperty(style));
-            properties.Add(PropertyNames.Left, style => new CSSLeftProperty(style));
-            properties.Add(PropertyNames.LetterSpacing, style => new CSSLetterSpacingProperty(style));
-            properties.Add(PropertyNames.LineHeight, style => new CSSLineHeightProperty(style));
-            properties.Add(PropertyNames.ListStyleImage, style => new CSSListStyleImageProperty(style));
-            properties.Add(PropertyNames.ListStylePosition, style => new CSSListStylePositionProperty(style));
-            properties.Add(PropertyNames.ListStyleType, style => new CSSListStyleTypeProperty(style));
-            properties.Add(PropertyNames.ListStyle, style => new CSSListStyleProperty(style));
-            properties.Add(PropertyNames.MarginRight, style => new CSSMarginRightProperty(style));
-            properties.Add(PropertyNames.MarginLeft, style => new CSSMarginLeftProperty(style));
-            properties.Add(PropertyNames.MarginTop, style => new CSSMarginTopProperty(style));
-            properties.Add(PropertyNames.MarginBottom, style => new CSSMarginBottomProperty(style));
-            properties.Add(PropertyNames.Margin, style => new CSSMarginProperty(style));
-            properties.Add(PropertyNames.MaxHeight, style => new CSSMaxHeightProperty(style));
-            properties.Add(PropertyNames.MaxWidth, style => new CSSMaxWidthProperty(style));
-            properties.Add(PropertyNames.MinHeight, style => new CSSMinHeightProperty(style));
-            properties.Add(PropertyNames.MinWidth, style => new CSSMinWidthProperty(style));
-            properties.Add(PropertyNames.Opacity, style => new CSSOpacityProperty(style));
-            properties.Add(PropertyNames.Orphans, style => new CSSOrphansProperty(style));
-            properties.Add(PropertyNames.OutlineColor, style => new CSSOutlineColorProperty(style));
-            properties.Add(PropertyNames.OutlineStyle, style => new CSSOutlineStyleProperty(style));
-            properties.Add(PropertyNames.OutlineWidth, style => new CSSOutlineWidthProperty(style));
-            properties.Add(PropertyNames.Outline, style => new CSSOutlineProperty(style));
-            properties.Add(PropertyNames.Overflow, style => new CSSOverflowProperty(style));
-            properties.Add(PropertyNames.PaddingTop, style => new CSSPaddingTopProperty(style));
-            properties.Add(PropertyNames.PaddingRight, style => new CSSPaddingRightProperty(style));
-            properties.Add(PropertyNames.PaddingLeft, style => new CSSPaddingLeftProperty(style));
-            properties.Add(PropertyNames.PaddingBottom, style => new CSSPaddingBottomProperty(style));
-            properties.Add(PropertyNames.Padding, style => new CSSPaddingProperty(style));
-            properties.Add(PropertyNames.PageBreakAfter, style => new CSSPageBreakAfterProperty(style));
-            properties.Add(PropertyNames.PageBreakBefore, style => new CSSPageBreakBeforeProperty(style));
-            properties.Add(PropertyNames.PageBreakInside, style => new CSSPageBreakInsideProperty(style));
-            properties.Add(PropertyNames.Perspective, style => new CSSPerspectiveProperty(style));
-            properties.Add(PropertyNames.PerspectiveOrigin, style => new CSSPerspectiveOriginProperty(style));
-            properties.Add(PropertyNames.Position, style => new CSSPositionProperty(style));
-            properties.Add(PropertyNames.Quotes, style => new CSSQuotesProperty(style));
-            properties.Add(PropertyNames.Right, style => new CSSRightProperty(style));
-            properties.Add(PropertyNames.TableLayout, style => new CSSTableLayoutProperty(style));
-            properties.Add(PropertyNames.TextAlign, style => new CSSTextAlignProperty(style));
-            properties.Add(PropertyNames.TextDecoration, style => new CSSTextDecorationProperty(style));
-            properties.Add(PropertyNames.TextDecorationStyle, style => new CSSTextDecorationStyleProperty(style));
-            properties.Add(PropertyNames.TextDecorationLine, style => new CSSTextDecorationLineProperty(style));
-            properties.Add(PropertyNames.TextDecorationColor, style => new CSSTextDecorationColorProperty(style));
-            properties.Add(PropertyNames.TextIndent, style => new CSSTextIndentProperty(style));
-            properties.Add(PropertyNames.TextTransform, style => new CSSTextTransformProperty(style));
-            properties.Add(PropertyNames.TextShadow, style => new CSSTextShadowProperty(style));
-            properties.Add(PropertyNames.Transform, style => new CSSTransformProperty(style));
-            properties.Add(PropertyNames.TransformOrigin, style => new CSSTransformOriginProperty(style));
-            properties.Add(PropertyNames.TransformStyle, style => new CSSTransformStyleProperty(style));
-            properties.Add(PropertyNames.Transition, style => new CSSTransitionProperty(style));
-            properties.Add(PropertyNames.TransitionDelay, style => new CSSTransitionDelayProperty(style));
-            properties.Add(PropertyNames.TransitionDuration, style => new CSSTransitionDurationProperty(style));
-            properties.Add(PropertyNames.TransitionTimingFunction, style => new CSSTransitionTimingFunctionProperty(style));
-            properties.Add(PropertyNames.TransitionProperty, style => new CSSTransitionPropertyProperty(style));
-            properties.Add(PropertyNames.Top, style => new CSSTopProperty(style));
-            properties.Add(PropertyNames.UnicodeBidi, style => new CSSUnicodeBidiProperty(style));
-            properties.Add(PropertyNames.VerticalAlign, style => new CSSVerticalAlignProperty(style));
-            properties.Add(PropertyNames.Visibility, style => new CSSVisibilityProperty(style));
-            properties.Add(PropertyNames.WhiteSpace, style => new CSSWhiteSpaceProperty(style));
-            properties.Add(PropertyNames.Widows, style => new CSSWidowsProperty(style));
-            properties.Add(PropertyNames.Width, style => new CSSWidthProperty(style));
-            properties.Add(PropertyNames.WordSpacing, style => new CSSWordSpacingProperty(style));
-            properties.Add(PropertyNames.ZIndex, style => new CSSZIndexProperty(style));
+            shorthands.Add(PropertyNames.Animation, style => new CSSAnimationProperty(style));
+            longhands.Add(PropertyNames.AnimationDelay, style => new CSSAnimationDelayProperty(style));
+            longhands.Add(PropertyNames.AnimationDirection, style => new CSSAnimationDirectionProperty(style));
+            longhands.Add(PropertyNames.AnimationDuration, style => new CSSAnimationDurationProperty(style));
+            longhands.Add(PropertyNames.AnimationFillMode, style => new CSSAnimationFillModeProperty(style));
+            longhands.Add(PropertyNames.AnimationIterationCount, style => new CSSAnimationIterationCountProperty(style));
+            longhands.Add(PropertyNames.AnimationName, style => new CSSAnimationNameProperty(style));
+            longhands.Add(PropertyNames.AnimationPlayState, style => new CSSAnimationPlayStateProperty(style));
+            longhands.Add(PropertyNames.AnimationTimingFunction, style => new CSSAnimationTimingFunctionProperty(style));
+            longhands.Add(PropertyNames.BackgroundAttachment, style => new CSSBackgroundAttachmentProperty(style));
+            longhands.Add(PropertyNames.BackgroundColor, style => new CSSBackgroundColorProperty(style));
+            longhands.Add(PropertyNames.BackgroundClip, style => new CSSBackgroundClipProperty(style));
+            longhands.Add(PropertyNames.BackgroundOrigin, style => new CSSBackgroundOriginProperty(style));
+            longhands.Add(PropertyNames.BackgroundSize, style => new CSSBackgroundSizeProperty(style));
+            longhands.Add(PropertyNames.BackgroundImage, style => new CSSBackgroundImageProperty(style));
+            longhands.Add(PropertyNames.BackgroundPosition, style => new CSSBackgroundPositionProperty(style));
+            longhands.Add(PropertyNames.BackgroundRepeat, style => new CSSBackgroundRepeatProperty(style));
+            shorthands.Add(PropertyNames.Background, style => new CSSBackgroundProperty(style));
+            shorthands.Add(PropertyNames.BorderColor, style => new CSSBorderColorProperty(style));
+            longhands.Add(PropertyNames.BorderSpacing, style => new CSSBorderSpacingProperty(style));
+            longhands.Add(PropertyNames.BorderCollapse, style => new CSSBorderCollapseProperty(style));
+            shorthands.Add(PropertyNames.BorderStyle, style => new CSSBorderStyleProperty(style));
+            longhands.Add(PropertyNames.BoxShadow, style => new CSSBoxShadowProperty(style));
+            longhands.Add(PropertyNames.BoxDecorationBreak, style => new CSSBoxDecorationBreak(style));
+            longhands.Add(PropertyNames.BreakAfter, style => new CSSBreakAfterProperty(style));
+            longhands.Add(PropertyNames.BreakBefore, style => new CSSBreakBeforeProperty(style));
+            longhands.Add(PropertyNames.BreakInside, style => new CSSBreakInsideProperty(style));
+            longhands.Add(PropertyNames.BackfaceVisibility, style => new CSSBackfaceVisibilityProperty(style));
+            longhands.Add(PropertyNames.BorderTopLeftRadius, style => new CSSBorderTopLeftRadiusProperty(style));
+            longhands.Add(PropertyNames.BorderTopRightRadius, style => new CSSBorderTopRightRadiusProperty(style));
+            longhands.Add(PropertyNames.BorderBottomLeftRadius, style => new CSSBorderBottomLeftRadiusProperty(style));
+            longhands.Add(PropertyNames.BorderBottomRightRadius, style => new CSSBorderBottomRightRadiusProperty(style));
+            longhands.Add(PropertyNames.BorderRadius, style => new CSSBorderRadiusProperty(style));
+            longhands.Add(PropertyNames.BorderImage, style => new CSSBorderImageProperty(style));
+            longhands.Add(PropertyNames.BorderImageOutset, style => new CSSBorderImageOutsetProperty(style));
+            longhands.Add(PropertyNames.BorderImageRepeat, style => new CSSBorderImageRepeatProperty(style));
+            longhands.Add(PropertyNames.BorderImageSource, style => new CSSBorderImageSourceProperty(style));
+            longhands.Add(PropertyNames.BorderImageSlice, style => new CSSBorderImageSliceProperty(style));
+            longhands.Add(PropertyNames.BorderImageWidth, style => new CSSBorderImageWidthProperty(style));
+            longhands.Add(PropertyNames.BorderTopColor, style => new CSSBorderTopColorProperty(style));
+            longhands.Add(PropertyNames.BorderLeftColor, style => new CSSBorderLeftColorProperty(style));
+            longhands.Add(PropertyNames.BorderRightColor, style => new CSSBorderRightColorProperty(style));
+            longhands.Add(PropertyNames.BorderBottomColor, style => new CSSBorderBottomColorProperty(style));
+            longhands.Add(PropertyNames.BorderTopStyle, style => new CSSBorderTopStyleProperty(style));
+            longhands.Add(PropertyNames.BorderLeftStyle, style => new CSSBorderLeftStyleProperty(style));
+            longhands.Add(PropertyNames.BorderRightStyle, style => new CSSBorderRightStyleProperty(style));
+            longhands.Add(PropertyNames.BorderBottomStyle, style => new CSSBorderBottomStyleProperty(style));
+            longhands.Add(PropertyNames.BorderTopWidth, style => new CSSBorderTopWidthProperty(style));
+            longhands.Add(PropertyNames.BorderLeftWidth, style => new CSSBorderLeftWidthProperty(style));
+            longhands.Add(PropertyNames.BorderRightWidth, style => new CSSBorderRightWidthProperty(style));
+            longhands.Add(PropertyNames.BorderBottomWidth, style => new CSSBorderBottomWidthProperty(style));
+            shorthands.Add(PropertyNames.BorderWidth, style => new CSSBorderWidthProperty(style));
+            shorthands.Add(PropertyNames.BorderTop, style => new CSSBorderTopProperty(style));
+            shorthands.Add(PropertyNames.BorderRight, style => new CSSBorderRightProperty(style));
+            shorthands.Add(PropertyNames.BorderBottom, style => new CSSBorderBottomProperty(style));
+            shorthands.Add(PropertyNames.BorderLeft, style => new CSSBorderLeftProperty(style));
+            shorthands.Add(PropertyNames.Border, style => new CSSBorderProperty(style));
+            longhands.Add(PropertyNames.Bottom, style => new CSSBottomProperty(style));
+            shorthands.Add(PropertyNames.Columns, style => new CSSColumnsProperty(style));
+            longhands.Add(PropertyNames.ColumnCount, style => new CSSColumnCountProperty(style));
+            longhands.Add(PropertyNames.ColumnWidth, style => new CSSColumnWidthProperty(style));
+            longhands.Add(PropertyNames.ColumnFill, style => new CSSColumnFillProperty(style));
+            longhands.Add(PropertyNames.ColumnGap, style => new CSSColumnGapProperty(style));
+            longhands.Add(PropertyNames.ColumnSpan, style => new CSSColumnSpanProperty(style));
+            shorthands.Add(PropertyNames.ColumnRule, style => new CSSColumnRuleProperty(style));
+            longhands.Add(PropertyNames.ColumnRuleColor, style => new CSSColumnRuleColorProperty(style));
+            longhands.Add(PropertyNames.ColumnRuleStyle, style => new CSSColumnRuleStyleProperty(style));
+            longhands.Add(PropertyNames.ColumnRuleWidth, style => new CSSColumnRuleWidthProperty(style));
+            longhands.Add(PropertyNames.CaptionSide, style => new CSSCaptionSideProperty(style));
+            longhands.Add(PropertyNames.Clear, style => new CSSClearProperty(style));
+            longhands.Add(PropertyNames.Clip, style => new CSSClipProperty(style));
+            longhands.Add(PropertyNames.Color, style => new CSSColorProperty(style));
+            longhands.Add(PropertyNames.Content, style => new CSSContentProperty(style));
+            longhands.Add(PropertyNames.CounterIncrement, style => new CSSCounterIncrementProperty(style));
+            longhands.Add(PropertyNames.CounterReset, style => new CSSCounterResetProperty(style));
+            longhands.Add(PropertyNames.Cursor, style => new CSSCursorProperty(style));
+            longhands.Add(PropertyNames.Direction, style => new CSSDirectionProperty(style));
+            longhands.Add(PropertyNames.Display, style => new CSSDisplayProperty(style));
+            longhands.Add(PropertyNames.EmptyCells, style => new CSSEmptyCellsProperty(style));
+            longhands.Add(PropertyNames.Float, style => new CSSFloatProperty(style));
+            longhands.Add(PropertyNames.FontFamily, style => new CSSFontFamilyProperty(style));
+            longhands.Add(PropertyNames.FontSize, style => new CSSFontSizeProperty(style));
+            longhands.Add(PropertyNames.FontSizeAdjust, style => new CSSFontSizeAdjustProperty(style));
+            longhands.Add(PropertyNames.FontStyle, style => new CSSFontStyleProperty(style));
+            longhands.Add(PropertyNames.FontVariant, style => new CSSFontVariantProperty(style));
+            longhands.Add(PropertyNames.FontWeight, style => new CSSFontWeightProperty(style));
+            longhands.Add(PropertyNames.FontStretch, style => new CSSFontStretchProperty(style));
+            shorthands.Add(PropertyNames.Font, style => new CSSFontProperty(style));
+            longhands.Add(PropertyNames.Height, style => new CSSHeightProperty(style));
+            longhands.Add(PropertyNames.Left, style => new CSSLeftProperty(style));
+            longhands.Add(PropertyNames.LetterSpacing, style => new CSSLetterSpacingProperty(style));
+            longhands.Add(PropertyNames.LineHeight, style => new CSSLineHeightProperty(style));
+            longhands.Add(PropertyNames.ListStyleImage, style => new CSSListStyleImageProperty(style));
+            longhands.Add(PropertyNames.ListStylePosition, style => new CSSListStylePositionProperty(style));
+            longhands.Add(PropertyNames.ListStyleType, style => new CSSListStyleTypeProperty(style));
+            shorthands.Add(PropertyNames.ListStyle, style => new CSSListStyleProperty(style));
+            longhands.Add(PropertyNames.MarginRight, style => new CSSMarginRightProperty(style));
+            longhands.Add(PropertyNames.MarginLeft, style => new CSSMarginLeftProperty(style));
+            longhands.Add(PropertyNames.MarginTop, style => new CSSMarginTopProperty(style));
+            longhands.Add(PropertyNames.MarginBottom, style => new CSSMarginBottomProperty(style));
+            shorthands.Add(PropertyNames.Margin, style => new CSSMarginProperty(style));
+            longhands.Add(PropertyNames.MaxHeight, style => new CSSMaxHeightProperty(style));
+            longhands.Add(PropertyNames.MaxWidth, style => new CSSMaxWidthProperty(style));
+            longhands.Add(PropertyNames.MinHeight, style => new CSSMinHeightProperty(style));
+            longhands.Add(PropertyNames.MinWidth, style => new CSSMinWidthProperty(style));
+            longhands.Add(PropertyNames.Opacity, style => new CSSOpacityProperty(style));
+            longhands.Add(PropertyNames.Orphans, style => new CSSOrphansProperty(style));
+            longhands.Add(PropertyNames.OutlineColor, style => new CSSOutlineColorProperty(style));
+            longhands.Add(PropertyNames.OutlineStyle, style => new CSSOutlineStyleProperty(style));
+            longhands.Add(PropertyNames.OutlineWidth, style => new CSSOutlineWidthProperty(style));
+            shorthands.Add(PropertyNames.Outline, style => new CSSOutlineProperty(style));
+            longhands.Add(PropertyNames.Overflow, style => new CSSOverflowProperty(style));
+            longhands.Add(PropertyNames.PaddingTop, style => new CSSPaddingTopProperty(style));
+            longhands.Add(PropertyNames.PaddingRight, style => new CSSPaddingRightProperty(style));
+            longhands.Add(PropertyNames.PaddingLeft, style => new CSSPaddingLeftProperty(style));
+            longhands.Add(PropertyNames.PaddingBottom, style => new CSSPaddingBottomProperty(style));
+            shorthands.Add(PropertyNames.Padding, style => new CSSPaddingProperty(style));
+            longhands.Add(PropertyNames.PageBreakAfter, style => new CSSPageBreakAfterProperty(style));
+            longhands.Add(PropertyNames.PageBreakBefore, style => new CSSPageBreakBeforeProperty(style));
+            longhands.Add(PropertyNames.PageBreakInside, style => new CSSPageBreakInsideProperty(style));
+            longhands.Add(PropertyNames.Perspective, style => new CSSPerspectiveProperty(style));
+            longhands.Add(PropertyNames.PerspectiveOrigin, style => new CSSPerspectiveOriginProperty(style));
+            longhands.Add(PropertyNames.Position, style => new CSSPositionProperty(style));
+            longhands.Add(PropertyNames.Quotes, style => new CSSQuotesProperty(style));
+            longhands.Add(PropertyNames.Right, style => new CSSRightProperty(style));
+            longhands.Add(PropertyNames.TableLayout, style => new CSSTableLayoutProperty(style));
+            longhands.Add(PropertyNames.TextAlign, style => new CSSTextAlignProperty(style));
+            shorthands.Add(PropertyNames.TextDecoration, style => new CSSTextDecorationProperty(style));
+            longhands.Add(PropertyNames.TextDecorationStyle, style => new CSSTextDecorationStyleProperty(style));
+            longhands.Add(PropertyNames.TextDecorationLine, style => new CSSTextDecorationLineProperty(style));
+            longhands.Add(PropertyNames.TextDecorationColor, style => new CSSTextDecorationColorProperty(style));
+            longhands.Add(PropertyNames.TextIndent, style => new CSSTextIndentProperty(style));
+            longhands.Add(PropertyNames.TextTransform, style => new CSSTextTransformProperty(style));
+            longhands.Add(PropertyNames.TextShadow, style => new CSSTextShadowProperty(style));
+            longhands.Add(PropertyNames.Transform, style => new CSSTransformProperty(style));
+            longhands.Add(PropertyNames.TransformOrigin, style => new CSSTransformOriginProperty(style));
+            longhands.Add(PropertyNames.TransformStyle, style => new CSSTransformStyleProperty(style));
+            shorthands.Add(PropertyNames.Transition, style => new CSSTransitionProperty(style));
+            longhands.Add(PropertyNames.TransitionDelay, style => new CSSTransitionDelayProperty(style));
+            longhands.Add(PropertyNames.TransitionDuration, style => new CSSTransitionDurationProperty(style));
+            longhands.Add(PropertyNames.TransitionTimingFunction, style => new CSSTransitionTimingFunctionProperty(style));
+            longhands.Add(PropertyNames.TransitionProperty, style => new CSSTransitionPropertyProperty(style));
+            longhands.Add(PropertyNames.Top, style => new CSSTopProperty(style));
+            longhands.Add(PropertyNames.UnicodeBidi, style => new CSSUnicodeBidiProperty(style));
+            longhands.Add(PropertyNames.VerticalAlign, style => new CSSVerticalAlignProperty(style));
+            longhands.Add(PropertyNames.Visibility, style => new CSSVisibilityProperty(style));
+            longhands.Add(PropertyNames.WhiteSpace, style => new CSSWhiteSpaceProperty(style));
+            longhands.Add(PropertyNames.Widows, style => new CSSWidowsProperty(style));
+            longhands.Add(PropertyNames.Width, style => new CSSWidthProperty(style));
+            longhands.Add(PropertyNames.WordSpacing, style => new CSSWordSpacingProperty(style));
+            longhands.Add(PropertyNames.ZIndex, style => new CSSZIndexProperty(style));
         }

         /// <summary>
@@ -176,10 +177,23 @@
             Func<CSSStyleDeclaration, CSSProperty> propertyCreator;
             var property = style.GetProperty(name);

-            if (property == null && properties.TryGetValue(name, out propertyCreator))
+            if (property != null)
+                return property;
+
+            if (longhands.TryGetValue(name, out propertyCreator) || shorthands.TryGetValue(name, out propertyCreator))
                 property = propertyCreator(style);

             return property;
         }
+
+        /// <summary>
+        /// Checks if the given property name is a shorthand property.
+        /// </summary>
+        /// <param name="name">The name of the property.</param>
+        /// <returns>True if the property is a shorthand, otherwise false.</returns>
+        public static Boolean IsShorthand(String name)
+        {
+            return shorthands.ContainsKey(name);
+        }
     }
 }


fix TabHelpers

fix TabHelpers

--- Signum.Web/HtmlHelpers/TabHelpers.cs
+++ Signum.Web/HtmlHelpers/TabHelpers.cs
@@ -59,23 +59,23 @@
             var newTabs = context.ViewOverrides == null ? tabs :
                 context.ViewOverrides.ExpandTabs(tabs, containerId, helper, context);

+            if (newTabs.IsEmpty())
+                return;
+
             TextWriter writer = helper.ViewContext.Writer;
+
+            var first = newTabs.First();

             using (Surround(writer, new HtmlTag("ul", context.Compose(containerId)).Class("nav nav-tabs")))
                 foreach (var t in newTabs)
-                    using (Surround(writer, new HtmlTag("li")))
-                        using (Surround(writer, new HtmlTag("a").Attr("href", "#" + context.Compose(t.Id))))
-                            t.Title.WriteTo(writer);
+                    using (Surround(writer, new HtmlTag("li").Class(t == first ? "active" : null)))
+                    using (Surround(writer, new HtmlTag("a").Attr("href", "#" + context.Compose(t.Id)).Attr("data-toggle", "tab")))
+                        t.Title.WriteTo(writer);

             using (Surround(writer, new HtmlTag("div").Class("tab-content")))
                 foreach (var t in newTabs)
-                    using (Surround(writer, new HtmlTag("div", context.Compose(t.Id))))
+                    using (Surround(writer, new HtmlTag("div", context.Compose(t.Id)).Class("tab-pane fade").Class(t == first ?  "in active" : null)))
                         t.Body.WriteTo(writer);
-
-            //using (Surround(writer, new HtmlTag("script")))
-            //{
-            //    writer.WriteLine("$(function () { $('#myTab a:last').tab('show')  })");
-            //}
         }

         public static IDisposable Surround(TextWriter writer, HtmlTag div)


All examples

All examples

--- ApiExamples/CSharp/ApiExamples/ExRtfLoadOptions.cs
+++ ApiExamples/CSharp/ApiExamples/ExRtfLoadOptions.cs
@@ -17,6 +17,8 @@
         public void RecognizeUtf8Text()
         {
             //ExStart
+            //ExFor:RtfLoadOptions
+            //ExFor:RtfLoadOptions.#ctor
             //ExFor:RtfLoadOptions.RecognizeUtf8Text
             //ExSummary:Shows how to detect UTF8 characters during import.
             RtfLoadOptions loadOptions = new RtfLoadOptions


Fixed name title.

Fixed name title.

--- App2Night/App2Night/CustomView/View/PreviewView.cs
+++ App2Night/App2Night/CustomView/View/PreviewView.cs
@@ -6,6 +6,7 @@
     public class PreviewView : ContentView
     {
         #region views
+
         static Style _labelStyle = new Style(typeof(Label))
         {
             BaseResourceKey = "AccentLabel",
@@ -27,7 +28,7 @@
             WidthRequest = 50,
             Text = "\uf078",
             VerticalOptions = LayoutOptions.Center,
-            ButtonLabel = { FontFamily = "FontAwesome" }
+            ButtonLabel = {FontFamily = "FontAwesome"}
         };

         CustomButton _moreButton = new CustomButton()
@@ -36,12 +37,13 @@
             WidthRequest = 50,
             Text = "\uf061",
             VerticalOptions = LayoutOptions.Center,
-            ButtonLabel = { FontFamily = "FontAwesome" }
+            ButtonLabel = {FontFamily = "FontAwesome"}
         };

         Label _titleLabel = new Label
         {
-            Style = _labelStyle
+            Style = _labelStyle,
+            HorizontalOptions = LayoutOptions.Center
         };

         private BoxView _middleBoxView = new BoxView
@@ -61,7 +63,8 @@
         }

         readonly ContentView _content = new ContentView();
-        #endregion
+
+        #endregion

         public PreviewView(string title, object item)
         {
@@ -78,35 +81,44 @@
                 RowSpacing = 0,
                 RowDefinitions =
                 {
-                    new RowDefinition {Height = new GridLength(1, GridUnitType.Absolute)},
-                    new RowDefinition {Height = new GridLength(50, GridUnitType.Absolute)},
+                    new RowDefinition {Height = new GridLength(1, GridUnitType.Absolute)}, // header information
+                    new RowDefinition {Height = new GridLength(50, GridUnitType.Absolute)}, // content
                     new RowDefinition {Height = new GridLength(1, GridUnitType.Absolute)},
                     new RowDefinition {Height = new GridLength(1, GridUnitType.Star)},
-                },
-                ColumnDefinitions =
-                {
-                    new ColumnDefinition {Width = new GridLength(1, GridUnitType.Star)},
-                    new ColumnDefinition {Width = new GridLength(4, GridUnitType.Star)},
-                    new ColumnDefinition {Width = new GridLength(1, GridUnitType.Star)},
                 },
                 Children =
                 {
                     new BoxView {Color = (Color) Application.Current.Resources["DarkPrimaryColor"]},
                     {_topBoxView, 0, 1},
-                    {_closeButton, 0, 1},
-                    {_titleLabel, 1, 1},
-                    {_moreButton, 2, 1},
+                    // add grid to handle length of party name
+                    {
+                        new Grid
+                        {
+                            ColumnSpacing = 0,
+                            ColumnDefinitions =
+                            {
+                                new ColumnDefinition {Width = new GridLength(1, GridUnitType.Star)},
+                                new ColumnDefinition {Width = new GridLength(4, GridUnitType.Star)},
+                                new ColumnDefinition {Width = new GridLength(1, GridUnitType.Star)},
+                            },
+                            Children =
+                            {
+                                {_closeButton, 0, 0},
+                                {_titleLabel, 1, 0},
+                                {_moreButton, 2, 0}
+                            }
+                        },
+                        0, 1
+                    },
                     {_middleBoxView, 0, 2},
                     {_content, 0, 3}
                 }
             };
-            Grid.SetColumnSpan(_content, 2);
-            Grid.SetColumnSpan(_middleBoxView, 2);
-            Grid.SetColumnSpan(_topBoxView, 2);
             base.Content = mainGrid;
         }

         #region Events
+
         /// <summary>
         /// Starts animation that rotate the <code>_closeButton</code>.
         /// </summary>


Removed unnecessary services

Removed unnecessary services

--- AspNetIdentityDependencyInjectionSample/Startup.cs
+++ AspNetIdentityDependencyInjectionSample/Startup.cs
@@ -31,10 +31,8 @@
             });
             container.GetInstance<IApplicationUserManager>().SeedDatabase();

-            app.CreatePerOwinContext(() => (ApplicationDbContext)container.GetInstance<IUnitOfWork>());
+            // This is necessary for `GenerateUserIdentityAsync` and `SecurityStampValidator` to work internally by ASP.NET Identity 2.x
             app.CreatePerOwinContext(() => (ApplicationUserManager)container.GetInstance<IApplicationUserManager>());
-            app.CreatePerOwinContext(() => (ApplicationSignInManager)container.GetInstance<IApplicationSignInManager>());
-            app.CreatePerOwinContext(() => (ApplicationRoleManager)container.GetInstance<IApplicationRoleManager>());

             // Enable the application to use a cookie to store information for the signed in user
             // and to use a cookie to temporarily store information about a user logging in with a third party login provider


Sanitize screenshot file names

Sanitize screenshot file names

--- Assets/ScreenShooter/Editor/Util/ScreenshotUtil.cs
+++ Assets/ScreenShooter/Editor/Util/ScreenshotUtil.cs
@@ -63,7 +63,7 @@
             }

             var fileName = tag + screenshotConfig.Name + "." + screenshotConfig.Width + "x" + screenshotConfig.Height;
-            var imageFilePath = folder + "/" + fileName + extension;
+            var imageFilePath = folder + "/" + MakeValidFileName(fileName + extension);

             // ReSharper disable once PossibleNullReferenceException
             (new FileInfo(imageFilePath)).Directory.Create();
@@ -71,5 +71,13 @@

             Debug.Log("Image saved to: " + imageFilePath);
         }
+
+        private static string MakeValidFileName(string name)
+        {
+            string invalidChars = System.Text.RegularExpressions.Regex.Escape(new string(Path.GetInvalidFileNameChars()));
+            string invalidRegStr = string.Format(@"([{0}]*\.+$)|([{0}]+)", invalidChars);
+
+            return System.Text.RegularExpressions.Regex.Replace(name, invalidRegStr, "_");
+        }
     }
 }


fix(SDKSetup): changes because of auto populate not serializing

Whenever the auto populate action run the changes done were not
saved. The fix is to let Unity know about the changes so it will
mark the scene as dirty.

This fixes #1187.

--- Assets/VRTK/Scripts/Utilities/SDK/VRTK_SDKSetup.cs
+++ Assets/VRTK/Scripts/Utilities/SDK/VRTK_SDKSetup.cs
@@ -277,6 +277,10 @@
             }
 #endif
             VRTK_SDK_Bridge.InvalidateCaches();
+
+#if UNITY_EDITOR
+            Undo.RecordObject(this, "Populate Object References");
+#endif

             actualBoundaries = null;
             actualHeadset = null;


Minor refactoring and doc update.

Minor refactoring and doc update.

--- AudioWorks/AudioWorks.Extensions/IAudioAnalyzer.cs
+++ AudioWorks/AudioWorks.Extensions/IAudioAnalyzer.cs
@@ -5,7 +5,7 @@
 namespace AudioWorks.Extensions
 {
     /// <summary>
-    /// An extension that can analyze an audio file stream.
+    /// An extension that can analyze audio samples.
     /// </summary>
     [PublicAPI]
     public interface IAudioAnalyzer
@@ -22,11 +22,11 @@
         /// <summary>
         /// Initializes the analyzer.
         /// </summary>
-        /// <param name="audioInfo">The audio information.</param>
+        /// <param name="info">The audio information.</param>
         /// <param name="settings">The settings.</param>
         /// <param name="groupToken">The group token.</param>
         void Initialize(
-            [NotNull] AudioInfo audioInfo,
+            [NotNull] AudioInfo info,
             [NotNull] SettingDictionary settings,
             [NotNull] GroupToken groupToken);


#v4.3.2202.5-rc - minor bug fixes in key generation (#94)

Co-authored-by: praveen <045d6a0ea77ba4303b9d27967b90227e55835e1d@deqode.com>

--- BitPaySetup/Program.cs
+++ BitPaySetup/Program.cs
@@ -135,7 +135,7 @@
             ecKey = KeyUtils.CreateEcKey();
             ecKeyPlain = ecKey.PrivateKey.ToString();
             Console.WriteLine(" Select whether you want token as a plain text format or in a file format");
-            Console.WriteLine(" 1. Generate key (Plain text forrmat)");
+            Console.WriteLine(" 1. Generate key (Plain text format)");
             Console.WriteLine(" 2. Save key in a file (Encrypted format)");
             Console.WriteLine("");
             Console.WriteLine(" Select an option");
@@ -194,17 +194,7 @@
                         throw ex;
                     }

-                    if (KeyUtils.PrivateKeyExists(ecKeyFilePath))
-                    {
-                        SetNotification(" A file with the same name already exists: \n \"" + ecKeyFilePath +
-                                        "\"\n Make sure you want to modify it, then delete it manually before trying again" +
-                                        "\"\n For security reasons we won't delete a private key.", 2);
-
-                        GenerateKeyPair(ecKey);
-                        return;
-                    }
-
-                    // ecKey = KeyUtils.CreateEcKey();
+                    ecKey = KeyUtils.CreateEcKey();
                     KeyUtils.PrivateKeyExists(ecKeyFilePath);
                     KeyUtils.SaveEcKey(ecKey);

@@ -246,18 +236,6 @@
                         ecKeyFilePath = Path.GetFullPath(newEcKeyPath);
                         ecKeyPlain = ecKey.PrivateKey.ToString();
                     }
-                    else
-                    {
-                        if (KeyUtils.PrivateKeyExists(newEcKeyPath))
-                        {
-                            SetNotification(" A file with the same name already exists: \n \"" + newEcKeyPath +
-                                            "\"\n Make sure you want to modify it, then delete it manually before trying again" +
-                                            "\"\n For security reasons we won't delete a private key.", 2);
-
-                            GenerateKeyPair(ecKey);
-                            return;
-                        }
-                    }

                     try
                     {
@@ -354,16 +332,6 @@
                     catch (Exception ex)
                     {
                         throw ex;
-                    }
-
-                    if (KeyUtils.PrivateKeyExists(ecKeyFilePath))
-                    {
-                        SetNotification(" A file with the same name already exists: \n \"" + ecKeyFilePath +
-                                        "\"\n Make sure you want to modify it, then delete it manually before trying again" +
-                                        "\"\n For security reasons we won't delete a private key.", 2);
-
-                        GenerateKeyPair(ecKey);
-                        return;
                     }

                     ecKey = KeyUtils.CreateEcKey();
@@ -405,18 +373,6 @@
                         if (answer.ToLower() == "yes") GenerateKeyPair(ecKey);

                         ecKeyFilePath = Path.GetFullPath(newEcKeyPath);
-                    }
-                    else
-                    {
-                        if (KeyUtils.PrivateKeyExists(newEcKeyPath))
-                        {
-                            SetNotification(" A file with the same name already exists: \n \"" + newEcKeyPath +
-                                            "\"\n Make sure you want to modify it, then delete it manually before trying again" +
-                                            "\"\n For security reasons we won't delete a private key.", 2);
-
-                            GenerateKeyPair(ecKey);
-                            return;
-                        }
                     }

                     try