Add methods to search for arrays in other arrays, and cleanup parameters.

--- src/SilDev/Comparison.cs
+++ src/SilDev/Comparison.cs
@@ -5,7 +5,7 @@
 // ==============================================
 //
 // Filename: Comparison.cs
-// Version:  2016-10-18 23:33
+// Version:  2016-10-29 11:31
 //
 // Copyright (c) 2016, Si13n7 Developments (r)
 // All rights reserved.
@@ -25,241 +25,26 @@
     public static class Comparison
     {
         /// <summary>
-        ///     Determines whether a specified string occurs within this sequence of strings. A
-        ///     parameter specifies the culture, case, and sort rules used in the comparison.
-        /// </summary>
-        /// <param name="a">
-        ///     The sequence to browse.
-        /// </param>
-        /// <param name="comparisonType">
-        ///     One of the enumeration values that specifies the rules for the search.
-        /// </param>
-        /// <param name="bs">
-        ///     The sequence of strings to seek.
-        /// </param>
-        public static bool ContainsEx(this IEnumerable<string> a, StringComparison comparisonType, params string[] bs)
-        {
-            try
-            {
-                var r = a.Any(x => bs.Any(y => string.Equals(x, y, comparisonType)));
-                return r;
-            }
-            catch
-            {
-                return false;
-            }
-        }
-
-        /// <summary>
-        ///     Determines whether a specified string occurs within this sequence of strings. The
-        ///     <see cref="StringComparison.OrdinalIgnoreCase"/> parameter is used for this
-        ///     comparison.
-        /// </summary>
-        /// <param name="a">
-        ///     The sequence to browse.
-        /// </param>
-        /// <param name="bs">
-        ///     The sequence of strings to seek.
-        /// </param>
-        public static bool ContainsEx(this IEnumerable<string> a, params string[] bs) =>
-            a.ContainsEx(StringComparison.OrdinalIgnoreCase, bs);
-
-        /// <summary>
-        ///     Determines whether a specified substring occurs within this string. A parameter
-        ///     specifies the culture, case, and sort rules used in the comparison.
-        /// </summary>
-        /// <param name="a">
-        ///     The string to browse.
-        /// </param>
-        /// <param name="comparisonType">
-        ///     One of the enumeration values that specifies the rules for the search.
-        /// </param>
-        /// <param name="ba">
-        ///     The sequence of strings to seek.
-        /// </param>
-        public static bool ContainsEx(this string a, StringComparison comparisonType, params string[] ba)
-        {
-            try
-            {
-                var r = ba.Any(x => a.IndexOf(x, 0, comparisonType) != -1);
-                return r;
-            }
-            catch
-            {
-                return false;
-            }
-        }
-
-        /// <summary>
-        ///     Determines whether a specified substring occurs within this string. The
-        ///     <see cref="StringComparison.OrdinalIgnoreCase"/> parameter is used for this
-        ///     comparison.
-        /// </summary>
-        /// <param name="a">
-        ///     The string to browse.
-        /// </param>
-        /// <param name="ba">
-        ///     The sequence of strings to seek.
-        /// </param>
-        public static bool ContainsEx(this string a, params string[] ba) =>
-            a.ContainsEx(StringComparison.OrdinalIgnoreCase, ba);
-
-        /// <summary>
-        ///     Determines whether a specified characters occurs within this string. A parameter
-        ///     specifies the culture, case, and sort rules used in the comparison.
-        /// </summary>
-        /// <param name="a">
-        ///     The string to browse.
-        /// </param>
-        /// <param name="comparisonType">
-        ///     One of the enumeration values that specifies the rules for the search.
-        /// </param>
-        /// <param name="ba">
-        ///     The sequence of characters to seek.
-        /// </param>
-        public static bool ContainsEx(this string a, StringComparison comparisonType, params char[] ba)
-        {
-            try
-            {
-                var r = ba.Any(x => a.IndexOf(x.ToString(), 0, comparisonType) != -1);
-                return r;
-            }
-            catch
-            {
-                return false;
-            }
-        }
-
-        /// <summary>
-        ///     Determines whether a specified characters occurs within this string. The
-        ///     <see cref="StringComparison.OrdinalIgnoreCase"/> parameter is used for this
-        ///     comparison.
-        /// </summary>
-        /// <param name="a">
-        ///     The string to browse.
-        /// </param>
-        /// <param name="ba">
-        ///     The sequence of characters to seek.
-        /// </param>
-        public static bool ContainsEx(this string a, params char[] ba) =>
-            a.ContainsEx(StringComparison.OrdinalIgnoreCase, ba);
-
-        /// <summary>
-        ///     Determines whether the beginning of this string matches a string. A parameter
-        ///     specifies the culture, case, and sort rules used in the comparison.
-        /// </summary>
-        /// <param name="a">
-        ///     The string to check.
-        /// </param>
-        /// <param name="comparisonType">
-        ///     One of the enumeration values that specifies the rules for the search.
-        /// </param>
-        /// <param name="bs">
-        ///     The sequence of strings to compare seek.
-        /// </param>
-        public static bool StartsWithEx(this string a, StringComparison comparisonType, params string[] bs)
-        {
-            try
-            {
-                var r = bs.Any(b => a.StartsWith(b, comparisonType));
-                return r;
-            }
-            catch
-            {
-                return false;
-            }
-        }
-
-        /// <summary>
-        ///     Determines whether the beginning of this string matches a string. The
-        ///     <see cref="StringComparison.OrdinalIgnoreCase"/> parameter is used for this
-        ///     comparison.
-        /// </summary>
-        /// <param name="a">
-        ///     The string to check.
-        /// </param>
-        /// <param name="bs">
-        ///     The sequence of strings to compare seek.
-        /// </param>
-        public static bool StartsWithEx(this string a, params string[] bs) =>
-            a.StartsWithEx(StringComparison.OrdinalIgnoreCase, bs);
-
-        /// <summary>
-        ///     Determines whether the end of this string matches a string. A parameter
-        ///     specifies the culture, case, and sort rules used in the comparison.
-        /// </summary>
-        /// <param name="a">
-        ///     The string to check.
-        /// </param>
-        /// <param name="comparisonType">
-        ///     One of the enumeration values that specifies the rules for the search.
-        /// </param>
-        /// <param name="bs">
-        ///     The sequence of strings to compare seek.
-        /// </param>
-        public static bool EndsWithEx(this string a, StringComparison comparisonType, params string[] bs)
-        {
-            try
-            {
-                var r = bs.Any(b => a.EndsWith(b, comparisonType));
-                return r;
-            }
-            catch
-            {
-                return false;
-            }
-        }
-
-        /// <summary>
-        ///     Determines whether the end of this string matches a string. The
-        ///     <see cref="StringComparison.OrdinalIgnoreCase"/> parameter is used for this
-        ///     comparison.
-        /// </summary>
-        /// <param name="a">
-        ///     The string to check.
-        /// </param>
-        /// <param name="bs">
-        ///     The sequence of strings to compare seek.
-        /// </param>
-        public static bool EndsWithEx(this string a, params string[] bs) =>
-            a.EndsWithEx(StringComparison.OrdinalIgnoreCase, bs);
-
-        /// <summary>
-        ///     Determines whether this string instance is the same as a string of the specified string
-        ///     array. A parameter specifies the culture, case, and sort rules used in the comparison.
-        /// </summary>
-        /// <param name="a">
-        ///     The first string to compare.
-        /// </param>
-        /// <param name="bs">
-        ///     The sequence of strings to compare with the first.
-        /// </param>
-        public static bool EqualsEx(this string a, StringComparison comparisonType, params string[] bs)
-        {
-            try
-            {
-                var r = bs.Any(b => string.Equals(a, b, comparisonType));
-                return r;
-            }
-            catch
-            {
-                return false;
-            }
-        }
-
-        /// <summary>
-        ///     Determines whether this string instance is the same as a string of the specified string
-        ///     array. The <see cref="StringComparison.OrdinalIgnoreCase"/> parameter is used for this
-        ///     comparison.
-        /// </summary>
-        /// <param name="a">
-        ///     The first string to compare.
-        /// </param>
-        /// <param name="bs">
-        ///     The sequence of strings to compare with the first.
-        /// </param>
-        public static bool EqualsEx(this string a, params string[] bs) =>
-            a.EqualsEx(StringComparison.OrdinalIgnoreCase, bs);
+        ///     Searches for the specified one-dimensional array and returns the index of its first
+        ///     occurrence in another one-dimensional array.
+        /// </summary>
+        /// <typeparam name="T">
+        ///     The type of the elements of the array.
+        /// </typeparam>
+        /// <param name="source">
+        ///     The one-dimensional array to search.
+        /// </param>
+        /// <param name="target">
+        ///     The one-dimensional array to locate.
+        /// </param>
+        public static IEnumerable<int> IndexOf<T>(T[] source, T[] target)
+        {
+            if (target == null || source.Length < target.Length)
+                yield break;
+            for (var i = 0; i < source.Length - target.Length + 1; i++)
+                if (!target.Where((data, index) => !source[i + index].Equals(data)).Any())
+                    yield return i;
+        }

         /// <summary>
         ///     Determines whether the value of this object instance is between two specified values.
@@ -290,6 +75,268 @@
                 return false;
             }
         }
