GSF.Core: Added GetColumn extension for two-dimensional arrays to CollectionExtensions.

--- Source/Libraries/GSF.Core/Collections/CollectionExtensions.cs
+++ Source/Libraries/GSF.Core/Collections/CollectionExtensions.cs
@@ -74,6 +74,19 @@
     public static class CollectionExtensions
     {
         ///
+        /// Gets a column of data out of a 2-dimensional array.
+        ///
+        /// <typeparam name="T">Type of array.</typeparam>
+        /// <param name="source">Source array.</param>
+        /// <param name="columnIndex">Column index to retrieve.</param>
+        /// <returns>Values from specified <paramref name="columnIndex"/>.</returns>
+        public static IEnumerable<T> GetColumn<T>(this T[,] source, int columnIndex)
+        {
+            for (int i = 0; i < source.GetLength(1); i++)
+                yield return source[columnIndex, i];
+        }
+
+        ///
         /// Gets a <see cref="PagedList{T}"/> to paginate <paramref name="source"/> enumeration for
         /// a given <paramref name="page"/> and specified <paramref name="pageSize"/>.
         ///
@@ -171,9 +184,7 @@
         /// <returns>The value of the key in the dictionary or the default value if no such value exists.</returns>
         public static TValue GetOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, Func<TKey, TValue> defaultValueFactory)
         {
-            TValue value;
-
-            if (!dictionary.TryGetValue(key, out value))
+            if (!dictionary.TryGetValue(key, out TValue value))
                 value = defaultValueFactory(key);

             return value;
@@ -190,9 +201,7 @@
         /// <returns>The value of the key in the dictionary.</returns>
         public static TValue GetOrAdd<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, Func<TKey, TValue> valueFactory)
         {
-            TValue value;
-
-            if (!dictionary.TryGetValue(key, out value))
+            if (!dictionary.TryGetValue(key, out TValue value))
             {
                 value = valueFactory(key);
                 dictionary.Add(key, value);
@@ -212,9 +221,7 @@
         /// <returns>The value of the key in the dictionary.</returns>
         public static TValue GetOrAdd<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, TValue value)
         {
-            TValue tryGetValue;
-
-            if (!dictionary.TryGetValue(key, out tryGetValue))
+            if (!dictionary.TryGetValue(key, out TValue tryGetValue))
             {
                 tryGetValue = value;
                 dictionary.Add(key, tryGetValue);
@@ -234,9 +241,7 @@
         /// <returns>The new value for the key. This will be either be the result of addValueFactory (if the key was absent) or the result of updateValueFactory (if the key was present).</returns>
         public static TValue AddOrUpdate<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory)
         {
-            TValue value;
-
-            if (dictionary.TryGetValue(key, out value))
+            if (dictionary.TryGetValue(key, out TValue value))
                 value = updateValueFactory(key, value);
             else
                 value = addValueFactory(key);
@@ -257,9 +262,7 @@
         /// <returns>The new value for the key. This will be either be the result of addValueFactory (if the key was absent) or the result of updateValueFactory (if the key was present).</returns>
         public static TValue AddOrUpdate<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, TValue addValue, Func<TKey, TValue, TValue> updateValueFactory)
         {
-            TValue value;
-
-            if (dictionary.TryGetValue(key, out value))
+            if (dictionary.TryGetValue(key, out TValue value))
                 value = updateValueFactory(key, value);
             else
                 value = addValue;
@@ -347,10 +350,10 @@
         /// <exception cref="ArgumentNullException"><paramref name="source" /> or <paramref name="predicate" /> is <c>null</c>.</exception>
         public static bool AllParallel<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate, ParallelOptions options = null)
         {
-            if ((object)source == null)
+            if (source == null)
                 throw new ArgumentNullException(nameof(source));

-            if ((object)predicate == null)
+            if (predicate == null)
                 throw new ArgumentNullException(nameof(predicate));

             bool succeeded = true;
@@ -379,7 +382,7 @@
         /// <returns>The median item(s) from an enumeration, or <c>null</c> if <paramref name="source"/> is <c>null</c>.</returns>
         public static T[] Median<T>(this IEnumerable<T> source)
         {
-            if ((object)source == null)
+            if (source == null)
                 return null;

             T[] values = source as T[] ?? source.ToArray();
@@ -430,7 +433,7 @@
         {
             TSource majority = defaultValue;

-            if ((object)source == null)
+            if (source == null)
                 return majority;

             TSource[] values;
@@ -447,10 +450,9 @@
                 // Count each number of items in the list
                 foreach (TSource value in values)
                 {
-                    Tuple<int, TSource> valueCount;
                     TKey key = keySelector(value);

-                    if (itemCounts.TryGetValue(key, out valueCount))
+                    if (itemCounts.TryGetValue(key, out Tuple<int, TSource> valueCount))
                     {
                         int count = valueCount.Item1 + 1;
                         itemCounts[key] = new Tuple<int, TSource>(count, valueCount.Item2);
@@ -498,7 +500,7 @@
         {
             T majority = defaultValue;

-            if ((object)source == null)
+            if (source == null)
                 return majority;

             T[] values;
@@ -515,9 +517,7 @@
                 // Count each number of items in the list
                 foreach (T item in values)
                 {
-                    int count;
-
-                    if (itemCounts.TryGetValue(item, out count))
+                    if (itemCounts.TryGetValue(item, out int count))
                     {
                         count++;
                         itemCounts[item] = count;
@@ -569,7 +569,7 @@
         {
             TSource minority = defaultValue;

-            if ((object)source == null)
+            if (source == null)
                 return minority;

             TSource[] values;
@@ -586,10 +586,9 @@
                 // Count each number of items in the list
                 foreach (TSource value in values)
                 {
-                    Tuple<int, TSource> valueCount;
                     TKey key = keySelector(value);

-                    if (itemCounts.TryGetValue(key, out valueCount))
+                    if (itemCounts.TryGetValue(key, out Tuple<int, TSource> valueCount))
                     {
                         int count = valueCount.Item1 + 1;
                         itemCounts[key] = new Tuple<int, TSource>(count, valueCount.Item2);
@@ -635,7 +634,7 @@
         {
             T minority = defaultValue;

-            if ((object)source == null)
+            if (source == null)
                 return minority;

             T[] values;
@@ -652,9 +651,7 @@
                 // Count each number of items in the list
                 foreach (T item in values)
                 {
-                    int count;
-
-                    if (itemCounts.TryGetValue(item, out count))
+                    if (itemCounts.TryGetValue(item, out int count))
                     {
                         count++;
                         itemCounts[item] = count;
@@ -781,21 +778,22 @@
             TSource minItem = default(TSource);
             TKey minKey, nextKey;

-            IEnumerator<TSource> enumerator = source.GetEnumerator();
-
-            if (enumerator.MoveNext())
-            {
-                minItem = enumerator.Current;
-                minKey = keySelector(minItem);
-
-                while (enumerator.MoveNext())
+            using (IEnumerator<TSource> enumerator = source.GetEnumerator())
+            {
+                if (enumerator.MoveNext())
                 {
-                    nextKey = keySelector(enumerator.Current);
-
-                    if (nextKey.CompareTo(minKey) < 0)
-                    {
-                        minItem = enumerator.Current;
-                        minKey = nextKey;
+                    minItem = enumerator.Current;
+                    minKey = keySelector(minItem);
+
+                    while (enumerator.MoveNext())
+                    {
+                        nextKey = keySelector(enumerator.Current);
+
+                        if (nextKey.CompareTo(minKey) < 0)
+                        {
+                            minItem = enumerator.Current;
+                            minKey = nextKey;
+                        }
                     }
                 }
             }
@@ -812,16 +810,17 @@
         {
             TSource minItem = default(TSource);

-            IEnumerator<TSource> enumerator = source.GetEnumerator();
-
-            if (enumerator.MoveNext())
-            {
-                minItem = enumerator.Current;
-
-                while (enumerator.MoveNext())
+            using (IEnumerator<TSource> enumerator = source.GetEnumerator())
+            {
+                if (enumerator.MoveNext())
                 {
-                    if (comparer(enumerator.Current, minItem) < 0)
-                        minItem = enumerator.Current;
+                    minItem = enumerator.Current;
+
+                    while (enumerator.MoveNext())
+                    {
+                        if (comparer(enumerator.Current, minItem) < 0)
+                            minItem = enumerator.Current;
+                    }
                 }
             }

@@ -849,21 +848,22 @@
             TSource maxItem = default(TSource);
             TKey maxKey, nextKey;

-            IEnumerator<TSource> enumerator = source.GetEnumerator();
-
-            if (enumerator.MoveNext())
-            {
-                maxItem = enumerator.Current;
-                maxKey = keySelector(maxItem);
-
-                while (enumerator.MoveNext())
+            using (IEnumerator<TSource> enumerator = source.GetEnumerator())
+            {
+                if (enumerator.MoveNext())
                 {
-                    nextKey = keySelector(enumerator.Current);
-
-                    if (nextKey.CompareTo(maxKey) > 0)
-                    {
-                        maxItem = enumerator.Current;
-                        maxKey = nextKey;
+                    maxItem = enumerator.Current;
+                    maxKey = keySelector(maxItem);
+
+                    while (enumerator.MoveNext())
+                    {
+                        nextKey = keySelector(enumerator.Current);
+
+                        if (nextKey.CompareTo(maxKey) > 0)
+                        {
+                            maxItem = enumerator.Current;
+                            maxKey = nextKey;
+                        }
                     }
                 }
             }
@@ -880,16 +880,17 @@
         {
             TSource maxItem = default(TSource);

-            IEnumerator<TSource> enumerator = source.GetEnumerator();
-
-            if (enumerator.MoveNext())
-            {
-                maxItem = enumerator.Current;
-
-                while (enumerator.MoveNext())
+            using (IEnumerator<TSource> enumerator = source.GetEnumerator())
+            {
+                if (enumerator.MoveNext())
                 {
-                    if (comparer(enumerator.Current, maxItem) > 0)
-                        maxItem = enumerator.Current;
+                    maxItem = enumerator.Current;
+
+                    while (enumerator.MoveNext())
+                    {
+                        if (comparer(enumerator.Current, maxItem) > 0)
+                            maxItem = enumerator.Current;
+                    }
                 }
             }

@@ -917,17 +918,16 @@
         /// <returns>The elements from <paramref name="source"/> whose keys are distinct.</returns>
         public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, bool forwardSearch = true)
         {
-            if (forwardSearch)
-                return source
+            return forwardSearch ?
+                source
                     .Select(obj => new DistinctByWrapper<TKey, TSource>(keySelector(obj), obj))
                     .Distinct()
+                    .Select(wrapper => wrapper.Value) :
+                source
+                    .Select(obj => new DistinctByWrapper<TKey, TSource>(keySelector(obj), obj))
+                    .Reverse()
+                    .Distinct()
                     .Select(wrapper => wrapper.Value);
-
-            return source
-                .Select(obj => new DistinctByWrapper<TKey, TSource>(keySelector(obj), obj))
-                .Reverse()
-                .Distinct()
-                .Select(wrapper => wrapper.Value);
         }

         /// Converts an enumeration to a string, using the default delimiter ("|") that can later be
@@ -935,10 +935,7 @@
         /// <typeparam name="TSource">The generic type used.</typeparam>
         /// <param name="source">The source object to be converted into a delimited string.</param>
         /// <returns>Returns a <see cref="String"/> that is result of combining all elements in the list delimited by the '|' character.</returns>
-        public static string ToDelimitedString<TSource>(this IEnumerable<TSource> source)
-        {
-            return source.ToDelimitedString('|');
-        }
+        public static string ToDelimitedString<TSource>(this IEnumerable<TSource> source) => source.ToDelimitedString('|');

         /// Converts an enumeration to a string that can later be converted back to a list using
         /// LoadDelimitedString.
@@ -946,10 +943,7 @@
         /// <param name="source">The source object to be converted into a delimited string.</param>
         /// <param name="delimiter">The delimiting character used.</param>
         /// <returns>Returns a <see cref="String"/> that is result of combining all elements in the list delimited by <paramref name="delimiter"/>.</returns>
-        public static string ToDelimitedString<TSource>(this IEnumerable<TSource> source, char delimiter)
-        {
-            return ToDelimitedString<TSource, char>(source, delimiter);
-        }
+        public static string ToDelimitedString<TSource>(this IEnumerable<TSource> source, char delimiter) => ToDelimitedString<TSource, char>(source, delimiter);

         /// Converts an enumeration to a string that can later be converted back to a list using
         /// LoadDelimitedString.
@@ -957,10 +951,7 @@
         /// <param name="source">The source object to be converted into a delimited string.</param>
         /// <param name="delimiter">The delimiting <see cref="string"/> used.</param>
         /// <returns>Returns a <see cref="String"/> that is result of combining all elements in the list delimited by <paramref name="delimiter"/>.</returns>
-        public static string ToDelimitedString<TSource>(this IEnumerable<TSource> source, string delimiter)
-        {
-            return ToDelimitedString<TSource, string>(source, delimiter);
-        }
+        public static string ToDelimitedString<TSource>(this IEnumerable<TSource> source, string delimiter) => ToDelimitedString<TSource, string>(source, delimiter);

         /// Converts an enumeration to a string that can later be converted back to a list using
         /// LoadDelimitedString.
@@ -971,7 +962,7 @@
         /// <returns>Returns a <see cref="String"/> that is result of combining all elements in the list delimited by <paramref name="delimiter"/>.</returns>
         private static string ToDelimitedString<TSource, TDelimiter>(IEnumerable<TSource> source, TDelimiter delimiter)
         {
-            if (Common.IsReference(delimiter) && (object)delimiter == null)
+            if (Common.IsReference(delimiter) && delimiter == null)
                 throw new ArgumentNullException(nameof(delimiter), "delimiter cannot be null");

             StringBuilder delimitedString = new StringBuilder();
@@ -994,10 +985,7 @@
         /// <param name="destination">The list we are adding items to.</param>
         /// <param name="delimitedString">The delimited string to parse for items.</param>
         /// <param name="convertFromString">Delegate that takes one parameter and converts from string to type TSource.</param>
-        public static void LoadDelimitedString<TSource>(this IList<TSource> destination, string delimitedString, Func<string, TSource> convertFromString)
-        {
-            destination.LoadDelimitedString(delimitedString, '|', convertFromString);
-        }
+        public static void LoadDelimitedString<TSource>(this IList<TSource> destination, string delimitedString, Func<string, TSource> convertFromString) => destination.LoadDelimitedString(delimitedString, '|', convertFromString);

         /// Appends items parsed from delimited string, created with ToDelimitedString, into the given list.
         /// <remarks>Items that are converted are added to list. The list is not cleared in advance.</remarks>
@@ -1008,7 +996,7 @@
         /// <param name="convertFromString">Delegate that takes one parameter and converts from string to type TSource.</param>
         public static void LoadDelimitedString<TSource>(this IList<TSource> destination, string delimitedString, char delimiter, Func<string, TSource> convertFromString)
         {
-            if ((object)delimitedString == null)
+            if (delimitedString == null)
                 throw new ArgumentNullException(nameof(delimitedString), "delimitedString cannot be null");

             if (destination.IsReadOnly)
@@ -1029,19 +1017,17 @@
         /// <param name="convertFromString">Delegate that takes a <see cref="String"/> and converts to type TSource.</param>
         public static void LoadDelimitedString<TSource>(this IList<TSource> destination, string delimitedString, string[] delimiters, Func<string, TSource> convertFromString)
         {
-            if ((object)delimiters == null)
+            if (delimiters == null)
                 throw new ArgumentNullException(nameof(delimiters), "delimiters cannot be null");

-            if ((object)delimitedString == null)
+            if (delimitedString == null)
                 throw new ArgumentNullException(nameof(delimitedString), "delimitedString cannot be null");

             if (destination.IsReadOnly)
                 throw new ArgumentException("Cannot add items to a read only list");

             foreach (string item in delimitedString.Split(delimiters, StringSplitOptions.None))
-            {
                 destination.Add(convertFromString(item.Trim()));
-            }
         }

         ///
@@ -1055,19 +1041,16 @@
             if (source.IsReadOnly && !(source is TSource[]))
                 throw new ArgumentException("Cannot modify items in a read only list");

-            int x, y;
-            TSource currentItem;
-
             // Mixes up the data in random order.
-            for (x = 0; x < source.Count; x++)
+            for (int x = 0; x < source.Count; x++)
             {
                 // Calls random function from GSF namespace.
-                y = Random.Int32Between(0, source.Count - 1);
+                int y = Random.Int32Between(0, source.Count - 1);

                 if (x != y)
                 {
                     // Swaps items
-                    currentItem = source[x];
+                    TSource currentItem = source[x];
                     source[x] = source[y];
                     source[y] = currentItem;
                 }
@@ -1087,19 +1070,18 @@
                 throw new ArgumentException("Cannot modify items in a read only list");

             System.Random random = new System.Random(seed);
-            int x, y, count = source.Count;
-            TSource currentItem;
+            int count = source.Count;

             // Mixes up the data in random order.
-            for (x = 0; x < count; x++)
+            for (int x = 0; x < count; x++)
             {
                 // Calls random function from System namespace.
-                y = random.Next(count);
+                int y = random.Next(count);

                 if (x != y)
                 {
                     // Swaps items
-                    currentItem = source[x];
+                    TSource currentItem = source[x];
                     source[x] = source[y];
                     source[y] = currentItem;
                 }
@@ -1119,28 +1101,24 @@

             System.Random random = new System.Random(seed);
             List<int> sequence = new List<int>();
-            int x, y, count = source.Count;
-            TSource currentItem;
+            int count = source.Count;

             // Generate original scramble sequence.
-            for (x = 0; x < count; x++)
-            {
-                // Calls random function from System namespace.
-                sequence.Add(random.Next(count));
-            }
-
-            // Unmix the data order (traverse same sequence in reverse order).
-            for (x = count - 1; x >= 0; x--)
-            {
-                y = sequence[x];
-
-                if (x != y)
-                {
-                    // Swaps items
-                    currentItem = source[x];
-                    source[x] = source[y];
-                    source[y] = currentItem;
-                }
+            for (int x = 0; x < count; x++)
+                sequence.Add(random.Next(count)); // Calls random function from System namespace
+
+            // Unmix the data order (traverse same sequence in reverse order)
+            for (int x = count - 1; x >= 0; x--)
+            {
+                int y = sequence[x];
+
+                if (x == y)
+                    continue;
+
+                // Swaps items
+                TSource currentItem = source[x];
+                source[x] = source[y];
+                source[y] = currentItem;
             }
         }

@@ -1151,10 +1129,7 @@
         /// <returns>An <see cref="int"/> which returns 0 if they are equal, 1 if <paramref name="array1"/> is larger, or -1 if <paramref name="array2"/> is larger.</returns>
         /// <typeparam name="TSource">The generic type of the array.</typeparam>
         /// <exception cref="ArgumentException">Cannot compare multidimensional arrays.</exception>
-        public static int CompareTo<TSource>(this TSource[] array1, TSource[] array2, bool orderIsImportant = true)
-        {
-            return CompareTo(array1, array2, Comparer<TSource>.Default, orderIsImportant);
-        }
+        public static int CompareTo<TSource>(this TSource[] array1, TSource[] array2, bool orderIsImportant = true) => CompareTo(array1, array2, Comparer<TSource>.Default, orderIsImportant);

         /// Compares two arrays.
         /// <param name="array1">The first <see cref="Array"/> to compare to.</param>
@@ -1166,16 +1141,16 @@
         /// <exception cref="ArgumentException">Cannot compare multidimensional arrays.</exception>
         private static int CompareTo(this Array array1, Array array2, IComparer comparer, bool orderIsImportant = true)
         {
-            if ((object)comparer == null)
+            if (comparer == null)
                 throw new ArgumentNullException(nameof(comparer));

-            if ((object)array1 == null && (object)array2 == null)
+            if (array1 == null && array2 == null)
                 return 0;

-            if ((object)array1 == null)
+            if (array1 == null)
                 return -1;

-            if ((object)array2 == null)
+            if (array2 == null)
                 return 1;

             if (array1.Rank != 1 || array2.Rank != 1)
@@ -1210,63 +1185,27 @@

         private class DistinctByWrapper<TKey, TValue> : IEquatable<DistinctByWrapper<TKey, TValue>>
         {
-            #region [ Members ]
-
-            // Fields
-            private readonly TKey m_key;
-            private readonly TValue m_value;
-
-            #endregion
-
-            #region [ Constructors ]
-
             public DistinctByWrapper(TKey key, TValue value)
             {
-                m_key = key;
-                m_value = value;
-            }
-
-            #endregion
-
-            #region [ Properties ]
-
-            public TValue Value
-            {
-                get
-                {
-                    return m_value;
-                }
-            }
-
-            #endregion
-
-            #region [ Methods ]
-
-            public bool Equals(DistinctByWrapper<TKey, TValue> other)
-            {
-                // ReSharper disable once PossibleNullReferenceException
-                return Equals(m_key, other.m_key);
-            }
+                Key = key;
+                Value = value;
+            }
+
+            public TKey Key { get; }
+            public TValue Value { get; }
+
+            // ReSharper disable once PossibleNullReferenceException
+            public bool Equals(DistinctByWrapper<TKey, TValue> other) => Equals(Key, other.Key);

             public override bool Equals(object obj)
             {
-                DistinctByWrapper<TKey, TValue> wrapper = obj as DistinctByWrapper<TKey, TValue>;
-
-                if ((object)wrapper != null)
+                if (obj is DistinctByWrapper<TKey, TValue> wrapper)
                     return Equals(wrapper);

                 return false;
             }

-            public override int GetHashCode()
-            {
-                if ((object)m_key == null)
-                    return 0;
-
-                return m_key.GetHashCode();
-            }
-
-            #endregion
+            public override int GetHashCode() => Key == null ? 0 : Key.GetHashCode();
         }
     }
 }


words.

words.

--- Source/Twitta.Website/Logic/Implementations/SentimentWords.cs
+++ Source/Twitta.Website/Logic/Implementations/SentimentWords.cs
@@ -14,6 +14,7 @@
         public static Dictionary<string, SentimentOptions> WordList = new Dictionary<string, SentimentOptions>()
         {
             {"awesome", SentimentOptions.Positive},
+            {"awesomeness", SentimentOptions.Positive},
             {"great", SentimentOptions.Positive},
             {"good", SentimentOptions.Positive},
             {"cool", SentimentOptions.Positive},
@@ -22,6 +23,7 @@
             {"amazing", SentimentOptions.Positive},
             {"yes", SentimentOptions.Positive},
             {"yeah", SentimentOptions.Positive},
+            {"superb", SentimentOptions.Positive},
             {"bad", SentimentOptions.Negative},
             {"awful", SentimentOptions.Negative},
             {"horrible", SentimentOptions.Negative},
@@ -31,7 +33,8 @@
             {"worst", SentimentOptions.Negative},
             {"not", SentimentOptions.Negative},
             {"no", SentimentOptions.Negative},
-            {"shit", SentimentOptions.Negative}
+            {"shit", SentimentOptions.Negative},
+            {"nasty", SentimentOptions.Negative}
         };
     }
 }


Add docs

Add docs

--- src/EditorFeatures/CSharpTest/StringCopyPaste/StringCopyPasteCommandHandlerTests.cs
+++ src/EditorFeatures/CSharpTest/StringCopyPaste/StringCopyPasteCommandHandlerTests.cs
@@ -128,12 +128,16 @@

             private static void GetCodeAndCaretPosition(string expectedMarkup, out string expected, out int caretPosition)
             {
-                expectedMarkup = expectedMarkup.Replace("$", "\uD7FF");
+                // Used so test can contain `$$` (for raw interpolations) without us thinking that it is an actual caret
+                // position
+                const string NON_TEST_CHARACTER = "\uD7FF";
+
+                expectedMarkup = expectedMarkup.Replace("$", NON_TEST_CHARACTER);

                 MarkupTestFile.GetPositionAndSpan(expectedMarkup, out expected, out int? cursorPosition, out var caretSpan);
                 Contract.ThrowIfTrue(cursorPosition != null);

-                expected = expected.Replace("\uD7FF", "$");
+                expected = expected.Replace(NON_TEST_CHARACTER, "$");

                 Assert.True(caretSpan.HasValue && caretSpan.Value.IsEmpty);
                 caretPosition = caretSpan!.Value.Start;


Fix a build error.

Fix a build error.

--- src/Extensions/VisualStudio/Gallio.VisualStudio.Tip.Proxy/GallioTestAdapterProxy.cs
+++ src/Extensions/VisualStudio/Gallio.VisualStudio.Tip.Proxy/GallioTestAdapterProxy.cs
@@ -15,6 +15,8 @@

 using System;
 using System.Diagnostics;
+using System.IO;
+using Gallio.Loader;
 using Gallio.Loader.Isolation;
 using Gallio.Loader.SharedEnvironment;
 using Microsoft.VisualStudio.TestTools.TestAdapter;


Avoid lock to update _projectToMaxSupportedLangVersionMap

Fixes #54137

--- src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.cs
+++ src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.cs
@@ -73,7 +73,7 @@

         private ImmutableDictionary<ProjectId, IVsHierarchy?> _projectToHierarchyMap = ImmutableDictionary<ProjectId, IVsHierarchy?>.Empty;
         private ImmutableDictionary<ProjectId, Guid> _projectToGuidMap = ImmutableDictionary<ProjectId, Guid>.Empty;
-        private readonly Dictionary<ProjectId, string?> _projectToMaxSupportedLangVersionMap = new();
+        private ImmutableDictionary<ProjectId, string?> _projectToMaxSupportedLangVersionMap = ImmutableDictionary<ProjectId, string?>.Empty;
         private ImmutableDictionary<ProjectId, string> _projectToDependencyNodeTargetIdentifier = ImmutableDictionary<ProjectId, string>.Empty;

         /// <summary>
@@ -1588,7 +1588,8 @@

                 _projectToHierarchyMap = _projectToHierarchyMap.Remove(projectId);
                 _projectToGuidMap = _projectToGuidMap.Remove(projectId);
-                _projectToMaxSupportedLangVersionMap.Remove(projectId);
+                // _projectToMaxSupportedLangVersionMap needs to be updated with ImmutableInterlocked since it can be mutated outside the lock
+                ImmutableInterlocked.TryRemove<ProjectId, string?>(ref _projectToMaxSupportedLangVersionMap, projectId, out _);
                 // _projectToDependencyNodeTargetIdentifier needs to be updated with ImmutableInterlocked since it can be mutated outside the lock
                 ImmutableInterlocked.TryRemove(ref _projectToDependencyNodeTargetIdentifier, projectId, out _);
                 _projectToRuleSetFilePath.Remove(projectId);
@@ -1986,12 +1987,13 @@
             RegisterDocumentOptionProviders(_documentOptionsProviderFactories);
         }

+        [PerformanceSensitive("https://github.com/dotnet/roslyn/issues/54137", AllowLocks = false)]
         internal void SetMaxLanguageVersion(ProjectId projectId, string? maxLanguageVersion)
         {
-            lock (_gate)
-            {
-                _projectToMaxSupportedLangVersionMap[projectId] = maxLanguageVersion;
-            }
+            ImmutableInterlocked.Update(
+                ref _projectToMaxSupportedLangVersionMap,
+                static (map, arg) => map.SetItem(arg.projectId, arg.maxLanguageVersion),
+                (projectId, maxLanguageVersion));
         }

         [PerformanceSensitive("https://github.com/dotnet/roslyn/issues/54135", AllowLocks = false)]


Changed how tests are performed in fix.

Changed how tests are performed in fix.

--- src/Workspaces/CSharp/Portable/Formatting/Rules/NewLineUserSettingFormattingRule.cs
+++ src/Workspaces/CSharp/Portable/Formatting/Rules/NewLineUserSettingFormattingRule.cs
@@ -1,5 +1,6 @@
 // Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

+using System.Diagnostics;
 using Microsoft.CodeAnalysis;
 using Microsoft.CodeAnalysis.CSharp.Syntax;
 using Microsoft.CodeAnalysis.Formatting.Rules;
@@ -11,22 +12,16 @@
     {
         private bool IsControlBlock(SyntaxNode node)
         {
-            if (node == null)
-            {
-                return false;
-            }
+            Debug.Assert(node != null);
+
             if (node.Kind() == SyntaxKind.SwitchStatement)
             {
                 return true;
             }
-            if (node.Parent == null)
-            {
-                return false;
-            }
-
-            var parentKind = node.Parent.Kind();
-
-            switch (parentKind)
+
+            var parentKind = node.Parent?.Kind();
+
+            switch (parentKind.GetValueOrDefault())
             {
                 case SyntaxKind.IfStatement:
                 case SyntaxKind.ElseClause:


CTransaction.Hash property

CTransaction.Hash property

--- Novacoin/CTransaction.cs
+++ Novacoin/CTransaction.cs
@@ -162,7 +162,17 @@
             }
         }

-
+        /// <summary>
+        /// Transaction hash
+        /// </summary>
+        public Hash256 Hash
+        {
+            get { return Hash256.Compute256(Bytes); }
+        }
+
+        /// <summary>
+        /// A sequence of bytes, which corresponds to the current state of CTransaction.
+        /// </summary>
         public IList<byte> Bytes
         {
             get


Expose package full name from process token.

--- NtApiDotNet/NtProcess.cs
+++ NtApiDotNet/NtProcess.cs
@@ -102,6 +102,21 @@
             }
         }

+        private T QueryToken<T>(TokenAccessRights desired_access, Func<NtToken, T> callback, T default_value)
+        {
+            return NtToken.OpenProcessToken(this, desired_access, false).RunAndDispose(callback, default_value);
+        }
+
+        private T QueryToken<T>(Func<NtToken, T> callback, T default_value)
+        {
+            return QueryToken(TokenAccessRights.Query, callback, default_value);
+        }
+
+        private T QueryToken<T>(Func<NtToken, T> callback)
+        {
+            return QueryToken(TokenAccessRights.Query, callback, default(T));
+        }
+
         #endregion

         #region Constructors
@@ -1641,8 +1656,7 @@
         {
             get
             {
-                return NtToken.OpenProcessToken(this,
-                    TokenAccessRights.Query, false).RunAndDispose(token => token.IsSandbox);
+                return QueryToken(token => token.IsSandbox);
             }
         }

@@ -1767,6 +1781,11 @@
             }
         }

+        /// <summary>
+        /// Query the process token's full package name.
+        /// </summary>
+        public string PackageFullName => QueryToken(t => t.PackageFullName, string.Empty);
+
         #endregion

         #region Static Properties


sync radio buttons on start of Edit dialog

--- OpenRoC/ProcessDialog.cs
+++ OpenRoC/ProcessDialog.cs
@@ -47,6 +47,8 @@
             ProcessOptionCommandLineControl.DataBindings.Add(new Binding("Text", Options, "CommandLine"));
             ProcessOptionEnvironmentVariablesEnabledControl.DataBindings.Add(new Binding("Checked", Options, "EnvironmentVariablesEnabled"));
             ProcessOptionEnvironmentVariablesControl.DataBindings.Add(new Binding("Text", Options, "EnvironmentVariables"));
+
+            SyncStartupStateRadioGroup();
         }

         private void OnProcessOptionsSaveButtonClick(object sender, System.EventArgs e)
@@ -73,6 +75,11 @@

         private void OnStartupStateRadioGroupCheckedChanged(object sender, System.EventArgs e)
         {
+            SyncStartupStateRadioGroup();
+        }
+
+        private void SyncStartupStateRadioGroup()
+        {
             if (StartupStateStoppedControl.Checked)
                 Options.InitialStateEnumValue = ProcessRunner.Status.Stopped;
             else if (StartupStateRunningControl.Checked)


bump version

bump version

--- CommonAssemblyInfo.cs
+++ CommonAssemblyInfo.cs
@@ -4,5 +4,5 @@
 [assembly: AssemblyTitle("Virtuosity")]
 [assembly: AssemblyProduct("Virtuosity")]
 [assembly: ComVisible(false)]
-[assembly: AssemblyVersion("1.12.0.0")]
-[assembly: AssemblyFileVersion("1.12.0.0")]
+[assembly: AssemblyVersion("1.13.0.0")]
+[assembly: AssemblyFileVersion("1.13.0.0")]


Bump version to 2.4.5

Bump version to 2.4.5

--- CommonAssemblyInfo.cs
+++ CommonAssemblyInfo.cs
@@ -4,4 +4,4 @@
 [assembly: AssemblyVersion("2.0.0")]
 [assembly: AssemblyProduct("RazorGenerator")]
 [assembly: AssemblyCompany("RazorGenerator contributors")]
-[assembly: AssemblyInformationalVersion("2.4.4")]
+[assembly: AssemblyInformationalVersion("2.4.5")]


Fixed missing store details and submit button text.

--- StoreManagement/StoreManagement/Views/Site/StoreDetail.cshtml
+++ StoreManagement/StoreManagement/Views/Site/StoreDetail.cshtml
@@ -8,28 +8,28 @@

                 Store Name
-                <input class="form-control" name="StoreName" type="text" />
+                <input class="form-control" name="StoreName" type="text" value="@Model.StoreName" />

                 Manager
-                <input class="form-control" name="StoreManagerName" type="text" />
+                <input class="form-control" name="StoreManagerName" type="text" value="@Model.StoreManagerName" />

                 Opening Time
-                <input class="form-control" name="OpeningTime" type="text" placeholder="example: 8:00AM" />
+                <input class="form-control" name="OpeningTime" type="text" placeholder="example: 8:00AM" value="@Model.OpeningTime" />

                 Closing Time
-                <input class="form-control" name="ClosingTime" type="text" placeholder="example: 5:00PM" />
+                <input class="form-control" name="ClosingTime" type="text" placeholder="example: 5:00PM" value="@Model.ClosingTime" />

@@ -38,7 +38,7 @@

-            <input id="form-submit-button" class="btn btn-default" type="button" value="Create Store" />
+            <input id="form-submit-button" class="btn btn-default" type="button" value="Save Changes" />

 </form>


log memory stats

log memory stats

--- CompatBot/Watchdog.cs
+++ CompatBot/Watchdog.cs
@@ -111,8 +111,14 @@
         {
             do
             {
-                await Task.Delay(TimeSpan.FromHours(1)).ConfigureAwait(false);
                 using var process = Process.GetCurrentProcess();
+                Config.Log.Info($"Process memory stats:\n" +
+                                $"Private: {process.PrivateMemorySize64}\n" +
+                                $"Working set: {process.WorkingSet64}\n" +
+                                $"Virtual: {process.VirtualMemorySize64}\n" +
+                                $"Paged: {process.PagedMemorySize64}\n" +
+                                $"Paged sytem: {process.PagedSystemMemorySize64}\n" +
+                                $"Non-pated system: {process.NonpagedSystemMemorySize64}");
                 var processMemory = process.PrivateMemorySize64;
                 var gcMemory = GC.GetTotalMemory(false);
                 if (processMemory / (double)gcMemory > 2)
@@ -120,6 +126,7 @@
                     GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
                     GC.Collect(2, GCCollectionMode.Optimized, true, true); // force LOH compaction
                 }
+                await Task.Delay(TimeSpan.FromHours(1)).ConfigureAwait(false);
             } while (!Config.Cts.IsCancellationRequested);
         }
     }


Fix fill _spriteVisualByUiElement before attach event handlers

--- TestAppUWP.AppShell/Samples/Animations/DropShadowStuff/Sun.cs
+++ TestAppUWP.AppShell/Samples/Animations/DropShadowStuff/Sun.cs
@@ -52,6 +52,9 @@
         {
             Compositor compositor = ElementCompositionPreview.GetElementVisual(shadowHost).Compositor;

+            SpriteVisual spriteVisual = compositor.CreateSpriteVisual();
+            _spriteVisualByUiElement.Add(shadowSource, spriteVisual);
+
             List<FrameworkElement> frameworkElements;
             ContainerVisual shadowHostContainerVisual;
             if (_shadowSourceByShadowHost.ContainsKey(shadowHost))
@@ -79,14 +82,11 @@
             dropShadow.Mask = await ShadowMask(shadowSource, compositor);
             dropShadow.SourcePolicy = CompositionDropShadowSourcePolicy.Default;

-            SpriteVisual spriteVisual = compositor.CreateSpriteVisual();
             spriteVisual.Size = new Vector2((float)shadowSource.ActualWidth, (float)shadowSource.ActualHeight);
             spriteVisual.Shadow = dropShadow;
             spriteVisual.Offset = VisualOffset(shadowSource, shadowHost);

             shadowHostContainerVisual.Children.InsertAtTop(spriteVisual);
-
-            _spriteVisualByUiElement.Add(shadowSource, spriteVisual);
         }

         private async void ShadowSourceOnSizeChanged(object sender, SizeChangedEventArgs e)


Fix missing expect call mock in handle refresh test.

--- VersionOne.VisualStudio.Tests/WorkitemTreeControllerTester.cs
+++ VersionOne.VisualStudio.Tests/WorkitemTreeControllerTester.cs
@@ -83,6 +83,7 @@
             Expect.Call(assetCacheMock.Drop);
             Expect.Call(dataLayerMock.EffortTracking).Return(effortTrackingMock);
             Expect.Call(effortTrackingMock.Refresh);
+            Expect.Call(dataLayerMock.UpdateListPropertyValues);
             Expect.Call(() => eventDispatcherMock.Notify(null, new ModelChangedArgs(EventReceiver.WorkitemView, EventContext.WorkitemsRequested)));

             mockRepository.ReplayAll();


Make it robust

Make it robust

--- WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
+++ WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
@@ -285,7 +285,7 @@
 				{
 					SelectionCheckBoxesInvalidated?.Invoke(this, null);
 					CoinListStatusColumnInvalidated?.Invoke(this, null);
-					cvm.Dispose();
+					cvm?.Dispose();
 				})
 				.Subscribe();

@@ -428,18 +428,35 @@
 				.ObserveOn(RxApp.MainThreadScheduler)
 				.Subscribe(x =>
 				{
-					SelectAllCheckBoxState = GetCheckBoxesSelectedState(x => true);
-					SelectPrivateCheckBoxState = GetCheckBoxesSelectedState(x => x.AnonymitySet >= Global.Config.MixUntilAnonymitySet);
-					SelectNonPrivateCheckBoxState = GetCheckBoxesSelectedState(x => x.AnonymitySet < Global.Config.MixUntilAnonymitySet);
+					try
+					{
+						SelectAllCheckBoxState = GetCheckBoxesSelectedState(x => true);
+						SelectPrivateCheckBoxState = GetCheckBoxesSelectedState(x => x.AnonymitySet >= Global.Config.MixUntilAnonymitySet);
+						SelectNonPrivateCheckBoxState = GetCheckBoxesSelectedState(x => x.AnonymitySet < Global.Config.MixUntilAnonymitySet);
+					}
+					catch (Exception ex)
+					{
+						Logger.LogError(ex);
+					}
 				});

 			Observable
 				.FromEventPattern(this, nameof(CoinListStatusColumnInvalidated))
 				.Throttle(TimeSpan.FromSeconds(0.5))
 				.ObserveOn(RxApp.MainThreadScheduler)
-				.Subscribe(_ => CoinJoinStatusWidth = Coins.Any() && Coins.All(x => NotVisibleStatuses.Contains(x.Status))
-						? new GridLength(0)
-						: new GridLength(180));
+				.Subscribe(_ =>
+				{
+					try
+					{
+						CoinJoinStatusWidth = Coins.Any() && Coins.All(x => NotVisibleStatuses.Contains(x.Status))
+							 ? new GridLength(0)
+							 : new GridLength(180);
+					}
+					catch (Exception ex)
+					{
+						Logger.LogError(ex);
+					}
+				});

 			Observable
 				.Merge(InitList.ThrownExceptions)
@@ -544,7 +561,17 @@
 			Global.Config
 				.WhenAnyValue(x => x.MixUntilAnonymitySet)
 				.ObserveOn(RxApp.MainThreadScheduler)
-				.Subscribe(x => RefreshSelectCheckBoxesShields(x))
+				.Subscribe(x =>
+				{
+					try
+					{
+						RefreshSelectCheckBoxesShields(x);
+					}
+					catch (Exception ex)
+					{
+						Logger.LogError(ex);
+					}
+				})
 				.DisposeWith(Disposables);

 			SelectionCheckBoxesInvalidated?.Invoke(this, null);
@@ -577,7 +604,7 @@

 		public void OnClose()
 		{
-			RootList.Clear(); // This must be called to trigger the OnItemRemoved for every items in the list.
+			RootList?.Clear(); // This must be called to trigger the OnItemRemoved for every items in the list.

 			// Do not dispose the RootList here. It will be reused next time when you open CoinJoinTab or SendTab.
 			Disposables?.Dispose();


Update WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs

Co-Authored-By: yahiheb <1ef907ec03476373b9c05d7f089a7d2fed4d8ea8@users.noreply.github.com>

--- WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
+++ WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
@@ -601,7 +601,7 @@
 				cvm.Dispose();
 			}

-			RootList.Clear(); // This must be called to trigger the OnItemRemoved for every items in the list.
+			RootList.Clear(); // This must be called to trigger the OnItemRemoved for every item in the list.

 			// Do not dispose the RootList here. It will be reused next time when you open CoinJoinTab or SendTab.
 			Disposables?.Dispose();


Added missing print button on Transport Requisition Detail View

--- Web/Areas/Logistics/Views/TransportRequisition/Details.cshtml
+++ Web/Areas/Logistics/Views/TransportRequisition/Details.cshtml
@@ -13,6 +13,7 @@

@Html.Translate("Transport Requisition Detail")

 @section Toolbar
 {
+

     @if (Model.StatusID == (int)Cats.Models.Constant.TransportRequisitionStatus.Draft)
     {


Call ToString on all blocks in cli

Call ToString on all blocks in cli

--- Decompiler/Program.cs
+++ Decompiler/Program.cs
@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Diagnostics;
 using System.IO;
 using System.Linq;
 using System.Threading.Tasks;
@@ -216,13 +215,7 @@

             try
             {
-                var sw = Stopwatch.StartNew();
-
                 resource.Read(stream);
-
-                sw.Stop();
-
-                Console.WriteLine("Parsed in {0}ms", sw.ElapsedMilliseconds);

                 string extension = Path.GetExtension(path);

@@ -288,6 +281,11 @@
                                 uniqueSpecialDependancies[string.Format("{0} \"{1}\"", dep.CompilerIdentifier, dep.String)] = path;
                             }
                         }
+                    }
+
+                    foreach (var block in resource.Blocks)
+                    {
+                        block.Value.ToString();
                     }
                 }

@@ -526,8 +524,6 @@
                 Console.ResetColor();
             }

-            var sw = Stopwatch.StartNew();
-
             var package = new Package();

             try
@@ -660,10 +656,6 @@
                     }
                 }
             }
-
-            sw.Stop();
-
-            Console.WriteLine("Processed in {0}ms", sw.ElapsedMilliseconds);
         }

         private void DumpVPK(Package package, string type, string newType)


FontFactory を外部に公開

FontFactory を外部に公開


polish 	modified:   Dragon/Source/Node.cs

polish
	modified:   Dragon/Source/Node.cs

--- Dragon/Source/Node.cs
+++ Dragon/Source/Node.cs
@@ -47,7 +47,7 @@
         public Token Op { get; set; }
         public Type Type { get; set; }

-        public Expr(Token tok, Type type)
+        public Expr(Token tok, Type type) //private on book
         {
             this.Op = tok;
             this.Type = type;
@@ -72,7 +72,8 @@
         {
             if(t != 0 && f != 0)
             {
-                this.Emit("if " + test + " goto L" + t); this.Emit("goto L" + f);
+                this.Emit("if " + test + " goto L" + t);
+                this.Emit("goto L" + f);
             }
             else if(t != 0)
             {


Update tests

Update tests

--- osu.Game.Rulesets.Osu.Tests/OsuDifficultyCalculatorTest.cs
+++ osu.Game.Rulesets.Osu.Tests/OsuDifficultyCalculatorTest.cs
@@ -17,18 +17,18 @@
     {
         protected override string ResourceAssembly => "osu.Game.Rulesets.Osu";

-        [TestCase(6.6972307565739273d, 206, "diffcalc-test")]
-        [TestCase(1.4484754139145539d, 45, "zero-length-sliders")]
+        [TestCase(6.8043847243906566d, 206, "diffcalc-test")]
+        [TestCase(1.449091582269485d, 45, "zero-length-sliders")]
         public void Test(double expectedStarRating, int expectedMaxCombo, string name)
             => base.Test(expectedStarRating, expectedMaxCombo, name);

-        [TestCase(8.9382559208689809d, 206, "diffcalc-test")]
-        [TestCase(1.7548875851757628d, 45, "zero-length-sliders")]
+        [TestCase(9.0768518847360937d, 206, "diffcalc-test")]
+        [TestCase(1.7555890739194639d, 45, "zero-length-sliders")]
         public void TestClockRateAdjusted(double expectedStarRating, int expectedMaxCombo, string name)
             => Test(expectedStarRating, expectedMaxCombo, name, new OsuModDoubleTime());

-        [TestCase(6.6972307218715166d, 239, "diffcalc-test")]
-        [TestCase(1.4484754139145537d, 54, "zero-length-sliders")]
+        [TestCase(6.8043847243906566d, 239, "diffcalc-test")]
+        [TestCase(1.449091582269485d, 54, "zero-length-sliders")]
         public void TestClassicMod(double expectedStarRating, int expectedMaxCombo, string name)
             => Test(expectedStarRating, expectedMaxCombo, name, new OsuModClassic());


green for turning 3 to fizz

green for turning 3 to fizz

--- FizzBuzz/FizzBuzz.csx
+++ FizzBuzz/FizzBuzz.csx
@@ -7,6 +7,11 @@
 {
 	public string Answer(int number)
 	{
+		if(number == 3)
+		{
+			return "fizz";
+		}
+
 		return number.ToString();
 	}
 }


Fix ray amplification at distance, remove some unneeded variables

--- Assets/MixedRealityToolkit.SDK/Experimental/Features/UX/ScrollingObjectCollection.cs
+++ Assets/MixedRealityToolkit.SDK/Experimental/Features/UX/ScrollingObjectCollection.cs
@@ -2,6 +2,7 @@
 // Licensed under the MIT License. See LICENSE in the project root for license information.

 using Microsoft.MixedReality.Toolkit.Input;
+using Microsoft.MixedReality.Toolkit.Physics;
 using Microsoft.MixedReality.Toolkit.Utilities;
 using Microsoft.MixedReality.Toolkit.Utilities.Solvers;
 using System.Collections;
@@ -467,33 +468,36 @@

         #region scroll state variables

-        // The currently tracked finger/pointer objects
-        private Transform currentPointerTransform;
-
-        private Handedness currentHand;
-
         private IMixedRealityPointer currentPointer;

-        //The point where the original PointerDown occured
+        // The point where the original PointerDown occured
         private Vector3 pointerHitPoint;
-
-        //Helper to get the current (actual) position of the pointer
-        private Vector3 currentPointerPos
-        {
-            get
-            {
-                if (currentPointer == null) { return Vector3.zero; } //bail
-
-                if (currentPointer.GetType() == typeof(PokePointer))
-                {
-                    //this is a hand pointer
-                    return UpdateFingerPosition(TrackedHandJoint.IndexTip, currentHand);
-                }
-                else
-                {
-                    return VectorExtensions.GetProjectedPoint(pointerHitPoint, currentPointerTransform.position, currentPointer.Position + currentPointer.Rotation * Vector3.forward, (scrollDirection == ScrollDirectionType.UpAndDown) ? transform.up : transform.right);
-                }
-            }
+        // The ray length of original pointer down
+        private float pointerHitDistance;
+
+        Vector3 currentPointerPos;
+
+        /// <summary>
+        /// Gets the cursor position (pointer end point) on the scrollable plane,
+        /// projected onto the direction being scrolled.
+        /// Returns false if the pointer is null or pointer details is null.
+        /// </summary>
+        private bool TryGetPointerPositionOnPlane(out Vector3 result)
+        {
+            if (currentPointer.GetType() == typeof(PokePointer))
+            {
+                result = currentPointer.Position;
+                return true;
+            }
+            if (currentPointer?.Result?.Details != null)
+            {
+                var endPoint = RayStep.GetPointByDistance(currentPointer.Rays, pointerHitDistance);
+                var scrollVector = (scrollDirection == ScrollDirectionType.UpAndDown) ? transform.up : transform.right;
+                result =  pointerHitPoint + Vector3.Project(endPoint - pointerHitPoint, scrollVector);
+                return true;
+            }
+            result = Vector3.zero;
+            return false;
         }

         #endregion scroll state variables
@@ -919,7 +923,7 @@
             thresholdPoint = transform.TransformPoint(finalOffset);

             //The scroller has detected input and has a valid pointer
-            if (isEngaged)
+            if (isEngaged && TryGetPointerPositionOnPlane(out currentPointerPos))
             {
                 handDelta = initialHandPos - currentPointerPos;

@@ -983,7 +987,6 @@
                     //Release the pointer
                     if (currentPointer.GetType() != typeof(PokePointer))
                     {
-                        currentPointer.IsFocusLocked = false;
                         currentPointer = null;
                     }

@@ -2004,15 +2007,13 @@
                 return;
             }

-            //we ignore this for touch events and calculate PointerUp in the Update() loop;
-
             if (!isTouched && isEngaged && !animatingToPosition)
             {
                 //Its a drag release
                 initialScrollerPos = workingScrollerPos;

                 //Release the pointer
-                currentPointer.IsFocusLocked = false;
+                currentPointer.IsTargetPositionLockedOnFocusLock = true;
                 currentPointer = null;

                 //Clear our states
@@ -2037,12 +2038,11 @@
                     }

                     currentPointer = eventData.Pointer;
-                    currentPointer.IsFocusLocked = true;
-
-                    IMixedRealityControllerVisualizer controllerViz = eventData.Pointer.Controller.Visualizer as IMixedRealityControllerVisualizer;
-                    currentPointerTransform = controllerViz.GameObjectProxy.transform;
+
+                    currentPointer.IsTargetPositionLockedOnFocusLock = false;

                     pointerHitPoint = currentPointer.Result.Details.Point;
+                    pointerHitDistance = currentPointer.Result.Details.RayDistance;

                     focusedObject = eventData.Pointer.Result.CurrentPointerTarget;

@@ -2100,8 +2100,6 @@

                 if (!isTouched && !isEngaged)
                 {
-                    currentHand = eventData.Controller.ControllerHandedness;
-
                     initialHandPos = UpdateFingerPosition(TrackedHandJoint.IndexTip, eventData.Controller.ControllerHandedness);
                     initialPressTime = Time.time;

@@ -2175,7 +2173,6 @@
                 //Release the pointer
                 if (currentPointer.GetType() != typeof(PokePointer))
                 {
-                    currentPointer.IsFocusLocked = false;
                     currentPointer = null;
                 }


ODataUriResolver has nothing to do with non qualified enums anymore. See Prev commit.

--- Foundation/Server/Foundation.Api/Middlewares/WebApi/OData/DefaultODataUriResolver.cs
+++ Foundation/Server/Foundation.Api/Middlewares/WebApi/OData/DefaultODataUriResolver.cs
@@ -1,48 +1,13 @@
-using Microsoft.OData.Edm;
-using Microsoft.OData.UriParser;
-using System;
-using System.Collections.Generic;
+using Microsoft.OData.UriParser;

 namespace Foundation.Api.Middlewares.WebApi.OData
 {
-    /// <summary>
-    /// See https://github.com/OData/WebApi/blob/368278e40296e87a420f1bbffef038c3c4a852d2/OData/src/System.Web.OData/OData/UnqualifiedCallAndEnumPrefixFreeResolver.cs
-    /// </summary>
     public class DefaultODataUriResolver : UnqualifiedODataUriResolver
     {
-        private readonly StringAsEnumResolver _stringAsEnumResolver = new StringAsEnumResolver
-        {
-            EnableCaseInsensitive = true
-        };
-
         public override bool EnableCaseInsensitive
         {
             get { return true; }
             set { }
         }
-
-        public override void PromoteBinaryOperandTypes(BinaryOperatorKind binaryOperatorKind,
-            ref SingleValueNode leftNode, ref SingleValueNode rightNode, out IEdmTypeReference typeReference)
-        {
-            _stringAsEnumResolver.PromoteBinaryOperandTypes(binaryOperatorKind, ref leftNode, ref rightNode, out typeReference);
-        }
-
-        public override IEnumerable<KeyValuePair<string, object>> ResolveKeys(IEdmEntityType type,
-            IDictionary<string, string> namedValues, Func<IEdmTypeReference, string, object> convertFunc)
-        {
-            return _stringAsEnumResolver.ResolveKeys(type, namedValues, convertFunc);
-        }
-
-        public override IEnumerable<KeyValuePair<string, object>> ResolveKeys(IEdmEntityType type,
-            IList<string> positionalValues, Func<IEdmTypeReference, string, object> convertFunc)
-        {
-            return _stringAsEnumResolver.ResolveKeys(type, positionalValues, convertFunc);
-        }
-
-        public override IDictionary<IEdmOperationParameter, SingleValueNode> ResolveOperationParameters(
-            IEdmOperation operation, IDictionary<string, SingleValueNode> input)
-        {
-            return _stringAsEnumResolver.ResolveOperationParameters(operation, input);
-        }
     }
 }


Shorten the sleep interval from one second to 1/2 a second, so the download-file tool appears more responsive to users.

--- tools/download-file/Program.cs
+++ tools/download-file/Program.cs
@@ -118,7 +118,7 @@
             Console.Write("0%");
             client.DownloadFileAsync(uri, fileName);
             while (! downloadComplete)
-                Thread.Sleep(1000);  // Wait a second
+                Thread.Sleep(500);  // Wait 1/2 of a second
         }

         //---------------------------------------------------------------------


Remove the most spammy XML dumps from the FS voice module

--- OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -132,7 +132,7 @@
                 m_FreeswitchService = ServerUtils.LoadPlugin<IFreeswitchService>(serviceDll, args);

                 string jsonConfig = m_FreeswitchService.GetJsonConfig();
-                m_log.Debug("[FreeSwitchVoice]: Configuration string: " + jsonConfig);
+                //m_log.Debug("[FreeSwitchVoice]: Configuration string: " + jsonConfig);
                 OSDMap map = (OSDMap)OSDParser.DeserializeJson(jsonConfig);

                 m_freeSwitchAPIPrefix = map["APIPrefix"].AsString();
@@ -363,7 +363,7 @@

             try
             {
-                m_log.DebugFormat("[FreeSwitchVoice][PROVISIONVOICE]: request: {0}, path: {1}, param: {2}",
+                //m_log.DebugFormat("[FreeSwitchVoice][PROVISIONVOICE]: request: {0}, path: {1}, param: {2}",
                                   request, path, param);

                 //XmlElement    resp;
@@ -445,7 +445,7 @@
                 // voice channel
                 LandData land = scene.GetLandData(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);

-                m_log.DebugFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": request: {4}, path: {5}, param: {6}",
+                //m_log.DebugFormat("[FreeSwitchVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": request: {4}, path: {5}, param: {6}",
                                   scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, request, path, param);

                 // TODO: EstateSettings don't seem to get propagated...
@@ -592,7 +592,7 @@

             response["int_response_code"] = 200;

-            m_log.DebugFormat("[FreeSwitchVoice] FreeSwitchSLVoiceGetPreloginHTTPHandler return {0}",response["str_response_string"]);
+            //m_log.DebugFormat("[FreeSwitchVoice] FreeSwitchSLVoiceGetPreloginHTTPHandler return {0}",response["str_response_string"]);
             return response;
         }

@@ -664,7 +664,7 @@
             response["str_response_string"] = resp.ToString();
             Regex normalizeEndLines = new Regex(@"\r\n", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline);

-            m_log.DebugFormat("[FREESWITCH]: {0}", normalizeEndLines.Replace((string)response["str_response_string"],""));
+            //m_log.DebugFormat("[FREESWITCH]: {0}", normalizeEndLines.Replace((string)response["str_response_string"],""));
             return response;
         }

@@ -696,7 +696,7 @@
                 }
             }

-            m_log.DebugFormat("[FreeSwitchVoice]: AUTH, URI: {0}, Content-Type:{1}, Body{2}", uri, contenttype,
+            //m_log.DebugFormat("[FreeSwitchVoice]: AUTH, URI: {0}, Content-Type:{1}, Body{2}", uri, contenttype,
                               requestbody);
             Hashtable response = new Hashtable();
             response["str_response_string"] = string.Format(@"<response xsi:schemaLocation=""/xsd/signin.xsd"">


Version 1.0.1

Version 1.0.1

--- Riganti.Utils/Riganti.Utils.Testing/Riganti.Utils.Testing/Properties/AssemblyInfo.cs
+++ Riganti.Utils/Riganti.Utils.Testing/Riganti.Utils.Testing/Properties/AssemblyInfo.cs
@@ -32,7 +32,7 @@
 //
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.0")]
+// [assembly: AssemblyVersion("1.0.1")]
 [assembly: AssemblyVersion("1.0.1")]
 [assembly: AssemblyFileVersion("1.0.1")]
 [assembly: InternalsVisibleTo("WebApplication1.Tests")]


[Terradue.Metadata.EarthObservation] Commented class Terradue.Metadata.EarthObservation.Ogc.Alt.EarthObservationPropertyType (exactly same as Terradue.Metadata.EarthObservation.Ogc.Eop.EarthObservationPropertyType) to avoid exception in XmlSerializer creation for Terradue.Metadata.EarthObservation.Ogc.Alt.AltEarthObservationType

--- Terradue.Metadata.EarthObservation/Terradue/Metadata/EarthObservation/Ogc/Alt/Alt.cs
+++ Terradue.Metadata.EarthObservation/Terradue/Metadata/EarthObservation/Ogc/Alt/Alt.cs
@@ -348,7 +348,7 @@
             }
         }
     }
-
+/*
     [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
     [System.SerializableAttribute()]
     [System.ComponentModel.DesignerCategoryAttribute("code")]
@@ -422,7 +422,7 @@
             }
         }
     }
-
+*/
     [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
     [System.SerializableAttribute()]
     [System.ComponentModel.DesignerCategoryAttribute("code")]


changed message

changed message

--- UnityProject/Assets/Scripts/Messages/Client/Admin/RequestRandomEventAllowedChange.cs
+++ UnityProject/Assets/Scripts/Messages/Client/Admin/RequestRandomEventAllowedChange.cs
@@ -19,7 +19,7 @@

 		var state = RandomEventsAllowed ? "ON" : "OFF";

-		DiscordWebhookMessage.Instance.AddWebHookMessageToQueue(DiscordWebhookURLs.DiscordWebhookAdminLogURL, $"{PlayerList.Instance.GetByUserID(Userid).Username}: Turned random events {state}", "");
+		DiscordWebhookMessage.Instance.AddWebHookMessageToQueue(DiscordWebhookURLs.DiscordWebhookAdminLogURL, $"Admin: {PlayerList.Instance.GetByUserID(Userid).Username}, Turned random events {state}", "");
 	}

 	public static RequestRandomEventAllowedChange Send(string userId, string adminToken, bool randomEventsAllowed)


update homepage bug

update homepage bug

--- HRI/Views/Home.cshtml
+++ HRI/Views/Home.cshtml
@@ -66,9 +66,9 @@

@Umbraco.Field("Plan1Caption")

-                @if(Umbraco.Field("Plan1Text").ToString().Length > 60)
-                {
-
@Umbraco.Field("Plan1Text").ToString().Substring(0, 60 ) >

+                @if (Umbraco.Field("Plan1Text").ToString().Length > 60)
+                {
+
@Umbraco.Field("Plan1Text").ToString().Substring(0, 60) >

                 }
                 else
                 {
@@ -82,7 +82,14 @@

@Umbraco.Field("Plan2Caption")

-
@Umbraco.Field("Plan2Text").ToString().Substring(0, 60) >

+                @if (Umbraco.Field("Plan2Text").ToString().Length > 60)
+                {
+
@Umbraco.Field("Plan2Text").ToString().Substring(0, 60) >

+                }
+                else
+                {
+
@Umbraco.Field("Plan2Text").ToString()

+                }

@@ -91,7 +98,14 @@

@Umbraco.Field("Plan3Caption")

-
@Umbraco.Field("Plan3Text").ToString().Substring(0, 60) >

+                @if (Umbraco.Field("Plan3Text").ToString().Length > 60)
+                {
+
@Umbraco.Field("Plan3Text").ToString().Substring(0, 60) >

+                }
+                else
+                {
+
@Umbraco.Field("Plan3Text").ToString()

+                }


Don't try to reply to a Steam command if we're not connected

--- IRC/CommandHandler.cs
+++ IRC/CommandHandler.cs
@@ -57,6 +57,11 @@

                 case ECommandType.SteamChatRoom:
                 {
+                    if (!Steam.Instance.Client.IsConnected)
+                    {
+                        break;
+                    }
+
                     Steam.Instance.Friends.SendChatRoomMessage(command.ChatRoomID, EChatEntryType.ChatMsg, string.Format("{0}: {1}", Steam.Instance.Friends.GetFriendPersonaName(command.SenderID), Colors.StripColors(message)));

                     break;
@@ -64,6 +69,11 @@

                 case ECommandType.SteamIndividual:
                 {
+                    if (!Steam.Instance.Client.IsConnected)
+                    {
+                        break;
+                    }
+
                     Steam.Instance.Friends.SendChatMessage(command.SenderID, EChatEntryType.ChatMsg, Colors.StripColors(message));

                     break;


Fix asset id generation for types in the global namespace.

--- LBi.LostDoc/Naming.cs
+++ LBi.LostDoc/Naming.cs
@@ -40,7 +40,12 @@
             }

             if (type.IsGenericType)
-                return string.Format("{0}.{1}", type.Namespace, type.Name);
+            {
+                if (type.Namespace != null)
+                    return string.Format("{0}.{1}", type.Namespace, type.Name);
+
+                return type.Name;
+            }

             return type.FullName;
         }


CqlPeerRepository: Added some test results to confirm the performance benefit of using "UselessKey"

--- src/Abc.Zebus.Directory.Cassandra.Tests/Storage/CqlPeerRepositoryPerformanceTests.cs
+++ src/Abc.Zebus.Directory.Cassandra.Tests/Storage/CqlPeerRepositoryPerformanceTests.cs
@@ -81,5 +81,35 @@
             }
             return subscriptionForTypes.ToArray();
         }
+
+        // UselessKey
+        //        100 iterations in 953 ms (105,0 iterations/sec)
+        //        Latencies :
+        //        Min :               6 068µs
+        //        Avg :               9 526µs
+        //        Median :            6 785µs
+        //        95 percentile :     11 572µs
+        //        99 percentile :     50 912µs
+        //        Max :             156 487µs (Iteration #0)
+        //        G0 : 18
+        //        G1 : 0
+        //        G2 : 0
+        //          Expected: 8000
+        //          But was:  0
+
+        // Clean
+        //        100 iterations in 1 242 ms (80,5 iterations/sec)
+        //        Latencies :
+        //        Min :               9 659µs
+        //        Avg :              12 416µs
+        //        Median :           10 291µs
+        //        95 percentile :     12 751µs
+        //        99 percentile :     65 848µs
+        //        Max :             109 858µs (Iteration #0)
+        //        G0 : 17
+        //        G1 : 0
+        //        G2 : 0
+        //          Expected: 8000
+        //          But was:  0
     }
 }


allow MainWindow close mode and LastWindowClose mode to be cancellable.

--- src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs
+++ src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs
@@ -76,9 +76,9 @@
                 return;

             if (ShutdownMode == ShutdownMode.OnLastWindowClose && _windows.Count == 0)
-                Shutdown();
-            else if (ShutdownMode == ShutdownMode.OnMainWindowClose && window == MainWindow)
-                Shutdown();
+                TryShutdown();
+            else if (ShutdownMode == ShutdownMode.OnMainWindowClose && ReferenceEquals(window, MainWindow))
+                TryShutdown();
         }

         public void Shutdown(int exitCode = 0)


fix bug (regression)

fix bug (regression)

--- src/NUnitFramework/framework/Internal/Commands/ConstructFixturePerTestCaseCommand.cs
+++ src/NUnitFramework/framework/Internal/Commands/ConstructFixturePerTestCaseCommand.cs
@@ -55,7 +55,7 @@
             {
                 ITypeInfo typeInfo = Test.TypeInfo;

-                if (context.TestObject == null && typeInfo != null && !typeInfo.IsStaticClass)
+                if (typeInfo != null && !typeInfo.IsStaticClass)
                 {
                     context.TestObject = typeInfo.Construct(testSuite.Arguments);
                     Test.Fixture = context.TestObject;


#17022: Initializing services.

#17022: Initializing services.

--HG--
branch : dev

--- src/Orchard.Web/Modules/Orchard.Packaging/Controllers/PackagingServicesController.cs
+++ src/Orchard.Web/Modules/Orchard.Packaging/Controllers/PackagingServicesController.cs
@@ -31,6 +31,7 @@
             _packageManager = packageManager;
             _notifier = notifier;
             _appDataFolderRoot = appDataFolderRoot;
+            Services = services;

             T = NullLocalizer.Instance;
         }


1769.3

--- src/PixelFarm/PixelFarm.Drawing/7_CpuBlitPainter/PathReconstruction/OutlineTracer.cs
+++ src/PixelFarm/PixelFarm.Drawing/7_CpuBlitPainter/PathReconstruction/OutlineTracer.cs
@@ -847,7 +847,7 @@
                 //but you can replace internal data of the old contour too,
                 RawContour newContour = new RawContour();
                 newContour.IsOutside = contour.IsOutside;
-                foreach (var point in simplifiedPoints)
+                foreach (Point point in simplifiedPoints)
                 {
                     newContour.AddPoint(point);
                 }


Added missing column

Added missing column

--- src/SFA.DAS.EmployerApprenticeshipsService.Infrastructure/Data/TransferRepository.cs
+++ src/SFA.DAS.EmployerApprenticeshipsService.Infrastructure/Data/TransferRepository.cs
@@ -121,6 +121,7 @@
                 new DataColumn("ReceiverAccountName", typeof(string)),
                 new DataColumn("ApprenticeshipId", typeof(long)),
                 new DataColumn("CourseName", typeof(string)),
+                new DataColumn("CourseLevel", typeof(int)),
                 new DataColumn("Amount", typeof(decimal)),
                 new DataColumn("PeriodEnd", typeof(string)),
                 new DataColumn("Type", typeof(string)),
@@ -136,6 +137,7 @@
                     transfer.ReceiverAccountName,
                     transfer.CommitmentId,
                     transfer.CourseName,
+                    transfer.CourseLevel,
                     transfer.Amount,
                     transfer.PeriodEnd,
                     transfer.Type,


ottimizzazione mezzi

ottimizzazione mezzi

--- src/backend/SO115App.FakePersistance.ExternalAPI/Servizi/Gac/GetMezziUtilizzabili.cs
+++ src/backend/SO115App.FakePersistance.ExternalAPI/Servizi/Gac/GetMezziUtilizzabili.cs
@@ -97,10 +97,11 @@

             #endregion LEGGO DA API ESTERNA

+
             //MAPPING
             var ListaMezzi = lstMezziDto.Select(m =>
             {
-                var mezzo = MapMezzo(m, ListaPosizioneFlotta, listaSediAlberate);
+                var mezzo = MapMezzo(m, ListaPosizioneFlotta.Result, listaSediAlberate.Result);

                 if (mezzo != null)
                 {
@@ -182,20 +183,22 @@
                 throw new Exception($"Elenco dei mezzi non disponibile: {e.GetBaseException()}");
             }

+            var flotta = ListaPosizioneFlotta.Result;
+
             //MAPPING
-            var ListaMezzi = lstMezziDto.Select(m => MapMezzo(m, ListaPosizioneFlotta, listaSediAlberate)).ToList();
+            var ListaMezzi = lstMezziDto.Select(m => MapMezzo(m, flotta, listaSediAlberate.Result)).ToList();

             ListaMezzi.RemoveAll(m => m == null);

             return ListaMezzi;
         }

-        private Mezzo MapMezzo(MezzoDTO mezzoDto, Task<List<MessaggioPosizione>> ListaPosizioneFlotta, Task<UnitaOperativa> listaSediAlberate)
+        private Mezzo MapMezzo(MezzoDTO mezzoDto, List<MessaggioPosizione> ListaPosizioneFlotta, UnitaOperativa listaSediAlberate)
         {
             if (listaSediAlberate == null || ListaPosizioneFlotta == null)
             {
-                ListaPosizioneFlotta = _getPosizioneFlotta.Get(0);
-                listaSediAlberate = _getAlberaturaUnitaOperative.ListaSediAlberata();
+                ListaPosizioneFlotta = _getPosizioneFlotta.Get(0).Result;
+                listaSediAlberate = _getAlberaturaUnitaOperative.ListaSediAlberata().Result;
             }

             try
@@ -207,7 +210,7 @@
                 string IndirizzoSede = "";
                 Coordinate coordinate = null;
                 string[] coordinateStrg = new string[2];
-                var CoordinateMezzoGeoFleet = ListaPosizioneFlotta.Result.Find(x => x.CodiceMezzo.Equals(mezzoDto.CodiceMezzo));
+                var CoordinateMezzoGeoFleet = ListaPosizioneFlotta.Find(x => x.CodiceMezzo.Equals(mezzoDto.CodiceMezzo));

                 if (CoordinateMezzoGeoFleet != null)
                 {
@@ -215,7 +218,7 @@
                     coordinateStrg = new string[2] { coordinate.Latitudine.ToString(), coordinate.Longitudine.ToString() };
                 }

-                foreach (var figlio in listaSediAlberate.Result.GetSottoAlbero(pinNodi))
+                foreach (var figlio in listaSediAlberate.GetSottoAlbero(pinNodi))
                 {
                     if (figlio.Codice.Equals(mezzoDto.CodiceDistaccamento))
                     {
@@ -247,7 +250,7 @@
             }
             catch (Exception e)
             {
-                return null;
+                throw new Exception("Errore mapping mezzi.");
             }
         }
     }


Avoid NullReferenceException in DistributedPubSubMediator.PublishMessage

--- src/contrib/cluster/Akka.Cluster.Tools/PublishSubscribe/DistributedPubSubMediator.cs
+++ src/contrib/cluster/Akka.Cluster.Tools/PublishSubscribe/DistributedPubSubMediator.cs
@@ -475,19 +475,23 @@

         private void PublishMessage(string path, object message, bool allButSelf = false)
         {
-            foreach (var entry in _registry)
-            {
-                var address = entry.Key;
-                var bucket = entry.Value;
-
-                if (!(allButSelf && address == _cluster.SelfAddress) && bucket.Content.TryGetValue(path, out var valueHolder))
-                {
-                    if (valueHolder != null && !valueHolder.Ref.Equals(ActorRefs.Nobody))
-                        valueHolder.Ref.Forward(message);
-                    else
-                        SendToDeadLetters(message);
-                }
-            }
+            IEnumerable<IActorRef> Refs()
+            {
+                foreach (var entry in _registry)
+                {
+                    var address = entry.Key;
+                    var bucket = entry.Value;
+
+                    if (!(allButSelf && address == _cluster.SelfAddress) && bucket.Content.TryGetValue(path, out var valueHolder))
+                    {
+                        if (valueHolder != null && !Equals(valueHolder.Ref, ActorRefs.Nobody))
+                            yield return valueHolder.Ref;
+                    }
+                }
+            }
+
+            if (!Refs().Any()) SendToDeadLetters(message);
+            else Refs().ForEach(r => r?.Forward(message));
         }

         private void PublishToEachGroup(string path, object message)


Updated WorkbenchProductAssemblyInfo.cs

Updated WorkbenchProductAssemblyInfo.cs

--- src/WorkbenchProductAssemblyInfo.cs
+++ src/WorkbenchProductAssemblyInfo.cs
@@ -6,10 +6,10 @@
 [assembly: AssemblyConfiguration("release")]
 #endif

-[assembly: AssemblyCompany("motoi.org")]
-[assembly: AssemblyProduct("motoi .NET RCP Workench")]
-[assembly: AssemblyCopyright("Copyright ©  2017 motoi.org")]
+[assembly: AssemblyCompany("Arian Storch")]
+[assembly: AssemblyProduct("Motoi RCP Workench")]
+[assembly: AssemblyCopyright("© 2017 Arian Storch. All rights reserved.")]
 [assembly: AssemblyTrademark("")]

-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]+[assembly: AssemblyInformationalVersion("1.0.0")]
+[assembly: AssemblyFileVersion("1.0.0")]


PreDestroy Test is failing within 3.5 compile

--- test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/PreDestroyAttributeTests.cs
+++ test/Spring/Spring.Core.Tests/Objects/Factory/Attributes/PreDestroyAttributeTests.cs
@@ -51,7 +51,6 @@
             _applicationContext.ObjectFactory.RegisterObjectDefinition("PreDestroyTestObject3", objDef);

             objDef = new RootObjectDefinition(typeof(PreDestroyTestObject4));
-            objDef.Scope = "prototype";
             _applicationContext.ObjectFactory.RegisterObjectDefinition("PreDestroyTestObject4", objDef);

             objDef = new RootObjectDefinition(typeof(PreDestroyTestObject5));


(#265) IsExternalInit: guard for .NET 5

(#265) IsExternalInit: guard for .NET 5

.NET 5 includes this type already. We aren't compiling for .NET 5, yet,
but I'll leave this guard for future, when we'll start supporting it.

--- src/WpfMath/Build/IsExternalInit.cs
+++ src/WpfMath/Build/IsExternalInit.cs
@@ -1,8 +1,10 @@
 // ReSharper disable once CheckNamespace
 namespace System.Runtime.CompilerServices
 {
+#if !NET5_0_OR_GREATER
     /// <summary>This is only used to enable init-only attributes for older target frameworks.</summary>
     internal class IsExternalInit
     {
     }
+#endif
 }


Cleanup: remove old comments in grammar rules

--- src/XLParser/ExcelFormulaGrammar.cs
+++ src/XLParser/ExcelFormulaGrammar.cs
@@ -226,7 +226,6 @@
         public NonTerminal PrefixOp{ get; } = new NonTerminal(GrammarNames.TransientPrefixOp);
         public NonTerminal QuotedFileSheet{ get; } = new NonTerminal(GrammarNames.QuotedFileSheet);
         public NonTerminal Reference{ get; } = new NonTerminal(GrammarNames.Reference);
-        //public NonTerminal ReferenceFunction{ get; } = new NonTerminal(GrammarNames.ReferenceFunction);
         public NonTerminal ReferenceItem{ get; } = new NonTerminal(GrammarNames.TransientReferenceItem);
         public NonTerminal ReferenceFunctionCall{ get; } = new NonTerminal(GrammarNames.ReferenceFunctionCall);
         public NonTerminal RefError{ get; } = new NonTerminal(GrammarNames.RefError);
@@ -237,7 +236,6 @@
         public NonTerminal StructuredReference { get; } = new NonTerminal(GrammarNames.StructuredReference);
         public NonTerminal StructuredReferenceElement { get; } = new NonTerminal(GrammarNames.StructuredReferenceElement);
         public NonTerminal StructuredReferenceExpression { get; } = new NonTerminal(GrammarNames.StructuredReferenceExpression);
-        //public NonTerminal StructuredReferenceKeyword { get; } = new NonTerminal(GrammarNames.StructuredReferenceKeyword);
         public NonTerminal StructuredReferenceTable { get; } = new NonTerminal(GrammarNames.StructuredReferenceTable);
         public NonTerminal Text{ get; } = new NonTerminal(GrammarNames.Text);
         public NonTerminal UDFName{ get; } = new NonTerminal(GrammarNames.UDFName);
@@ -253,7 +251,6 @@
             MarkPunctuation(OpenParen, CloseParen);
             MarkPunctuation(OpenSquareParen, CloseSquareParen);
             MarkPunctuation(OpenCurlyParen, CloseCurlyParen);
-            //exclamationMark.SetFlag(TermFlags.IsDelimiter);
             #endregion

             #region Rules
@@ -282,7 +279,6 @@
                 | OpenParen + Formula + CloseParen
                 | ReservedName
                 ;
-            //MarkTransient(Formula);

             ReservedName.Rule = ReservedNameToken;

@@ -311,11 +307,9 @@
             FunctionName.Rule = ExcelFunction;

             Arguments.Rule = MakeStarRule(Arguments, comma, Argument);
-            //Arguments.Rule = Argument | Argument + comma + Arguments;

             EmptyArgument.Rule = EmptyArgumentToken;
             Argument.Rule = Formula | EmptyArgument;
-            //MarkTransient(Argument);

             PrefixOp.Rule =
                 ImplyPrecedenceHere(Precedence.UnaryPreFix) + plusop
@@ -338,7 +332,6 @@
                 | lteop;
             MarkTransient(InfixOp);

-            //PostfixOp.Rule = ImplyPrecedenceHere(Precedence.UnaryPostFix) + percentop;
             // ImplyPrecedenceHere doesn't seem to work for this rule, but postfix has such a high priority shift will nearly always be the correct action
             PostfixOp.Rule = PreferShiftHere() + percentop;
             MarkTransient(PostfixOp);
@@ -358,7 +351,7 @@
                 | Reference + intersectop + Reference
                 | OpenParen + Union + CloseParen
                 | RefFunctionName + Arguments + CloseParen
-                | Reference + hash;
+                | Reference + hash
                 ;

             RefFunctionName.Rule = ExcelRefFunctionToken | ExcelConditionalRefFunctionToken;
@@ -410,8 +403,6 @@
                   OpenSquareParen + SRColumnToken + CloseSquareParen
                 | OpenSquareParen + NameToken + CloseSquareParen
                 | FileNameEnclosedInBracketsToken;
-
-            //StructuredReferenceKeyword.Rule = EnclosedInBracketsToken;

             StructuredReferenceTable.Rule = NameToken;


fix type mistake

fix type mistake

--- src/YifySharp/Models/UserDetails.cs
+++ src/YifySharp/Models/UserDetails.cs
@@ -42,7 +42,7 @@
         /// <summary>
         /// The date the user registered
         /// </summary>
-        public string DateJoined { get; set; }
+        public DateTime DateJoined { get; set; }

         /// <summary>
         /// The date the user registered, in epoch format


[Modify] Replace it

[Modify] Replace it

--- websocket-sharp/HttpBase.cs
+++ websocket-sharp/HttpBase.cs
@@ -40,6 +40,7 @@
   {
     #region Private Fields

+    private string              _entityBody;
     private byte[]              _entityBodyData;
     private NameValueCollection _headers;
     private static readonly int _headersMaxLength;
@@ -92,16 +93,10 @@

     public string EntityBody {
       get {
-        if (_entityBodyData == null || _entityBodyData.LongLength == 0)
-          return String.Empty;
-
-        var contentType = _headers["Content-Type"];
-
-        var enc = contentType != null && contentType.Length > 0
-                  ? HttpUtility.GetEncoding (contentType)
-                  : Encoding.UTF8;
-
-        return enc.GetString (_entityBodyData);
+        if (_entityBody == null)
+          _entityBody = getEntityBody ();
+
+        return _entityBody;
       }
     }


Ack timeout *stab*. We never cleared the old agents properly. This adds the crucial check for them.

--- OpenSim/Services/MessagingService/MessagingModules/AgentProcessing/AgentProcessing.cs
+++ OpenSim/Services/MessagingService/MessagingModules/AgentProcessing/AgentProcessing.cs
@@ -133,6 +133,7 @@
                 eventQueue.DisableSimulator (regionCaps.AgentID, regionCaps.RegionHandle);
                 //regionCaps.Close();
                 //clientCaps.RemoveCAPS(requestingRegion);
+                regionCaps.Disabled = true;
             }
             else if (message["Method"] == "ArrivedAtDestination")
             {


ApplicationSummaryDto mods

ApplicationSummaryDto mods

--- PS.Mothership.Core/PS.Mothership.Core.Common/Dto/Application/OpportunitySummaryDto.cs
+++ PS.Mothership.Core/PS.Mothership.Core.Common/Dto/Application/OpportunitySummaryDto.cs
@@ -17,10 +17,10 @@
         public double Debit { get; set; }

         [DataMember]
-        public string Description { get; set; }
+        public string TypeOfTransaction { get; set; }

         [DataMember]
-        public string Reference { get; set; }
+        public string ProductType { get; set; }

         [DataMember]
         public GenOpportunityStatusEnum OpportunityStatusKey { get; set; }


improved database interceptor

improved database interceptor

--- Source/nHydrate.Generator.EFCodeFirst/Generators/Contexts/ContextGeneratedTemplate.cs
+++ Source/nHydrate.Generator.EFCodeFirst/Generators/Contexts/ContextGeneratedTemplate.cs
@@ -346,6 +346,9 @@
             sb.AppendLine("		partial void OnAfterSaveChanges();");
             sb.AppendLine();

+            sb.AppendLine("		private static List<Tuple<string, string>> _tableMappings = new List<Tuple<string, string>>();");
+            sb.AppendLine("		protected internal static List<Tuple<string, string>> _TableMappings => _tableMappings;");
+
             #region OnModelCreating

             sb.AppendLine("		/// <summary>");
@@ -405,7 +408,7 @@

             #endregion

-            #region Rename Tables
+            #region Map Tables
             sb.AppendLine("			#region Map Tables");
             foreach (var table in _model.Database.Tables.Where(x => x.Generated && !x.AssociativeTable && (x.TypedTable != Models.TypedTableConstants.EnumOnly)).OrderBy(x => x.Name))
             {
@@ -423,6 +426,16 @@
                 {
                     sb.AppendLine("			modelBuilder.Entity<" + this.GetLocalNamespace() + ".Entity." + table.PascalName + ">().ToTable(\"" + table.DatabaseName + "\", \"" + schema + "\");");
                 }
+            }
+            sb.AppendLine("			#endregion");
+            sb.AppendLine();
+            #endregion
+
+            #region Load Mapper
+            sb.AppendLine("			#region Load Mapper");
+            foreach (var table in _model.Database.Tables.Where(x => x.Generated && !x.AssociativeTable && (x.TypedTable != Models.TypedTableConstants.EnumOnly)).OrderBy(x => x.Name))
+            {
+                sb.AppendLine("			_tableMappings.Add(new Tuple<string, string>(\"" + table.GetSQLSchema() + "\", \"" + table.DatabaseName + "\"));");
             }
             sb.AppendLine("			#endregion");
             sb.AppendLine();
@@ -1654,24 +1667,42 @@
             sb.AppendLine();

             sb.AppendLine("	#region DbInterceptor");
-            sb.AppendLine("	internal class DbInterceptor : System.Data.Entity.Infrastructure.Interception.IDbCommandInterceptor");
+            sb.AppendLine("	public partial class DbInterceptor : System.Data.Entity.Infrastructure.Interception.IDbCommandInterceptor");
             sb.AppendLine("	{");
+
+            sb.AppendLine("		/// <summary />");
+            sb.AppendLine("		partial void OnNonQueryExecuting(System.Data.Common.DbCommand command, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext<int> interceptionContext);");
+            sb.AppendLine("		/// <summary />");
+            sb.AppendLine("		partial void OnNonQueryExecuted(System.Data.Common.DbCommand command, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext<int> interceptionContext);");
+            sb.AppendLine("		/// <summary />");
+            sb.AppendLine("		partial void OnReaderExecuting(System.Data.Common.DbCommand command, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext<System.Data.Common.DbDataReader> interceptionContext);");
+            sb.AppendLine("		/// <summary />");
+            sb.AppendLine("		partial void OnReaderExecuted(System.Data.Common.DbCommand command, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext<System.Data.Common.DbDataReader> interceptionContext);");
+            sb.AppendLine("		/// <summary />");
+            sb.AppendLine("		partial void OnScalarExecuting(System.Data.Common.DbCommand command, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext<object> interceptionContext);");
+            sb.AppendLine("		/// <summary />");
+            sb.AppendLine("		partial void OnScalarExecuted(System.Data.Common.DbCommand command, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext<object> interceptionContext);");
+
             sb.AppendLine("		#region IDbCommandInterceptor Members");
             sb.AppendLine();
             sb.AppendLine("		void System.Data.Entity.Infrastructure.Interception.IDbCommandInterceptor.NonQueryExecuted(System.Data.Common.DbCommand command, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext<int> interceptionContext)");
             sb.AppendLine("		{");
+            sb.AppendLine("			this.OnNonQueryExecuted(command, interceptionContext);");
             sb.AppendLine("		}");
             sb.AppendLine();
             sb.AppendLine("		void System.Data.Entity.Infrastructure.Interception.IDbCommandInterceptor.NonQueryExecuting(System.Data.Common.DbCommand command, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext<int> interceptionContext)");
             sb.AppendLine("		{");
+            sb.AppendLine("			this.OnNonQueryExecuting(command, interceptionContext);");
             sb.AppendLine("		}");
             sb.AppendLine();
             sb.AppendLine("		void System.Data.Entity.Infrastructure.Interception.IDbCommandInterceptor.ReaderExecuted(System.Data.Common.DbCommand command, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext<System.Data.Common.DbDataReader> interceptionContext)");
             sb.AppendLine("		{");
+            sb.AppendLine("			this.OnReaderExecuted(command, interceptionContext);");
             sb.AppendLine("		}");
             sb.AppendLine();
             sb.AppendLine("		void System.Data.Entity.Infrastructure.Interception.IDbCommandInterceptor.ReaderExecuting(System.Data.Common.DbCommand command, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext<System.Data.Common.DbDataReader> interceptionContext)");
             sb.AppendLine("		{");
+            sb.AppendLine("			this.OnReaderExecuting(command, interceptionContext);");
             sb.AppendLine("			try");
             sb.AppendLine("			{");
             sb.AppendLine("				//If this is a tenant table then rig query plan for this specific tenant");
@@ -1691,10 +1722,12 @@
             sb.AppendLine();
             sb.AppendLine("		void System.Data.Entity.Infrastructure.Interception.IDbCommandInterceptor.ScalarExecuted(System.Data.Common.DbCommand command, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext<object> interceptionContext)");
             sb.AppendLine("		{");
+            sb.AppendLine("			this.OnScalarExecuted(command, interceptionContext);");
             sb.AppendLine("		}");
             sb.AppendLine();
             sb.AppendLine("		void System.Data.Entity.Infrastructure.Interception.IDbCommandInterceptor.ScalarExecuting(System.Data.Common.DbCommand command, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext<object> interceptionContext)");
             sb.AppendLine("		{");
+            sb.AppendLine("			this.OnScalarExecuting(command, interceptionContext);");
             sb.AppendLine("		}");
             sb.AppendLine();
             sb.AppendLine("		#endregion");


made budgetpayment available only to purchaser

--- Sources/EPiServer.Reference.Commerce.Site/Features/Payment/Services/PaymentService.cs
+++ Sources/EPiServer.Reference.Commerce.Site/Features/Payment/Services/PaymentService.cs
@@ -4,12 +4,21 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using EPiServer.Reference.Commerce.Site.B2B;
+using EPiServer.Reference.Commerce.Site.B2B.Enums;
+using EPiServer.Reference.Commerce.Site.B2B.ServiceContracts;

 namespace EPiServer.Reference.Commerce.Site.Features.Payment.Services
 {
     [ServiceConfiguration(typeof(IPaymentService), Lifecycle = ServiceInstanceScope.Singleton)]
     public class PaymentService : IPaymentService
     {
+        private readonly ICustomerService _customerService;
+        public PaymentService(ICustomerService customerService)
+        {
+            _customerService = customerService;
+        }
+
         public IEnumerable<PaymentMethodModel> GetPaymentMethodsByMarketIdAndLanguageCode(string marketId, string languageCode)
         {
             var methods = PaymentManager.GetPaymentMethodsByMarket(marketId)
@@ -25,7 +34,12 @@
                     LanguageId = x.LanguageId
                 });

-            return methods;
+            var currentContact = _customerService.GetCurrentContact();
+            if (currentContact != null && currentContact.Role == B2BUserRoles.Purchaser)
+            {
+                return methods;
+            }
+            return methods.Where(payment => !payment.SystemName.Equals(Constants.Order.BudgetPayment));
         }
     }
 }


Minor socket update.

Minor socket update.

DLL rebuilt and updated.
(Serialization, Http, Utility, Rest, Security)

--- csharp/Server/Revenj.Http/HttpSocketServer.cs
+++ csharp/Server/Revenj.Http/HttpSocketServer.cs
@@ -62,25 +62,19 @@
 			if (endpoints.Count == 0)
 			{
 				Console.WriteLine("Http address not found in config. Starting IPv6 on all interfaces");
-				Socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);
-				//Socket.SetSocketOption(SocketOptionLevel.IPv6, (SocketOptionName)27, 0);
 				endpoints.Add(new IPEndPoint(IPAddress.IPv6Any, 8999));
 			}
-			else if (endpoints.FindAll(it => it.AddressFamily == AddressFamily.InterNetworkV6).Count == endpoints.Count)
-			{
-				Socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);
-				//Socket.SetSocketOption(SocketOptionLevel.IPv6, (SocketOptionName)27, 0);
-			}
 			else if (endpoints.FindAll(it => it.AddressFamily == AddressFamily.InterNetwork).Count == endpoints.Count)
 			{
-				Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-				//Socket.SetSocketOption(SocketOptionLevel.IPv6, (SocketOptionName)27, 0);
-			}
-			else
+				networkType = AddressFamily.InterNetwork;
+			}
+			else if (endpoints.FindAll(it => it.AddressFamily == AddressFamily.InterNetworkV6).Count != endpoints.Count)
 			{
 				throw new ConfigurationErrorsException(@"Unable to setup configuration for both IPv4 and IPv6. Use either only IPv4 or IPv6.
 Please check settings: " + string.Join(", ", endpoints));
 			}
+			Socket = new Socket(networkType, SocketType.Stream, ProtocolType.Tcp);
+			//Socket.SetSocketOption(SocketOptionLevel.IPv6, (SocketOptionName)27, 0);
 			foreach (var ep in endpoints)
 			{
 				Socket.Bind(ep);
@@ -122,7 +116,7 @@
 						if (socket.Connected)
 							ThreadPool.QueueUserWorkItem(ProcessSocketThread, socket);
 					}
-					catch (HttpListenerException ex)
+					catch (SocketException ex)
 					{
 						Console.WriteLine(ex.ToString());
 						TraceSource.TraceEvent(TraceEventType.Error, 5401, "{0}", ex);


(#379) Added WinUI support by removing MAUI dependency (#380)

--- sdk/dotnet/src/Microsoft.Datasync.Client/Platforms/net6-windows/ApplicationStorage.cs
+++ sdk/dotnet/src/Microsoft.Datasync.Client/Platforms/net6-windows/ApplicationStorage.cs
@@ -2,37 +2,39 @@
 // Licensed under the MIT License.

 using Microsoft.Datasync.Client.Utils;
-using Microsoft.Maui.Storage;
-using System.Runtime.Versioning;
+using Windows.Foundation.Collections;
+using Windows.Storage;

 namespace Microsoft.Datasync.Client.Platforms
 {
     /// <summary>
-    /// Implementation of the <see cref="IApplicationStorage"/> interface for
-    /// Android devices.
+    /// An implementation of the <see cref="IApplicationStorage"/> interface for
+    /// UWP/UAP/Windows Storage platform.
     /// </summary>
     internal class ApplicationStorage : IApplicationStorage
     {
+        internal ApplicationStorage(string containerName = "")
+        {
+            SharedContainerName = string.IsNullOrWhiteSpace(containerName) ? "ms-datasync-client" : containerName;
+            Preferences = ApplicationData.Current.LocalSettings.CreateContainer(SharedContainerName, ApplicationDataCreateDisposition.Always).Values;
+        }
+
         /// <summary>
-        /// The storage prefix.
+        /// The name of the shared container for preferences.
         /// </summary>
         private string SharedContainerName { get; }

         /// <summary>
-        /// Creates a new <see cref="ApplicationStorage"/> instance.
+        /// The set of properties for the preference storage.
         /// </summary>
-        /// <param name="containerName">The optional storage prefix.</param>
-        internal ApplicationStorage(string containerName = "")
-        {
-            SharedContainerName = string.IsNullOrWhiteSpace(containerName) ? "ms-datasync-client" : containerName;
-        }
+        private IPropertySet Preferences { get; }

         /// <summary>
         /// Clear all the values within the store.
         /// </summary>
         public void ClearValues()
         {
-            Preferences.Clear(SharedContainerName);
+            Preferences.Clear();
         }

         /// <summary>
@@ -41,7 +43,7 @@
         /// <param name="key">The key</param>
         public void RemoveValue(string key)
         {
-            if (Preferences.ContainsKey(key, SharedContainerName))
+            if (Preferences.ContainsKey(key))
             {
                 Preferences.Remove(key);
             }
@@ -55,7 +57,7 @@
         /// <param name="value">The value to store</param>
         public void SetValue(string key, string value)
         {
-            Preferences.Set(key, value, SharedContainerName);
+            Preferences[key] = value;
         }

         /// <summary>
@@ -66,11 +68,12 @@
         /// <returns>True if the key was found</returns>
         public bool TryGetValue(string key, out string value)
         {
-            if (Preferences.ContainsKey(key, SharedContainerName))
+            if (Preferences.TryGetValue(key, out object prefValue))
             {
-                value = Preferences.Get(key, null, SharedContainerName);
+                value = prefValue.ToString();
                 return value != null;
             }
+
             value = null;
             return false;
         }


Fixed bug with async background task registration

--- src/Cofoundry.Core/BackgroundTasks/Bootstrap/BackgroundTasksDependencyRegistration.cs
+++ src/Cofoundry.Core/BackgroundTasks/Bootstrap/BackgroundTasksDependencyRegistration.cs
@@ -12,6 +12,7 @@
         public void Register(IContainerRegister container)
         {
             container.RegisterAll<IRecurringBackgroundTask>();
+            container.RegisterAll<IAsyncRecurringBackgroundTask>();
             container.RegisterAll<IBackgroundTaskRegistration>();
         }
     }