Change RequiredIf rule to accept a path rather than a single property.  Implement ESY explanation required if decision is yes.  Strip out empty html content in tinymce editor so that requiredness check is accurate.

--- ExoWeb/Rule.cs
+++ ExoWeb/Rule.cs
@@ -97,7 +97,7 @@
 		/// Client-format property path(s) that the rule applies to.
 		/// </summary>
 		[DataMember(Name = "properties")]
-		private string[] PropertyPaths
+		private string[] PropertyPaths
 		{
 			get
 			{
@@ -212,6 +212,138 @@
 		/// </summary>
 		/// <returns>true if <paramref name="root"/> should be associated with the <see cref="ConditionType"/></returns>
 		protected abstract bool ConditionApplies(GraphInstance root);
+
+		/// <summary>
+		///
+		/// </summary>
+		/// <param name="instance"></param>
+		/// <param name="property"></param>
+		/// <returns></returns>
+		private static GraphInstanceList GetInstanceReferenceList(GraphInstance instance, GraphReferenceProperty property)
+		{
+			return instance.GetList(property);
+		}
+
+		/// <summary>
+		///
+		/// </summary>
+		/// <param name="instance"></param>
+		/// <param name="property"></param>
+		/// <returns></returns>
+		private static GraphInstanceList GetInstanceReferenceList(GraphInstance instance, string property)
+		{
+			return GetInstanceReferenceList(instance, instance.Type.Properties[property] as GraphReferenceProperty);
+		}
+
+		/// <summary>
+		///
+		/// </summary>
+		/// <param name="instance"></param>
+		/// <param name="property"></param>
+		/// <returns></returns>
+		private static GraphInstance GetInstanceReference(GraphInstance instance, GraphReferenceProperty property)
+		{
+			return instance.GetReference(property);
+		}
+
+		/// <summary>
+		///
+		/// </summary>
+		/// <param name="instance"></param>
+		/// <param name="property"></param>
+		/// <returns></returns>
+		private static GraphInstance GetInstanceReference(GraphInstance instance, string property)
+		{
+			return GetInstanceReference(instance, instance.Type.Properties[property] as GraphReferenceProperty);
+		}
+
+		/// <summary>
+		///
+		/// </summary>
+		/// <param name="instance"></param>
+		/// <param name="property"></param>
+		/// <returns></returns>
+		private static object GetInstanceValue(GraphInstance instance, GraphValueProperty property)
+		{
+			return instance.GetValue(property);
+		}
+
+		/// <summary>
+		///
+		/// </summary>
+		/// <param name="instance"></param>
+		/// <param name="property"></param>
+		/// <returns></returns>
+		private static object GetInstanceValue(GraphInstance instance, string property)
+		{
+			return GetInstanceValue(instance, instance.Type.Properties[property] as GraphValueProperty);
+		}
+
+		/// <summary>
+		///
+		/// </summary>
+		/// <param name="type"></param>
+		/// <param name="property"></param>
+		/// <returns></returns>
+		private static GraphInstanceList GetStaticReferenceList(GraphType type, GraphReferenceProperty property)
+		{
+			return type.GetList(property);
+		}
+
+		/// <summary>
+		///
+		/// </summary>
+		/// <param name="type"></param>
+		/// <param name="property"></param>
+		/// <returns></returns>
+		private static GraphInstanceList GetStaticReferenceList(GraphType type, string property)
+		{
+			return GetStaticReferenceList(type, type.Properties[property] as GraphReferenceProperty);
+		}
+
+		/// <summary>
+		///
+		/// </summary>
+		/// <param name="type"></param>
+		/// <param name="property"></param>
+		/// <returns></returns>
+		private static GraphInstance GetStaticReference(GraphType type, GraphReferenceProperty property)
+		{
+			return type.GetReference(property);
+		}
+
+		/// <summary>
+		///
+		/// </summary>
+		/// <param name="type"></param>
+		/// <param name="property"></param>
+		/// <returns></returns>
+		private static GraphInstance GetStaticReference(GraphType type, string property)
+		{
+			return GetStaticReference(type, type.Properties[property] as GraphReferenceProperty);
+		}
+
+		/// <summary>
+		///
+		/// </summary>
+		/// <param name="type"></param>
+		/// <param name="property"></param>
+		/// <returns></returns>
+		private static object GetStaticValue(GraphType type, GraphValueProperty property)
+		{
+			return type.GetValue(property);
+		}
+
+		/// <summary>
+		///
+		/// </summary>
+		/// <param name="type"></param>
+		/// <param name="property"></param>
+		/// <returns></returns>
+		private static object GetStaticValue(GraphType type, string property)
+		{
+			return GetStaticValue(type, type.Properties[property] as GraphValueProperty);
+		}

 		/// <summary>
 		/// Gets the value for the given <see cref="GraphInstance"/> for the given <see cref="GraphProperty"/>.
@@ -223,25 +355,57 @@
 		/// <param name="ifInstanceList">Code to execute if the property is an instance list.</param>
 		/// <param name="ifValue">Code to execute if the property is a value.</param>
 		/// <returns>The value resulting from calling the function for the given property type.</returns>
-		protected internal static T ForValue<T>(GraphInstance instance, GraphProperty property,
+		protected internal static T ForInstanceProperty<T>(GraphInstance instance, GraphProperty property,
 			Func<GraphInstance, T> ifInstance, Func<GraphInstanceList, T> ifInstanceList, Func<object, T> ifValue)
 		{
-			if (property is GraphReferenceProperty)
-			{
-				GraphReferenceProperty referenceProperty = (GraphReferenceProperty)property;
+			GraphReferenceProperty referenceProperty = property as GraphReferenceProperty;
+			if (referenceProperty != null)
+			{
 				if (referenceProperty.IsList)
 				{
-					return ifInstanceList(instance.GetList(property as GraphReferenceProperty));
+					return ifInstanceList(GetInstanceReferenceList(instance, referenceProperty));
 				}
 				else
 				{
-					return ifInstance(instance.GetReference(referenceProperty));
+					return ifInstance(GetInstanceReference(instance, referenceProperty));
 				}
 			}
 			else
 			{
 				GraphValueProperty valueProperty = (GraphValueProperty)property;
-				return ifValue(instance.GetValue(valueProperty));
+				return ifValue(GetInstanceValue(instance, valueProperty));
+			}
+		}
+
+		/// <summary>
+		/// Gets the value for the given <see cref="GraphType"/> for the given <see cref="GraphProperty"/>.
+		/// Performs arbitrary logic (depending on the type of property) and returns a value of type <typeparam name="T" />.
+		/// </summary>
+		/// <param name="type">The graph type from which to evaluate the given property.</param>
+		/// <param name="property">The property to evaluate.</param>
+		/// <param name="ifInstance">Code to execute if the property is an instance reference.</param>
+		/// <param name="ifInstanceList">Code to execute if the property is an instance list.</param>
+		/// <param name="ifValue">Code to execute if the property is a value.</param>
+		/// <returns>The value resulting from calling the function for the given property type.</returns>
+		protected internal static T ForStaticProperty<T>(GraphType type, GraphProperty property,
+			Func<GraphInstance, T> ifInstance, Func<GraphInstanceList, T> ifInstanceList, Func<object, T> ifValue)
+		{
+			GraphReferenceProperty referenceProperty = property as GraphReferenceProperty;
+			if (referenceProperty != null)
+			{
+				if (referenceProperty.IsList)
+				{
+					return ifInstanceList(GetStaticReferenceList(type, referenceProperty));
+				}
+				else
+				{
+					return ifInstance(GetStaticReference(type, referenceProperty));
+				}
+			}
+			else
+			{
+				GraphValueProperty valueProperty = (GraphValueProperty)property;
+				return ifValue(GetStaticValue(type, valueProperty));
 			}
 		}

@@ -253,9 +417,18 @@
 		/// <returns>The value of the given instance for the given property.</returns>
 		protected internal static object GetValue(GraphInstance instance, GraphProperty property)
 		{
-			return ForValue<object>(instance, property, reference => reference, list => list, val => val);
-		}
-
+			return ForInstanceProperty<object>(instance, property, reference => reference, list => list, val => val);
+		}
+
+		private static object GetInstancePropertyValue(GraphInstance root, string property)
+		{
+			return ForInstanceProperty<object>(root, root.Type.Properties[property], instance => instance, list => list, value => value);
+		}
+
+		private static object GetStaticPropertyValue(GraphType type, string property)
+		{
+			return ForStaticProperty<object>(type, type.Properties[property], instance => instance, list => list, value => value);
+		}

 		/// <summary>
 		/// Get the value from the given <see cref="GraphInstance"/> for the given <see cref="GraphProperty"/>.
@@ -270,7 +443,89 @@
 		protected internal static bool IfValue(GraphInstance instance, GraphProperty property,
 			Func<GraphInstance, bool> ifInstance, Func<GraphInstanceList, bool> ifInstanceList, Func<object, bool> ifValue)
 		{
-			return ForValue<bool>(instance, property, ifInstance, ifInstanceList, ifValue);
+			return ForInstanceProperty<bool>(instance, property, ifInstance, ifInstanceList, ifValue);
+		}
+
+		private static T EvaluateInstancePath<T>(GraphInstance root, string path, Func<GraphInstance, string, T> resultFn)
+			where T : class
+		{
+			if (string.IsNullOrEmpty(path))
+				return null;
+
+			string[] steps = path.Split('.');
+
+			// Property was found, procede to last step.
+			GraphInstance instance = root;
+
+			for (int i = 0; i < steps.Length - 1; i++)
+			{
+				instance = GetInstanceReference(instance, steps[i]);
+
+				if (instance == null)
+					return null;
+			}
+
+			return resultFn(instance, steps.Last());
+		}
+
+		private static T EvaluateStaticPath<T>(string path, Func<GraphType, string, T> staticResultFn, Func<GraphInstance, string, T> instanceResultFn)
+		{
+			if (string.IsNullOrEmpty(path))
+				return default(T);
+
+			string[] steps = path.Split('.');
+
+			if (steps.Length < 2)
+				return default(T);
+
+			GraphType type = GraphContext.Current.GetGraphType(steps[0]);
+			GraphReferenceProperty firstProp = type.Properties[steps[1]] as GraphReferenceProperty;
+
+			if (firstProp == null)
+			{
+				return default(T);
+			}
+			else if (steps.Length == 2)
+			{
+				return staticResultFn(type, steps[1]);
+			}
+			else
+			{
+				GraphInstance firstInstance = type.GetReference(firstProp);
+				return firstInstance != null ? instanceResultFn(firstInstance, string.Join(".", steps, 2, steps.Length - 2)) : default(T);
+			}
+		}
+
+		protected internal static GraphInstanceList EvaluateInstanceList(GraphInstance root, string path)
+		{
+			if (path.StartsWith("this."))
+				return EvaluateInstancePath<GraphInstanceList>(root, path.Substring(5), GetInstanceReferenceList);
+			else
+				return EvaluateStaticPath<GraphInstanceList>(path, GetStaticReferenceList, GetInstanceReferenceList);
+		}
+
+		protected internal static GraphInstance EvaluateInstance(GraphInstance root, string path)
+		{
+			if (path.StartsWith("this."))
+				return EvaluateInstancePath<GraphInstance>(root, path.Substring(5), GetInstanceReference);
+			else
+				return EvaluateStaticPath<GraphInstance>(path, GetStaticReference, GetInstanceReference);
+		}
+
+		protected internal static object EvaluateValue(GraphInstance root, string path)
+		{
+			if (path.StartsWith("this."))
+				return EvaluateInstancePath<object>(root, path.Substring(5), GetInstanceValue);
+			else
+				return EvaluateStaticPath<object>(path, GetStaticValue, GetInstanceValue);
+		}
+
+		protected internal static object Evaluate(GraphInstance root, string path)
+		{
+			if (path.StartsWith("this."))
+				return EvaluateInstancePath<object>(root, path.Substring(5), GetInstancePropertyValue);
+			else
+				return EvaluateStaticPath<object>(path, GetStaticPropertyValue, GetInstancePropertyValue);
 		}

 		#endregion
@@ -389,22 +644,22 @@

 		#region Constructors

-		public RequiredIfRule(GraphProperty graphProperty, ConditionType conditionType, GraphProperty compareProperty)
+		public RequiredIfRule(GraphProperty graphProperty, ConditionType conditionType, string comparePath)
 			: base(graphProperty, conditionType, ClientRuleType.requiredIf)
 		{
-			Init(compareProperty, Operator.NotEqual, default(TInput));
-		}
-
-		public RequiredIfRule(GraphProperty graphProperty, ConditionType conditionType, GraphProperty compareProperty, TInput compareValue)
+			Init(comparePath, Operator.NotEqual, default(TInput));
+		}
+
+		public RequiredIfRule(GraphProperty graphProperty, ConditionType conditionType, string comparePath, TInput compareValue)
 			: base(graphProperty, conditionType, ClientRuleType.requiredIf)
 		{
-			Init(compareProperty, Operator.Equal, compareValue);
-		}
-
-		public RequiredIfRule(GraphProperty graphProperty, ConditionType conditionType, GraphProperty compareProperty, Operator compareOperator, TInput compareValue)
+			Init(comparePath, Operator.Equal, compareValue);
+		}
+
+		public RequiredIfRule(GraphProperty graphProperty, ConditionType conditionType, string comparePath, Operator compareOperator, TInput compareValue)
 			: base(graphProperty, conditionType, ClientRuleType.requiredIf)
 		{
-			Init(compareProperty, compareOperator, compareValue);
+			Init(comparePath, compareOperator, compareValue);
 		}

 		#endregion
@@ -412,32 +667,15 @@
 		#region Properties

 		/// <summary>
-		/// The property to compare the source property to.
-		/// </summary>
-		public GraphProperty CompareProperty
+		/// The path to compare the compare value to.
+		/// </summary>
+		[DataMember(Name = "comparePath")]
+		public string ComparePath
 		{
 			get;
 			private set;
 		}

-		[DataMember(Name = "comparePath")]
-		public string ComparePropertyText
-		{
-			get
-			{
-				if (comparePropertyText == null)
-				{
-					comparePropertyText = (CompareProperty.IsStatic ? CompareProperty.DeclaringType.Name : "this") + "." + CompareProperty.Name;
-				}
-
-				return comparePropertyText;
-			}
-			private set
-			{
-				comparePropertyText = value;
-			}
-		}
-
 		/// <summary>
 		/// The value to compare to.
 		/// </summary>
@@ -481,12 +719,14 @@

 		#region Methods

-		protected virtual void Init(GraphProperty compareProperty, Operator compareOperator, TInput compareValue)
-		{
-			if (compareProperty == null)
-				throw new ComparePropertyRequiredException();
-
-			this.CompareProperty = compareProperty;
+		protected virtual void Init(string comparePath, Operator compareOperator, TInput compareValue)
+		{
+			if (string.IsNullOrEmpty(comparePath))
+				throw new ComparePathRequiredException();
+
+			// Only instance paths are allowed.
+			this.ComparePath = "this." + comparePath;
+
 			this.CompareOperator = compareOperator;
 			this.CompareValue = compareValue;
 		}
@@ -498,7 +738,7 @@

 		protected bool ShouldEnforce(GraphInstance root)
 		{
-			object compareValue = GetValue(root, CompareProperty);
+			object compareValue = Evaluate(root, ComparePath);

 			// Trim the value is it is a string
 			if (compareValue is string)
@@ -536,18 +776,18 @@
 	{
 		#region Constructors

-		public StructRequiredIfRule(GraphProperty graphProperty, ConditionType conditionType, GraphProperty compareProperty)
-			: base(graphProperty, conditionType, compareProperty)
-		{
-		}
-
-		public StructRequiredIfRule(GraphProperty graphProperty, ConditionType conditionType, GraphProperty compareProperty, T compareValue)
-			: base(graphProperty, conditionType, compareProperty, compareValue)
-		{
-		}
-
-		public StructRequiredIfRule(GraphProperty graphProperty, ConditionType conditionType, GraphProperty compareProperty, Operator compareOperator, T compareValue)
-			: base(graphProperty, conditionType, compareProperty, compareOperator, compareValue)
+		public StructRequiredIfRule(GraphProperty graphProperty, ConditionType conditionType, string comparePath)
+			: base(graphProperty, conditionType, comparePath)
+		{
+		}
+
+		public StructRequiredIfRule(GraphProperty graphProperty, ConditionType conditionType, string comparePath, T compareValue)
+			: base(graphProperty, conditionType, comparePath, compareValue)
+		{
+		}
+
+		public StructRequiredIfRule(GraphProperty graphProperty, ConditionType conditionType, string comparePath, Operator compareOperator, T compareValue)
+			: base(graphProperty, conditionType, comparePath, compareOperator, compareValue)
 		{
 		}

@@ -586,18 +826,18 @@

 		#region Constructors

-		public ClassRequiredIfRule(GraphProperty graphProperty, ConditionType conditionType, GraphProperty compareProperty)
-			: base(graphProperty, conditionType, compareProperty)
-		{
-		}
-
-		public ClassRequiredIfRule(GraphProperty graphProperty, ConditionType conditionType, GraphProperty compareProperty, object compareValue)
-			: base(graphProperty, conditionType, compareProperty, compareValue)
-		{
-		}
-
-		public ClassRequiredIfRule(GraphProperty graphProperty, ConditionType conditionType, GraphProperty compareProperty, Operator compareOperator, object compareValue)
-			: base(graphProperty, conditionType, compareProperty, compareOperator, compareValue)
+		public ClassRequiredIfRule(GraphProperty graphProperty, ConditionType conditionType, string comparePath)
+			: base(graphProperty, conditionType, comparePath)
+		{
+		}
+
+		public ClassRequiredIfRule(GraphProperty graphProperty, ConditionType conditionType, string comparePath, object compareValue)
+			: base(graphProperty, conditionType, comparePath, compareValue)
+		{
+		}
+
+		public ClassRequiredIfRule(GraphProperty graphProperty, ConditionType conditionType, string comparePath, Operator compareOperator, object compareValue)
+			: base(graphProperty, conditionType, comparePath, compareOperator, compareValue)
 		{
 		}

@@ -634,9 +874,9 @@
 	/// An exception that is thrown when the CompareProperty is not
 	/// specified for a CompareRule or RequiredIfRule.
 	/// </summary>
-	public sealed class ComparePropertyRequiredException : Exception
-	{
-		internal ComparePropertyRequiredException()
+	public sealed class ComparePathRequiredException : Exception
+	{
+		internal ComparePathRequiredException()
 			: base("The CompareProperty for this rule is required.")
 		{
 		}
@@ -733,6 +973,8 @@
 	[DataContract(Name = "allowedValues")]
 	public class AllowedValuesRule : PropertyRule
 	{
+		#region Constructors
+
 		public AllowedValuesRule(GraphProperty graphProperty, ConditionType conditionType, string source, bool autoInclude)
 			: base(graphProperty, conditionType, ClientRuleType.allowedValues)
 		{
@@ -740,59 +982,18 @@
 			this.AutoInclude = autoInclude;
 		}

+		#endregion
+
+		#region Properties
+
 		[DataMember(Name = "source")]
 		public string Source { get; private set; }

 		public bool AutoInclude { get; private set; }

-		#region Source Evaluation Logic
-		GraphInstanceList EvaluateInstancePath(GraphInstance root, string path)
-		{
-			if (string.IsNullOrEmpty(path))
-				return null;
-
-			string[] steps = path.Split('.');
-
-			// property was found, procede to last step
-			GraphInstance instance = root;
-
-			for (int i = 0; i < steps.Length - 1; i++)
-			{
-				instance = instance.GetReference(steps[i]);
-
-				if (instance == null)
-					return null;
-			}
-			return instance.GetList(steps.Last());
-
-		}
-
-		GraphInstanceList EvaluateStaticPath(string path)
-		{
-			if (string.IsNullOrEmpty(path))
-				return null;
-
-			string[] steps = path.Split('.');
-
-			if(steps.Length < 2)
-				return null;
-
-			GraphType type = GraphContext.Current.GetGraphType(steps[0]);
-			GraphReferenceProperty firstProp = type.Properties[steps[1]] as GraphReferenceProperty;
-
-			if (firstProp == null)
-				return null;
-			else if (steps.Length == 2)
-			{
-				return type.GetList(firstProp);
-			}
-			else
-			{
-				GraphInstance firstInstance = Type.GetReference(firstProp);
-				return firstInstance != null ? EvaluateInstancePath(firstInstance, string.Join(".", steps, 2, steps.Length - 2)) : null;
-			}
-		}
-		#endregion
+		#endregion
+
+		#region Methods

 		protected override bool ConditionApplies(GraphInstance root)
 		{
@@ -802,10 +1003,7 @@

 			try
 			{
-				if (Source.StartsWith("this."))
-					allowedValues = EvaluateInstancePath(root, Source.Substring(5));
-				else
-					allowedValues = EvaluateStaticPath(Source);
+				allowedValues = EvaluateInstanceList(root, Source);

 				return !(allowedValues == null || allowedValues.Select(graphInstance => graphInstance.Instance).Contains(value));
 			}
@@ -814,6 +1012,8 @@
 				return false;
 			}
 		}
+
+		#endregion
 	}

 	#endregion
@@ -836,7 +1036,7 @@
 			: base(graphProperty, conditionType, ClientRuleType.compare)
 		{
 			if (compareProperty == null)
-				throw new ComparePropertyRequiredException();
+				throw new ComparePathRequiredException();

 			this.CompareProperty = compareProperty;
 			this.CompareOperator = compareOperator;


remove unneeded lib references

remove unneeded lib references

--- UnityProject/Assets/Scripts/UI/PlayerChatBubble/PlayerChatBubble.cs
+++ UnityProject/Assets/Scripts/UI/PlayerChatBubble/PlayerChatBubble.cs
@@ -1,11 +1,8 @@
 using System.Collections;
 using System.Collections.Generic;
-using System.Globalization;
 using System.Linq;
-using IngameDebugConsole;
 using TMPro;
 using UnityEngine;
-using UnityEngine.UI;

 /// <summary>
 /// Handles the ChatIcon and PlayerChatBubble.


Fixes #96: Support IVisual

Fixes #96: Support IVisual

--- XamlCSS.XamarinForms/ComponentModel/XamarinTypeConverterProvider.cs
+++ XamlCSS.XamarinForms/ComponentModel/XamarinTypeConverterProvider.cs
@@ -24,6 +24,7 @@
             Register<float, NumberTypeConverter<float>>();
             Register<double, NumberTypeConverter<double>>();

+            Register<IVisual, VisualTypeConverter>();
             Register<Font, FontTypeConverter>();
             Register<Binding, BindingTypeConverter>();
             Register<BoundsConstraint, BoundsTypeConverter>();


[RFC] invalidate SystemColors / SystemResources on a new thread

- This gets rid of the small UI hickup when changing theme/accents (noticeable if you have A LOT of complex ui elements, like charts)

--- MahApps.Metro/ThemeManager.cs
+++ MahApps.Metro/ThemeManager.cs
@@ -9,6 +9,7 @@

 namespace MahApps.Metro
 {
+    using System.Threading;

     /// <summary>
     /// A class that allows for the detection and alteration of a MetroWindow's theme and accent.
@@ -301,27 +302,31 @@
         {
             SafeRaise.Raise(IsThemeChanged, Application.Current, new OnThemeChangedEventArgs() { Theme = newTheme, Accent = newAccent });

-            if (SystemColors_InvalidateColors != null)
-            {
-                SystemColors_InvalidateColors.Invoke(null, null);
-            }
-
-            // See: https://github.com/MahApps/MahApps.Metro/issues/923
-            //var invalidateParameters = typeof(SystemParameters).GetMethod("InvalidateCache", BindingFlags.Static | BindingFlags.NonPublic, null, Type.EmptyTypes, null);
-            //if (invalidateParameters != null)
-            //{
-            //    invalidateParameters.Invoke(null, null);
-            //}
-
-            if (SystemResources_OnThemeChanged != null)
-            {
-                SystemResources_OnThemeChanged.Invoke(null, null);
-            }
-
-            if (SystemResources_InvalidateResources != null)
-            {
-                SystemResources_InvalidateResources.Invoke(null, new object[] { false });
-            }
+            new Thread(
+                () =>
+                    {
+                        if (SystemColors_InvalidateColors != null)
+                        {
+                            SystemColors_InvalidateColors.Invoke(null, null);
+                        }
+
+                        // See: https://github.com/MahApps/MahApps.Metro/issues/923
+                        //var invalidateParameters = typeof(SystemParameters).GetMethod("InvalidateCache", BindingFlags.Static | BindingFlags.NonPublic, null, Type.EmptyTypes, null);
+                        //if (invalidateParameters != null)
+                        //{
+                        //    invalidateParameters.Invoke(null, null);
+                        //}
+
+                        if (SystemResources_OnThemeChanged != null)
+                        {
+                            SystemResources_OnThemeChanged.Invoke(null, null);
+                        }
+
+                        if (SystemResources_InvalidateResources != null)
+                        {
+                            SystemResources_InvalidateResources.Invoke(null, new object[] { false });
+                        }
+                    }).Start();
         }
     }


Another attempt

Another attempt

--- MapViewServer/VtfConverter.cs
+++ MapViewServer/VtfConverter.cs
@@ -109,8 +109,11 @@
                 src.CopyTo( process.StandardInput.BaseStream );
                 process.StandardInput.Close();

-                process.WaitForExit();
-                process.StandardOutput.BaseStream.CopyTo( dst );
+                while ( !process.HasExited )
+                {
+                    process.StandardOutput.BaseStream.CopyTo( dst );
+                    process.WaitForExit( 1 );
+                }
             }
             else
             {


Resolves issue #20

Resolves issue #20

--- Model/OpenXmlReportCreator.cs
+++ Model/OpenXmlReportCreator.cs
@@ -1396,10 +1396,21 @@
             assetName = assetName.Replace("\r\n", "__");
             string outputPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\AcasScanOutput_TextFiles";
             string outputTextFile = string.Empty;
-            if (cellValue.Contains("Title:"))
-            { outputTextFile = outputPath + @"\" + assetName + "_" + pluginId + "_VulnerabilityDescription.txt"; }
+
+            if (!AcasFindingsShouldBeMerged)
+            {
+                if (cellValue.Contains("Title:"))
+                { outputTextFile = outputPath + @"\" + assetName + "_" + pluginId + "_VulnerabilityDescription.txt"; }
+                else
+                { outputTextFile = outputPath + @"\" + assetName + "_" + pluginId + "_ScanOutput.txt"; }
+            }
             else
-            { outputTextFile = outputPath + @"\" + assetName + "_" + pluginId + "_ScanOutput.txt"; }
+            {
+                if (cellValue.Contains("Title:"))
+                { outputTextFile = outputPath + @"\" + pluginId + "_VulnerabilityDescription.txt"; }
+                else
+                { outputTextFile = outputPath + @"\" + pluginId + "_ScanOutput.txt"; }
+            }
             if (!Directory.Exists(outputPath))
             { Directory.CreateDirectory(outputPath); }
             if (!File.Exists(outputTextFile))


Fixed bug in Descendants operation

Fixed bug in Descendants operation

--- Models/Models/ModelElement.cs
+++ Models/Models/ModelElement.cs
@@ -828,6 +828,8 @@
                     var e = new UriChangedEventArgs(originalAbsoluteUri);
                     OnDeleting(e);
                     OnDeleted(e);
+                    // only bubble deletion for deleted root
+                    OnBubbledChange(BubbledChangeEventArgs.ElementDeleted(this, e));
                 }
                 SetParent(null);
             }
@@ -867,7 +869,6 @@
                 }
             }
             Deleted?.Invoke(this, e);
-            OnBubbledChange(BubbledChangeEventArgs.ElementDeleted(this, e));
             UnsetFlag(ModelElementFlag.Deleting);
         }


inline the shit out of the Matrix2D methods

--- Nez.Portable/Math/Matrix2D.cs
+++ Nez.Portable/Math/Matrix2D.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 using Microsoft.Xna.Framework;

@@ -126,6 +127,7 @@
 		/// <param name="matrix1">The first matrix to add.</param>
 		/// <param name="matrix2">The second matrix to add.</param>
 		/// <returns>The result of the matrix addition.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D add( Matrix2D matrix1, Matrix2D matrix2 )
 		{
 			matrix1.M11 += matrix2.M11;
@@ -147,6 +149,7 @@
 		/// <param name="matrix1">The first matrix to add.</param>
 		/// <param name="matrix2">The second matrix to add.</param>
 		/// <param name="result">The result of the matrix addition as an output parameter.</param>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static void add( ref Matrix2D matrix1, ref Matrix2D matrix2, out Matrix2D result )
 		{
 			result.M11 = matrix1.M11 + matrix2.M11;
@@ -165,6 +168,7 @@
 		/// </summary>
 		/// <param name="radians">Angle in radians.</param>
 		/// <returns>The rotation <see cref="Matrix2D"/> around Z axis.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D createRotation( float radians )
 		{
 			Matrix2D result;
@@ -178,6 +182,7 @@
 		/// </summary>
 		/// <param name="radians">Angle in radians.</param>
 		/// <param name="result">The rotation <see cref="Matrix2D"/> around Z axis as an output parameter.</param>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static void createRotation( float radians, out Matrix2D result )
 		{
 			result = Matrix2D.identity;
@@ -197,6 +202,7 @@
 		/// </summary>
 		/// <param name="scale">Scale value for all three axises.</param>
 		/// <returns>The scaling <see cref="Matrix2D"/>.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D createScale( float scale )
 		{
 			Matrix2D result;
@@ -210,6 +216,7 @@
 		/// </summary>
 		/// <param name="scale">Scale value for all three axises.</param>
 		/// <param name="result">The scaling <see cref="Matrix2D"/> as an output parameter.</param>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static void createScale( float scale, out Matrix2D result )
 		{
 			createScale( scale, scale, out result );
@@ -222,6 +229,7 @@
 		/// <param name="xScale">Scale value for X axis.</param>
 		/// <param name="yScale">Scale value for Y axis.</param>
 		/// <returns>The scaling <see cref="Matrix2D"/>.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D createScale( float xScale, float yScale )
 		{
 			Matrix2D result;
@@ -236,6 +244,7 @@
 		/// <param name="xScale">Scale value for X axis.</param>
 		/// <param name="yScale">Scale value for Y axis.</param>
 		/// <param name="result">The scaling <see cref="Matrix2D"/> as an output parameter.</param>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static void createScale( float xScale, float yScale, out Matrix2D result )
 		{
 			result.M11 = xScale;
@@ -254,6 +263,7 @@
 		/// </summary>
 		/// <param name="scale"><see cref="Vector2"/> representing x and y scale values.</param>
 		/// <returns>The scaling <see cref="Matrix2D"/>.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D createScale( Vector2 scale )
 		{
 			Matrix2D result;
@@ -267,6 +277,7 @@
 		/// </summary>
 		/// <param name="scale"><see cref="Vector3"/> representing x,y and z scale values.</param>
 		/// <param name="result">The scaling <see cref="Matrix2D"/> as an output parameter.</param>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static void createScale( ref Vector2 scale, out Matrix2D result )
 		{
 			result.M11 = scale.X;
@@ -286,6 +297,7 @@
 		/// <param name="xPosition">X coordinate of translation.</param>
 		/// <param name="yPosition">Y coordinate of translation.</param>
 		/// <returns>The translation <see cref="Matrix2D"/>.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D createTranslation( float xPosition, float yPosition )
 		{
 			Matrix2D result;
@@ -299,6 +311,7 @@
 		/// </summary>
 		/// <param name="position">X,Y and Z coordinates of translation.</param>
 		/// <param name="result">The translation <see cref="Matrix2D"/> as an output parameter.</param>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static void createTranslation( ref Vector2 position, out Matrix2D result )
 		{
 			result.M11 = 1;
@@ -317,6 +330,7 @@
 		/// </summary>
 		/// <param name="position">X,Y and Z coordinates of translation.</param>
 		/// <returns>The translation <see cref="Matrix2D"/>.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D createTranslation( Vector2 position )
 		{
 			Matrix2D result;
@@ -331,6 +345,7 @@
 		/// <param name="xPosition">X coordinate of translation.</param>
 		/// <param name="yPosition">Y coordinate of translation.</param>
 		/// <param name="result">The translation <see cref="Matrix2D"/> as an output parameter.</param>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static void createTranslation( float xPosition, float yPosition, out Matrix2D result )
 		{
 			result.M11 = 1;
@@ -344,12 +359,14 @@
 		}

+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public float determinant()
 		{
 			return M11 * M22 - M12 * M21;
 		}

+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static void invert( ref Matrix2D matrix, out Matrix2D result )
 		{
 			var det = 1 / matrix.determinant();
@@ -371,6 +388,7 @@
 		/// <param name="matrix1">Source <see cref="Matrix2D"/>.</param>
 		/// <param name="matrix2">Divisor <see cref="Matrix2D"/>.</param>
 		/// <returns>The result of dividing the matrix.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D divide( Matrix2D matrix1, Matrix2D matrix2 )
 		{
 			matrix1.M11 = matrix1.M11 / matrix2.M11;
@@ -391,6 +409,7 @@
 		/// <param name="matrix1">Source <see cref="Matrix2D"/>.</param>
 		/// <param name="matrix2">Divisor <see cref="Matrix2D"/>.</param>
 		/// <param name="result">The result of dividing the matrix as an output parameter.</param>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static void divide( ref Matrix2D matrix1, ref Matrix2D matrix2, out Matrix2D result )
 		{
 			result.M11 = matrix1.M11 / matrix2.M11;
@@ -410,6 +429,7 @@
 		/// <param name="matrix1">Source <see cref="Matrix2D"/>.</param>
 		/// <param name="divider">Divisor scalar.</param>
 		/// <returns>The result of dividing a matrix by a scalar.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D divide( Matrix2D matrix1, float divider )
 		{
 			float num = 1f / divider;
@@ -432,6 +452,7 @@
 		/// <param name="matrix1">Source <see cref="Matrix2D"/>.</param>
 		/// <param name="divider">Divisor scalar.</param>
 		/// <param name="result">The result of dividing a matrix by a scalar as an output parameter.</param>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static void divide( ref Matrix2D matrix1, float divider, out Matrix2D result )
 		{
 			float num = 1f / divider;
@@ -453,6 +474,7 @@
 		/// <param name="matrix2">The second <see cref="Vector2"/>.</param>
 		/// <param name="amount">Weighting value(between 0.0 and 1.0).</param>
 		/// <returns>>The result of linear interpolation of the specified matrixes.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D lerp( Matrix2D matrix1, Matrix2D matrix2, float amount )
 		{
 			matrix1.M11 = matrix1.M11 + ( ( matrix2.M11 - matrix1.M11 ) * amount );
@@ -474,6 +496,7 @@
 		/// <param name="matrix2">The second <see cref="Vector2"/>.</param>
 		/// <param name="amount">Weighting value(between 0.0 and 1.0).</param>
 		/// <param name="result">The result of linear interpolation of the specified matrixes as an output parameter.</param>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static void lerp( ref Matrix2D matrix1, ref Matrix2D matrix2, float amount, out Matrix2D result )
 		{
 			result.M11 = matrix1.M11 + ( ( matrix2.M11 - matrix1.M11 ) * amount );
@@ -493,6 +516,7 @@
 		/// <param name="matrix1">Source <see cref="Matrix2D"/>.</param>
 		/// <param name="matrix2">Source <see cref="Matrix2D"/>.</param>
 		/// <returns>Result of the matrix multiplication.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D multiply( Matrix2D matrix1, Matrix2D matrix2 )
 		{
 			var m11 = ( matrix1.M11 * matrix2.M11 ) + ( matrix1.M12 * matrix2.M21 );
@@ -522,6 +546,7 @@
 		/// <param name="matrix1">Source <see cref="Matrix2D"/>.</param>
 		/// <param name="matrix2">Source <see cref="Matrix2D"/>.</param>
 		/// <param name="result">Result of the matrix multiplication as an output parameter.</param>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static void multiply( ref Matrix2D matrix1, ref Matrix2D matrix2, out Matrix2D result )
 		{
 			var m11 = ( matrix1.M11 * matrix2.M11 ) + ( matrix1.M12 * matrix2.M21 );
@@ -550,6 +575,7 @@
 		/// <param name="matrix1">Source <see cref="Matrix2D"/>.</param>
 		/// <param name="scaleFactor">Scalar value.</param>
 		/// <returns>Result of the matrix multiplication with a scalar.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D multiply( Matrix2D matrix1, float scaleFactor )
 		{
 			matrix1.M11 *= scaleFactor;
@@ -570,6 +596,7 @@
 		/// <param name="matrix1">Source <see cref="Matrix2D"/>.</param>
 		/// <param name="scaleFactor">Scalar value.</param>
 		/// <param name="result">Result of the matrix multiplication with a scalar as an output parameter.</param>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static void multiply( ref Matrix2D matrix1, float scaleFactor, out Matrix2D result )
 		{
 			result.M11 = matrix1.M11 * scaleFactor;
@@ -589,6 +616,7 @@
 		/// <param name="matrix1">Source <see cref="Matrix2D"/> on the left of the add sign.</param>
 		/// <param name="matrix2">Source <see cref="Matrix2D"/> on the right of the add sign.</param>
 		/// <returns>Sum of the matrixes.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D operator +( Matrix2D matrix1, Matrix2D matrix2 )
 		{
 			matrix1.M11 = matrix1.M11 + matrix2.M11;
@@ -609,6 +637,7 @@
 		/// <param name="matrix1">Source <see cref="Matrix2D"/> on the left of the div sign.</param>
 		/// <param name="matrix2">Divisor <see cref="Matrix2D"/> on the right of the div sign.</param>
 		/// <returns>The result of dividing the matrixes.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D operator /( Matrix2D matrix1, Matrix2D matrix2 )
 		{
 			matrix1.M11 = matrix1.M11 / matrix2.M11;
@@ -629,6 +658,7 @@
 		/// <param name="matrix">Source <see cref="Matrix2D"/> on the left of the div sign.</param>
 		/// <param name="divider">Divisor scalar on the right of the div sign.</param>
 		/// <returns>The result of dividing a matrix by a scalar.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D operator /( Matrix2D matrix, float divider )
 		{
 			float num = 1f / divider;
@@ -650,6 +680,7 @@
 		/// <param name="matrix1">Source <see cref="Matrix2D"/> on the left of the equal sign.</param>
 		/// <param name="matrix2">Source <see cref="Matrix2D"/> on the right of the equal sign.</param>
 		/// <returns><c>true</c> if the instances are equal; <c>false</c> otherwise.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static bool operator ==( Matrix2D matrix1, Matrix2D matrix2 )
 		{
 			return (
@@ -671,6 +702,7 @@
 		/// <param name="matrix1">Source <see cref="Matrix2D"/> on the left of the not equal sign.</param>
 		/// <param name="matrix2">Source <see cref="Matrix2D"/> on the right of the not equal sign.</param>
 		/// <returns><c>true</c> if the instances are not equal; <c>false</c> otherwise.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static bool operator !=( Matrix2D matrix1, Matrix2D matrix2 )
 		{
 			return (
@@ -695,6 +727,7 @@
 		/// <remarks>
 		/// Using matrix multiplication algorithm - see http://en.wikipedia.org/wiki/Matrix_multiplication.
 		/// </remarks>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D operator *( Matrix2D matrix1, Matrix2D matrix2 )
 		{
 			var m11 = ( matrix1.M11 * matrix2.M11 ) + ( matrix1.M12 * matrix2.M21 );
@@ -725,6 +758,7 @@
 		/// <param name="matrix">Source <see cref="Matrix2D"/> on the left of the mul sign.</param>
 		/// <param name="scaleFactor">Scalar value on the right of the mul sign.</param>
 		/// <returns>Result of the matrix multiplication with a scalar.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D operator *( Matrix2D matrix, float scaleFactor )
 		{
 			matrix.M11 = matrix.M11 * scaleFactor;
@@ -745,6 +779,7 @@
 		/// <param name="matrix1">Source <see cref="Matrix2D"/> on the left of the sub sign.</param>
 		/// <param name="matrix2">Source <see cref="Matrix2D"/> on the right of the sub sign.</param>
 		/// <returns>Result of the matrix subtraction.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D operator -( Matrix2D matrix1, Matrix2D matrix2 )
 		{
 			matrix1.M11 = matrix1.M11 - matrix2.M11;
@@ -764,6 +799,7 @@
 		/// </summary>
 		/// <param name="matrix">Source <see cref="Matrix2D"/> on the right of the sub sign.</param>
 		/// <returns>Result of the inversion.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D operator -( Matrix2D matrix )
 		{
 			matrix.M11 = -matrix.M11;
@@ -784,6 +820,7 @@
 		/// <param name="matrix1">The first <see cref="Matrix2D"/>.</param>
 		/// <param name="matrix2">The second <see cref="Matrix2D"/>.</param>
 		/// <returns>The result of the matrix subtraction.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D subtract( Matrix2D matrix1, Matrix2D matrix2 )
 		{
 			matrix1.M11 = matrix1.M11 - matrix2.M11;
@@ -804,6 +841,7 @@
 		/// <param name="matrix1">The first <see cref="Matrix2D"/>.</param>
 		/// <param name="matrix2">The second <see cref="Matrix2D"/>.</param>
 		/// <param name="result">The result of the matrix subtraction as an output parameter.</param>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static void subtract( ref Matrix2D matrix1, ref Matrix2D matrix2, out Matrix2D result )
 		{
 			result.M11 = matrix1.M11 - matrix2.M11;
@@ -822,6 +860,7 @@
 		/// </summary>
 		/// <param name="matrix">The matrix for transposing operation.</param>
 		/// <returns>The new <see cref="Matrix2D"/> which contains the transposing result.</returns>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static Matrix2D transpose( Matrix2D matrix )
 		{
 			Matrix2D ret;
@@ -835,6 +874,7 @@
 		/// </summary>
 		/// <param name="matrix">The matrix for transposing operation.</param>
 		/// <param name="result">The new <see cref="Matrix2D"/> which contains the transposing result as an output parameter.</param>
+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public static void transpose( ref Matrix2D matrix, out Matrix2D result )
 		{
 			Matrix2D ret;
@@ -854,6 +894,7 @@

 		#region public methods

+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public void multiplyTranslation( float x, float y )
 		{
 			var trans = createTranslation( x, y );
@@ -861,6 +902,7 @@
 		}

+		[MethodImpl( MethodImplOptions.AggressiveInlining )]
 		public void multiplyRotation( float radians )
 		{
 			var rot = createRotation( radians );


Remove unused parameter

Remove unused parameter

--- osu.Game/Screens/Menu/OsuLogo.cs
+++ osu.Game/Screens/Menu/OsuLogo.cs
@@ -213,7 +213,7 @@
         }

         [BackgroundDependencyLoader]
-        private void load(TextureStore textures, AudioManager audio, OsuGameBase game)
+        private void load(TextureStore textures, AudioManager audio)
         {
             sampleClick = audio.Sample.Get(@"Menu/menuhit");
             logo.Texture = textures.Get(@"Menu/logo");


Cleaned up Program.cs

Cleaned up Program.cs

--- NugetPackageReport/Program.cs
+++ NugetPackageReport/Program.cs
@@ -12,43 +12,7 @@
         private static string inputPath;
         private static string outputPath;

-        /// <summary>
-        /// Entry point for program
-        /// </summary>
-        /// <param name="args">Arguments for Program, First argument is the input path and second argument is the output path</param>
-        private static void Main(string[] args)
-        {
-            if (!validateArguments(args))
-            {
-                return;
-            }
-
-            var results = Processor.Process(inputPath);
-
-            ReportWriter.GenerateReport(inputPath, outputPath, results);
-        }
-
-        private static bool testPath(string path, string outputMessageType)
-        {
-            try
-            {
-                var inputPath = Path.GetFullPath(path);
-
-                if (!Directory.Exists(inputPath))
-                {
-                    Console.WriteLine("The {0} directory does not exist!", outputMessageType);
-                    return false;
-                }
-                return true;
-            }
-            catch (Exception)
-            {
-                Console.WriteLine("The {0} directory is not a valid file path", outputMessageType);
-            }
-            return false;
-        }
-
-        private static bool validateArguments(string[] args)
+        private static bool handleArguments(string[] args)
         {
             if (args.Length != 2)
             {
@@ -56,19 +20,38 @@
                 return false;
             }

-            var result = testPath(args[0], "Input");
+            var validPaths = testPath(args[0], "Input") && testPath(args[1], "Output");

-            if (!result)
+            if (!validPaths)
                 return false;

             inputPath = args[0];
+            outputPath = args[1];

-            result = testPath(args[1], "Output");
+            return true;
+        }

-            if (!result)
+        /// <summary>
+        /// Entry point for the program.
+        /// </summary>
+        /// <param name="args">Arguments for the program. First argument is the input path; second argument is the output path.</param>
+        private static void Main(string[] args)
+        {
+            if (!handleArguments(args))
+                return;
+
+            var results = Processor.Process(inputPath);
+
+            ReportWriter.GenerateReport(inputPath, outputPath, results);
+        }
+
+        private static bool testPath(string path, string directoryType)
+        {
+            if (!Directory.Exists(path))
+            {
+                Console.WriteLine("Can't access the {0} directory!", directoryType);
                 return false;
-
-            outputPath = args[1];
+            }

             return true;
         }


LIBOMV-636: More timer cleanup

LIBOMV-636: More timer cleanup

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

--- OpenMetaverse/TextureCache.cs
+++ OpenMetaverse/TextureCache.cs
@@ -45,6 +45,7 @@
         private Thread cleanerThread;
         private System.Timers.Timer cleanerTimer;
         private double pruneInterval = 1000 * 60 * 5;
+        private bool autoPruneEnabled = true;

         /// <summary>
         /// Allows setting weather to periodicale prune the cache if it grows too big
@@ -54,16 +55,10 @@
         {
             set
             {
-                if (!Operational())
-                {
-                    return;
-                }
-                else
-                {
-                    cleanerTimer.Enabled = value;
-                }
-            }
-            get { return cleanerTimer.Enabled; }
+                autoPruneEnabled = value;
+                SetupTimer();
+            }
+            get { return autoPruneEnabled; }
         }

         /// <summary>
@@ -71,12 +66,12 @@
         /// </summary>
         public double AutoPruneInterval
         {
+            set
+            {
+                pruneInterval = value;
+                SetupTimer();
+            }
             get { return pruneInterval; }
-            set
-            {
-                pruneInterval = value;
-                cleanerTimer.Interval = pruneInterval;
-            }
         }

         /// <summary>
@@ -86,15 +81,38 @@
         public TextureCache(GridClient client)
         {
             Client = client;
-            cleanerTimer = new System.Timers.Timer(pruneInterval);
-            cleanerTimer.Elapsed += new System.Timers.ElapsedEventHandler(cleanerTimer_Elapsed);
-            if (Operational())
-            {
+            Client.Network.OnConnected += new NetworkManager.ConnectedCallback(Network_OnConnected);
+            Client.Network.OnDisconnected += new NetworkManager.DisconnectedCallback(Network_OnDisconnected);
+        }
+
+        void Network_OnDisconnected(NetworkManager.DisconnectType reason, string message)
+        {
+            if (cleanerTimer != null)
+            {
+                cleanerTimer.Dispose();
+                cleanerTimer = null;
+            }
+        }
+
+        void Network_OnConnected(object sender)
+        {
+            SetupTimer();
+        }
+
+        /// <summary>
+        /// Only create timer when needed
+        /// </summary>
+        private void SetupTimer()
+        {
+            if (Operational() && autoPruneEnabled && Client.Network.Connected)
+            {
+                if (cleanerTimer == null)
+                {
+                    cleanerTimer = new System.Timers.Timer(pruneInterval);
+                    cleanerTimer.Elapsed += new System.Timers.ElapsedEventHandler(cleanerTimer_Elapsed);
+                }
+                cleanerTimer.Interval = pruneInterval;
                 cleanerTimer.Enabled = true;
-            }
-            else
-            {
-                cleanerTimer.Enabled = false;
             }
         }


dont check for updates in development (win)

fixes #899

--- src/ui/windows/TogglDesktop/TogglDesktop/AboutWindowController.cs
+++ src/ui/windows/TogglDesktop/TogglDesktop/AboutWindowController.cs
@@ -36,11 +36,25 @@
         private void comboBoxChannel_SelectedIndexChanged(object sender, EventArgs e)
         {
             Toggl.SetUpdateChannel(comboBoxChannel.Text);
+            check();
+            loaded = true;
+        }
+
+        private void check()
+        {
+            if (Toggl.IsUpdateCheckDisabled())
+            {
+                return;
+            }
+            if ("development" == Properties.Settings.Default.Environment)
+            {
+                return;
+            }
             String url = "https://assets.toggl.com/installers/windows_" + comboBoxChannel.Text + "_appcast.xml";
             WinSparkle.win_sparkle_set_appcast_url(url);
             WinSparkle.setupWinSparkle();
             WinSparkle.win_sparkle_init();
-            if (!loaded && !Toggl.IsUpdateCheckDisabled())
+            if (!loaded)
             {
                 WinSparkle.win_sparkle_check_update_without_ui();
             }
@@ -48,7 +62,6 @@
             {
                 WinSparkle.win_sparkle_check_update_with_ui();
             }
-            loaded = true;
         }

         private void linkLabelGithub_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)


Add new data type "CustomType". Work Item #1982

--- trunk/Solutions/CslaGenFork/Metadata/TypeCodeEx.cs
+++ trunk/Solutions/CslaGenFork/Metadata/TypeCodeEx.cs
@@ -6,6 +6,7 @@
     public enum TypeCodeEx
     {
         Empty,
+        CustomType,
         Boolean,
         Byte,
         ByteArray,


Removing the check enforcing the GPU support Resource Heap Tier 2


Documentation for SaveBufferThenClear and ReadByte

--- Pdoxcl2Sharp/ParadoxParser.cs
+++ Pdoxcl2Sharp/ParadoxParser.cs
@@ -204,6 +204,11 @@
             }
         }

+        /// <summary>
+        /// Transfers the string buffer to the current string.
+        /// Clears the buffer for the next round of reading
+        /// </summary>
+        /// <returns>The string contained inside the buffer</returns>
         private string SaveBufferThenClear()
         {
             CurrentString = stringBuffer.ToString();
@@ -211,6 +216,12 @@
             return CurrentString;
         }

+        /// <summary>
+        /// Retrieves the next byte in the buffer, reading from the
+        /// stream if necessary.  Since this is a raw byte, if a number
+        /// is expected, better to use <see cref="ReadInt32"/>
+        /// </summary>
+        /// <returns>The next raw byte in the buffer</returns>
         public byte ReadByte()
         {
             if (currentPosition == bufferSize)
@@ -229,7 +240,6 @@

             return buffer[currentPosition++];
         }
-

         public string ReadString()


Some changes to decouple GUI from server...

--- QDMSServer/MainWindow.xaml.cs
+++ QDMSServer/MainWindow.xaml.cs
@@ -256,7 +256,7 @@
                 foreach (Instrument i in selectedInstruments)
                 {
                     if (!i.ID.HasValue) continue;
-
+                    //TODO add GetStorageInfo to client, then remove dependency on DataStorageFactory here
                     var storageInfo = localStorage.GetStorageInfo(i.ID.Value);
                     if (storageInfo.Any(x => x.Frequency == frequency))
                     {
@@ -325,11 +325,12 @@
         //show the Quandl add instrument window
         private void AddInstrumentQuandlBtn_OnClick(object sender, RoutedEventArgs e)
         {
-            var window = new AddInstrumentQuandlWindow();
-
-            if (window.AddedInstruments != null)
-            {
-                foreach (Instrument i in window.AddedInstruments)
+            var window = new AddInstrumentQuandlWindow(_client);
+            window.ShowDialog();
+
+            if (window.ViewModel.AddedInstruments != null)
+            {
+                foreach (Instrument i in window.ViewModel.AddedInstruments)
                 {
                     ViewModel.Instruments.Add(i);
                 }
@@ -431,6 +432,7 @@

             using (var storage = DataStorageFactory.Get())
             {
+                //todo remove dependency on local storage here, use client instead
                 foreach (Instrument i in selectedInstruments)
                 {
                     try
@@ -448,38 +450,41 @@
         }

         //adds or removes a tag from one or more instruments
-        private void SetTag_ItemClick(object sender, RoutedEventArgs routedEventArgs)
-        {
-            //todo move to mvvm
-            using (var context = new MyDBContext())
-            {
-                var selectedInstruments = InstrumentsGrid.SelectedItems;
-                var btn = (MenuItem)routedEventArgs.Source;
-
-                //one instrument selected
-                foreach (Instrument instrument in selectedInstruments)
-                {
-                    context.Instruments.Attach(instrument);
-
-                    if (btn.IsChecked)
-                    {
-                        var tag = context.Tags.First(x => x.ID == (int)btn.Tag);
-                        context.Tags.Attach(tag);
-                        instrument.Tags.Add(tag);
-                    }
-                    else
-                    {
-                        btn.IsChecked = false;
-                        var tmpTag = instrument.Tags.First(x => x.ID == (int)btn.Tag);
-                        context.Tags.Attach(tmpTag);
-                        instrument.Tags.Remove(tmpTag);
-                    }
-                }
-
-                context.SaveChanges();
-
-                CollectionViewSource.GetDefaultView(InstrumentsGrid.ItemsSource).Refresh();
-            }
+        private async void SetTag_ItemClick(object sender, RoutedEventArgs routedEventArgs)
+        {
+            var selectedInstruments = InstrumentsGrid.SelectedItems;
+            var btn = (MenuItem)routedEventArgs.Source;
+            int tagID = (int)btn.Tag;
+            var tagResponse = await _client.GetTags().ConfigureAwait(true);
+            if (!tagResponse.WasSuccessful)
+            {
+                await this.ShowMessageAsync("Error", string.Join("\n", tagResponse.Errors)).ConfigureAwait(true);
+                return;
+            }
+
+            var tag = tagResponse.Result.FirstOrDefault(x => x.ID == tagID);
+            if (tag == null)
+            {
+                await this.ShowMessageAsync("Error", "Could not find tag on the server").ConfigureAwait(true);
+                return;
+            }
+
+            //one instrument selected
+            foreach (Instrument instrument in selectedInstruments)
+            {
+                if (btn.IsChecked)
+                {
+                    instrument.Tags.Add(tag);
+                }
+                else
+                {
+                    instrument.Tags.Remove(tag);
+                }
+
+                await _client.UpdateInstrument(instrument).ConfigureAwait(true);
+            }
+
+            CollectionViewSource.GetDefaultView(InstrumentsGrid.ItemsSource).Refresh();
         }

         private void BtnSettings_OnItemClick(object sender, RoutedEventArgs routedEventArgs)
@@ -531,34 +536,36 @@
         }

         //add a new tag from the context menu and then apply it to the selected instruments
-        private void NewTagTextBox_KeyDown(object sender, KeyEventArgs e)
+        private async void NewTagTextBox_KeyDown(object sender, KeyEventArgs e)
         {
             if (e.Key != Key.Enter) return;

             var newTagTextBox = (TextBox)sender;

-            using (var context = new MyDBContext())
-            {
-                string newTagName = newTagTextBox.Text;
-                if (context.Tags.Any(x => x.Name == newTagName)) return; //tag already exists
-
-                //add the tag
-                var newTag = new Tag { Name = newTagName };
-                context.Tags.Add(newTag);
-
-                //apply the tag to the selected instruments
-                var selectedInstruments = InstrumentsGrid.SelectedItems.Cast<Instrument>();
-                foreach (Instrument i in selectedInstruments)
-                {
-                    context.Instruments.Attach(i);
-                    i.Tags.Add(newTag);
-                }
-
-                context.SaveChanges();
-
-                //update the tag menu
-                var allTags = context.Tags.ToList();
-                BuildTagContextMenu(allTags);
+            string newTagName = newTagTextBox.Text;
+
+            //add the tag
+            var addTagResult = await _client.AddTag(new Tag() { Name = newTagName }).ConfigureAwait(true);
+            if(!addTagResult.WasSuccessful)
+            {
+                await this.ShowMessageAsync("Error", "Could not add tag").ConfigureAwait(true);
+                return;
+            }
+            var newTag = addTagResult.Result;
+
+            //apply the tag to the selected instruments
+            var selectedInstruments = InstrumentsGrid.SelectedItems.Cast<Instrument>();
+            foreach (Instrument i in selectedInstruments)
+            {
+                i.Tags.Add(newTag);
+                await _client.UpdateInstrument(i).ConfigureAwait(true);
+            }
+
+            //update the tag menu
+            var allTags = await _client.GetTags().ConfigureAwait(true);
+            if (allTags.WasSuccessful)
+            {
+                BuildTagContextMenu(allTags.Result);
             }

             newTagTextBox.Text = "";
@@ -620,7 +627,7 @@
         {
             var setSessionMenu = (MenuItem)Resources["InstrumentSetSessionMenu"];
             setSessionMenu.Items.Clear();
-
+            //todo remake to use client
             using (var context = new MyDBContext())
             {
                 foreach (SessionTemplate t in context.SessionTemplates.ToList())
@@ -637,47 +644,47 @@
             }
         }

-        private void SetSession_ItemClick(object sender, RoutedEventArgs e)
-        {
-            using (var context = new MyDBContext())
-            {
-                var selectedInstruments = InstrumentsGrid.SelectedItems;
-                var btn = (MenuItem)e.Source;
-
-                int templateID = (int)btn.Tag;
-
-                var templateSessions = context.TemplateSessions.Where(x => x.TemplateID == templateID).ToList();
-
-                //one instrument selected
-                foreach (Instrument instrument in selectedInstruments)
-                {
-                    context.Instruments.Attach(instrument);
-                    instrument.SessionsSource = SessionsSource.Template;
-                    instrument.SessionTemplateID = templateID;
-
-                    if(instrument.Sessions == null)
-                    {
-                        instrument.Sessions = new List<InstrumentSession>();
-                    }
-
-                    //Remove any old sessions
-                    var tmpSessions = new List<InstrumentSession>(instrument.Sessions);
-                    foreach (InstrumentSession isession in tmpSessions)
-                    {
-                        context.InstrumentSessions.Attach(isession);
-                        context.InstrumentSessions.Remove(isession);
-                    }
-
-                    instrument.Sessions.Clear();
-
-                    //Add the new sessions
-                    foreach(TemplateSession ts in templateSessions)
-                    {
-                        instrument.Sessions.Add(ts.ToInstrumentSession());
-                    }
-                }
-
-                context.SaveChanges();
+        private async void SetSession_ItemClick(object sender, RoutedEventArgs e)
+        {
+            var selectedInstruments = InstrumentsGrid.SelectedItems;
+            var btn = (MenuItem)e.Source;
+
+            int templateID = (int)btn.Tag;
+
+            var templates = await _client.GetSessionTemplates().ConfigureAwait(true);
+            if(!templates.WasSuccessful)
+            {
+                await this.ShowMessageAsync("Error", string.Join("\n", templates.Errors)).ConfigureAwait(true);
+                return;
+            }
+
+            var template = templates.Result.FirstOrDefault(x => x.ID == templateID);
+            if (template == null)
+            {
+                await this.ShowMessageAsync("Error", "Could not find template on the server").ConfigureAwait(true);
+                return;
+            }
+
+            foreach (Instrument instrument in selectedInstruments)
+            {
+                instrument.SessionsSource = SessionsSource.Template;
+                instrument.SessionTemplateID = templateID;
+
+                if(instrument.Sessions == null)
+                {
+                    instrument.Sessions = new List<InstrumentSession>();
+                }
+
+                instrument.Sessions.Clear();
+
+                //Add the new sessions
+                foreach(TemplateSession ts in template.Sessions)
+                {
+                    instrument.Sessions.Add(ts.ToInstrumentSession());
+                }
+
+                //update the instruments
+                await _client.UpdateInstrument(instrument).ConfigureAwait(true);
             }
         }

@@ -690,6 +697,7 @@
         {
             var window = new TagsWindow(_client);
             window.Show();
+            BuildTagContextMenu(window.ViewModel.Tags.Select(x => x.Model));
         }

         private void TableView_RowDoubleClick(object sender, MouseButtonEventArgs e)


Moved the broker object creation out of the servers, now held in the main window.

--- QDMSServer/MainWindow.xaml.cs
+++ QDMSServer/MainWindow.xaml.cs
@@ -29,7 +29,9 @@
     /// </summary>
     public partial class MainWindow : MetroWindow
     {
+        private readonly RealTimeDataBroker _realTimeBroker;
         private readonly RealTimeDataServer _realTimeServer;
+        private readonly HistoricalDataBroker _historicalBroker;
         private readonly HistoricalDataServer _historicalDataServer;
         private readonly InstrumentsServer _instrumentsServer;

@@ -95,11 +97,14 @@
                 Instruments.Add(i);
             }

+            //create brokers
+            _realTimeBroker = new RealTimeDataBroker();
+            _historicalBroker = new HistoricalDataBroker();

             //create the various servers
-            _realTimeServer = new RealTimeDataServer(Properties.Settings.Default.rtDBPubPort, Properties.Settings.Default.rtDBReqPort);
+            _realTimeServer = new RealTimeDataServer(Properties.Settings.Default.rtDBPubPort, Properties.Settings.Default.rtDBReqPort, _realTimeBroker);
             _instrumentsServer = new InstrumentsServer(Properties.Settings.Default.instrumentServerPort);
-            _historicalDataServer = new HistoricalDataServer(Properties.Settings.Default.hDBPort);
+            _historicalDataServer = new HistoricalDataServer(Properties.Settings.Default.hDBPort, _historicalBroker);

             //and start them
             _realTimeServer.StartServer();
@@ -118,7 +123,7 @@
             _client.HistoricalDataReceived += _client_HistoricalDataReceived;

-            ActiveStreamGrid.ItemsSource = _realTimeServer.Broker.ActiveStreams;
+            ActiveStreamGrid.ItemsSource = _realTimeBroker.ActiveStreams;

             entityContext.Dispose();
         }


Methods to remove income and expense

Methods to remove income and expense

--- Rambutan/BudgetInfo/Budget.cs
+++ Rambutan/BudgetInfo/Budget.cs
@@ -26,6 +26,20 @@
                 throw new ArgumentException("Incorect input! First write a string for the name of the income, then a double for the sum!");
             }
         }
+
+
+        public void RemoveIncome(string incomeName)
+        {
+            try
+            {
+                expenseDictionary.Remove(incomeName);
+            }
+            catch (Exception)
+            {
+                throw new ArgumentException("Incorect input! Write an exsisting income name!");
+            }
+        }
+

         public void AddExpense(string expenseName, decimal expenseSum)
         {


Add license #region.

Add license #region.


SecondLife.Self.Teleport(string, LLVector3) now obeys the z coordinate when teleporting.

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

--- libsecondlife-cs/Avatar.cs
+++ libsecondlife-cs/Avatar.cs
@@ -558,7 +558,7 @@
         /// <returns></returns>
         public bool Teleport(string simName, LLVector3 position)
         {
-            position.Z = 0;
+            //position.Z = 0; //why was this here?
             return Teleport(simName, position, new LLVector3(0, 1.0F, 0));
         }


Bug fix in CSE, fixed case where same expr comes from different preds in different vars

--- source/Util/BoogieUtil.cs
+++ source/Util/BoogieUtil.cs
@@ -1368,31 +1368,33 @@

     public class CSEVisitor : StandardVisitor
     {
-        Expr origExpr;
+        Dictionary<string, Variable> exprs;
         Expr currExpr;
-        Variable currVar;
-
-        CSEVisitor(Expr expr, Variable v)
-        {
-            origExpr = expr;
+
+        CSEVisitor(HashSet<Variable> vlist, Dictionary<Variable, Expr> var2expr)
+        {
             currExpr = null;
-            currVar = v;
+            exprs = new Dictionary<string, Variable>();
+            foreach (Variable v in vlist)
+            {
+                exprs.Add(SSA.expr2key(var2expr[v]), v);
+            }
         }

         /*
          * Perform CSE on given_expr w.r.t. non_null_expr, replacing it with variable v
          */
-        public static Expr getExpr(Expr given_expr, Expr non_null_expr, Variable v)
+        public static Expr getExpr(Expr given_expr, HashSet<Variable> vars, Dictionary<Variable, Expr> var2expr)
         {
             if (given_expr == null) return null;
-            var cse = new CSEVisitor(non_null_expr, v);
+            var cse = new CSEVisitor(vars, var2expr);
             cse.currExpr = cse.VisitExpr(given_expr);
             return cse.currExpr;
         }

         public override Expr VisitExpr(Expr node)
         {
-            if (SSA.ExprEquals(node, origExpr)) return Expr.Ident(currVar);
+            if (exprs.ContainsKey(SSA.expr2key(node))) return Expr.Ident(exprs[SSA.expr2key(node)]);
             else return base.VisitExpr(node);
         }
     }
@@ -1423,10 +1425,12 @@
                 throw new NotImplementedException();
         }

+
         /*
          * We go to every implementation, and look at assert (expr != NULL) and assume (expr != NULL)
          * Now, we introduce a temporary variable and assignment cseTmp{i} := expr;
          * Now, as long as this temporary variable is available, we replace expr by cseTmp{i}
+         * When the same expr is available from multiple vars from different predecessors, we introduce a new cseTmp{i} var := expr
          * We now perform SSA, and then do the alias analysis
          * This improves the precision of alias analysis, since these cseTmp vars are always non null, and hence, NULL cannot flow through these vars
          */
@@ -1451,9 +1455,6 @@

                 // block_name -> set of variables available at the end of the block
                 Dictionary<string, HashSet<Variable>> block2livevars = new Dictionary<string, HashSet<Variable>>();
-
-                // cseTmp variable -> list of commands to be ignored while performing CSE
-                Dictionary<Variable, List<Cmd>> ignore_cmds = new Dictionary<Variable, List<Cmd>>();

                 // Compute predecessors, do a topological sort on the CFG
                 impl.ComputePredecessorsForBlocks();
@@ -1465,127 +1466,254 @@
                 {
                     if (dbg) Console.WriteLine("Analyzing {0}", b.Label);

-                    // List of positions where assignment of cseTmp has to be inserted
-                    List<int> add_pos = new List<int>();
-
-                    // List of local cseTmp variables in the block
-                    List<LocalVariable> add_lv = new List<LocalVariable>();
-
-                    // List of expressions assigned to these local variables
-                    List<Expr> add_node = new List<Expr>();
+                    // Checking if expr is available in all predecessors
+                    Dictionary<string, int> expr_count = new Dictionary<string, int>();
+
+                    // string -> expr
+                    Dictionary<string, Expr> string2expr = new Dictionary<string, Expr>();
+
+                    // List of variables which contain the same expr from all predecessors
+                    // If list has 1 variable, add it to live_vars
+                    // Else, create a new temporary for expr
+                    Dictionary<string, HashSet<Variable>> expr2varlist = new Dictionary<string, HashSet<Variable>>();
+
+                    // List of variables live after each cmd
                     HashSet<Variable> live_vars = new HashSet<Variable>();

-                    // Adding current block to keys of block2livevars dictionary
-                    block2livevars.Add(b.Label, new HashSet<Variable>());
-
-                    // Go to each command, and generate local vars
-                    for (int pos = 0; pos < b.Cmds.Count; pos++)
+                    // Go to each predecessor, find expr available in all predecessors
+                    foreach (Block blk in b.Predecessors)
+                    {
+                        foreach (Variable v in block2livevars[blk.Label])
+                        {
+                            string expr = expr2key(var2expr[v]);
+                            if (!string2expr.ContainsKey(expr)) string2expr.Add(expr, var2expr[v]);
+                            if (!expr_count.ContainsKey(expr)) expr_count.Add(expr, 0);
+                            expr_count[expr]++;
+                            if (!expr2varlist.ContainsKey(expr)) expr2varlist.Add(expr, new HashSet<Variable>());
+                            expr2varlist[expr].Add(v);
+                        }
+                    }
+
+                    // Add cmds for expr available from all predecessors at the start of current block
+                    // cseTmp{i} := expr;
+                    int cmds_added = 0;
+                    foreach (string expr in expr_count.Keys.Where(e => expr_count[e] == b.Predecessors.Count))
+                    {
+                        if (dbg) Console.WriteLine("{0} is live at all preds", expr);
+                        if (expr2varlist[expr].Count == 1)
+                        {
+                            live_vars.Add(expr2varlist[expr].First());
+                            if (dbg) Console.WriteLine("available at {0}", expr2varlist[expr].First());
+                        }
+                        else
+                        {
+                            Expr node = dup.VisitExpr(string2expr[expr]);
+                            LocalVariable lv = new LocalVariable(Token.NoToken, new TypedIdent(Token.NoToken, "cseTmp" + (counter++).ToString(), Microsoft.Boogie.Type.Int));
+                            var2expr.Add(lv, dup.VisitExpr(node));
+                            live_vars.Add(lv);
+
+                            // Adding local variable
+                            impl.LocVars.Add(lv);
+
+                            if (dbg) Console.WriteLine("{0} {1}", lv.Name, expr);
+
+                            // Inserting cmd
+                            b.Cmds.Insert(0, BoogieAstFactory.MkVarEqExpr(lv, node));
+                            cmds_added++;
+                        }
+                    }
+
+                    bool gen_cmd = false;
+
+                    // Doing gen, kill, replace for each cmd for all available expr
+                    for (int pos = cmds_added; pos < b.Cmds.Count; pos++)
                     {
                         Cmd c = b.Cmds[pos];
+
+                        if (dbg)
+                        {
+                            Console.Write("Live vars -> ");
+                            foreach (Variable v in live_vars) Console.Write(var2expr[v].ToString() + " ");
+                            Console.WriteLine();
+                        }
+
                         if (dbg) Console.WriteLine(c.ToString());
-
-                        // Generate cseTmp for assume cmds
-                        if (c is AssumeCmd)
+
+                        HashSet<Variable> live_vars_in = new HashSet<Variable>(live_vars);
+                        HashSet<Variable> live_vars_out;
+
+                        // Gen Kill
+                        live_vars_out = ProcessCmdGenKill(c, live_vars_in, impl_names, out gen_cmd, var2expr);
+
+                        if (gen_cmd)
                         {
-                            var ac = c as AssumeCmd;
-                            if (CleanAssert.validAssumeCmd(ac))
+                            if (c is AssumeCmd)
                             {
-                                if (dbg) Console.WriteLine("Valid Assume");
+                                var ac = c as AssumeCmd;
                                 Expr node = dup.VisitExpr(CleanAssert.getExprFromAssume(ac));
                                 LocalVariable lv = new LocalVariable(Token.NoToken, new TypedIdent(Token.NoToken, "cseTmp" + (counter++).ToString(), Microsoft.Boogie.Type.Int));
                                 var2expr.Add(lv, dup.VisitExpr(node));
-                                live_vars.Add(lv);
-                                if (dbg) Console.WriteLine("Added {0} {1} to block2livevars", node.ToString(), lv.Name);

                                 impl.LocVars.Add(lv);

-                                add_pos.Add(pos + 1);
-                                add_lv.Add(lv);
-                                add_node.Add(node);
-
-                                ignore_cmds.Add(lv, new List<Cmd>());
+                                b.Cmds.Insert(pos + 1, BoogieAstFactory.MkVarEqExpr(lv, node));
                             }
-                        }
-
-                        // Generate cseTmp for assert cmds
-                        else if (c is AssertCmd)
-                        {
-                            var ac = c as AssertCmd;
-                            if (CleanAssert.validAssertCmd(ac))
+                            else if (c is AssertCmd)
                             {
-                                if (dbg) Console.WriteLine("Valid Assert");
+                                var ac = c as AssertCmd;
                                 Expr node = dup.VisitExpr(CleanAssert.getExprFromAssert(ac));
                                 LocalVariable lv = new LocalVariable(Token.NoToken, new TypedIdent(Token.NoToken, "cseTmp" + (counter++).ToString(), Microsoft.Boogie.Type.Int));
                                 var2expr.Add(lv, dup.VisitExpr(node));
-                                live_vars.Add(lv);
-                                if (dbg) Console.WriteLine("Added {0} {1} to block2livevars", node.ToString(), lv.Name);

                                 impl.LocVars.Add(lv);

-                                add_pos.Add(pos + 1);
-                                add_lv.Add(lv);
-                                add_node.Add(node);
-
-                                ignore_cmds.Add(lv, new List<Cmd>());
+                                b.Cmds.Insert(pos + 1, BoogieAstFactory.MkVarEqExpr(lv, node));
                             }
                         }
-                    }
-
-                    // Add assignments to the block at relevant positions
-                    for (int i = 0; i < add_pos.Count; i++) b.Cmds.Insert(add_pos[i] + i, BoogieAstFactory.MkVarEqExpr(add_lv[i], add_node[i]));
-
-                    // Constuct the ignore cmds for each cseTmp generated
-                    for (int i = 0; i < add_lv.Count; i++)
-                    {
-                        int ind = 0;
-                        LocalVariable lv = add_lv[i];
-                        int position = add_pos[i] + i;
-                        while (ind <= position)
-                        {
-                            Cmd c = b.Cmds[ind];
-                            ignore_cmds[lv].Add(c);
-                            ind++;
-                        }
-                    }
-
-                    // Check whether cseTmp var is available at all predecessors
-                    // cseTmp var -> #predecessors where it is available
-                    Dictionary<Variable, int> count = new Dictionary<Variable,int>();
-
-                    // Go to each predecessor, and check if cseTmp var is available
-                    foreach (Block blk in b.Predecessors)
-                    {
-                        foreach (Variable v in block2livevars[blk.Label])
-                        {
-                            if (!count.ContainsKey(v)) count.Add(v, 0);
-                            count[v]++;
-                        }
-                    }
-
-                    if (dbg) Console.WriteLine(b.Label + " ->");
-
-                    // Listing all variables, available here, either obtained from all predecessors, or generated in this block
-                    foreach (Variable v in (count.Keys.Where(va => count[va] == b.Predecessors.Count)).Union(live_vars))
-                    {
-                        if (dbg) Console.WriteLine(v.Name + " " + var2expr[v].ToString());
-                        bool block_live = true;
-
-                        // Go to each cmd, and perform CSE for the current cseTmp var
-                        foreach (Cmd c in b.Cmds)
-                        {
-                            if (ignore_cmds.ContainsKey(v) && ignore_cmds[v].Contains(c)) continue;
-                            if (dbg) Console.WriteLine(c.ToString());
-                            block_live = ProcessCmdForCSE(c, var2expr[v], block_live, v, impl_names);
-                        }
-
-                        // If cseTmp var is still alive, add it to block2livevars
-                        if (block_live)
-                        {
-                            block2livevars[b.Label].Add(v);
-                        }
-                    }
-                }
-            }
+
+                        // Replace RHS
+                        ProcessCmdReplaceRHS(c, live_vars_in, var2expr);
+
+                        // Replace LHS
+                        ProcessCmdReplaceLHS(c, live_vars_out, var2expr);
+
+                        live_vars = live_vars_out;
+
+                        if (dbg) Console.WriteLine(c.ToString());
+                    }
+                    block2livevars.Add(b.Label, live_vars);
+                }
+            }
+        }
+
+        // Add/Remove variables generated/killed by cmd
+        private HashSet<Variable> ProcessCmdGenKill(Cmd c, HashSet<Variable> live_vars_in, HashSet<string> impl_names, out bool gen_cmd, Dictionary<Variable, Expr> var2expr)
+        {
+            HashSet<Variable> live_vars_out = new HashSet<Variable>(live_vars_in);
+            gen_cmd = false;
+
+            if (c is AssumeCmd)
+            {
+                var ac = c as AssumeCmd;
+                if (CleanAssert.validAssumeCmd(ac))
+                {
+                    gen_cmd = true;
+                    foreach (Variable v in live_vars_in)
+                    {
+                        if (dbg) Console.WriteLine("Comparing {0} {1}", var2expr[v].ToString(), CleanAssert.getExprFromAssume(ac).ToString());
+                        if (ExprEquals(var2expr[v], CleanAssert.getExprFromAssume(ac))) gen_cmd = false;
+                    }
+                }
+            }
+            else if (c is AssertCmd)
+            {
+                var ac = c as AssertCmd;
+                if (CleanAssert.validAssertCmd(ac))
+                {
+                    gen_cmd = true;
+                    foreach (Variable v in live_vars_in)
+                    {
+                        if (dbg) Console.WriteLine("Comparing {0} {1}", var2expr[v].ToString(), CleanAssert.getExprFromAssert(ac).ToString());
+                        if (ExprEquals(var2expr[v], CleanAssert.getExprFromAssert(ac))) gen_cmd = false;
+                    }
+                }
+            }
+            else if (c is AssignCmd)
+            {
+                var ac = c as AssignCmd;
+                if (CleanAssert.validAssignCmd(ac))
+                {
+                    live_vars_out.Add((c as AssignCmd).Lhss.First().DeepAssignedVariable);
+                    if (dbg) Console.WriteLine("{0} added to live_vars", (c as AssignCmd).Lhss.First().DeepAssignedVariable.Name);
+                    return live_vars_out;
+                }
+            }
+
+            // If vars modified by cmd contains any subexpr in live_vars_in, remove it from live_vars_in
+            HashSet<string> vars_modified = BoogieUtil.getVarsModified(c, impl_names);
+
+            foreach (Variable v in live_vars_in)
+            {
+                HashSet<string> sub_exprs = getSubExprs(var2expr[v]);
+                if (vars_modified.Intersection(sub_exprs).Count > 0) live_vars_out.Remove(v);
+            }
+
+            return live_vars_out;
+        }
+
+        // Perform substitution on LHS of cmd
+        private void ProcessCmdReplaceLHS(Cmd c, HashSet<Variable> live_vars, Dictionary<Variable, Expr> var2expr)
+        {
+            if (c is AssignCmd)
+            {
+                var ac = c as AssignCmd;
+
+                for (int i = 0; i < ac.Lhss.Count; i++)
+                {
+                    if (ac.Lhss[i] is SimpleAssignLhs)
+                    {
+                        SimpleAssignLhs lhs = ac.Lhss[i] as SimpleAssignLhs;
+                        ac.Lhss[i] = new SimpleAssignLhs(lhs.tok, CSEVisitor.getExpr(lhs.DeepAssignedIdentifier, live_vars, var2expr) as IdentifierExpr);
+                    }
+                    else if (ac.Lhss[i] is MapAssignLhs)
+                    {
+                        MapAssignLhs lhs = ac.Lhss[i] as MapAssignLhs;
+                        lhs.Indexes = new List<Expr>(lhs.Indexes.Select(e => CSEVisitor.getExpr(e, live_vars, var2expr)));
+                    }
+                }
+            }
+            else if (c is CallCmd)
+            {
+                var cc = c as CallCmd;
+
+                for (int i = 0; i < cc.Outs.Count; i++)
+                {
+                    Expr lhs = cc.Outs[i];
+                    cc.Outs[i] = CSEVisitor.getExpr(lhs, live_vars, var2expr) as IdentifierExpr;
+                }
+            }
+        }
+
+        // Perform substitution on RHS of cmd
+        private void ProcessCmdReplaceRHS(Cmd c, HashSet<Variable> live_vars, Dictionary<Variable, Expr> var2expr)
+        {
+            if (c is AssumeCmd)
+            {
+                var ac = c as AssumeCmd;
+                ac.Expr = CSEVisitor.getExpr(ac.Expr, live_vars, var2expr);
+            }
+            else if (c is AssertCmd)
+            {
+                var ac = c as AssertCmd;
+                ac.Expr = CSEVisitor.getExpr(ac.Expr, live_vars, var2expr);
+            }
+            else if (c is CallCmd)
+            {
+                var cc = c as CallCmd;
+
+                for (int i = 0; i < cc.Ins.Count; i++)
+                {
+                    Expr rhs = cc.Ins[i];
+                    cc.Ins[i] = CSEVisitor.getExpr(rhs, live_vars, var2expr);
+                }
+            }
+            else if (c is AssignCmd)
+            {
+                var ac = c as AssignCmd;
+                for (int i = 0; i < ac.Rhss.Count; i++)
+                {
+                    Expr rhs = ac.Rhss[i];
+                    ac.Rhss[i] = CSEVisitor.getExpr(rhs, live_vars, var2expr);
+                }
+
+
+            }
+        }
+
+        // TODO: Better key
+        public static string expr2key(Expr expr)
+        {
+            return expr.ToString();
         }

         /*
@@ -1594,80 +1722,8 @@
          */
         public static bool ExprEquals(Expr e1, Expr e2)
         {
-            if (e1.ToString().Equals(e2.ToString())) return true;
+            if (expr2key(e1).Equals(expr2key(e2))) return true;
             else return false;
-        }
-
-        /*
-         * Perform CSE on the given cmd c for the variable v, which represents expression expr
-         */
-        private bool ProcessCmdForCSE(Cmd c, Expr expr, bool block_alive, Variable v, HashSet<string> impl_names)
-        {
-            if (dbg) Console.WriteLine("Called with " + c.ToString());
-            if (block_alive)
-            {
-                // If vars modified by cmd contains any var in expr, expr is no longer available
-                HashSet<string> subexprs = getSubExprs(expr);
-                if (BoogieUtil.getVarsModified(c, impl_names).Intersection(subexprs).Count > 0) block_alive = false;
-
-                if (c is AssumeCmd)
-                {
-                    var ac = c as AssumeCmd;
-                    ac.Expr = CSEVisitor.getExpr(ac.Expr, expr, v);
-                }
-                else if (c is AssertCmd)
-                {
-                    var ac = c as AssertCmd;
-                    ac.Expr = CSEVisitor.getExpr(ac.Expr, expr, v);
-                }
-                else if (c is CallCmd)
-                {
-                    var cc = c as CallCmd;
-                    for (int i = 0 ; i < cc.Ins.Count ; i++)
-                    {
-                        Expr rhs = cc.Ins[i];
-                        cc.Ins[i] = CSEVisitor.getExpr(rhs, expr, v);
-                    }
-                    if (block_alive)
-                    {
-                        for (int i = 0 ; i < cc.Outs.Count ; i++)
-                        {
-                            Expr lhs = cc.Outs[i];
-                            cc.Outs[i] = CSEVisitor.getExpr(lhs, expr, v) as IdentifierExpr;
-                        }
-                    }
-                }
-                else if (c is AssignCmd)
-                {
-                    var ac = c as AssignCmd;
-                    for (int i = 0 ; i < ac.Rhss.Count ; i++)
-                    {
-                        Expr rhs = ac.Rhss[i];
-                        ac.Rhss[i] = CSEVisitor.getExpr(rhs, expr, v);
-                    }
-                    if (block_alive)
-                    {
-                        for (int i = 0 ; i < ac.Lhss.Count ; i++)
-                        {
-                            if (ac.Lhss[i] is SimpleAssignLhs)
-                            {
-                                SimpleAssignLhs lhs = ac.Lhss[i] as SimpleAssignLhs;
-                                ac.Lhss[i] = new SimpleAssignLhs(lhs.tok, CSEVisitor.getExpr(lhs.DeepAssignedIdentifier, expr, v) as IdentifierExpr);
-                            }
-                            else if (ac.Lhss[i] is MapAssignLhs)
-                            {
-                                MapAssignLhs lhs = ac.Lhss[i] as MapAssignLhs;
-                                lhs.Indexes = new List<Expr>(lhs.Indexes.Select(e => CSEVisitor.getExpr(e, expr, v)));
-                            }
-                        }
-                    }
-                }
-
-                if (dbg) Console.WriteLine("Returned with " + c.ToString());
-
-                return block_alive;
-            }
-            else return block_alive;
         }

         /*
@@ -2219,6 +2275,12 @@
                 (((NAryExpr)ac.Expr).Args).First() is NAryExpr &&
                 ((NAryExpr)(((NAryExpr)ac.Expr).Args).First()).Args != null)
                 return true;
+            else return false;
+        }
+
+        public static bool validAssignCmd(AssignCmd ac)
+        {
+            if (ac.Lhss.Count == 1 && ac.Lhss[0] is SimpleAssignLhs && (ac.Lhss[0] as SimpleAssignLhs).DeepAssignedVariable.Name.StartsWith("cseTmp")) return true;
             else return false;
         }


fixing TokenCredentialOptions doc comment (#8462)

--- sdk/identity/Azure.Identity/src/TokenCredentialOptions.cs
+++ sdk/identity/Azure.Identity/src/TokenCredentialOptions.cs
@@ -14,7 +14,7 @@
         private static readonly Uri s_defaultAuthorityHost = new Uri("https://login.microsoftonline.com/");

         /// <summary>
-        /// The host of the Azure Active Directory authority.   The default is https://login.microsoft.com/
+        /// The host of the Azure Active Directory authority.   The default is https://login.microsoftonline.com/
         /// </summary>
         public Uri AuthorityHost { get; set; }


Add missing comma

Add missing comma


Fixed broken link in documentation.

Fixed broken link in documentation.


Removed unused code.

Removed unused code.

--- Shared/AssemblyVersionInfo.cs
+++ Shared/AssemblyVersionInfo.cs
@@ -1,7 +0,0 @@
-// Will be replaced by the build server
-
-using System.Reflection;
-
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
-[assembly: AssemblyInformationalVersion("1.0.0.0")]


Fix summary comment

Fix summary comment

--- ShopifySharp/Entities/Shop.cs
+++ ShopifySharp/Entities/Shop.cs
@@ -16,7 +16,7 @@
         public string Address1 { get; set; }

         /// <summary>
-        /// The the optional second line of the shop's street address.
+        /// The optional second line of the shop's street address.
         /// </summary>
         [JsonProperty("address2")]
         public string Address2 { get; set; }


fixed an exception that the socket session has been closed when sending data

--- SocketEngine/SocketSession.cs
+++ SocketEngine/SocketSession.cs
@@ -204,7 +204,11 @@
         /// <returns></returns>
         public bool TrySend(IList<ArraySegment<byte>> segments)
         {
+            if (IsClosed)
+                return false;
+
             var queue = m_SendingQueue;
+
             var trackID = queue.TrackID;

             if (!queue.Enqueue(segments, trackID))


Fix order of BadgeStyle values

Fix order of BadgeStyle values

Fixes breaking changes due to the enum constants having a different values

--- Source/Elements/UIMenuItem.cs
+++ Source/Elements/UIMenuItem.cs
@@ -345,8 +345,6 @@
         public enum BadgeStyle
         {
             None,
-            Custom,
-            Blank,
             BronzeMedal,
             GoldMedal,
             SilverMedal,
@@ -374,6 +372,8 @@
             CardSuitHearts,
             CardSuitSpades,
             Art,
+            Blank,
+            Custom,
         }

         public class BadgeInfo


:lemon: C# Hamming - Split into functions for readability

--- csharp/hamming/Hamming.cs
+++ csharp/hamming/Hamming.cs
@@ -1,10 +1,22 @@
 using System;
+using System.Collections.Generic;
 using System.Linq;

 public class Hamming
 {
   public static int Compute(string first, string second)
   {
-    return first.Zip(second, Tuple.Create).Count(x => x.Item1 != x.Item2);
+    return PositionalPairs(first, second).Count(Mismatched);
+  }
+
+  private static IEnumerable<Tuple<char, char>> PositionalPairs(
+    string first, string second)
+  {
+    return first.Zip(second, Tuple.Create);
+  }
+
+  private static bool Mismatched(Tuple<char, char> pair)
+  {
+    return pair.Item1 != pair.Item2;
   }
 }


nit: commented-out code.

nit: commented-out code.

--- Stiletto.Fody/ModuleWeaver.cs
+++ Stiletto.Fody/ModuleWeaver.cs
@@ -308,11 +308,6 @@
                     }

                     moduleReaders.Add(ModuleReader.Read(module));
-                    /*var moduleProcessor = new ModuleProcessor(
-                        errorReporter,
-                        module,
-                        new References(module, stilettoReferences));
-                    processors.Add(moduleProcessor);*/
                     AddModuleToAssemblyDictionary(module, null);
                 }
             }


Removed extra assignment to the gaze trigger variable that effectively did nothing

--- Assets/MRTK/SDK/Features/Utilities/Solvers/HandConstraintPalmUp.cs
+++ Assets/MRTK/SDK/Features/Utilities/Solvers/HandConstraintPalmUp.cs
@@ -192,7 +192,6 @@
                     Debug.LogError("HandConstraintPalmUp requires controllers of type IMixedRealityHand to perform hand activation tests.");
                 }

-                eyeGazeActivationAlreadyTriggered = palmFacingThresholdMet ? eyeGazeActivationAlreadyTriggered : false;
                 return palmFacingThresholdMet;
             }


fix required resource properties check

fix required resource properties check

--- AutoRest/Generators/Extensions/Azure.Extensions/AzureExtensions.cs
+++ AutoRest/Generators/Extensions/Azure.Extensions/AzureExtensions.cs
@@ -643,16 +643,13 @@
         private static void CheckAzureResourceProperties(CompositeType compositeType)
         {
             // If derived from resource with x-ms-azure-resource then resource should have resource specific properties
-            var extraResourceProperties = compositeType.ComposedProperties
-                                                       .Select(p => p.Name.ToUpperInvariant())
-                                                       .OrderBy(n => n)
-                                                       .Except(ResourcePropertyNames.Select(n => n.ToUpperInvariant()));
-
-            if (compositeType.Properties.Count() != ResourcePropertyNames.Count() ||
-               extraResourceProperties.Count() != 0)
+            var missingResourceProperties = ResourcePropertyNames.Select(p => p.ToLowerInvariant())
+                                               .Except(compositeType.ComposedProperties.Select(n => n.Name.ToLowerInvariant()));
+
+            if (missingResourceProperties.Count() != 0)
             {
                 Logger.LogWarning(Resources.ResourcePropertyMismatch,
-                    string.Join(", ", ResourcePropertyNames));
+                    string.Join(", ", missingResourceProperties));
             }
         }
     }


update comment.

update comment.

--- CSharpGL/0Foundations/OpenGLObjects/Texture/Texture.IDisposable.cs
+++ CSharpGL/0Foundations/OpenGLObjects/Texture/Texture.IDisposable.cs
@@ -55,8 +55,9 @@
                     var disp = this.ImageBuilder as IDisposable;
                     if (disp != null) { disp.Dispose(); }
                 }
+                // A sampler builder can be used in multiple textures.
+                // Thus we shouldn't dispose it here.
                 //{
-                //    a sampler builder can be used in multiple textures.
                 //    var disp = this.SamplerBuilder as IDisposable;
                 //    if (disp != null) { disp.Dispose(); }
                 //}


Only store one snapshot for each aggregate

--- CodeUtopia.EventStore.EntityFramework/EntityFrameworkEventStore.cs
+++ CodeUtopia.EventStore.EntityFramework/EntityFrameworkEventStore.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Data.Entity;
 using System.IO;
 using System.Linq;
 using System.Runtime.Serialization;
@@ -108,6 +109,14 @@

         public void SaveSnapshotForAggregate(Guid aggregateId, int aggregateVersionNumber, object memento)
         {
+            var snapshot = _databaseContext.Snapshots.SingleOrDefault(x => x.AggregateId == aggregateId);
+
+            if (snapshot != null)
+            {
+                _databaseContext.Entry(snapshot)
+                                .State = EntityState.Deleted;
+            }
+
             _databaseContext.Snapshots.Add(new SnapshotEntity
                                            {
                                                AggregateId = aggregateId,


add some documentation links

add some documentation links

--- src/BizTalk.Dsl/Dsl/Binding/Adapter/FtpAdapter.Inbound.cs
+++ src/BizTalk.Dsl/Dsl/Binding/Adapter/FtpAdapter.Inbound.cs
@@ -56,11 +56,14 @@
 		/// <seealso href="https://msdn.microsoft.com/en-us/library/aa561215.aspx">FTP Adapter</seealso>
 		/// <seealso href="https://msdn.microsoft.com/en-us/library/aa559267.aspx">What Is the FTP Adapter?</seealso>
 		/// <seealso href="https://msdn.microsoft.com/en-us/library/aa561032.aspx">Configuring the FTP Adapter</seealso>
+		/// <seealso href="https://msdn.microsoft.com/en-us/library/aa561231.aspx">FTP Adapter Configuration Properties</seealso>
 		/// <seealso href="https://msdn.microsoft.com/en-us/library/aa578371.aspx">FTP Commands that are Required by the FTP Adapter</seealso>
 		/// <seealso href="https://msdn.microsoft.com/en-us/library/aa561727.aspx">FTP Adapter Security Recommendations</seealso>
 		/// <seealso href="https://msdn.microsoft.com/en-us/library/aa561990.aspx">Best Practices for the FTP Adapter</seealso>
 		/// <seealso href="https://msdn.microsoft.com/en-us/library/ff629768.aspx">Enhancements to the FTP Adapter</seealso>
 		/// <seealso href="https://msdn.microsoft.com/en-us/library/aa559095.aspx">How to Configure an FTP Receive Location</seealso>
+		/// <seealso href="https://msdn.microsoft.com/en-us/library/aa577610.aspx">Known Issues with the FTP Adapter</seealso>
+		/// <seealso href="https://msdn.microsoft.com/en-us/library/aa559960.aspx">How to Diagnose Problems with the FTP Adapter</seealso>
 		[XmlRoot("Config")]
 		public class Inbound : FtpAdapter, IInboundAdapter
 		{