+
+        /// <summary>
+        ///     Determines whether a specified sequence of elements occurs within this sequence of
+        ///     elements.
+        /// </summary>
+        /// <typeparam name="T">
+        ///     The type of the elements of the array.
+        /// </typeparam>
+        /// <param name="source">
+        ///     The sequence of elements to browse.
+        /// </param>
+        /// <param name="targets">
+        ///     The sequence of elements to seek.
+        /// </param>
+        public static bool ContainsEx<T>(this IEnumerable<T> source, params T[][] targets)
+        {
+            try
+            {
+                var r = targets.Any(x => IndexOf(source.ToArray(), x).Any(y => y >= 0));
+                return r;
+            }
+            catch
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        ///     Determines whether a specified string occurs within this sequence of strings. A
+        ///     parameter specifies the culture, case, and sort rules used in the comparison.
+        /// </summary>
+        /// <param name="source">
+        ///     The sequence to browse.
+        /// </param>
+        /// <param name="comparisonType">
+        ///     One of the enumeration values that specifies the rules for the search.
+        /// </param>
+        /// <param name="targets">
+        ///     The sequence of strings to seek.
+        /// </param>
+        public static bool ContainsEx(this IEnumerable<string> source, StringComparison comparisonType, params string[] targets)
+        {
+            try
+            {
+                var r = source.Any(x => targets.Any(y => string.Equals(x, y, comparisonType)));
+                return r;
+            }
+            catch
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        ///     Determines whether a specified string occurs within this sequence of strings. The
+        ///     <see cref="StringComparison.OrdinalIgnoreCase"/> parameter is used for this
+        ///     comparison.
+        /// </summary>
+        /// <param name="source">
+        ///     The sequence to browse.
+        /// </param>
+        /// <param name="targets">
+        ///     The sequence of strings to seek.
+        /// </param>
+        public static bool ContainsEx(this IEnumerable<string> source, params string[] targets) =>
+            source.ContainsEx(StringComparison.OrdinalIgnoreCase, targets);
+
+        /// <summary>
+        ///     Determines whether a specified substring occurs within this string. A parameter
+        ///     specifies the culture, case, and sort rules used in the comparison.
+        /// </summary>
+        /// <param name="source">
+        ///     The string to browse.
+        /// </param>
+        /// <param name="comparisonType">
+        ///     One of the enumeration values that specifies the rules for the search.
+        /// </param>
+        /// <param name="targets">
+        ///     The sequence of strings to seek.
+        /// </param>
+        public static bool ContainsEx(this string source, StringComparison comparisonType, params string[] targets)
+        {
+            try
+            {
+                var r = targets.Any(x => source.IndexOf(x, 0, comparisonType) != -1);
+                return r;
+            }
+            catch
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        ///     Determines whether a specified substring occurs within this string. The
+        ///     <see cref="StringComparison.OrdinalIgnoreCase"/> parameter is used for this
+        ///     comparison.
+        /// </summary>
+        /// <param name="source">
+        ///     The string to browse.
+        /// </param>
+        /// <param name="targets">
+        ///     The sequence of strings to seek.
+        /// </param>
+        public static bool ContainsEx(this string source, params string[] targets) =>
+            source.ContainsEx(StringComparison.OrdinalIgnoreCase, targets);
+
+        /// <summary>
+        ///     Determines whether a specified characters occurs within this string. A parameter
+        ///     specifies the culture, case, and sort rules used in the comparison.
+        /// </summary>
+        /// <param name="source">
+        ///     The string to browse.
+        /// </param>
+        /// <param name="comparisonType">
+        ///     One of the enumeration values that specifies the rules for the search.
+        /// </param>
+        /// <param name="targets">
+        ///     The sequence of characters to seek.
+        /// </param>
+        public static bool ContainsEx(this string source, StringComparison comparisonType, params char[] targets)
+        {
+            try
+            {
+                var r = targets.Any(x => source.IndexOf(x.ToString(), 0, comparisonType) != -1);
+                return r;
+            }
+            catch
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        ///     Determines whether a specified characters occurs within this string. The
+        ///     <see cref="StringComparison.OrdinalIgnoreCase"/> parameter is used for this
+        ///     comparison.
+        /// </summary>
+        /// <param name="source">
+        ///     The string to browse.
+        /// </param>
+        /// <param name="targets">
+        ///     The sequence of characters to seek.
+        /// </param>
+        public static bool ContainsEx(this string source, params char[] targets) =>
+            source.ContainsEx(StringComparison.OrdinalIgnoreCase, targets);
+
+        /// <summary>
+        ///     Determines whether the beginning of this string matches a string. A parameter
+        ///     specifies the culture, case, and sort rules used in the comparison.
+        /// </summary>
+        /// <param name="source">
+        ///     The string to check.
+        /// </param>
+        /// <param name="comparisonType">
+        ///     One of the enumeration values that specifies the rules for the search.
+        /// </param>
+        /// <param name="targets">
+        ///     The sequence of strings to compare seek.
+        /// </param>
+        public static bool StartsWithEx(this string source, StringComparison comparisonType, params string[] targets)
+        {
+            try
+            {
+                var r = targets.Any(b => source.StartsWith(b, comparisonType));
+                return r;
+            }
+            catch
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        ///     Determines whether the beginning of this string matches a string. The
+        ///     <see cref="StringComparison.OrdinalIgnoreCase"/> parameter is used for this
+        ///     comparison.
+        /// </summary>
+        /// <param name="source">
+        ///     The string to check.
+        /// </param>
+        /// <param name="targets">
+        ///     The sequence of strings to compare seek.
+        /// </param>
+        public static bool StartsWithEx(this string source, params string[] targets) =>
+            source.StartsWithEx(StringComparison.OrdinalIgnoreCase, targets);
+
+        /// <summary>
+        ///     Determines whether the end of this string matches a string. A parameter
+        ///     specifies the culture, case, and sort rules used in the comparison.
+        /// </summary>
+        /// <param name="source">
+        ///     The string to check.
+        /// </param>
+        /// <param name="comparisonType">
+        ///     One of the enumeration values that specifies the rules for the search.
+        /// </param>
+        /// <param name="targets">
+        ///     The sequence of strings to compare seek.
+        /// </param>
+        public static bool EndsWithEx(this string source, StringComparison comparisonType, params string[] targets)
+        {
+            try
+            {
+                var r = targets.Any(b => source.EndsWith(b, comparisonType));
+                return r;
+            }
+            catch
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        ///     Determines whether the end of this string matches a string. The
+        ///     <see cref="StringComparison.OrdinalIgnoreCase"/> parameter is used for this comparison.
+        /// </summary>
+        /// <param name="source">
+        ///     The string to check.
+        /// </param>
+        /// <param name="targets">
+        ///     The sequence of strings to compare seek.
+        /// </param>
+        public static bool EndsWithEx(this string source, params string[] targets) =>
+            source.EndsWithEx(StringComparison.OrdinalIgnoreCase, targets);
+
+        /// <summary>
+        ///     Determines whether this string instance is the same as a string of the specified string
+        ///     array. A parameter specifies the culture, case, and sort rules used in the comparison.
+        /// </summary>
+        /// <param name="source">
+        ///     The first string to compare.
+        /// </param>
+        /// <param name="targets">
+        ///     The sequence of strings to compare with the first.
+        /// </param>
+        public static bool EqualsEx(this string source, StringComparison comparisonType, params string[] targets)
+        {
+            try
+            {
+                var r = targets.Any(b => string.Equals(source, b, comparisonType));
+                return r;
+            }
+            catch
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        ///     Determines whether this string instance is the same as a string of the specified string
+        ///     array. The <see cref="StringComparison.OrdinalIgnoreCase"/> parameter is used for this
+        ///     comparison.
+        /// </summary>
+        /// <param name="source">
+        ///     The first string to compare.
+        /// </param>
+        /// <param name="targets">
+        ///     The sequence of strings to compare with the first.
+        /// </param>
+        public static bool EqualsEx(this string source, params string[] targets) =>
+            source.EqualsEx(StringComparison.OrdinalIgnoreCase, targets);

         /// <summary>
         ///     Provides a base class for comparison.
@@ -311,8 +358,8 @@
             }

             /// <summary>
-            ///     Compare two specified objects and returns an integer that indicates their
-            ///     relative position in the sort order.
+            ///     Compare two specified objects and returns an integer that indicates their relative
+            ///     position in the sort order.
             /// </summary>
             /// <param name="a">
             ///     The first object to compare.


CoolerMaster monochrome option

CoolerMaster monochrome option

--- Project-Aurora/Project-Aurora/Devices/CoolerMaster/CoolerMasterDevice.cs
+++ Project-Aurora/Project-Aurora/Devices/CoolerMaster/CoolerMasterDevice.cs
@@ -395,6 +395,7 @@
         private bool peripheral_updated = false;

         private readonly object action_lock = new object();
+        private VariableRegistry default_registry = null;

         private System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
         private long lastUpdateTime = 0;
@@ -531,8 +532,23 @@

         private void SetOneKey(int[] key, Color color)
         {
-            color = Color.FromArgb(255, Utils.ColorUtils.MultiplyColorByScalar(color, color.A / 255.0D));
-            CoolerMasterSDK.KEY_COLOR key_color = new CoolerMasterSDK.KEY_COLOR(color.R, color.G, color.B);
+            CoolerMasterSDK.KEY_COLOR key_color;
+            //process
+            if (Global.Configuration.VarRegistry.GetVariable<bool>($"{devicename}_monochrome_mode"))
+            {
+                //Strip alpha
+                color = Color.FromArgb(255, Utils.ColorUtils.MultiplyColorByScalar(color, color.A / 255.0D));
+                //Get brightness
+                key_color = new CoolerMasterSDK.KEY_COLOR(ColorUtils.GetColorBrightness(color), 0, 0);
+            }
+            else
+            {
+                color = Color.FromArgb(255, Utils.ColorUtils.MultiplyColorByScalar(color, color.A / 255.0D));
+                key_color = new CoolerMasterSDK.KEY_COLOR(color.R, color.G, color.B);
+            }
+
+
+
             color_matrix.KeyColor[key[0], key[1]] = key_color;
         }

@@ -640,7 +656,12 @@

         public VariableRegistry GetRegisteredVariables()
         {
-            return new VariableRegistry();
+            if (default_registry == null)
+            {
+                default_registry = new VariableRegistry();
+                default_registry.Register($"{devicename}_monochrome_mode", false, "Monochrome Mode");
+            }
+            return default_registry;
         }
     }
 }


fix comment

fix comment

--- Python/Product/PythonTools/PythonTools/Commands/ImportCoverageCommand.cs
+++ Python/Product/PythonTools/PythonTools/Commands/ImportCoverageCommand.cs
@@ -24,7 +24,7 @@

 namespace Microsoft.PythonTools.Commands {
     /// <summary>
-    /// Provides the command for starting a file or the start item of a project in the REPL window.
+    /// Provides the command for importing code coverage information from a coverage.py XML file.
     /// </summary>
     internal sealed class ImportCoverageCommand : Command {
         private readonly IServiceProvider _serviceProvider;


Fix in XML comment.

Fix in XML comment.

--- SimpleServiceLocator/CuttingEdge.ServiceLocation/SimpleServiceLocator.cs
+++ SimpleServiceLocator/CuttingEdge.ServiceLocation/SimpleServiceLocator.cs
@@ -461,7 +461,7 @@

         ///
         /// Validates the SimpleServiceLocator. Validate will call all delegates registered with
-        /// <see cref="Register"/> and iterate collections registered with <see cref="RegisterAll"/> and
+        /// Register and iterate collections registered with <see cref="RegisterAll"/> and
         /// throws an exception if there was an error.
         ///
         /// <exception cref="InvalidOperationException">Thrown when the registration of instances was


#99 Get-IshFolderContent should return all versions of objects when VersionFilter is empty

--- Source/ISHRemote/Trisoft.ISHRemote/Cmdlets/Folder/GetIshFolderContent.cs
+++ Source/ISHRemote/Trisoft.ISHRemote/Cmdlets/Folder/GetIshFolderContent.cs
@@ -155,7 +155,7 @@
         /// <summary>
         /// Private field to store and provide defaults for non-mandatory parameters
         /// </summary>
-        private string _versionFilter = "latest";
+        private string _versionFilter = "";
         private string[] _languagesFilter = { };
         #endregion

@@ -227,6 +227,30 @@
                 }

                 List<IshObject> returnIshObjects = new List<IshObject>();
+                IshFields metadataFilterFields = new IshFields(MetadataFilter);
+                // Update MetadataFilter with LanguagesFilter (if provided)
+                if (LanguagesFilter != null && LanguagesFilter.Length > 0)
+                {
+                    if (LanguagesFilter[0].StartsWith("VLANGUAGE"))
+                    {
+                        metadataFilterFields.AddOrUpdateField(new IshMetadataFilterField(FieldElements.DocumentLanguage,
+                            Enumerations.Level.Lng,
+                            Enumerations.FilterOperator.In,
+                            String.Join(IshSession.Separator, LanguagesFilter),
+                            Enumerations.ValueType.Element),
+                            Enumerations.ActionMode.Update);
+                    }
+                    else
+                    {
+                        metadataFilterFields.AddOrUpdateField(new IshMetadataFilterField(FieldElements.DocumentLanguage,
+                            Enumerations.Level.Lng,
+                            Enumerations.FilterOperator.In,
+                            String.Join(IshSession.Separator, LanguagesFilter),
+                            Enumerations.ValueType.Value),
+                            Enumerations.ActionMode.Update);
+                    }
+                }
+
                 int current = 0;
                 foreach (long returnFolderId in returnFolderIds)
                 {
@@ -237,7 +261,7 @@

                     if (ishObjects.Ids.Length > 0)
                     {
-                        WriteDebug("Retrieving LogicalIds.Length["+ishObjects.Ids.Length+"]");
+                        WriteDebug("Retrieving LogicalIds.Length[" + ishObjects.Ids.Length + "]");
                         // First handle all documents/illustrations
                         var documentLogicalIds = ishObjects.Objects
                                     .Where(ishObject => ishObject.IshType != Enumerations.ISHType.ISHPublication)
@@ -245,7 +269,6 @@
                                     .ToList();
                         if (documentLogicalIds.Any())
                         {
-                            WriteDebug($"Filtering DocumentObj using VersionFilter[{VersionFilter}]");
                             Enumerations.ISHType[] ISHType = { Enumerations.ISHType.ISHIllustration, Enumerations.ISHType.ISHLibrary, Enumerations.ISHType.ISHMasterDoc, Enumerations.ISHType.ISHModule, Enumerations.ISHType.ISHTemplate };
                             IshFields requestedMetadata = IshSession.IshTypeFieldSetup.ToIshRequestedMetadataFields(IshSession.DefaultRequestedMetadata, ISHType, new IshFields(), Enumerations.ActionMode.Read);

@@ -254,44 +277,36 @@
                             int currentLogicalIdCount = 0;
                             foreach (List<string> logicalIdBatch in devidedDocumentLogicalIdsList)
                             {
-                                xmlIshObjects = IshSession.DocumentObj25.RetrieveVersionMetadata(logicalIdBatch.ToArray(), VersionFilter, "");
-                                var documentIshObjects = new IshObjects(xmlIshObjects);
-                                IshFields metadataFilterFields = new IshFields(MetadataFilter);
-
                                 currentLogicalIdCount += logicalIdBatch.Count;
                                 WriteDebug($"Retrieving DocumentObj.length[{logicalIdBatch.Count}] MetadataFilter.length[{metadataFilterFields.ToXml().Length}] {currentLogicalIdCount}/{documentLogicalIds.Count}");
-                                if (documentIshObjects.Objects.Length > 0)
+
+                                if (VersionFilter != null && VersionFilter.Length > 0)
                                 {
-                                    if (LanguagesFilter != null && LanguagesFilter.Length > 0)
+                                    WriteDebug($"Filtering DocumentObj using VersionFilter[{VersionFilter}]");
+                                    xmlIshObjects = IshSession.DocumentObj25.RetrieveVersionMetadata(logicalIdBatch.ToArray(), VersionFilter, "");
+                                    var documentIshObjects = new IshObjects(xmlIshObjects);
+                                    if (documentIshObjects.Objects.Length > 0)
                                     {
                                         WriteVerbose($"Filtering DocumentObj using MetadataFilter.length[{metadataFilterFields.ToXml().Length}] and LanguagesFilter.Length[{LanguagesFilter.Length}]");
-                                        if (LanguagesFilter[0].StartsWith("VLANGUAGE"))
-                                        {
-                                            metadataFilterFields.AddOrUpdateField(new IshMetadataFilterField(FieldElements.DocumentLanguage,
-                                                Enumerations.Level.Lng,
-                                                Enumerations.FilterOperator.In,
-                                                String.Join(IshSession.Separator, LanguagesFilter),
-                                                Enumerations.ValueType.Element),
-                                                Enumerations.ActionMode.Update);
-                                        }
-                                        else
-                                        {
-                                            metadataFilterFields.AddOrUpdateField(new IshMetadataFilterField(FieldElements.DocumentLanguage,
-                                                Enumerations.Level.Lng,
-                                                Enumerations.FilterOperator.In,
-                                                String.Join(IshSession.Separator, LanguagesFilter),
-                                                Enumerations.ValueType.Value),
-                                                Enumerations.ActionMode.Update);
-                                        }
+                                        var versionRefs = documentIshObjects.Objects
+                                            .Select(ishObject => Convert.ToInt64(ishObject.ObjectRef[Enumerations.ReferenceType.Version]))
+                                            .ToList();
+                                        xmlIshObjects =
+                                            IshSession.DocumentObj25.RetrieveMetadataByIshVersionRefs(versionRefs.ToArray(),
+                                                DocumentObj25ServiceReference.StatusFilter.ISHNoStatusFilter, metadataFilterFields.ToXml(),
+                                                requestedMetadata.ToXml());
+                                        documentIshObjects = new IshObjects(ISHType, xmlIshObjects);
+                                        returnIshObjects.AddRange(documentIshObjects.Objects);
                                     }
-                                    var versionRefs = documentIshObjects.Objects
-                                        .Select(ishObject => Convert.ToInt64(ishObject.ObjectRef[Enumerations.ReferenceType.Version]))
-                                        .ToList();
-                                    xmlIshObjects =
-                                        IshSession.DocumentObj25.RetrieveMetadataByIshVersionRefs(versionRefs.ToArray(),
-                                            DocumentObj25ServiceReference.StatusFilter.ISHNoStatusFilter, metadataFilterFields.ToXml(),
-                                            requestedMetadata.ToXml());
-                                    documentIshObjects = new IshObjects(ISHType, xmlIshObjects);
+                                }
+                                else
+                                {
+                                    WriteVerbose($"Filtering DocumentObj using MetadataFilter.length[{metadataFilterFields.ToXml().Length}]");
+                                    xmlIshObjects = IshSession.DocumentObj25.RetrieveMetadata(logicalIdBatch.ToArray(),
+                                        DocumentObj25ServiceReference.StatusFilter.ISHNoStatusFilter,
+                                        metadataFilterFields.ToXml(),
+                                        requestedMetadata.ToXml());
+                                    var documentIshObjects = new IshObjects(ISHType, xmlIshObjects);
                                     returnIshObjects.AddRange(documentIshObjects.Objects);
                                 }
                             }
@@ -305,7 +320,6 @@
                                     .ToList();
                         if (publicationLogicalIds.Any())
                         {
-                            WriteDebug($"Filtering PublicationOutput using VersionFilter[{VersionFilter}]");
                             Enumerations.ISHType[] ISHType = { Enumerations.ISHType.ISHPublication };
                             IshFields requestedMetadata = IshSession.IshTypeFieldSetup.ToIshRequestedMetadataFields(IshSession.DefaultRequestedMetadata, ISHType, new IshFields(), Enumerations.ActionMode.Read);

@@ -314,46 +328,37 @@
                             int currentLogicalIdCount = 0;
                             foreach (List<string> logicalIdBatch in devidedPublicationLogicalIdsList)
                             {
-                                xmlIshObjects = IshSession.PublicationOutput25.RetrieveVersionMetadata(logicalIdBatch.ToArray(), VersionFilter, "");
-                                var publicationIshObjects = new IshObjects(xmlIshObjects);
-                                IshFields metadataFilterFields = new IshFields(MetadataFilter);
-
                                 currentLogicalIdCount += logicalIdBatch.Count;
                                 WriteDebug($"Retrieving PublicationOutput.length[{logicalIdBatch.Count}] MetadataFilter.length[{metadataFilterFields.ToXml().Length}] {currentLogicalIdCount}/{publicationLogicalIds.Count}");
-                                if (publicationIshObjects.Objects.Length > 0)
+
+                                if (VersionFilter != null && VersionFilter.Length > 0)
                                 {
-                                    if (LanguagesFilter != null && LanguagesFilter.Length > 0)
+                                    WriteDebug($"Filtering PublicationOutput using VersionFilter[{VersionFilter}]");
+                                    xmlIshObjects = IshSession.PublicationOutput25.RetrieveVersionMetadata(logicalIdBatch.ToArray(), VersionFilter, "");
+                                    var publicationIshObjects = new IshObjects(xmlIshObjects);
+
+                                    if (publicationIshObjects.Objects.Length > 0)
                                     {
                                         WriteVerbose($"Filtering PublicationOutput using MetadataFilter.length[{metadataFilterFields.ToXml().Length}] and LanguagesFilter.Length[{LanguagesFilter.Length}]");
-                                        if (LanguagesFilter[0].StartsWith("VLANGUAGE"))
-                                        {
-                                            metadataFilterFields.AddOrUpdateField(new IshMetadataFilterField(FieldElements.DocumentLanguage,
-                                                Enumerations.Level.Lng,
-                                                Enumerations.FilterOperator.In,
-                                                String.Join(IshSession.Separator, LanguagesFilter),
-                                                Enumerations.ValueType.Element),
-                                                Enumerations.ActionMode.Update);
-                                        }
-                                        else
-                                        {
-                                            metadataFilterFields.AddOrUpdateField(new IshMetadataFilterField(FieldElements.DocumentLanguage,
-                                                Enumerations.Level.Lng,
-                                                Enumerations.FilterOperator.In,
-                                                String.Join(IshSession.Separator, LanguagesFilter),
-                                                Enumerations.ValueType.Value),
-                                                Enumerations.ActionMode.Update);
-
-                                        }
-
+                                        var versionRefs = publicationIshObjects.Objects
+                                            .Select(ishObject => Convert.ToInt64(ishObject.ObjectRef[Enumerations.ReferenceType.Version]))
+                                            .ToList();
+                                        xmlIshObjects =
+                                            IshSession.PublicationOutput25.RetrieveMetadataByIshVersionRefs(versionRefs.ToArray(),
+                                                PublicationOutput25ServiceReference.StatusFilter.ISHNoStatusFilter, metadataFilterFields.ToXml(),
+                                                requestedMetadata.ToXml());
+                                        publicationIshObjects = new IshObjects(ISHType, xmlIshObjects);
+                                        returnIshObjects.AddRange(publicationIshObjects.Objects);
                                     }
-                                    var versionRefs = publicationIshObjects.Objects
-                                        .Select(ishObject => Convert.ToInt64(ishObject.ObjectRef[Enumerations.ReferenceType.Version]))
-                                        .ToList();
-                                    xmlIshObjects =
-                                        IshSession.PublicationOutput25.RetrieveMetadataByIshVersionRefs(versionRefs.ToArray(),
-                                            PublicationOutput25ServiceReference.StatusFilter.ISHNoStatusFilter, metadataFilterFields.ToXml(),
-                                            requestedMetadata.ToXml());
-                                    publicationIshObjects = new IshObjects(ISHType, xmlIshObjects);
+                                }
+                                else
+                                {
+                                    WriteVerbose($"Filtering PublicationOutput using MetadataFilter.length[{metadataFilterFields.ToXml().Length}]");
+                                    xmlIshObjects = IshSession.PublicationOutput25.RetrieveMetadata(logicalIdBatch.ToArray(),
+                                        PublicationOutput25ServiceReference.StatusFilter.ISHNoStatusFilter,
+                                        metadataFilterFields.ToXml(),
+                                        requestedMetadata.ToXml());
+                                    var publicationIshObjects = new IshObjects(ISHType, xmlIshObjects);
                                     returnIshObjects.AddRange(publicationIshObjects.Objects);
                                 }
                             }


enable pct optimisation again

enable pct optimisation again

--- Source/SystematicTesting/SchedulingStrategies/Prioritized/PCTStrategy.cs
+++ Source/SystematicTesting/SchedulingStrategies/Prioritized/PCTStrategy.cs
@@ -262,14 +262,21 @@
                 IO.Debug("<PCTDebug> Detected new machine '{0}({1})' at index '{2}'.",
                     mi.Machine, mi.Machine.Id.MVal, mIndex);
             }
-
+
             if (this.PriorityChangePoints.Contains(this.ExploredSteps))
             {
-                var priority = this.GetHighestPriorityEnabledMachine(choices);
-                this.PrioritizedMachines.Remove(priority);
-                this.PrioritizedMachines.Add(priority);
-                IO.PrintLine("<PCTLog> Machine '{0}({1})' changes to lowest priority.",
-                    priority.Type, priority.MVal);
+                if (choices.Count == 1)
+                {
+                    this.MovePriorityChangePointForward();
+                }
+                else
+                {
+                    var priority = this.GetHighestPriorityEnabledMachine(choices);
+                    this.PrioritizedMachines.Remove(priority);
+                    this.PrioritizedMachines.Add(priority);
+                    IO.PrintLine("<PCTLog> Machine '{0}({1})' changes to lowest priority.",
+                        priority.Type, priority.MVal);
+                }
             }

             var prioritizedMachine = this.GetHighestPriorityEnabledMachine(choices);
@@ -317,6 +324,24 @@
             return prioritizedMachine;
         }

+        /// <summary>
+        /// Moves the current priority change point forward. This is a useful
+        /// optimization when a priority change point is assigned in either a
+        /// sequential execution or a nondeterministic choice.
+        /// </summary>
+        private void MovePriorityChangePointForward()
+        {
+            this.PriorityChangePoints.Remove(this.ExploredSteps);
+            var newPriorityChangePoint = this.ExploredSteps + 1;
+            while (this.PriorityChangePoints.Contains(newPriorityChangePoint))
+            {
+                newPriorityChangePoint++;
+            }
+
+            this.PriorityChangePoints.Add(newPriorityChangePoint);
+            IO.Debug("<PCTDebug> Moving priority change to '{0}'.", newPriorityChangePoint);
+        }
+
         #endregion
     }
 }


Fixed model for all documents view

Fixed model for all documents view

--- Source/Web/Interapp.Web/Areas/Student/Controllers/DocumentsController.cs
+++ Source/Web/Interapp.Web/Areas/Student/Controllers/DocumentsController.cs
@@ -4,6 +4,7 @@
     using Interapp.Services.Contracts;
     using Microsoft.AspNet.Identity;
     using Models.DocumentViewModels;
+    using Models.UniversityViewModels;
     using System.Linq;
     using System.Web.Mvc;

@@ -11,26 +12,39 @@
     {
         private IDocumentsService documents;
         private IUniversitiesService universities;
+        private IStudentInfosService students;

-        public DocumentsController(IDocumentsService documents, IUniversitiesService universities)
+        public DocumentsController(IDocumentsService documents, IUniversitiesService universities, IStudentInfosService students)
         {
+            this.students = students;
             this.documents = documents;
             this.universities = universities;
         }

         public ActionResult All()
         {
+            //var studentId = this.User.Identity.GetUserId();
+            //var studentDocuments = this.documents
+            //    .GetByStudent(studentId)
+            //    .ProjectTo<DocumentViewModel>()
+            //    .ToList();
+
+            //var universities = this.universities
+            //    .GetForUserWithDocuments(studentId);
+            // TODO: Finish and add model to view
             var studentId = this.User.Identity.GetUserId();
-            var studentDocuments = this.documents
-                .GetByStudent(studentId)
-                .ProjectTo<DocumentViewModel>()
-                .ToList();
+            var studentInfo = this.students.GetFullInfoById(studentId);

-            var universities = this.universities
-                .GetForUserWithDocuments(studentId);
-            // TODO: Finish and add model to view
+            var studentDocuments = studentInfo.Documents.AsQueryable().ProjectTo<DocumentViewModel>().ToList();
+            var universities = studentInfo.UniversitiesOfInterest.AsQueryable().ProjectTo<UniversityViewModel>().ToList();

-            return View();
+            var model = new DocumentsFullViewModel()
+            {
+                StudentDocuments = studentDocuments,
+                Universities = universities
+            };
+
+            return View(model);
         }
     }
 }


Removed call to UrlAuthorizationModule.CheckUrlAccessForPrincipal which cannot be called from medium trust.

--- SubtextSolution/Subtext.Framework/UrlManager/UrlReWriteHandlerFactory.cs
+++ SubtextSolution/Subtext.Framework/UrlManager/UrlReWriteHandlerFactory.cs
@@ -130,29 +130,6 @@

 		private static IHttpHandler GetHandlerForUrl(string url)
 		{
-			if(!UrlAuthorizationModule.CheckUrlAccessForPrincipal(url, HttpContext.Current.User, HttpContext.Current.Request.HttpMethod))
-			{
-				BlogRequest request = BlogRequest.Current;
-				if (String.IsNullOrEmpty(request.Subfolder))
-				{
-					FormsAuthentication.RedirectToLoginPage();
-				}
-				else
-				{
-					string query = HttpContext.Current.Request.QueryString.ToString();
-					if(!String.IsNullOrEmpty(query))
-					{
-						query = "?" + query;
-					}
-					HttpContext.Current.Response.Redirect(Config.CurrentBlog.VirtualUrl
-														  + "Login.aspx?ReturnUrl="
-														  +
-														  HttpUtility.UrlEncode(HttpContext.Current.Request.Path + query,
-																				HttpContext.Current.Request.ContentEncoding));
-				}
-				return null;
-			}
-
 			string path = HttpContext.Current.Request.Path;
 			if (path.EndsWith("/"))
 			{


adding a unit test (ignored for now) that will make sure Config.CurrentBlog returns NULL for requests to HostAdmin.

Ignoring b/c of a quirk where the SP always returns a record if the system has EXACTLY ONE (1) blog configured. Anyone know of a good fix for this?

--- SubtextSolution/UnitTests.Subtext/Framework/Configuration/ConfigTests.cs
+++ SubtextSolution/UnitTests.Subtext/Framework/Configuration/ConfigTests.cs
@@ -46,6 +46,15 @@

 			Assert.AreEqual(Config.BlogCount, 0, "This test requires that there be no blogs in the system.");
 			Assert.IsNull(Config.CurrentBlog, "Should not have been able to find a BlogInfo object when in the Install directory");
+		}
+
+		[Ignore] // ignore for now b/c having exactly one blog in the system will always return a BlogInfo.
+		[Test]
+		public void CurrentBlogReturnNsullWhenInHostAdminDirectory()
+		{
+			UnitTestHelper.SetHttpContextWithBlogRequest(UnitTestHelper.GenerateRandomString(), "HostAdmin", "", "Default.aspx");
+
+			Assert.IsNull(Config.CurrentBlog, "Should not have been able to find a BlogInfo object for a request to the HostAdmin directory.");
 		}

     	/// <summary>


Add axes

Add axes

--- UIExension/StatsUIExtension/StatsUIExtensionCore/StatsUIExtensionCore.cs
+++ UIExension/StatsUIExtension/StatsUIExtensionCore/StatsUIExtensionCore.cs
@@ -299,6 +299,14 @@
             m_Chart.Background = System.Windows.Media.Brushes.White;
             m_Chart.BorderBrush = null;

+            m_XAxis = new System.Windows.Controls.DataVisualization.Charting.DateTimeAxis();
+            m_XAxis.Orientation = System.Windows.Controls.DataVisualization.Charting.AxisOrientation.X;
+
+            m_YAxis = new System.Windows.Controls.DataVisualization.Charting.CategoryAxis();
+            m_YAxis.Orientation = System.Windows.Controls.DataVisualization.Charting.AxisOrientation.Y;
+
+            m_Chart.Axes.Add(m_XAxis);
+
             this.Children.Add(m_Chart);
         }

@@ -311,6 +319,8 @@

         // --------------------------------------------------------------------------------------
         private System.Windows.Controls.DataVisualization.Charting.Chart m_Chart;
+        private System.Windows.Controls.DataVisualization.Charting.DateTimeAxis m_XAxis;
+        private System.Windows.Controls.DataVisualization.Charting.CategoryAxis m_YAxis;
         //private System.Windows.Controls.DataVisualization.Charting.ChartArea m_ChartArea;

     }


Add a ton of missing namespaces for XMP rendering.

--- src/TagLib/Xmp/XmpTag.cs
+++ src/TagLib/Xmp/XmpTag.cs
@@ -58,11 +58,21 @@
 		public static readonly string EXIF_NS = "http://ns.adobe.com/exif/1.0/";

 		/// <summary>
+		///    JOB namespace
+		/// </summary>
+		public static readonly string JOB_NS = "http://ns.adobe.com/xap/1.0/sType/Job#";
+
+		/// <summary>
 		///    Microsoft Photo namespace
 		/// </summary>
 		public static readonly string MS_PHOTO_NS = "http://ns.microsoft.com/photo/1.0/";

 		/// <summary>
+		///    Photoshop namespace
+		/// </summary>
+		public static readonly string PHOTOSHOP_NS = "http://ns.adobe.com/photoshop/1.0/";
+
+		/// <summary>
 		///    RDF namespace
 		/// </summary>
 		public static readonly string RDF_NS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
@@ -81,6 +91,21 @@
 		///    XAP (XMP's previous name) namespace
 		/// </summary>
 		public static readonly string XAP_NS = "http://ns.adobe.com/xap/1.0/";
+
+		/// <summary>
+		///    XAP bj namespace
+		/// </summary>
+		public static readonly string XAP_BJ_NS = "http://ns.adobe.com/xap/1.0/bj/";
+
+		/// <summary>
+		///    XAP mm namespace
+		/// </summary>
+		public static readonly string XAP_MM_NS = "http://ns.adobe.com/xap/1.0/mm/";
+
+		/// <summary>
+		///    XAP rights namespace
+		/// </summary>
+		public static readonly string XAP_RIGHTS_NS = "http://ns.adobe.com/xap/1.0/rights/";

 		/// <summary>
 		///    XML namespace
@@ -121,15 +146,21 @@
 			// This allows for fast string comparison using operator==
 			NameTable = new NameTable ();
 			// Namespaces
+			AddNamespacePrefix ("", ""); // Needed for the about attribute, which can be unqualified.
 			AddNamespacePrefix ("x", ADOBE_X_NS);
 			AddNamespacePrefix ("crs", CRS_NS);
 			AddNamespacePrefix ("dc", DC_NS);
 			AddNamespacePrefix ("exif", EXIF_NS);
+			AddNamespacePrefix ("stJob", JOB_NS);
 			AddNamespacePrefix ("MicrosoftPhoto", MS_PHOTO_NS);
+			AddNamespacePrefix ("photoshop", PHOTOSHOP_NS);
 			AddNamespacePrefix ("rdf", RDF_NS);
 			AddNamespacePrefix ("stDim", STDIM_NS);
 			AddNamespacePrefix ("tiff", TIFF_NS);
 			AddNamespacePrefix ("xmp", XAP_NS);
+			AddNamespacePrefix ("xapBJ", XAP_BJ_NS);
+			AddNamespacePrefix ("xapMM", XAP_MM_NS);
+			AddNamespacePrefix ("xapRights", XAP_RIGHTS_NS);
 			AddNamespacePrefix ("xml", XML_NS);
 			AddNamespacePrefix ("xmlns", XMLNS_NS);
 			AddNamespacePrefix ("xmpTPg", XMPTG_NS);


Initialize context simulation

Initialize context simulation

--- Test/Windows/MainWindow.xaml.cs
+++ Test/Windows/MainWindow.xaml.cs
@@ -34,6 +34,7 @@
             var context = new EditorContext();
             context.Initialize(this, WpfRenderer.Create());
             context.InitializeSctipts();
+            context.InitializeSimulation();
             context.Editor.Renderer.DrawShapeState = ShapeState.Visible;

             context.Commands.OpenCommand = new DelegateCommand(


Fixes subscription not found due to PythonData warm up history request

--- Engine/AlgorithmManager.cs
+++ Engine/AlgorithmManager.cs
@@ -785,7 +785,7 @@
                             else               list.Add(data);

                             Type dataType = data.GetType();
-                            var config = security.Subscriptions.FirstOrDefault(subscription => subscription.Type == dataType);
+                            var config = security.Subscriptions.FirstOrDefault(subscription => dataType.IsAssignableFrom(subscription.Type));
                             if (config == null)
                             {
                                 throw new Exception($"A data subscription for type '{dataType.Name}' was not found.");


Only accept html elements are root and take whatever comes first as body (frameset / body)

--- AngleSharp/DOM/Document.cs
+++ AngleSharp/DOM/Document.cs
@@ -670,7 +670,7 @@
         /// </summary>
         public IElement DocumentElement
         {
-            get { return this.FindChild<Element>(); }
+            get { return this.FindChild<HTMLHtmlElement>(); }
         }

         /// <summary>
@@ -810,7 +810,28 @@
         /// </summary>
         public IHtmlElement Body
         {
-            get { return DocumentElement.FindChild<IHtmlBodyElement>() as IHtmlElement ?? DocumentElement.FindChild<HTMLFrameSetElement>(); }
+            get
+            {
+                var root = DocumentElement;
+
+                if (root != null)
+                {
+                    foreach (var child in root.ChildNodes)
+                    {
+                        var body = child as HTMLBodyElement;
+
+                        if (body != null)
+                            return body;
+
+                        var frameset = child as HTMLFrameSetElement;
+
+                        if (frameset != null)
+                            return frameset;
+                    }
+                }
+
+                return null;
+            }
             set
             {
                 if (value is IHtmlBodyElement == false && value is HTMLFrameSetElement == false)


Store LocalValues in value store as plain values.

Instead of using a `PriorityValue`, when a property is assigned a simple `LocalValue` just store the value directly in the value store.

--- src/Avalonia.Base/ValueStore.cs
+++ src/Avalonia.Base/ValueStore.cs
@@ -1,16 +1,14 @@
 using System;
 using System.Collections.Generic;
-using System.Text;
 using Avalonia.Data;
-using Avalonia.Utilities;

 namespace Avalonia
 {
     internal class ValueStore : IPriorityValueOwner
     {
         private readonly AvaloniaObject _owner;
-        private readonly Dictionary<AvaloniaProperty, PriorityValue> _values =
-            new Dictionary<AvaloniaProperty, PriorityValue>();
+        private readonly Dictionary<AvaloniaProperty, object> _values =
+            new Dictionary<AvaloniaProperty, object>();

         public ValueStore(AvaloniaObject owner)
         {
@@ -22,51 +20,94 @@
             IObservable<object> source,
             BindingPriority priority)
         {
-            if (!_values.TryGetValue(property, out PriorityValue v))
+            PriorityValue priorityValue;
+
+            if (_values.TryGetValue(property, out var v))
             {
-                v = CreatePriorityValue(property);
-                _values.Add(property, v);
+                priorityValue = v as PriorityValue;
+
+                if (priorityValue == null)
+                {
+                    priorityValue = CreatePriorityValue(property);
+                    priorityValue.SetValue(v, (int)BindingPriority.LocalValue);
+                    _values[property] = priorityValue;
+                }
+            }
+            else
+            {
+                priorityValue = CreatePriorityValue(property);
+                _values.Add(property, priorityValue);
             }

-            return v.Add(source, (int)priority);
+            return priorityValue.Add(source, (int)priority);
         }

         public void AddValue(AvaloniaProperty property, object value, int priority)
         {
-            var originalValue = value;
+            PriorityValue priorityValue;

-            if (!TypeUtilities.TryConvertImplicit(property.PropertyType, value, out value))
+            if (_values.TryGetValue(property, out var v))
             {
-                throw new ArgumentException(string.Format(
-                    "Invalid value for Property '{0}': '{1}' ({2})",
-                    property.Name,
-                    originalValue,
-                    originalValue?.GetType().FullName ?? "(null)"));
+                priorityValue = v as PriorityValue;
+
+                if (priorityValue == null)
+                {
+                    if (priority == (int)BindingPriority.LocalValue)
+                    {
+                        _values[property] = Validate(property, value);
+                        Changed(property, priority, v, value);
+                        return;
+                    }
+                    else
+                    {
+                        priorityValue = CreatePriorityValue(property);
+                        priorityValue.SetValue(v, (int)BindingPriority.LocalValue);
+                        _values[property] = priorityValue;
+                    }
+                }
             }
-
-            if (!_values.TryGetValue(property, out PriorityValue v))
+            else
             {
                 if (value == AvaloniaProperty.UnsetValue)
                 {
                     return;
                 }

-                v = CreatePriorityValue(property);
-                _values.Add(property, v);
+                if (priority == (int)BindingPriority.LocalValue)
+                {
+                    _values.Add(property, Validate(property, value));
+                    Changed(property, priority, AvaloniaProperty.UnsetValue, value);
+                    return;
+                }
+                else
+                {
+                    priorityValue = CreatePriorityValue(property);
+                    _values.Add(property, priorityValue);
+                }
             }

-            v.SetValue(value, priority);
+            priorityValue.SetValue(value, priority);
         }

-        public IDictionary<AvaloniaProperty, PriorityValue> GetSetValues() => _values;
+        public void BindingNotificationReceived(AvaloniaProperty property, BindingNotification notification)
+        {
+            ((IPriorityValueOwner)_owner).BindingNotificationReceived(property, notification);
+        }
+
+        public void Changed(AvaloniaProperty property, int priority, object oldValue, object newValue)
+        {
+            ((IPriorityValueOwner)_owner).Changed(property, priority, oldValue, newValue);
+        }
+
+        public IDictionary<AvaloniaProperty, PriorityValue> GetSetValues() => throw new NotImplementedException();

         public object GetValue(AvaloniaProperty property)
         {
             var result = AvaloniaProperty.UnsetValue;

-            if (_values.TryGetValue(property, out PriorityValue value))
+            if (_values.TryGetValue(property, out var value))
             {
-                result = value.Value;
+                result = (value is PriorityValue priorityValue) ? priorityValue.Value : value;
             }

             if (result == AvaloniaProperty.UnsetValue)
@@ -79,14 +120,14 @@

         public bool IsAnimating(AvaloniaProperty property)
         {
-            return _values.TryGetValue(property, out PriorityValue value) ? value.IsAnimating : false;
+            return _values.TryGetValue(property, out var value) ? (value as PriorityValue)?.IsAnimating ?? false : false;
         }

         public bool IsSet(AvaloniaProperty property)
         {
-            if (_values.TryGetValue(property, out PriorityValue value))
+            if (_values.TryGetValue(property, out var value))
             {
-                return value.Value != AvaloniaProperty.UnsetValue;
+                return ((value as PriorityValue)?.Value ?? value) != AvaloniaProperty.UnsetValue;
             }

             return false;
@@ -94,23 +135,13 @@

         public void Revalidate(AvaloniaProperty property)
         {
-            if (_values.TryGetValue(property, out PriorityValue value))
+            if (_values.TryGetValue(property, out var value))
             {
-                value.Revalidate();
+                (value as PriorityValue)?.Revalidate();
             }
         }

-        void IPriorityValueOwner.BindingNotificationReceived(AvaloniaProperty property, BindingNotification notification)
-        {
-            ((IPriorityValueOwner)_owner).BindingNotificationReceived(property, notification);
-        }
-
-        void IPriorityValueOwner.Changed(AvaloniaProperty property, int priority, object oldValue, object newValue)
-        {
-            ((IPriorityValueOwner)_owner).Changed(property, priority, oldValue, newValue);
-        }
-
-        void IPriorityValueOwner.VerifyAccess() => _owner.VerifyAccess();
+        public void VerifyAccess() => _owner.VerifyAccess();

         private PriorityValue CreatePriorityValue(AvaloniaProperty property)
         {
@@ -130,5 +161,17 @@

             return result;
         }
+
+        private object Validate(AvaloniaProperty property, object value)
+        {
+            var validate = ((IStyledPropertyAccessor)property).GetValidationFunc(_owner.GetType());
+
+            if (validate != null && value != AvaloniaProperty.UnsetValue)
+            {
+                return validate(_owner, value);
+            }
+
+            return value;
+        }
     }
 }


Implemented Adopt according to WHATWG

Implemented Adopt according to WHATWG

--- AngleSharp/DOM/Document.cs
+++ AngleSharp/DOM/Document.cs
@@ -722,10 +722,17 @@
         /// since it has not yet been inserted into the document tree.</returns>
         public INode Adopt(INode externalNode)
         {
+            if (externalNode is IDocument)
+                throw new DomException(ErrorCode.NotSupported);
+
             if (externalNode.Parent != null)
                 externalNode.Parent.RemoveChild(externalNode);

-            AppendChild(externalNode);
+            var node = externalNode as Node;
+
+            if (node != null)
+                node.Owner = this;
+
             return externalNode;
         }


fix bug that was preventing user from cancelling window close.

--- src/Avalonia.Controls/Window.cs
+++ src/Avalonia.Controls/Window.cs
@@ -302,17 +302,23 @@

         internal void Close(bool ignoreCancel)
         {
+            bool close = true;
+
             try
             {
                 if (!ignoreCancel && HandleClosing())
                 {
+                    close = false;
                     return;
                 }
             }
             finally
             {
-                PlatformImpl?.Dispose();
-                HandleClosed();
+                if (close)
+                {
+                    PlatformImpl?.Dispose();
+                    HandleClosed();
+                }
             }
         }


Remove <returns> comments on void methods

Minor nit with XML comments on void methods

--- src/Cake.Git/GitAliases.Push.cs
+++ src/Cake.Git/GitAliases.Push.cs
@@ -18,7 +18,6 @@
         /// </summary>
         /// <param name="context">The context.</param>
         /// <param name="repositoryDirectoryPath">Repository path.</param>
-        /// <returns>The path to the created repository.</returns>
         /// <exception cref="ArgumentNullException"></exception>
         [CakeMethodAlias]
         [CakeAliasCategory("Push")]
@@ -60,7 +59,6 @@
         /// <param name="repositoryDirectoryPath">Repository path.</param>
         /// <param name="username">Username used for authentication.</param>
         /// <param name="password">Password used for authentication.</param>
-        /// <returns>The path to the created repository.</returns>
         /// <exception cref="ArgumentNullException"></exception>
         [CakeMethodAlias]
         [CakeAliasCategory("Push")]
@@ -115,7 +113,6 @@
         /// <param name="username">Username used for authentication.</param>
         /// <param name="password">Password used for authentication.</param>
         /// <param name="branchName">Name of branch to push.</param>
-        /// <returns>The path to the created repository.</returns>
         /// <exception cref="ArgumentNullException"></exception>
         [CakeMethodAlias]
         [CakeAliasCategory("Push")]
@@ -171,4 +168,4 @@
                 );
         }
     }
-}+}


oops, replace rabbitmq => amqp before prepending amqp

--- src/Chinchilla/DepotSettings.cs
+++ src/Chinchilla/DepotSettings.cs
@@ -50,15 +50,15 @@
                 throw new ChinchillaException("A consumer factory builder is required");
             }

+            if (ConnectionString.StartsWith(RabbitMqProtocol))
+            {
+                ConnectionString = ConnectionString.Replace(RabbitMqProtocol, AmqpProtocol);
+            }
+
             if (!ConnectionString.StartsWith(AmqpProtocol))
             {
                 ConnectionString = string.Concat(AmqpProtocol, ConnectionString);
             }
-
-            if (ConnectionString.StartsWith(RabbitMqProtocol))
-            {
-                ConnectionString = ConnectionString.Replace(RabbitMqProtocol, AmqpProtocol);
-            }
         }
     }
 }


updated logger to also write to a rolling file

--- src/csharp/TrafficIntersection.ConsoleApp/Program.cs
+++ src/csharp/TrafficIntersection.ConsoleApp/Program.cs
@@ -8,7 +8,10 @@
     {
         private static void Main(string[] args)
         {
-            Log.Logger = new LoggerConfiguration().WriteTo.ColoredConsole().CreateLogger();
+            Log.Logger = new LoggerConfiguration()
+                .WriteTo.ColoredConsole()
+                .WriteTo.RollingFile("TrafficController-{Date}.log")
+                .CreateLogger();

             var trafficController = new TrafficController(Scheduler.Default);


Add useful message to VariableNameException

--- src/dotless.Core/exceptions/VariableNameException.cs
+++ src/dotless.Core/exceptions/VariableNameException.cs
@@ -23,5 +23,13 @@
         {
             Ident = ident;
         }
+
+        public override string Message
+        {
+            get
+            {
+                return string.Format("Variable or Mixin '{0}' not found.", Ident);
+            }
+        }
     }
 }


関数からImplicitReturnValueを取り除くとき、TypeMapperからも取り除く

--- src/Compiler/Typing.Function.cs
+++ src/Compiler/Typing.Function.cs
@@ -48,6 +48,7 @@
                         }
                         else
                         {
+                            m.Remove(imp);
                             afb.Return = null;
                             afb.Body
                                 .OfType<IReturnBind>()


Re-style Strings to project conventions

Re-style Strings to project conventions

--- src/Core/Collections/Strings.cs
+++ src/Core/Collections/Strings.cs
@@ -23,18 +23,24 @@
     //   to this project.
     // - Renamed from StringValues to Strings.
     // - Marked partial.
+    // - Re-styled to use project conventions.

     /// <summary>
     /// Represents zero/null, one, or many strings in an efficient way.
     /// </summary>

-    public readonly partial struct Strings : IList<string>, IReadOnlyList<string>, IEquatable<Strings>, IEquatable<string>, IEquatable<string[]>
+    public readonly partial struct Strings :
+        IList<string>,
+        IReadOnlyList<string>,
+        IEquatable<Strings>,
+        IEquatable<string>,
+        IEquatable<string[]>
     {
-        private static readonly string[] EmptyArray = new string[0];
+        static readonly string[] EmptyArray = new string[0];
         public static readonly Strings Empty = new Strings(EmptyArray);

-        private readonly string _value;
-        private readonly string[] _values;
+        readonly string _value;
+        readonly string[] _values;

         public Strings(string value)
         {
@@ -48,66 +54,41 @@
             _values = values;
         }

-        public static implicit operator Strings(string value)
-        {
-            return new Strings(value);
-        }
-
-        public static implicit operator Strings(string[] values)
-        {
-            return new Strings(values);
-        }
-
-        public static implicit operator string (Strings values)
-        {
-            return values.GetStringValue();
-        }
-
-        public static implicit operator string[] (Strings value)
-        {
-            return value.GetArrayValue();
-        }
+        public static implicit operator Strings(string value) =>
+            new Strings(value);
+
+        public static implicit operator Strings(string[] values) =>
+            new Strings(values);
+
+        public static implicit operator string (Strings values) =>
+            values.GetStringValue();
+
+        public static implicit operator string[] (Strings value) =>
+            value.GetArrayValue();

         public int Count => _value != null ? 1 : (_values?.Length ?? 0);

-        bool ICollection<string>.IsReadOnly
-        {
-            get { return true; }
-        }
+        bool ICollection<string>.IsReadOnly => true;

         string IList<string>.this[int index]
         {
-            get { return this[index]; }
-            set { throw new NotSupportedException(); }
+            get => this[index];
+            set => throw new NotSupportedException();
         }

         public string this[int index]
-        {
-            get
-            {
-                if (_values != null)
-                {
-                    return _values[index]; // may throw
-                }
-                if (index == 0 && _value != null)
-                {
-                    return _value;
-                }
-                return EmptyArray[0]; // throws
-            }
-        }
-
-        public override string ToString()
-        {
-            return GetStringValue() ?? string.Empty;
-        }
-
-        private string GetStringValue()
+            => _values != null ? _values[index]
+             : index == 0 && _value != null ? _value
+             : EmptyArray[0];
+
+        public override string ToString() =>
+            GetStringValue() ?? string.Empty;
+
+        string GetStringValue()
         {
             if (_values == null)
-            {
                 return _value;
-            }
+
             switch (_values.Length)
             {
                 case 0: return null;
@@ -116,59 +97,41 @@
             }
         }

-        public string[] ToArray()
-        {
-            return GetArrayValue() ?? EmptyArray;
-        }
-
-        private string[] GetArrayValue()
-        {
-            if (_value != null)
-            {
-                return new[] { _value };
-            }
-            return _values;
-        }
-
-        int IList<string>.IndexOf(string item)
-        {
-            return IndexOf(item);
-        }
-
-        private int IndexOf(string item)
+        public string[] ToArray() =>
+            GetArrayValue() ?? EmptyArray;
+
+        string[] GetArrayValue() =>
+            _value != null ? new[] { _value } : _values;
+
+        int IList<string>.IndexOf(string item) =>
+            IndexOf(item);
+
+        int IndexOf(string item)
         {
             if (_values != null)
             {
                 var values = _values;
-                for (int i = 0; i < values.Length; i++)
+                for (var i = 0; i < values.Length; i++)
                 {
                     if (string.Equals(values[i], item, StringComparison.Ordinal))
-                    {
                         return i;
-                    }
                 }
+
                 return -1;
             }

-            if (_value != null)
-            {
-                return string.Equals(_value, item, StringComparison.Ordinal) ? 0 : -1;
-            }
-
-            return -1;
-        }
-
-        bool ICollection<string>.Contains(string item)
-        {
-            return IndexOf(item) >= 0;
-        }
-
-        void ICollection<string>.CopyTo(string[] array, int arrayIndex)
-        {
+            return _value != null
+                 ? string.Equals(_value, item, StringComparison.Ordinal) ? 0 : -1
+                 : -1;
+        }
+
+        bool ICollection<string>.Contains(string item) =>
+            IndexOf(item) >= 0;
+
+        void ICollection<string>.CopyTo(string[] array, int arrayIndex) =>
             CopyTo(array, arrayIndex);
-        }
-
-        private void CopyTo(string[] array, int arrayIndex)
+
+        void CopyTo(string[] array, int arrayIndex)
         {
             if (_values != null)
             {
@@ -179,13 +142,10 @@
             if (_value != null)
             {
                 if (array == null)
-                {
                     throw new ArgumentNullException(nameof(array));
-                }
                 if (arrayIndex < 0)
-                {
                     throw new ArgumentOutOfRangeException(nameof(arrayIndex));
-                }
+
                 if (array.Length - arrayIndex < 1)
                 {
                     throw new ArgumentException(
@@ -196,52 +156,26 @@
             }
         }

-        void ICollection<string>.Add(string item)
-        {
-            throw new NotSupportedException();
-        }
-
-        void IList<string>.Insert(int index, string item)
-        {
-            throw new NotSupportedException();
-        }
-
-        bool ICollection<string>.Remove(string item)
-        {
-            throw new NotSupportedException();
-        }
-
-        void IList<string>.RemoveAt(int index)
-        {
-            throw new NotSupportedException();
-        }
-
-        void ICollection<string>.Clear()
-        {
-            throw new NotSupportedException();
-        }
-
-        public Enumerator GetEnumerator()
-        {
-            return new Enumerator(_values, _value);
-        }
-
-        IEnumerator<string> IEnumerable<string>.GetEnumerator()
-        {
-            return GetEnumerator();
-        }
-
-        IEnumerator IEnumerable.GetEnumerator()
-        {
-            return GetEnumerator();
-        }
+        void ICollection<string>.Add(string item) => throw new NotSupportedException();
+        void IList<string>.Insert(int index, string item) => throw new NotSupportedException();
+        bool ICollection<string>.Remove(string item) => throw new NotSupportedException();
+        void IList<string>.RemoveAt(int index) => throw new NotSupportedException();
+        void ICollection<string>.Clear() => throw new NotSupportedException();
+
+        public Enumerator GetEnumerator() =>
+            new Enumerator(_values, _value);
+
+        IEnumerator<string> IEnumerable<string>.GetEnumerator() =>
+            GetEnumerator();
+
+        IEnumerator IEnumerable.GetEnumerator() =>
+            GetEnumerator();

         public static bool IsNullOrEmpty(Strings value)
         {
             if (value._values == null)
-            {
                 return string.IsNullOrEmpty(value._value);
-            }
+
             switch (value._values.Length)
             {
                 case 0: return true;
@@ -256,14 +190,10 @@
             var count2 = values2.Count;

             if (count1 == 0)
-            {
                 return values2;
-            }

             if (count2 == 0)
-            {
                 return values1;
-            }

             var combined = new string[count1 + count2];
             values1.CopyTo(combined, 0);
@@ -274,15 +204,11 @@
         public static Strings Concat(in Strings values, string value)
         {
             if (value == null)
-            {
                 return values;
-            }

             var count = values.Count;
             if (count == 0)
-            {
                 return new Strings(value);
-            }

             var combined = new string[count + 1];
             values.CopyTo(combined, 0);
@@ -293,15 +219,11 @@
         public static Strings Concat(string value, in Strings values)
         {
             if (value == null)
-            {
                 return values;
-            }

             var count = values.Count;
             if (count == 0)
-            {
                 return new Strings(value);
-            }

             var combined = new string[count + 1];
             combined[0] = value;
@@ -314,170 +236,108 @@
             var count = left.Count;

             if (count != right.Count)
-            {
                 return false;
-            }

             for (var i = 0; i < count; i++)
             {
                 if (left[i] != right[i])
-                {
                     return false;
-                }
             }

             return true;
         }

-        public static bool operator ==(Strings left, Strings right)
-        {
-            return Equals(left, right);
-        }
-
-        public static bool operator !=(Strings left, Strings right)
-        {
-            return !Equals(left, right);
-        }
-
-        public bool Equals(Strings other)
-        {
-            return Equals(this, other);
-        }
-
-        public static bool Equals(string left, Strings right)
-        {
-            return Equals(new Strings(left), right);
-        }
-
-        public static bool Equals(Strings left, string right)
-        {
-            return Equals(left, new Strings(right));
-        }
-
-        public bool Equals(string other)
-        {
-            return Equals(this, new Strings(other));
-        }
-
-        public static bool Equals(string[] left, Strings right)
-        {
-            return Equals(new Strings(left), right);
-        }
-
-        public static bool Equals(Strings left, string[] right)
-        {
-            return Equals(left, new Strings(right));
-        }
-
-        public bool Equals(string[] other)
-        {
-            return Equals(this, new Strings(other));
-        }
-
-        public static bool operator ==(Strings left, string right)
-        {
-            return Equals(left, new Strings(right));
-        }
-
-        public static bool operator !=(Strings left, string right)
-        {
-            return !Equals(left, new Strings(right));
-        }
-
-        public static bool operator ==(string left, Strings right)
-        {
-            return Equals(new Strings(left), right);
-        }
-
-        public static bool operator !=(string left, Strings right)
-        {
-            return !Equals(new Strings(left), right);
-        }
-
-        public static bool operator ==(Strings left, string[] right)
-        {
-            return Equals(left, new Strings(right));
-        }
-
-        public static bool operator !=(Strings left, string[] right)
-        {
-            return !Equals(left, new Strings(right));
-        }
-
-        public static bool operator ==(string[] left, Strings right)
-        {
-            return Equals(new Strings(left), right);
-        }
-
-        public static bool operator !=(string[] left, Strings right)
-        {
-            return !Equals(new Strings(left), right);
-        }
-
-        public static bool operator ==(Strings left, object right)
-        {
-            return left.Equals(right);
-        }
-
-        public static bool operator !=(Strings left, object right)
-        {
-            return !left.Equals(right);
-        }
-        public static bool operator ==(object left, Strings right)
-        {
-            return right.Equals(left);
-        }
-
-        public static bool operator !=(object left, Strings right)
-        {
-            return !right.Equals(left);
-        }
+        public static bool operator ==(Strings left, Strings right) =>
+            Equals(left, right);
+
+        public static bool operator !=(Strings left, Strings right) =>
+            !Equals(left, right);
+
+        public bool Equals(Strings other) =>
+            Equals(this, other);
+
+        public static bool Equals(string left, Strings right) =>
+            Equals(new Strings(left), right);
+
+        public static bool Equals(Strings left, string right) =>
+            Equals(left, new Strings(right));
+
+        public bool Equals(string other) =>
+            Equals(this, new Strings(other));
+
+        public static bool Equals(string[] left, Strings right) =>
+            Equals(new Strings(left), right);
+
+        public static bool Equals(Strings left, string[] right) =>
+            Equals(left, new Strings(right));
+
+        public bool Equals(string[] other) =>
+            Equals(this, new Strings(other));
+
+        public static bool operator ==(Strings left, string right) =>
+            Equals(left, new Strings(right));
+
+        public static bool operator !=(Strings left, string right) =>
+            !Equals(left, new Strings(right));
+
+        public static bool operator ==(string left, Strings right) =>
+            Equals(new Strings(left), right);
+
+        public static bool operator !=(string left, Strings right) =>
+            !Equals(new Strings(left), right);
+
+        public static bool operator ==(Strings left, string[] right) =>
+            Equals(left, new Strings(right));
+
+        public static bool operator !=(Strings left, string[] right) =>
+            !Equals(left, new Strings(right));
+
+        public static bool operator ==(string[] left, Strings right) =>
+            Equals(new Strings(left), right);
+
+        public static bool operator !=(string[] left, Strings right) =>
+            !Equals(new Strings(left), right);
+
+        public static bool operator ==(Strings left, object right) =>
+            left.Equals(right);
+
+        public static bool operator !=(Strings left, object right) =>
+            !left.Equals(right);
+
+        public static bool operator ==(object left, Strings right) =>
+            right.Equals(left);
+
+        public static bool operator !=(object left, Strings right) =>
+            !right.Equals(left);

         public override bool Equals(object obj)
         {
-            if (obj == null)
-            {
-                return Equals(this, Strings.Empty);
-            }
-
-            if (obj is string)
-            {
-                return Equals(this, (string)obj);
-            }
-
-            if (obj is string[])
-            {
-                return Equals(this, (string[])obj);
-            }
-
-            if (obj is Strings)
-            {
-                return Equals(this, (Strings)obj);
-            }
-
-            return false;
+            switch (obj)
+            {
+                case null: return Equals(this, Empty);
+                case string b: return Equals(this, b);
+                case string[] b: return Equals(this, b);
+                case Strings b: return Equals(this, b);
+                default: return false;
+            }
         }

         public override int GetHashCode()
         {
             if (_values == null)
-            {
                 return _value == null ? 0 : _value.GetHashCode();
-            }

             var hcc = new HashCodeCombiner();
-            for (var i = 0; i < _values.Length; i++)
-            {
-                hcc.Add(_values[i]);
-            }
+            foreach (var v in _values)
+                hcc.Add(v);
             return hcc.CombinedHash;
         }

         public struct Enumerator : IEnumerator<string>
         {
-            private readonly string[] _values;
-            private string _current;
-            private int _index;
+            readonly string[] _values;
+            string _current;
+            int _index;

             internal Enumerator(string[] values, string value)
             {
@@ -496,9 +356,7 @@
             public bool MoveNext()
             {
                 if (_index < 0)
-                {
                     return false;
-                }

                 if (_values != null)
                 {
@@ -521,14 +379,10 @@

             object IEnumerator.Current => _current;

-            void IEnumerator.Reset()
-            {
+            void IEnumerator.Reset() =>
                 throw new NotSupportedException();
-            }
-
-            public void Dispose()
-            {
-            }
+
+            public void Dispose() {}
         }
     }
 }


Specify internal types by Assembly Qualified Name for reflection

--- Torch/Utils/ReflectedManager.cs
+++ Torch/Utils/ReflectedManager.cs
@@ -23,6 +23,15 @@
         /// Declaring type of the member to access.  If null, inferred from the instance argument type.
         /// </summary>
         public Type Type { get; set; } = null;
+
+        /// <summary>
+        /// Assembly qualified name of <see cref="Type"/>
+        /// </summary>
+        public string TypeName
+        {
+            get => Type?.AssemblyQualifiedName;
+            set => Type = value == null ? null : Type.GetType(value, true);
+        }
     }

     /// <summary>
@@ -93,6 +102,19 @@
     [AttributeUsage(AttributeTargets.Field)]
     public class ReflectedMethodAttribute : ReflectedMemberAttribute
     {
+        /// <summary>
+        /// When set the parameters types for the method are assumed to be this.
+        /// </summary>
+        public Type[] OverrideTypes { get; set; }
+
+        /// <summary>
+        /// Assembly qualified names of <see cref="OverrideTypes"/>
+        /// </summary>
+        public string[] OverrideTypeNames
+        {
+            get => OverrideTypes.Select(x => x.AssemblyQualifiedName).ToArray();
+            set => OverrideTypes = value?.Select(x => x == null ? null : Type.GetType(x)).ToArray();
+        }
     }

     /// <summary>
@@ -125,7 +147,7 @@
         private static readonly string[] _namespaceBlacklist = new[] {
             "System", "VRage", "Sandbox", "SpaceEngineers"
         };
-
+
         /// <summary>
         /// Registers the assembly load event and loads every already existing assembly.
         /// </summary>
@@ -232,10 +254,14 @@
                 trueParameterTypes = parameters.Skip(1).Select(x => x.ParameterType).ToArray();
             }

+            var invokeTypes = new Type[trueParameterTypes.Length];
+            for (var i = 0; i < invokeTypes.Length; i++)
+                invokeTypes[i] = attr.OverrideTypes?[i] ?? trueParameterTypes[i];
+
             MethodInfo methodInstance = trueType.GetMethod(attr.Name ?? field.Name,
                 (attr is ReflectedStaticMethodAttribute ? BindingFlags.Static : BindingFlags.Instance) |
                 BindingFlags.Public |
-                BindingFlags.NonPublic, null, CallingConventions.Any, trueParameterTypes, null);
+                BindingFlags.NonPublic, null, CallingConventions.Any, invokeTypes, null);
             if (methodInstance == null)
             {
                 string methodType = attr is ReflectedStaticMethodAttribute ? "static" : "instance";
@@ -245,13 +271,38 @@
                     $"Unable to find {methodType} method {attr.Name ?? field.Name} in type {trueType.FullName} with parameters {methodParams}");
             }

+
             if (attr is ReflectedStaticMethodAttribute)
-                field.SetValue(null, Delegate.CreateDelegate(field.FieldType, methodInstance));
+            {
+                if (attr.OverrideTypes != null)
+                {
+                    ParameterExpression[] paramExp =
+                        parameters.Select(x => Expression.Parameter(x.ParameterType)).ToArray();
+                    var argExp = new Expression[invokeTypes.Length];
+                    for (var i = 0; i < argExp.Length; i++)
+                        if (invokeTypes[i] != paramExp[i].Type)
+                            argExp[i] = Expression.Convert(paramExp[i], invokeTypes[i]);
+                        else
+                            argExp[i] = paramExp[i];
+                    field.SetValue(null,
+                        Expression.Lambda(Expression.Call(methodInstance, argExp), paramExp)
+                                  .Compile());
+                }
+                else
+                    field.SetValue(null, Delegate.CreateDelegate(field.FieldType, methodInstance));
+            }
             else
             {
-                ParameterExpression[] paramExp = parameters.Select(x => Expression.Parameter(x.ParameterType)).ToArray();
+                ParameterExpression[] paramExp =
+                    parameters.Select(x => Expression.Parameter(x.ParameterType)).ToArray();
+                var argExp = new Expression[invokeTypes.Length];
+                for (var i = 0; i < argExp.Length; i++)
+                    if (invokeTypes[i] != paramExp[i + 1].Type)
+                        argExp[i] = Expression.Convert(paramExp[i + 1], invokeTypes[i]);
+                    else
+                        argExp[i] = paramExp[i + 1];
                 field.SetValue(null,
-                    Expression.Lambda(Expression.Call(paramExp[0], methodInstance, paramExp.Skip(1)), paramExp)
+                    Expression.Lambda(Expression.Call(paramExp[0], methodInstance, argExp), paramExp)
                               .Compile());
             }
         }
@@ -287,7 +338,7 @@
                 if (trueType == null && isStatic)
                     throw new ArgumentException("Static field setters need their type defined", nameof(field));

-                if (!isStatic)
+                if (!isStatic && trueType == null)
                     trueType = parameters[0].ParameterType;
             }
             else if (attr is ReflectedGetterAttribute)
@@ -300,7 +351,7 @@
                 if (trueType == null && isStatic)
                     throw new ArgumentException("Static field getters need their type defined", nameof(field));

-                if (!isStatic)
+                if (!isStatic && trueType == null)
                     trueType = parameters[0].ParameterType;
             }
             else
@@ -318,10 +369,15 @@
                     $"Unable to find field or property for {trueName} in {trueType.FullName} or its base types", nameof(field));

             ParameterExpression[] paramExp = parameters.Select(x => Expression.Parameter(x.ParameterType)).ToArray();
+            Expression instanceExpr = null;
+            if (!isStatic)
+            {
+                instanceExpr = trueType == paramExp[0].Type ? (Expression) paramExp[0] : Expression.Convert(paramExp[0], trueType);
+            }

             MemberExpression fieldExp = sourceField != null
-                                            ? Expression.Field(isStatic ? null : paramExp[0], sourceField)
-                                            : Expression.Property(isStatic ? null : paramExp[0], sourceProperty);
+                                            ? Expression.Field(instanceExpr, sourceField)
+                                            : Expression.Property(instanceExpr, sourceProperty);
             Expression impl;
             if (attr is ReflectedSetterAttribute)
             {


Gesture now resets cached screen positions.

--- TouchScript/Gestures/Gesture.cs
+++ TouchScript/Gestures/Gesture.cs
@@ -695,7 +695,10 @@
         /// Called to reset gesture state after it fails or recognizes.
         /// </summary>
         protected virtual void reset()
-        {}
+        {
+            cachedScreenPosition = TouchManager.INVALID_POSITION;
+            cachedPreviousScreenPosition = TouchManager.INVALID_POSITION;
+        }

         /// <summary>
         /// Called when state is changed to Possible.


can use SendRequest with bearerToken

can use SendRequest with bearerToken

--- scripts/twitterRequest.cs
+++ scripts/twitterRequest.cs
@@ -148,7 +148,15 @@

         private static IEnumerator SendRequest(UnityWebRequest request, SortedDictionary<string, string> parameters, string method, string requestURL, TwitterCallback callback)
         {
-            request.SetRequestHeader("Authorization", Oauth.GenerateHeaderWithAccessToken(parameters, method, requestURL));
+            if (Twity.Oauth.accessToken != null && Twity.Oauth.accessToken != "")
+            {
+                request.SetRequestHeader("Authorization", Oauth.GenerateHeaderWithAccessToken(parameters, method, requestURL));
+            }
+            else if (Twity.Oauth.bearerToken != null && Twity.Oauth.bearerToken != "")
+            {
+                request.SetRequestHeader("Authorization", "Bearer " + Oauth.bearerToken);
+            }
+
             #if UNITY_2017_1
                     yield return request.Send();
             #endif