U4-2467 v4.11.1: Membership search does not search on email address anymore

--- src/Umbraco.Web/umbraco.presentation/umbraco/members/MemberSearch.ascx.cs
+++ src/Umbraco.Web/umbraco.presentation/umbraco/members/MemberSearch.ascx.cs
@@ -1,16 +1,15 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Web;
 using System.Web.UI;
-using System.Web.UI.WebControls;
 using Examine.LuceneEngine.SearchCriteria;
+using Examine.SearchCriteria;
 using umbraco.cms.businesslogic.member;
 using System.Web.Security;

 namespace umbraco.presentation.umbraco.members
 {
-    public partial class MemberSearch : System.Web.UI.UserControl
+    public partial class MemberSearch : UserControl
     {
         protected void Page_Load(object sender, EventArgs e)
         {
@@ -19,46 +18,30 @@
                 ButtonSearch.Text = ui.Text("search");
         }

-        protected void ButtonSearch_Click(object sender, System.EventArgs e)
+        protected void ButtonSearch_Click(object sender, EventArgs e)
         {
             resultsPane.Visible = true;

-            if (!Member.InUmbracoMemberMode())
+            if (Member.InUmbracoMemberMode())
             {
-
-                IEnumerable<MemberSearchResult> results;
-                if (searchQuery.Text.Contains("@"))
-                {
-                    results = from MembershipUser x in Membership.FindUsersByEmail(searchQuery.Text)
-                              select new MemberSearchResult() { Id = x.UserName, Email = x.Email, LoginName = x.UserName, Name = x.UserName };
-                }
-                else
-                {
-                    results = from MembershipUser x in Membership.FindUsersByName(searchQuery.Text + "%")
-                              select new MemberSearchResult() { Id = x.UserName, Email = x.Email, LoginName = x.UserName, Name = x.UserName };
-                }
-
-                rp_members.DataSource = results;
-                rp_members.DataBind();
-            }
-            else
-            {
-
-                string query = searchQuery.Text.ToLower();
+                var query = searchQuery.Text.ToLower();
                 var internalSearcher = UmbracoContext.Current.InternalMemberSearchProvider;

-                IEnumerable<MemberSearchResult> results;
-                if (!String.IsNullOrEmpty(query))
+                if (String.IsNullOrEmpty(query) == false)
                 {
-                    var criteria = internalSearcher.CreateSearchCriteria("member", Examine.SearchCriteria.BooleanOperation.And);
-                    var operation = criteria.Field("__nodeName", query.MultipleCharacterWildcard());
-                    results = internalSearcher.Search(operation.Compile()).Select(x => new MemberSearchResult()
-                    {
-                        Id = x["id"],
-                        Name = x["nodeName"],
-                        Email = x["email"],
-                        LoginName = x["loginName"]
-                    });
+                    var criteria = internalSearcher.CreateSearchCriteria("member", BooleanOperation.Or);
+                    var fields = new[] {"id", "__nodeName", "email"};
+                    var term = new[] {query.ToLower().Escape()};
+                    var operation = criteria.GroupedOr(fields, term).Compile();
+
+                    var results = internalSearcher.Search(operation)
+                        .Select(x => new MemberSearchResult
+                                     {
+                                         Id = x["id"],
+                                         Name = x["nodeName"],
+                                         Email = x["email"],
+                                         LoginName = x["loginName"]
+                                     });
                     rp_members.DataSource = results;
                     rp_members.DataBind();
                 }
@@ -67,7 +50,39 @@
                     resultsPane.Visible = false;
                 }
             }
+            else
+            {
+                IEnumerable<MemberSearchResult> results;
+                if (searchQuery.Text.Contains("@"))
+                {
+                    results = from MembershipUser x in Membership.FindUsersByEmail(searchQuery.Text)
+                        select
+                            new MemberSearchResult()
+                            {
+                                Id = x.UserName,
+                                Email = x.Email,
+                                LoginName = x.UserName,
+                                Name = x.UserName
+                            };
+                }
+                else
+                {
+                    results = from MembershipUser x in Membership.FindUsersByName(searchQuery.Text + "%")
+                        select
+                            new MemberSearchResult()
+                            {
+                                Id = x.UserName,
+                                Email = x.Email,
+                                LoginName = x.UserName,
+                                Name = x.UserName
+                            };
+                }
+
+                rp_members.DataSource = results;
+                rp_members.DataBind();
+            }
         }
+
         public class MemberSearchResult
         {
             public string Id { get; set; }


Replaced Where(predicate).SingleOrDefault() chain with SingleOrDefault(predicate) on helper class IEnumerableOfIMethodSymbolExtensions.

--- src/Utilities/Compiler/Extensions/IEnumerableOfIMethodSymbolExtensions.cs
+++ src/Utilities/Compiler/Extensions/IEnumerableOfIMethodSymbolExtensions.cs
@@ -102,7 +102,7 @@
         public static IMethodSymbol GetSingleOrDefaultMemberWithParameterInfos(this IEnumerable<IMethodSymbol> members, params ParameterInfo[] expectedParameterTypesInOrder)
         {
             var expectedParameterCount = expectedParameterTypesInOrder.Count();
-            return members?.Where(member =>
+            return members?.SingleOrDefault(member =>
             {
                 if (member.Parameters.Count() != expectedParameterCount)
                 {
@@ -137,7 +137,7 @@
                 }

                 return true;
-            }).SingleOrDefault();
+            });
         }
     }


Code review feedback on deferring metadata reloads

1. Assert threading expectations
2. Document new variable's purpose
3. Clean up pending reloads on `Disconnect()`

--- src/VisualStudio/Core/Def/Implementation/ProjectSystem/AbstractProject.cs
+++ src/VisualStudio/Core/Def/Implementation/ProjectSystem/AbstractProject.cs
@@ -12,6 +12,7 @@
 using Microsoft.CodeAnalysis;
 using Microsoft.CodeAnalysis.Diagnostics;
 using Microsoft.CodeAnalysis.Editor.Shared.Options;
+using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
 using Microsoft.CodeAnalysis.ErrorReporting;
 using Microsoft.CodeAnalysis.Host;
 using Microsoft.CodeAnalysis.Notification;
@@ -28,7 +29,7 @@

 namespace Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem
 {
-    internal abstract partial class AbstractProject : IVisualStudioHostProject
+    internal abstract partial class AbstractProject : ForegroundThreadAffinitizedObject, IVisualStudioHostProject
     {
         internal static object RuleSetErrorId = new object();

@@ -111,6 +112,15 @@
             defaultSeverity: DiagnosticSeverity.Error,
             isEnabledByDefault: true);

+        /// <summary>
+        /// When a reference changes on disk we start a delayed task to update the <see cref="Workspace"/>.
+        /// It is delayed for two reasons: first, there are often a bunch of change notifications in quick succession
+        /// as the file is written.  Second, we often get the first notification while something is still writing the
+        /// file, so we're unable to actually load it.  To avoid both of these issues, we wait five seconds before
+        /// reloading the metadata.  This <see cref="Dictionary{TKey, TValue}"/> holds on to
+        /// <see cref="CancellationTokenSource"/>s that allow us to cancel the existing reload task if another file
+        /// change comes in before we process it.
+        /// </summary>
         private readonly Dictionary<VisualStudioMetadataReference, CancellationTokenSource> _changedReferencesPendingUpdate
             = new Dictionary<VisualStudioMetadataReference, CancellationTokenSource>();

@@ -590,6 +600,8 @@
         /// </summary>
         private void OnImportChanged(object sender, EventArgs e)
         {
+            AssertIsForeground();
+
             VisualStudioMetadataReference reference = (VisualStudioMetadataReference)sender;

             CancellationTokenSource delayTaskCancellationTokenSource;
@@ -612,6 +624,8 @@

         private void OnImportChangedAfterDelay(Task previous, object state)
         {
+            AssertIsForeground();
+
             var reference = (VisualStudioMetadataReference)state;
             _changedReferencesPendingUpdate.Remove(reference);
             // Ensure that we are still referencing this binary
@@ -930,8 +944,18 @@

         public virtual void Disconnect()
         {
+            AssertIsForeground();
+
             using (_visualStudioWorkspaceOpt?.Services.GetService<IGlobalOperationNotificationService>()?.Start("Disconnect Project"))
             {
+                // No sense in reloading any metadata references anymore.
+                foreach (var cancellationTokenSource in _changedReferencesPendingUpdate.Values)
+                {
+                    cancellationTokenSource.Cancel();
+                }
+
+                _changedReferencesPendingUpdate.Clear();
+
                 // Unsubscribe IVsHierarchyEvents
                 DisconnectHierarchyEvents();


This is a fix for #15 that should resolve#15

--- TfvcBranchPolicy.CheckinPolicy/TfvcBranchPolicy.cs
+++ TfvcBranchPolicy.CheckinPolicy/TfvcBranchPolicy.cs
@@ -152,7 +152,7 @@
                     List<BranchPolicyFailure> branchPolicyFailures = new List<BranchPolicyFailure>();
                     foreach (BranchPattern bp in matchingBranchPatterns)
                     {
-                     branchPolicyFailures  = bp.EvaluatePendingCheckin(_pendingCheckin );
+                     branchPolicyFailures.AddRange( bp.EvaluatePendingCheckin(_pendingCheckin ));
                     }
                     policyFailures = (from bpf in branchPolicyFailures select new PolicyFailure(bpf.Message, this)).ToList();
                 }


so close yet so far.

so close yet so far.

--- SalesforceReportsConnector/QVX/QvxSalesforceReportsConnection.cs
+++ SalesforceReportsConnector/QVX/QvxSalesforceReportsConnection.cs
@@ -49,10 +49,15 @@

 			tables.AddRange(tableDictionary.Select(table =>
 			{
-				QvxTable.GetRowsHandler handler = () => GetData(table.Value);
+				QvxField[] fields = GetFields(table.Key);
+				QvxTable.GetRowsHandler handler = () =>
+				{
+					TempLogger.Log("lets go handler.");
+					return GetData(fields, table.Key);
+				};
 				return new QvxTable()
 				{
-					TableName = table.Value, Fields = GetFields(table.Key), GetRows = handler
+					TableName = table.Value, Fields = fields, GetRows = handler
 				};
 			}));

@@ -63,44 +68,91 @@
 		{
 			return new QvxField[]
 			{
-				new QvxField("Title", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
-				new QvxField("Message", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII)
+				new QvxField("Title" + tableID, QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
+				new QvxField("Message" + tableID, QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII)
 			};
 		}

-		private IEnumerable<QvxDataRow> GetData(string tableName)
+		private IEnumerable<QvxDataRow> GetData(QvxField[] fields, string tableKey)
 		{
+			TempLogger.Log("Ready to get some data for: " + tableKey);
+
 			for (int i = 0; i < 20; i++)
 			{
 				var row = new QvxDataRow();
-				var table = FindTable(tableName, this.MTables);
-				row[table.Fields[0]] = "SomeTitle " + i;
-				row[table.Fields[1]] = i + " - This is my message. - " + i;
+				//var table = FindTable(tableKey, this.MTables);
+				row[fields[0]] = "SomeTitle " + i;
+				row[fields[1]] = i + " - This is my message. - " + i;
 				yield return row;
 			}
 		}

 		public override QvxDataTable ExtractQuery(string query, List<QvxTable> qvxTables)
 		{
+			QvxDataTable returnTable = null;
+
 			IList<ParseError> errors = null;
 			var parser = new TSql100Parser(true);
 			TextReader reader = new StringReader(query);
 			TSqlScript script = parser.Parse(reader, out errors) as TSqlScript;

 			IList<TSqlParserToken> tokens = script.Batches[0].Statements[0].ScriptTokenStream;
+
+			// get record folder
 			TSqlParserToken fromToken = tokens.First(t => t.TokenType == TSqlTokenType.From);
 			int indexOfFromToken = tokens.IndexOf(fromToken);
 			IEnumerable<TSqlParserToken> tableTokens = tokens.Skip(indexOfFromToken);
-			var identifier = tableTokens.First(t => t.TokenType == TSqlTokenType.Identifier || t.TokenType == TSqlTokenType.AsciiStringOrQuotedIdentifier);
+			TSqlParserToken identifier = tableTokens.First(t => t.TokenType == TSqlTokenType.Identifier || t.TokenType == TSqlTokenType.AsciiStringOrQuotedIdentifier);
 			string folderName = identifier.Text;
 			if (identifier.TokenType == TSqlTokenType.AsciiStringOrQuotedIdentifier)
 			{
 				folderName = folderName.Substring(1, folderName.Length - 2);
 			}
-			TempLogger.Log("table name: " + folderName);
+			TempLogger.Log("folder name: " + folderName);

-			this.MParameters.Add("folder_name", folderName);
-			this.Init();
+			// get report name
+			tableTokens = tokens.Skip(tokens.IndexOf(identifier));
+			TSqlParserToken reportSeparator = tableTokens.First(t => t.TokenType == TSqlTokenType.Dot);
+			tableTokens = tokens.Skip(tokens.IndexOf(reportSeparator));
+			TSqlParserToken reportNameToken = tableTokens.First(t => t.TokenType == TSqlTokenType.Identifier || t.TokenType == TSqlTokenType.AsciiStringOrQuotedIdentifier);
+			string reportName = reportNameToken.Text;
+			TempLogger.Log("report name: " + reportName);
+
+			if (reportNameToken.TokenType == TSqlTokenType.AsciiStringOrQuotedIdentifier)
+			{
+				reportName = reportName.Substring(1, reportName.Length - 2);
+			}
+			TempLogger.Log("report name: " + reportName);
+
+			if (this.MParameters.ContainsKey("folder_name"))
+			{
+				if (folderName == this.MParameters["folder_name"] && this.MTables == null)
+				{
+					this.Init();
+				}
+				else if (folderName != this.MParameters["folder_name"])
+				{
+					this.MParameters["folder_name"] = folderName;
+					this.Init();
+				}
+			}
+			else
+			{
+				this.MParameters.Add("folder_name", folderName);
+				this.Init();
+			}
+
+			try
+			{
+				var newTable = this.FindTable(reportName, this.MTables);
+				TempLogger.Log("Got a report." + this.MTables.Count);
+				TempLogger.Log(newTable.TableName);
+				returnTable = new QvxDataTable(this.FindTable(reportName, this.MTables));
+			}
+			catch (Exception e)
+			{
+				TempLogger.Log("Exception: " + e.Message);
+			}

 			/* Make sure to remove your quotesuffix, quoteprefix,
@@ -115,9 +167,7 @@

 			TempLogger.Log("------------------\ndone with query");

-			query = Regex.Replace(query, "\\\"", "");
-
-			return base.ExtractQuery(query, this.MTables);
+			return returnTable;
 		}
 	}
 }


modify

modify

--- Samples/netcore3.0-mvc/Senparc.Weixin.Sample.NetCore3/Startup.cs
+++ Samples/netcore3.0-mvc/Senparc.Weixin.Sample.NetCore3/Startup.cs
@@ -351,7 +351,7 @@
                        #endregion
                    });

-            //ʹùںŵ MessageHandler м                                                 -- DPBMARK MP
+            //ʹùںŵ MessageHandler мҪ Controller                       -- DPBMARK MP
             app.UseMessageHandler("/WeixinAsync", CustomMessageHandler.GenerateMessageHandler, options =>
             {
                 //첽δṩдʱͬӾ


Omnibox fix

Omnibox fix

--- Signum.Windows.Extensions/Omnibox/DynamicQueryOmniboxProvider.cs
+++ Signum.Windows.Extensions/Omnibox/DynamicQueryOmniboxProvider.cs
@@ -10,6 +10,7 @@
 using System.Windows.Documents;
 using System.Windows.Media;
 using Signum.Entities.Basics;
+using Signum.Entities.UserQueries;

 namespace Signum.Windows.Omnibox
 {
@@ -95,7 +96,7 @@
                 }
                 else if (item.Operation != null)
                 {
-                    lines.Add(new Bold(new Run(DynamicQueryOmniboxResultGenerator.ToStringOperation(item.Operation.Value))));
+                    lines.Add(new Bold(new Run(FilterValueConverter.ToStringOperation(item.Operation.Value))));

                     if (item.Value == DynamicQueryOmniboxResultGenerator.UnknownValue)
                         lines.Add(new Run(OmniboxMessage.Unknown.NiceToString()) { Foreground = Brushes.Red });


removing obsolete utility methods for reading terminals

--- src/SLANG/src/Lexer.cs
+++ src/SLANG/src/Lexer.cs
@@ -79,157 +79,5 @@
             element = default(Element);
             return false;
         }
-
-        /// <summary>
-        ///     Utility method. Reads the next specified character. The comparison is case-sensitive. A return value indicates
-        ///     whether the character was available.
-        /// </summary>
-        /// <param name="scanner"></param>
-        /// <param name="c">The character to read.</param>
-        /// <param name="element">
-        ///     When this method returns, contains the next available element, or a <c>null</c> reference, depending
-        ///     on whether the return value indicates success.
-        /// </param>
-        /// <returns><c>true</c> to indicate success; otherwise, <c>false</c>.</returns>
-        [Obsolete("Obsolete: use class TerminalsLexer instead")]
-        protected static bool TryReadTerminal(ITextScanner scanner, char c, out Element element)
-        {
-            if (scanner == null)
-            {
-                throw new ArgumentNullException("scanner", "Precondition: scanner != null");
-            }
-
-            if (scanner.EndOfInput)
-            {
-                element = default(Element);
-                return false;
-            }
-
-            var context = scanner.GetContext();
-            if (scanner.TryMatch(c))
-            {
-                element = new Element(c, context);
-                return true;
-            }
-
-            element = default(Element);
-            return false;
-        }
-
-        /// <summary>
-        ///     Utility method. Reads the next specified terminal. The comparison is case-sensitive. A return value indicates
-        ///     whether the terminal was available.
-        /// </summary>
-        /// <param name="scanner"></param>
-        /// <param name="s">The characters to read.</param>
-        /// <param name="element">
-        ///     When this method returns, contains the next available element, or a <c>null</c> reference, depending
-        ///     on whether the return value indicates success.
-        /// </param>
-        /// <returns><c>true</c> to indicate success; otherwise, <c>false</c>.</returns>
-        [Obsolete("Obsolete: use class TerminalsLexer instead")]
-        protected static bool TryReadTerminal(ITextScanner scanner, char[] s, out Element element)
-        {
-            if (scanner == null)
-            {
-                throw new ArgumentNullException("scanner", "Precondition: scanner != null");
-            }
-
-            if (s == null)
-            {
-                throw new ArgumentNullException("s", "Precondition: s != null");
-            }
-
-            if (scanner.EndOfInput)
-            {
-                element = default(Element);
-                return false;
-            }
-
-            var context = scanner.GetContext();
-            if (s.Length == 0)
-            {
-                element = new Element(string.Empty, context);
-                return true;
-            }
-
-            for (var i = 0; i < s.Length; i++)
-            {
-                if (scanner.EndOfInput || !scanner.TryMatch(s[i]))
-                {
-                    if (i != 0)
-                    {
-                        for (var j = i - 1; j >= 0; j--)
-                        {
-                            scanner.PutBack(s[j].ToString());
-                        }
-                    }
-
-                    element = default(Element);
-                    return false;
-                }
-            }
-
-            element = new Element(new string(s), context);
-            return true;
-        }
-
-        /// <summary>
-        ///     Utility method. Reads the next specified terminal. The comparison is case-insensitive. A return value
-        ///     indicates whether the terminal was available.
-        /// </summary>
-        /// <param name="scanner"></param>
-        /// <param name="s">The characters to read.</param>
-        /// <param name="element">
-        ///     When this method returns, contains the next available element, or a <c>null</c> reference, depending
-        ///     on whether the return value indicates success.
-        /// </param>
-        /// <returns><c>true</c> to indicate success; otherwise, <c>false</c>.</returns>
-        [Obsolete("Obsolete: use class StringLexer instead")]
-        protected static bool TryReadTerminal(ITextScanner scanner, string s, out Element element)
-        {
-            if (scanner == null)
-            {
-                throw new ArgumentNullException("scanner", "Precondition: scanner != null");
-            }
-
-            if (s == null)
-            {
-                throw new ArgumentNullException("s", "Precondition: s != null");
-            }
-
-            if (scanner.EndOfInput)
-            {
-                element = default(Element);
-                return false;
-            }
-
-            var context = scanner.GetContext();
-            var buffer = new char[s.Length];
-            for (var i = 0; i < s.Length; i++)
-            {
-                var c = s[i];
-                if (!scanner.EndOfInput && scanner.TryMatchIgnoreCase(c, out c))
-                {
-                    buffer[i] = c;
-                }
-                else
-                {
-                    if (i != 0)
-                    {
-                        for (var j = i - 1; j >= 0; j--)
-                        {
-                            scanner.PutBack(buffer[j]);
-                        }
-                    }
-
-                    element = default(Element);
-                    return false;
-                }
-            }
-
-            element = new Element(new string(buffer), context);
-            return true;
-        }
     }
 }


Added license info

Added license info

--- SimplePersistence/SimplePersistence.Model.Security/IClaimType.cs
+++ SimplePersistence/SimplePersistence.Model.Security/IClaimType.cs
@@ -1,11 +1,17 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
+#region License
+// The MIT License (MIT)
+// Copyright (c) 2015 João Simões
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#endregion
 namespace SimplePersistence.Model.Security
 {
     public interface IClaimType : IEntity<string>
     {
+
     }
 }


Update Program.cs

Update Program.cs

--- src/SvgDemo/Program.cs
+++ src/SvgDemo/Program.cs
@@ -1,20 +1,21 @@
 using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
 using Svg;

 namespace SvgDemo
 {
     class SvgDebug
     {
+        internal static ConsoleColor ErrorColor = ConsoleColor.Red;
+        internal static ConsoleColor ElementColor = ConsoleColor.Blue;
+        internal static ConsoleColor GroupColor = ConsoleColor.Gray;
+        internal static ConsoleColor AttributeColor = ConsoleColor.DarkRed;
+
         internal static void ResetColor()
         {
             Console.ResetColor();
         }

-        internal static void WriteLine(string value, ConsoleColor color = ConsoleColor.DarkGray)
+        internal static void WriteLine(string value, ConsoleColor color)
         {
             Console.ForegroundColor = color;
             Console.WriteLine(value);
@@ -26,32 +27,32 @@
             {
                 case SvgColourServer colourServer:
                     {
-                        WriteLine($"{indent}{indentAttribute}[{attribute}]={colourServer.ToString()}", ConsoleColor.DarkGray);
+                        WriteLine($"{indent}{indentAttribute}[{attribute}]={colourServer.ToString()}", AttributeColor);
                     }
                     break;
                 case SvgDeferredPaintServer deferredPaintServer:
                     {
-                        WriteLine($"{indent}{indentAttribute}[{attribute}]={deferredPaintServer.GetType()}", ConsoleColor.DarkGray);
+                        WriteLine($"{indent}{indentAttribute}[{attribute}]={deferredPaintServer.GetType()}", AttributeColor);
                     }
                     break;
                 case SvgFallbackPaintServer fallbackPaintServer:
                     {
-                        WriteLine($"{indent}{indentAttribute}[{attribute}]={fallbackPaintServer.GetType()}", ConsoleColor.DarkGray);
+                        WriteLine($"{indent}{indentAttribute}[{attribute}]={fallbackPaintServer.GetType()}", AttributeColor);
                     }
                     break;
                 case SvgGradientServer gradientServer:
                     {
-                        WriteLine($"{indent}{indentAttribute}[{attribute}]={gradientServer.GetType()}", ConsoleColor.DarkGray);
+                        WriteLine($"{indent}{indentAttribute}[{attribute}]={gradientServer.GetType()}", AttributeColor);
                     }
                     break;
                 case SvgPatternServer patternServer:
                     {
-                        WriteLine($"{indent}{indentAttribute}[{attribute}]={patternServer.GetType()}", ConsoleColor.DarkGray);
+                        WriteLine($"{indent}{indentAttribute}[{attribute}]={patternServer.GetType()}", AttributeColor);
                     }
                     break;
                 default:
                     {
-                        WriteLine($"{indent}{indentAttribute}[{attribute}]={paintServer.GetType()}", ConsoleColor.DarkGray);
+                        WriteLine($"{indent}{indentAttribute}[{attribute}]={paintServer.GetType()}", AttributeColor);
                     }
                     break;
             }
@@ -63,12 +64,12 @@

             if (element.Transforms.Count > 0)
             {
-                WriteLine($"{indent}{indentAttribute}<Transforms>", ConsoleColor.Gray);
-                WriteLine($"{indent}{indentAttribute}[transform]", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}<Transforms>", GroupColor);
+                WriteLine($"{indent}{indentAttribute}[transform]", AttributeColor);

                 foreach (var transform in element.Transforms)
                 {
-                    WriteLine($"{indent}{indentAttribute}{transform}", ConsoleColor.DarkGray);
+                    WriteLine($"{indent}{indentAttribute}{transform}", AttributeColor);
                 }
             }

@@ -76,12 +77,12 @@

             if (!string.IsNullOrEmpty(element.ID))
             {
-                WriteLine($"{indent}{indentAttribute}[id]={element.ID}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[id]={element.ID}", AttributeColor);
             }

             if (element.SpaceHandling != XmlSpaceHandling.@default && element.SpaceHandling != XmlSpaceHandling.inherit)
             {
-                WriteLine($"{indent}{indentAttribute}[space]={element.SpaceHandling}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[space]={element.SpaceHandling}", AttributeColor);
             }

             if (element.Color != null && element.Color != SvgColourServer.NotSet)
@@ -103,47 +104,47 @@

             if (element.FillRule != SvgFillRule.NonZero)
             {
-                WriteLine($"{indent}{indentAttribute}[fill-rule]={element.FillRule}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[fill-rule]={element.FillRule}", AttributeColor);
             }

             if (element.FillOpacity != 1f)
             {
-                WriteLine($"{indent}{indentAttribute}[fill-opacity]={element.FillOpacity}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[fill-opacity]={element.FillOpacity}", AttributeColor);
             }

             if (element.StrokeWidth != 1f)
             {
-                WriteLine($"{indent}{indentAttribute}[stroke-width]={element.StrokeWidth}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[stroke-width]={element.StrokeWidth}", AttributeColor);
             }

             if (element.StrokeLineCap != SvgStrokeLineCap.Butt)
             {
-                WriteLine($"{indent}{indentAttribute}[stroke-linecap]={element.StrokeLineCap}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[stroke-linecap]={element.StrokeLineCap}", AttributeColor);
             }

             if (element.StrokeLineJoin != SvgStrokeLineJoin.Miter)
             {
-                WriteLine($"{indent}{indentAttribute}[stroke-linejoin]={element.StrokeLineJoin}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[stroke-linejoin]={element.StrokeLineJoin}", AttributeColor);
             }

             if (element.StrokeMiterLimit != 4f)
             {
-                WriteLine($"{indent}{indentAttribute}[stroke-miterlimit]={element.StrokeMiterLimit}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[stroke-miterlimit]={element.StrokeMiterLimit}", AttributeColor);
             }

             if (element.StrokeDashArray != null)
             {
-                WriteLine($"{indent}{indentAttribute}[stroke-dasharray]={element.StrokeDashArray}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[stroke-dasharray]={element.StrokeDashArray}", AttributeColor);
             }

             if (element.StrokeDashOffset != SvgUnit.Empty)
             {
-                WriteLine($"{indent}{indentAttribute}[stroke-dashoffset]={element.StrokeDashOffset}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[stroke-dashoffset]={element.StrokeDashOffset}", AttributeColor);
             }

             if (element.StrokeOpacity != 1f)
             {
-                WriteLine($"{indent}{indentAttribute}[stroke-opacity]={element.StrokeOpacity}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[stroke-opacity]={element.StrokeOpacity}", AttributeColor);
             }

             if (element.StopColor != null)
@@ -153,73 +154,73 @@

             if (element.Opacity != 1f)
             {
-                WriteLine($"{indent}{indentAttribute}[opacity]={element.Opacity}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[opacity]={element.Opacity}", AttributeColor);
             }

             if (element.ShapeRendering != SvgShapeRendering.Inherit)
             {
-                WriteLine($"{indent}{indentAttribute}[shape-rendering]={element.ShapeRendering}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[shape-rendering]={element.ShapeRendering}", AttributeColor);
             }

             if (element.TextAnchor != SvgTextAnchor.Inherit)
             {
-                WriteLine($"{indent}{indentAttribute}[text-anchor]={element.TextAnchor}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[text-anchor]={element.TextAnchor}", AttributeColor);
             }

             if (!string.IsNullOrEmpty(element.BaselineShift))
             {
-                WriteLine($"{indent}{indentAttribute}[baseline-shift]={element.BaselineShift}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[baseline-shift]={element.BaselineShift}", AttributeColor);
             }

             if (!string.IsNullOrEmpty(element.FontFamily))
             {
-                WriteLine($"{indent}{indentAttribute}[font-family]={element.FontFamily}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[font-family]={element.FontFamily}", AttributeColor);
             }

             if (element.FontSize != SvgUnit.Empty)
             {
-                WriteLine($"{indent}{indentAttribute}[font-size]={element.FontSize}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[font-size]={element.FontSize}", AttributeColor);
             }

             if (element.FontStyle != SvgFontStyle.All)
             {
-                WriteLine($"{indent}{indentAttribute}[font-style]={element.FontStyle}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[font-style]={element.FontStyle}", AttributeColor);
             }

             if (element.FontVariant != SvgFontVariant.Inherit)
             {
-                WriteLine($"{indent}{indentAttribute}[font-variant]={element.FontVariant}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[font-variant]={element.FontVariant}", AttributeColor);
             }

             if (element.TextDecoration != SvgTextDecoration.Inherit)
             {
-                WriteLine($"{indent}{indentAttribute}[text-decoration]={element.TextDecoration}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[text-decoration]={element.TextDecoration}", AttributeColor);
             }

             if (element.FontWeight != SvgFontWeight.Inherit)
             {
-                WriteLine($"{indent}{indentAttribute}[font-weight]={element.FontWeight}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[font-weight]={element.FontWeight}", AttributeColor);
             }

             if (element.TextTransformation != SvgTextTransformation.Inherit)
             {
-                WriteLine($"{indent}{indentAttribute}[text-transform]={element.TextTransformation}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[text-transform]={element.TextTransformation}", AttributeColor);
             }

             if (!string.IsNullOrEmpty(element.Font))
             {
-                WriteLine($"{indent}{indentAttribute}[font]={element.Font}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[font]={element.Font}", AttributeColor);
             }

             // CustomAttributes

             if (element.CustomAttributes.Count > 0)
             {
-                WriteLine($"{indent}{indentAttribute}<CustomAttributes>", ConsoleColor.Gray);
+                WriteLine($"{indent}{indentAttribute}<CustomAttributes>", GroupColor);

                 foreach (var attribute in element.CustomAttributes)
                 {
-                    WriteLine($"{indent}{indentAttribute}[{attribute.Key}]={attribute.Value}", ConsoleColor.DarkGray);
+                    WriteLine($"{indent}{indentAttribute}[{attribute.Key}]={attribute.Value}", AttributeColor);
                 }
             }
         }
@@ -234,11 +235,11 @@

             if (element.Children.Count > 0)
             {
-                WriteLine($"{indent}<Children>", ConsoleColor.Gray);
+                WriteLine($"{indent}<Children>", GroupColor);

                 foreach (var child in element.Children)
                 {
-                    WriteLine($"{indent}{child}", ConsoleColor.Blue);
+                    WriteLine($"{indent}{child}", ElementColor);
                     PrintElement(child, indent + "    ", indentAttribute);
                 }
             }
@@ -247,11 +248,11 @@

             if (element.Nodes.Count > 0)
             {
-                WriteLine($"{indent}<Nodes>", ConsoleColor.Gray);
+                WriteLine($"{indent}<Nodes>", GroupColor);

                 foreach (var node in element.Nodes)
                 {
-                    WriteLine($"{indent}{node.Content}", ConsoleColor.DarkGray);
+                    WriteLine($"{indent}{node.Content}", AttributeColor);
                 }
             }
         }
@@ -260,33 +261,33 @@
         {
             if (fragment.X != 0f)
             {
-                WriteLine($"{indent}{indentAttribute}[x]={fragment.X}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[x]={fragment.X}", AttributeColor);
             }

             if (fragment.Y != 0f)
             {
-                WriteLine($"{indent}{indentAttribute}[y]={fragment.Y}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[y]={fragment.Y}", AttributeColor);
             }

             if (fragment.Width != new SvgUnit(SvgUnitType.Percentage, 100f))
             {
-                WriteLine($"{indent}{indentAttribute}[width]={fragment.Width}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[width]={fragment.Width}", AttributeColor);
             }

             if (fragment.Height != new SvgUnit(SvgUnitType.Percentage, 100f))
             {
-                WriteLine($"{indent}{indentAttribute}[height]={fragment.Height}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[height]={fragment.Height}", AttributeColor);
             }

             if (fragment.Overflow != SvgOverflow.Inherit && fragment.Overflow != SvgOverflow.Hidden)
             {
-                WriteLine($"{indent}{indentAttribute}[overflow]={fragment.Overflow}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[overflow]={fragment.Overflow}", AttributeColor);
             }

             if (fragment.ViewBox != SvgViewBox.Empty)
             {
                 var viewBox = fragment.ViewBox;
-                WriteLine($"{indent}{indentAttribute}[viewBox]={viewBox.MinX} {viewBox.MinY} {viewBox.Width} {viewBox.Height}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[viewBox]={viewBox.MinX} {viewBox.MinY} {viewBox.Width} {viewBox.Height}", AttributeColor);
             }

             if (fragment.AspectRatio != null)
@@ -296,29 +297,29 @@
                  || fragment.AspectRatio.Slice != @default.Slice
                  || fragment.AspectRatio.Defer != @default.Defer)
                 {
-                    WriteLine($"{indent}{indentAttribute}[preserveAspectRatio]={fragment.AspectRatio}", ConsoleColor.DarkGray);
+                    WriteLine($"{indent}{indentAttribute}[preserveAspectRatio]={fragment.AspectRatio}", AttributeColor);
                 }
             }

             if (fragment.FontSize != SvgUnit.Empty)
             {
-                WriteLine($"{indent}{indentAttribute}[font-size]={fragment.FontSize}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[font-size]={fragment.FontSize}", AttributeColor);
             }

             if (!string.IsNullOrEmpty(fragment.FontFamily))
             {
-                WriteLine($"{indent}{indentAttribute}[font-family]={fragment.FontFamily}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[font-family]={fragment.FontFamily}", AttributeColor);
             }

             if (fragment.SpaceHandling != XmlSpaceHandling.@default && fragment.SpaceHandling != XmlSpaceHandling.inherit)
             {
-                WriteLine($"{indent}{indentAttribute}[space]={fragment.SpaceHandling}", ConsoleColor.DarkGray);
+                WriteLine($"{indent}{indentAttribute}[space]={fragment.SpaceHandling}", AttributeColor);
             }
         }

         internal static void PrintFragment(SvgFragment fragment, string indent = "    ", string indentAttribute = "")
         {
-            WriteLine($"{fragment}", ConsoleColor.Blue);
+            WriteLine($"{fragment}", ElementColor);
             PrintFragmentAttributes(fragment, indent, indentAttribute);
             PrintElement(fragment, indent, indentAttribute);
             ResetColor();
@@ -334,7 +335,7 @@
             for (int i = 0; i < args.Length; i++)
             {
                 string path = args[i];
-                WriteLine($"Path: {path}", ConsoleColor.DarkGray);
+                WriteLine($"Path: {path}", AttributeColor);

                 var document = SvgDocument.Open<SvgDocument>(path, null);
                 document.FlushStyles(true);
@@ -344,8 +345,8 @@

         internal static void Error(Exception ex)
         {
-            WriteLine($"{ex.Message}", ConsoleColor.Red);
-            WriteLine($"{ex.StackTrace}", ConsoleColor.DarkGray);
+            WriteLine($"{ex.Message}", ErrorColor);
+            WriteLine($"{ex.StackTrace}", AttributeColor);
             if (ex.InnerException != null)
             {
                 Error(ex.InnerException);
@@ -360,6 +361,7 @@
             try
             {
                 SvgDebug.Run(args);
+                Console.ReadKey();
             }
             catch (Exception ex)
             {


Add unit test

Add unit test

--- UnitTestUsefullFunctions/UnitTestFunctionCrypto.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionCrypto.cs
@@ -709,6 +709,15 @@
       Assert.AreEqual(result, expected);
     }

+    [TestMethod]
+    public void TestMethod_NTLM_W()
+    {
+      const string source = "W";
+      string expected = "CBB5D41A63E9A77BB35D603B629992C2";
+      string result = CryptoFunc.Ntlm(source);
+      Assert.AreEqual(result, expected);
+    }
+
     #endregion

   }


Updated messages that are targeted for high-emphasis

--- Source/Applications/openMIC/openMIC/wwwroot/DranetzConfig.cshtml
+++ Source/Applications/openMIC/openMIC/wwwroot/DranetzConfig.cshtml
@@ -560,7 +560,7 @@
             self.loadAnalyzerConfig = function (configID, analyzerType) {
                 if (analyzerTypeKeys.every(key => analyzerType !== analyzerTypes[key].index))
                 {
-                    showErrorMessage(`Cannot load configuration from unknown analyzer type "${analyzerType}"`);
+                    showErrorMessage(`Cannot load configuration from unknown analyzer type "${analyzerType}"`, null, true);
                     return $.Deferred().resolve().promise();
                 }

@@ -582,7 +582,7 @@
                             promises.push(dataHub.getSectionMap(`${key}.xml`).done(function (result) {
                                 self.addSection(key, buildSection(JSON.parse(result).SECTION));
                             }).fail(function (error) {
-                                showErrorMessage(error);
+                                showErrorMessage(error, null, true);
                             }));
                         }
                     }
@@ -678,7 +678,7 @@
                     });
                 })
                 .fail(function (error) {
-                    showErrorMessage(error);
+                    showErrorMessage(error, null, true);
                 });
             }


Fix Child Container Resolve for Types with Generic Interfaces

--- src/TinyIoC/TinyIoC.cs
+++ src/TinyIoC/TinyIoC.cs
@@ -3716,23 +3716,26 @@

             ObjectFactoryBase factory;

+            if (_Parent._RegisteredTypes.TryGetValue(registration, out factory))
+            {
+                return factory.GetFactoryForChildContainer(registration.Type, _Parent, this);
+            }
+
+#if RESOLVE_OPEN_GENERICS
+            // Attempt container resolution of open generic
             if (registration.Type.IsGenericType())
             {
-                var openTypeRegistration = new TypeRegistration(registration.Type,
+                var openTypeRegistration = new TypeRegistration(registration.Type.GetGenericTypeDefinition(),
                                                                 registration.Name);

                 if (_Parent._RegisteredTypes.TryGetValue(openTypeRegistration, out factory))
                 {
-                    return factory.GetFactoryForChildContainer(openTypeRegistration.Type, _Parent, this);
+                    return factory.GetFactoryForChildContainer(registration.Type, _Parent, this);
                 }

                 return _Parent.GetParentObjectFactory(registration);
             }
-
-            if (_Parent._RegisteredTypes.TryGetValue(registration, out factory))
-            {
-                return factory.GetFactoryForChildContainer(registration.Type, _Parent, this);
-            }
+#endif

             return _Parent.GetParentObjectFactory(registration);
         }


item attributes

item attributes

--- Voxalia/ServerGame/TagSystem/TagObjects/ItemTag.cs
+++ Voxalia/ServerGame/TagSystem/TagObjects/ItemTag.cs
@@ -138,6 +138,31 @@
                 // -->
                 case "model_name":
                     return new TextTag(Internal.GetModelName()).Handle(data.Shrink());
+                // <--[tag]
+                // @Name ItemTag.shared_attributes
+                // @Group General Information
+                // @ReturnType MapTag
+                // @Returns a full map of all this items shared attributes.
+                // @Example "blocks/dirt" .shared_attributes returns an empty map.
+                // -->
+                case "shared_attributes":
+                    {
+                        MapTag map = new MapTag();
+                        foreach (KeyValuePair<string, float> entry in Internal.SharedAttributes)
+                        {
+                            map.Internal[entry.Key] = new NumberTag(entry.Value);
+                        }
+                        return map.Handle(data.Shrink());
+                    }
+                // <--[tag]
+                // @Name ItemTag.local_attributes
+                // @Group General Information
+                // @ReturnType MapTag
+                // @Returns a full map of all this items local attributes.
+                // @Example "blocks/dirt" .local_attributes returns an empty map.
+                // -->
+                case "local_attributes":
+                    return new MapTag(Internal.Attributes).Handle(data.Shrink());
                 // TODO: All other item properties!
                 // <--[tag]
                 // @Name ItemTag.with_count[<IntegerTag>]
@@ -260,6 +285,38 @@
                         items.DrawColor = ColorTag.For(data.GetModifierObject(0)).Internal;
                         return new ItemTag(items).Handle(data.Shrink());
                     }
+                // <--[tag]
+                // @Name ItemTag.with_shared_attributes[<MapTag>]
+                // @Group Modification
+                // @ReturnType ItemTag
+                // @Returns a copy of this item with the specified shared attributes map.
+                // -->
+                case "with_shared_attributes":
+                    {
+                        ItemStack items = Internal.Duplicate();
+                        items.SharedAttributes.Clear();
+                        foreach (KeyValuePair<string, TemplateObject> entry in MapTag.For(data.GetModifierObject(0)).Internal)
+                        {
+                            items.SharedAttributes[entry.Key] = (float)NumberTag.For(data, entry.Value).Internal;
+                        }
+                        return new ItemTag(items).Handle(data.Shrink());
+                    }
+                // <--[tag]
+                // @Name ItemTag.with_local_attributes[<MapTag>]
+                // @Group Modification
+                // @ReturnType ItemTag
+                // @Returns a copy of this item with the specified local attributes map.
+                // -->
+                case "with_local_attributes":
+                    {
+                        ItemStack items = Internal.Duplicate();
+                        items.Attributes.Clear();
+                        foreach (KeyValuePair<string, TemplateObject> entry in MapTag.For(data.GetModifierObject(0)).Internal)
+                        {
+                            items.Attributes[entry.Key] = entry.Value;
+                        }
+                        return new ItemTag(items).Handle(data.Shrink());
+                    }
                 // TODO: Modifiers for all other item properties!
                 default:
                     return new TextTag(ToString()).Handle(data);


[Toolkit.Game] Fix issue with regression when using multiple window, revert back using standard application window dispatching on desktop

--- Source/Toolkit/SharpDX.Toolkit.Game/Desktop/GameWindowDesktop.cs
+++ Source/Toolkit/SharpDX.Toolkit.Game/Desktop/GameWindowDesktop.cs
@@ -129,7 +129,6 @@
             try
             {
                 // Use custom do events to improve performance and avoid GC caused by Application.DoEvents
-                RenderLoop.UseCustomDoEvents = true;
                 RenderLoop.Run(Control, runRenderCallback);
             }
             finally


(TFS CS 4200)

(TFS CS 4200)

--- Signum.Web.Extensions/Authorization/UserIUModification.cs
+++ Signum.Web.Extensions/Authorization/UserIUModification.cs
@@ -115,13 +115,13 @@
             return base.GeneratePropertyModification(formValues, interval, subControlID, commonSubControlID, propertyName, index, propertyValidators);
         }

-        public override void Validate(object entity, Dictionary<string, List<string>> errors, string prefix)
+        public override void Validate(Controller controller, object entity, Dictionary<string, List<string>> errors, string prefix)
         {
             if (Properties != null)
             {
                 foreach (var ppm in Properties.Values)
                 {
-                    ppm.Modification.Validate(ppm.PropertyPack.GetValue(entity), errors, prefix);
+                    ppm.Modification.Validate(controller, ppm.PropertyPack.GetValue(entity), errors, prefix);

                     if (ppm.PropertyPack.PropertyInfo.Name == "PasswordHash")
                         continue;


Rewrite ForgotPassword form markup

Rewrite ForgotPassword form markup

--- WebApplication/Views/Account/ForgotPassword.cshtml
+++ WebApplication/Views/Account/ForgotPassword.cshtml
@@ -4,28 +4,30 @@
 }

@ViewData["Title"].

-

-    For more information on how to enable reset password please see this article.
-

-
-@*<form asp-controller="Account" asp-action="ForgotPassword" method="post" class="form-horizontal" role="form">
-
Enter your email.

-

-

-

-
-

-            <input asp-for="Email" class="form-control" />
-
+
For more information on how to enable reset password please see this article.

+@*
+<form asp-controller="Account" asp-action="ForgotPassword" method="post" class="form-horizontal" role="form">
+    <fieldset>
+        <legend>Enter your email.</legend>
+

+

+

+
+

+                <input asp-for="Email" class="form-control" />
+
+

-

-

-

-            <button type="submit" class="btn btn-default">Submit</button>
+

+

+                <button type="submit" class="btn btn-primary">Submit</button>
+

-

-</form>*@
-
+    </fieldset>
+</form>
+*@
 @section Scripts {
-    @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
+    @{
+      await Html.RenderPartialAsync("_ValidationScriptsPartial");
+    }
 }


Update the main menu screen to reverse the intro animation if the previous screen is the boss selection menu.

--- Xmas-Hell/Xmas-Hell-Core/Screens/MainMenuScreen.cs
+++ Xmas-Hell/Xmas-Hell-Core/Screens/MainMenuScreen.cs
@@ -36,6 +36,10 @@
         {
             Animators["MainMenu"].Play("Zoom");
             Animators["MainMenu"].CurrentAnimation.Looping = false;
+
+            if (Animators["MainMenu"].Speed < 0f)
+            Animators["MainMenu"].Speed *= -1f;
+
             _playButton.Enable(false);
         }

@@ -94,9 +98,22 @@

             if (Animators["MainMenu"] != null)
             {
+                var previousScreen = Game.ScreenManager.GetPreviousScreen();
+
+                if (previousScreen == null)
+                {
+                    Animators["MainMenu"].Play("Idle");
+                }
+                else
+                {
+                    Animators["MainMenu"].Play("Zoom");
+                    Animators["MainMenu"].Progress = 1f;
+                    Animators["MainMenu"].Speed *= -1;
+                }
+
                 Game.SpriteBatchManager.AddSpriterAnimator(Animators["MainMenu"], Layer.BACKGROUND);
-                Animators["MainMenu"].Play("Idle");
-            }
+            }
+
             if (Animators["XmasTitle"] != null)
                 Game.SpriteBatchManager.AddSpriterAnimator(Animators["XmasTitle"], Layer.BACKGROUND);
         }
@@ -114,7 +131,10 @@
         private void MainMenuScreen_AnimationFinished(string animationName)
         {
             if (animationName == "Zoom")
-                Game.ScreenManager.GoTo<BossSelectionScreen>();
+            {
+                if (Animators["MainMenu"].Progress == 1f)
+                    Game.ScreenManager.GoTo<BossSelectionScreen>();
+            }
         }

         public override void Show(bool reset = false)


Fix concurrency issues in DiagnosticHandler

--- Source/CakeMail.RestClient/Utilities/DiagnosticHandler.cs
+++ Source/CakeMail.RestClient/Utilities/DiagnosticHandler.cs
@@ -2,7 +2,7 @@
 using Pathoschild.Http.Client;
 using Pathoschild.Http.Client.Extensibility;
 using System;
-using System.Collections.Generic;
+using System.Collections.Concurrent;
 using System.Diagnostics;
 using System.Linq;
 using System.Net.Http;
@@ -28,7 +28,7 @@

 		#region PROPERTIES

-		internal static IDictionary<string, (WeakReference<HttpRequestMessage> RequestReference, StringBuilder Diagnostic, long RequestTimestamp, long ResponseTimeStamp)> DiagnosticsInfo { get; } = new Dictionary<string, (WeakReference<HttpRequestMessage>, StringBuilder, long, long)>();
+		internal static ConcurrentDictionary<string, (WeakReference<HttpRequestMessage> RequestReference, string Diagnostic, long RequestTimestamp, long ResponseTimeStamp)> DiagnosticsInfo { get; } = new ConcurrentDictionary<string, (WeakReference<HttpRequestMessage>, string, long, long)>();

 		#endregion

@@ -62,10 +62,7 @@
 			LogContent(diagnostic, httpRequest.Content);

 			// Add the diagnotic info to our cache
-			lock (DiagnosticsInfo)
-			{
-				DiagnosticsInfo.Add(diagnosticId, (new WeakReference<HttpRequestMessage>(request.Message), diagnostic, Stopwatch.GetTimestamp(), long.MinValue));
-			}
+			DiagnosticsInfo.TryAdd(diagnosticId, (new WeakReference<HttpRequestMessage>(request.Message), diagnostic.ToString(), Stopwatch.GetTimestamp(), long.MinValue));
 		}

 		/// <summary>Method invoked just after the HTTP response is received. This method can modify the incoming HTTP response.</summary>
@@ -76,69 +73,52 @@
 			var responseTimestamp = Stopwatch.GetTimestamp();
 			var httpResponse = response.Message;

-			var diagnosticId = response.Message.RequestMessage.Headers.GetValue(DiagnosticHandler.DIAGNOSTIC_ID_HEADER_NAME);
-			var diagnosticInfo = DiagnosticsInfo[diagnosticId];
-			diagnosticInfo.ResponseTimeStamp = responseTimestamp;
-
-			try
-			{
-				// Log the response
-				diagnosticInfo.Diagnostic.AppendLine();
-				diagnosticInfo.Diagnostic.AppendLine("RESPONSE:");
-				diagnosticInfo.Diagnostic.AppendLine($"  HTTP/{httpResponse.Version} {(int)httpResponse.StatusCode} {httpResponse.ReasonPhrase}");
-				LogHeaders(diagnosticInfo.Diagnostic, httpResponse.Headers);
-				LogContent(diagnosticInfo.Diagnostic, httpResponse.Content);
-
-				// Calculate how much time elapsed between request and response
-				var elapsed = TimeSpan.FromTicks(diagnosticInfo.ResponseTimeStamp - diagnosticInfo.RequestTimestamp);
-
-				// Log diagnostic
-				diagnosticInfo.Diagnostic.AppendLine();
-				diagnosticInfo.Diagnostic.AppendLine("DIAGNOSTIC:");
-				diagnosticInfo.Diagnostic.AppendLine($"  The request took {elapsed.ToDurationString()}");
-			}
-			catch (Exception e)
-			{
-				Debug.WriteLine("{0}\r\nAN EXCEPTION OCCURRED: {1}\r\n{0}", new string('=', 50), e.GetBaseException().Message);
-				diagnosticInfo.Diagnostic.AppendLine($"AN EXCEPTION OCCURRED: {e.GetBaseException().Message}");
-
-				if (_logger != null && _logger.IsErrorEnabled())
-				{
-					_logger.Error(e, "An exception occurred when inspecting the response from CakeMail");
-				}
-			}
-			finally
-			{
-				var diagnosticMessage = diagnosticInfo.Diagnostic.ToString();
-
-				if (!string.IsNullOrEmpty(diagnosticMessage))
-				{
-					Debug.WriteLine("{0}\r\n{1}{0}", new string('=', 50), diagnosticMessage);
-
-					if (_logger != null)
-					{
-						var shouldLogSuccessfulCalls = _logger.Log(_logLevelSuccessfulCalls, null, null, Array.Empty<object>());
-						if (response.IsSuccessStatusCode && shouldLogSuccessfulCalls)
-						{
-							_logger.Log(_logLevelSuccessfulCalls, () => diagnosticMessage
-								.Replace("{", "{{")
-								.Replace("}", "}}"));
-						}
-
-						var shouldLogFailedCalls = _logger.Log(_logLevelFailedCalls, null, null, Array.Empty<object>());
-						if (!response.IsSuccessStatusCode && shouldLogFailedCalls)
-						{
-							_logger.Log(_logLevelFailedCalls, () => diagnosticMessage
-								.Replace("{", "{{")
-								.Replace("}", "}}"));
-						}
-					}
-				}
-
-				DiagnosticsInfo[diagnosticId] = diagnosticInfo;
-
-				Cleanup();
-			}
+			var diagnosticId = response.Message.RequestMessage.Headers.GetValue(DIAGNOSTIC_ID_HEADER_NAME);
+			if (DiagnosticsInfo.TryGetValue(diagnosticId, out (WeakReference<HttpRequestMessage> RequestReference, string Diagnostic, long RequestTimestamp, long ResponseTimestamp) diagnosticInfo))
+			{
+				var updatedDiagnostic = new StringBuilder(diagnosticInfo.Diagnostic);
+				try
+				{
+					// Log the response
+					updatedDiagnostic.AppendLine();
+					updatedDiagnostic.AppendLine("RESPONSE:");
+					updatedDiagnostic.AppendLine($"  HTTP/{httpResponse.Version} {(int)httpResponse.StatusCode} {httpResponse.ReasonPhrase}");
+					LogHeaders(updatedDiagnostic, httpResponse.Headers);
+					LogContent(updatedDiagnostic, httpResponse.Content);
+
+					// Calculate how much time elapsed between request and response
+					var elapsed = TimeSpan.FromTicks(responseTimestamp - diagnosticInfo.RequestTimestamp);
+
+					// Log diagnostic
+					updatedDiagnostic.AppendLine();
+					updatedDiagnostic.AppendLine("DIAGNOSTIC:");
+					updatedDiagnostic.AppendLine($"  The request took {elapsed.ToDurationString()}");
+				}
+				catch (Exception e)
+				{
+					Debug.WriteLine("{0}\r\nAN EXCEPTION OCCURRED: {1}\r\n{0}", new string('=', 50), e.GetBaseException().Message);
+					updatedDiagnostic.AppendLine($"AN EXCEPTION OCCURRED: {e.GetBaseException().Message}");
+
+					if (_logger != null && _logger.IsErrorEnabled())
+					{
+						_logger.Error(e, "An exception occurred when inspecting the response from SendGrid");
+					}
+				}
+				finally
+				{
+					var diagnosticMessage = updatedDiagnostic.ToString();
+
+					LogDiagnostic(response.IsSuccessStatusCode, _logLevelSuccessfulCalls, diagnosticMessage);
+					LogDiagnostic(!response.IsSuccessStatusCode, _logLevelFailedCalls, diagnosticMessage);
+
+					DiagnosticsInfo.TryUpdate(
+						diagnosticId,
+						(diagnosticInfo.RequestReference, updatedDiagnostic.ToString(), diagnosticInfo.RequestTimestamp, responseTimestamp),
+						(diagnosticInfo.RequestReference, diagnosticInfo.Diagnostic, diagnosticInfo.RequestTimestamp, diagnosticInfo.ResponseTimestamp));
+				}
+			}
+
+			Cleanup();
 		}

 		#endregion
@@ -187,6 +167,20 @@
 			}
 		}

+		private void LogDiagnostic(bool shouldLog, LogLevel logLEvel, string diagnosticMessage)
+		{
+			if (shouldLog && _logger != null)
+			{
+				var logLevelEnabled = _logger.Log(logLEvel, null, null, Array.Empty<object>());
+				if (logLevelEnabled)
+				{
+					_logger.Log(logLEvel, () => diagnosticMessage
+						.Replace("{", "{{")
+						.Replace("}", "}}"));
+				}
+			}
+		}
+
 		private void Cleanup()
 		{
 			try
@@ -194,11 +188,12 @@
 				// Remove diagnostic information for requests that have been garbage collected
 				foreach (string key in DiagnosticHandler.DiagnosticsInfo.Keys.ToArray())
 				{
-					var diagnosticInfo = DiagnosticHandler.DiagnosticsInfo[key];
-					if (!diagnosticInfo.RequestReference.TryGetTarget(out HttpRequestMessage request))
-					{
-						DiagnosticHandler.DiagnosticsInfo.Remove(key);
-						continue;
+					if (DiagnosticHandler.DiagnosticsInfo.TryGetValue(key, out (WeakReference<HttpRequestMessage> RequestReference, string Diagnostic, long RequestTimeStamp, long ResponseTimestamp) diagnosticInfo))
+					{
+						if (!diagnosticInfo.RequestReference.TryGetTarget(out HttpRequestMessage request))
+						{
+							DiagnosticsInfo.TryRemove(key, out _);
+						}
 					}
 				}
 			}


Fix incorrect update checker.

Fix incorrect update checker.

--- EarthLiveSharp/Program.cs
+++ EarthLiveSharp/Program.cs
@@ -134,13 +134,19 @@
         public static void UpdateImage()
         {
             GetLatestAddress();
-            if(latest_address.Equals(saved_address))
+            if (saved_address.Length==0)
+            {
+                SaveImage();
+                return;
+            }
+            else if (latest_address.Substring(latest_address.Length - 85, 85).Equals(saved_address.Substring(saved_address.Length - 85, 85)))
             {
                 return;
             }
             else
             {
                 SaveImage();
+                return;
             }
         }
     }


implemented TaskPoolScheduler.

implemented TaskPoolScheduler.

--- System.Reactive/System.Reactive.Concurrency/TaskPoolScheduler.cs
+++ System.Reactive/System.Reactive.Concurrency/TaskPoolScheduler.cs
@@ -2,13 +2,19 @@
 using System.Collections.Generic;
 using System.Threading;
 using System.Threading.Tasks;
+using System.Reactive.Disposables;

 namespace System.Reactive.Concurrency
 {
 	public sealed class TaskPoolScheduler : IScheduler
 	{
+		TaskFactory factory;
+
 		public TaskPoolScheduler (TaskFactory taskFactory)
 		{
+			if (taskFactory == null)
+				throw new ArgumentNullException ("taskFactory");
+			this.factory = taskFactory;
 		}

 		public DateTimeOffset Now {
@@ -22,7 +28,15 @@

 		public IDisposable Schedule<TState> (TState state, DateTimeOffset dueTime, Func<IScheduler, TState, IDisposable> action)
 		{
-			throw new NotImplementedException ();
+			IDisposable disposable = null;
+			var task = factory.StartNew<Unit> (() => {
+				var sleep = Scheduler.Normalize (dueTime - Now);
+				Thread.Sleep (sleep);
+				var dis = action (this, state);
+				dis.Dispose ();
+				return Unit.Default;
+				});
+			return Disposable.Create (() => (disposable ?? Disposable.Empty).Dispose ());
 		}

 		public IDisposable Schedule<TState> (TState state, TimeSpan dueTime, Func<IScheduler, TState, IDisposable> action)


feat: 为文件上传增加一个是否自动添加扩展名的选项。 :open_hands: :file_folder:

--- src/WebFileAccessor.cs
+++ src/WebFileAccessor.cs
@@ -303,6 +303,7 @@
 			private int _index;
 			private bool _cancel;
 			private bool _overwrite;
+			private bool _extensionAppend;
 			private string _directory;
 			private string _fileName;
 			#endregion
@@ -313,6 +314,7 @@
 				_index = index;
 				_cancel = false;
 				_overwrite = false;
+				_extensionAppend = true;
 				_directory = directory;
 				_fileName = fileName;
 			}
@@ -357,6 +359,21 @@
 				set
 				{
 					_overwrite = value;
+				}
+			}
+
+			/// <summary>
+			/// 获取或设置一个值，指示是否自动添加文件的扩展名。
+			/// </summary>
+			public bool ExtensionAppend
+			{
+				get
+				{
+					return _extensionAppend;
+				}
+				set
+				{
+					_extensionAppend = value;
 				}
 			}

@@ -480,6 +497,9 @@
 				//定义文件写入的模式
 				bool overwrite = false;

+				//定义文件的扩展名是否自动添加
+				bool extensionAppend = true;
+
 				//执行写入前的回调方法
 				if(_onWriting != null)
 				{
@@ -492,15 +512,16 @@
 					if(args.Cancel)
 						return null;

-					//获取写入的文件名和写入模式
+					//获取文件写入参数
 					fileName = args.FileName;
 					overwrite = args.Overwrite;
+					extensionAppend = args.ExtensionAppend;
 				}

 				//如果文件名为空，则生成一个以“当前日期-时间-随机数.ext”的默认文件名
 				if(string.IsNullOrWhiteSpace(fileName))
-					fileName = string.Format("{0:yyyyMMdd-HHmmss}-{1}{2}", DateTime.Now, (uint)Zongsoft.Common.RandomGenerator.GenerateInt32(), extensionName);
-				else if(!fileName.EndsWith(extensionName))
+					fileName = string.Format("{0:yyyyMMdd-HHmmss}-{1}{2}", DateTime.Now, (uint)Zongsoft.Common.RandomGenerator.GenerateInt32(), extensionAppend ? string.Empty : extensionName);
+				else if(extensionAppend && !fileName.EndsWith(extensionName))
 					fileName = fileName + extensionName;

 				//生成文件的完整路径


Exec: Don't add `cd $working_dir` as that is set when the process is

started, so it isn't required and would be incorrect.

--- src/XMakeTasks/Exec.cs
+++ src/XMakeTasks/Exec.cs
@@ -234,10 +234,6 @@
                 else
                 {
                     sw.WriteLine("#!/bin/bash");
-                    if (!string.IsNullOrWhiteSpace(_workingDirectory))
-                    {
-                        sw.WriteLine("cd " + _workingDirectory);
-                    }
                 }

                 if (isUnix && NativeMethodsShared.IsMono)


- Changing EmotesDictionary property to use long for ID of emote instead of string to match better with EmoteModel class

--- Twitch/Twitch.Base/Models/Clients/Chat/ChatMessagePacketModel.cs
+++ Twitch/Twitch.Base/Models/Clients/Chat/ChatMessagePacketModel.cs
@@ -118,11 +118,11 @@
         /// <summary>
         /// A dictionary containing the emote IDs used by the user in the message and their location in the message
         /// </summary>
-        public Dictionary<string, List<Tuple<int, int>>> EmotesDictionary
+        public Dictionary<long, List<Tuple<int, int>>> EmotesDictionary
         {
             get
             {
-                Dictionary<string, List<Tuple<int, int>>> results = new Dictionary<string, List<Tuple<int, int>>>();
+                Dictionary<long, List<Tuple<int, int>>> results = new Dictionary<long, List<Tuple<int, int>>>();
                 if (!string.IsNullOrEmpty(this.Emotes))
                 {
                     string[] splits = this.Emotes.Split(new char[] { '/', ':' });
@@ -130,16 +130,18 @@
                     {
                         for (int i = 0; i < splits.Length; i = i + 2)
                         {
-                            string setID = splits[i];
-                            results[setID] = new List<Tuple<int, int>>();
-                            string[] setSplits = splits[i + 1].Split(new char[] { '-', ',' });
-                            if (setSplits != null && setSplits.Length > 0 && setSplits.Length % 2 == 0)
+                            if (long.TryParse(splits[i], out long setID))
                             {
-                                for (int j = 0; j < setSplits.Length; j = j + 2)
+                                results[setID] = new List<Tuple<int, int>>();
+                                string[] setSplits = splits[i + 1].Split(new char[] { '-', ',' });
+                                if (setSplits != null && setSplits.Length > 0 && setSplits.Length % 2 == 0)
                                 {
-                                    if (int.TryParse(setSplits[j], out int start) && int.TryParse(setSplits[j + 1], out int end))
+                                    for (int j = 0; j < setSplits.Length; j = j + 2)
                                     {
-                                        results[setID].Add(new Tuple<int, int>(start, end));
+                                        if (int.TryParse(setSplits[j], out int start) && int.TryParse(setSplits[j + 1], out int end))
+                                        {
+                                            results[setID].Add(new Tuple<int, int>(start, end));
+                                        }
                                     }
                                 }
                             }


Added identifier tests for type declaration names.

--- Vba.Language/Vba.Language.Tests/Compiler/ModuleStatementTests.cs
+++ Vba.Language/Vba.Language.Tests/Compiler/ModuleStatementTests.cs
@@ -340,6 +340,23 @@
             CannotParseAnyTrueKeywords(eventDeclarationTemplate, p => p.eventDeclaration());
         }

+        [Fact]
+        public void CanParseIdentifierInTypeDeclaration()
+        {
+            const string typeDeclarationTemplate = "Type {0}\r\nValue As String\r\nEnd Type";
+            const string expectedOutputTypeDeclarationTemplate = "(typeDeclaration (udtDeclaration Type (untypedName (identifier {0})) \\r\\n (udtMemberList (udtElement (udtMember (untypedNameMemberDcl (identifier Value) (optionalArrayClause (asClause (asType As (typeSpec (typeExpression (builtInType (reservedTypeIdentifier String))))))))))) \\r\\n End Type))";
+
+            CanParseAllAmbiguousIdentifiers(typeDeclarationTemplate, expectedOutputTypeDeclarationTemplate, p => p.typeDeclaration());
+        }
+
+        [Fact]
+        public void CannotParseInvalidIdentifierInTypeDeclaration()
+        {
+            const string typeDeclarationTemplate = "Type {0}\r\nValue As String\r\nEnd Type";
+
+            CannotParseAnyTrueKeywords(typeDeclarationTemplate, p => p.typeDeclaration());
+        }
+
         private void CannotParseAnyTrueKeywords(string sourceTemplate, Func<VbaParser, ParserRuleContext> rule)
         {
             foreach (var id in trueKeywords)


Fix straight validator bug

Fix straight validator bug

Also cleaned up code to make it easier to follow logic

--- Yahtzee/Framework/DiceCombinationValidators/StraightValidator.cs
+++ Yahtzee/Framework/DiceCombinationValidators/StraightValidator.cs
@@ -8,22 +8,32 @@
 {
 	public class StraightValidator : IStraightValidator
 	{
-		public bool IsValid(int lengthOfStraight, IEnumerable<IDie> diceValues)
+		public bool IsValid(int lengthOfStraight, IEnumerable<IDie> dice)
 		{
-			IEnumerable<int> orderedDice = diceValues.OrderBy(x => x.Value).Select(x => x.Value).Distinct().ToList();
+			List<int> orderedValues = dice.OrderBy(x => x.Value).Select(x => x.Value).Distinct().ToList();
+			return CheckValidity(lengthOfStraight, orderedValues);
+		}

-			if(orderedDice.Count() < lengthOfStraight)
+		private bool CheckValidity(int lengthOfStraight, List<int> orderedValues)
+		{
+			if(orderedValues.Count < lengthOfStraight)
 			{
 				return false;
 			}

+			var isValid = true;
+
 			for (int i = 0; i < lengthOfStraight - 1; i++)
 			{
-				var currentIncrementedValue = orderedDice.ElementAt(i) + 1;
-				if (!(currentIncrementedValue == orderedDice.ElementAt(i + 1))) return false;
+				var expectedNextValue = orderedValues.ElementAt(i) + 1;
+				var nextValue = orderedValues.ElementAt(i + 1);
+				if (expectedNextValue != nextValue)
+				{
+					isValid = CheckValidity(lengthOfStraight, orderedValues.Skip(1).ToList());
+				}
 			}

-			return true;
+			return isValid;
 		}
 	}
 }


fix bug in adding record from record entry msg

--- _Out/Server/ClientBin/source/Assets/_NF/_Net/NFCoreExListener.cs
+++ _Out/Server/ClientBin/source/Assets/_NF/_Net/NFCoreExListener.cs
@@ -703,7 +703,7 @@
                     NFMsg.ObjectRecordBase xObjectRecordBase = xObjectRecordList.record_list[j];
                     for (int k = 0; k < xObjectRecordBase.row_struct.Count; ++k )
                     {
-                        NFMsg.RecordAddRowStruct xAddRowStruct = xObjectRecordBase.row_struct[i];
+                        NFMsg.RecordAddRowStruct xAddRowStruct = xObjectRecordBase.row_struct[k];

                         ADD_ROW(PBToNF(xObjectRecordList.player_id), System.Text.Encoding.Default.GetString(xObjectRecordBase.record_name), xAddRowStruct);
                     }


Bug fixes at the import process by using XMLs

* FileManager.cs: Fixed bug getting type from XML.

* ExampleGame.xml, ExampleEdition.xml: updated for tests

* Program.cs: Added new test to check import process from XMLs

* Worker.cs: Fixed bug.

--- FileManager.cs
+++ FileManager.cs
@@ -21,6 +21,7 @@
 //-----------------------------------------------------------------------
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using System.Xml.Linq;
 using Mono.Addins;

@@ -139,12 +140,12 @@
 			// Add dependencies
 			file.AddDependencies(depends.ToArray());

-			// Get type of dependency from info
-			Type t = Type.GetType(fileInfo.Element("Type").Value, true, false);
-
-			// Set type
-			if (file.Format == null)
-				file.SetFormat(t);
+			// Get type from info
+			string typeName = fileInfo.Element("Type").Value;
+			Format romFormat = AddinManager.GetExtensionObjects<Format>().
+			                   Where(f => f.FormatName == typeName).
+			                   ToArray()[0];
+			romFormat.Initialize(file);

 			return file;
 		}


Fix call expression validation regression

--- src/Moq/Mock.cs
+++ src/Moq/Mock.cs
@@ -924,6 +924,17 @@

 		internal void AddInnerMockSetup(MethodInfo method, IReadOnlyList<Expression> arguments, LambdaExpression expression, object returnValue)
 		{
+			if (expression.IsProperty())
+			{
+				var property = expression.ToPropertyInfo();
+				Guard.CanRead(property);
+
+				Debug.Assert(method == property.GetGetMethod(true));
+			}
+
+			ThrowIfSetupExpressionInvolvesUnsupportedMember(expression, method);
+			ThrowIfSetupMethodNotVisibleToProxyFactory(method);
+
 			this.Setups.Add(new InnerMockSetup(method, arguments, expression, returnValue));
 		}


Throw if control is null

Throw if control is null

--- src/Shience/Science.cs
+++ src/Shience/Science.cs
@@ -37,6 +37,11 @@

         public TResult Test(Func<TResult> control, Func<TResult> candidate, Func<TResult, TResult, bool> comparer, params object[] contexts)
         {
+            if (control == null)
+            {
+                throw new ArgumentNullException("control");
+            }
+
             //If candidate is null, don't do any science
             if (candidate == null)
             {


handle task canceled exceptions and object disposed exceptions for disposed buffered senders w/ outstanding timer callbacks

--- SumoLogic.Logging.Common/Sender/SumoLogicMessageSender.cs
+++ SumoLogic.Logging.Common/Sender/SumoLogicMessageSender.cs
@@ -237,6 +237,7 @@
                 {
                     httpContent.Headers.Add(SUMO_CLIENT_HEADER, ClientName);
                 }
+
                 try
                 {
                     var response = await this.HttpClient.PostAsync(this.Url, httpContent);
@@ -285,6 +286,23 @@
                     }

                     throw;
+                }
+                // Its possible for a buffered sender to get disposed while an outstanding timer callback is
+                // executing. netstandard 1.3's System.Threading.Timer task doesn't implement the overload of
+                // Dispose that has a WaitHandle, so we'll just have to suppress these exceptions.
+                catch (TaskCanceledException)
+                {
+                    if (this.Log.IsWarnEnabled)
+                    {
+                        this.Log.Warn("Could not send log to Sumo Logic; a task was canceled");
+                    }
+                }
+                catch (ObjectDisposedException ode)
+                {
+                    if (this.Log.IsWarnEnabled)
+                    {
+                        this.Log.Warn($"Could not send log to Sumo Logic: ${ode.Message}");
+                    }
                 }
             }
         }


Update SimpleJsonBondSerializer.cs

Update SimpleJsonBondSerializer.cs

--- TIKSN.Core/Serialization/Bond/SimpleJsonBondSerializer.cs
+++ TIKSN.Core/Serialization/Bond/SimpleJsonBondSerializer.cs
@@ -1,15 +1,10 @@
 using Bond.Protocols;
 using System.IO;
-using TIKSN.Analytics.Telemetry;

 namespace TIKSN.Serialization.Bond
 {
     public class SimpleJsonBondSerializer : SerializerBase<string>
     {
-        public SimpleJsonBondSerializer(IExceptionTelemeter exceptionTelemeter) : base(exceptionTelemeter)
-        {
-        }
-
         protected override string SerializeInternal(object obj)
         {
             using (var output = new StringWriter())


Removed netcoreapp2.0 framework check in formatting precision tests (#1976)

* Removed netcoreapp2.0 framework check in formatting precision tests

* Added fix note to releases.md

* Revert "Added fix note to releases.md"

This reverts commit b46d86b93c5d8a2ab4a2db6acbd5941730a5d113.

--- Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs
+++ Tests/FluentAssertions.Specs/Formatting/FormatterSpecs.cs
@@ -458,11 +458,7 @@
         string result = Formatter.ToString(value);

         // Assert
-#if NETCOREAPP3_0_OR_GREATER
-        result.Should().Be("0.33333334F");
-#else
-        result.Should().Be("0.333333343F");
-#endif
+        result.Should().BeOneOf("0.33333334F", "0.333333343F");
     }

     [Fact]
@@ -555,11 +551,7 @@
         string result = Formatter.ToString(value);

         // Assert
-#if NETCOREAPP3_0_OR_GREATER
-        result.Should().Be("0.3333333333333333");
-#else
-        result.Should().Be("0.33333333333333331");
-#endif
+        result.Should().BeOneOf("0.3333333333333333", "0.33333333333333331");
     }

     [Fact]


Remove validation of removed menu item

Remove validation of removed menu item

- Issue MatterHackers/MCCentral#2912
Investigate View3DOverflowMenus failure

--- Tests/MatterControl.AutomationTests/MatterControlTests.cs
+++ Tests/MatterControl.AutomationTests/MatterControlTests.cs
@@ -66,15 +66,6 @@

 				testRunner.ClickByName("Model View Button");
 				testRunner.ClickByName("View3D Overflow Menu");
-				Assert.IsTrue(testRunner.WaitForName("Overhang Menu Item"), "Model overflow menu should have Overhang item");
-
-				testRunner.ClickByName("Layers3D Button");
-				testRunner.ClickByName("View3D Overflow Menu");
-				Assert.IsTrue(testRunner.WaitForName("Sync To Print Menu Item"), "GCode3D overflow menu should have sync-to-print item");
-
-				testRunner.ClickByName("Layers2D Button");
-				testRunner.ClickByName("View3D Overflow Menu");
-				Assert.IsTrue(testRunner.WaitForName("Sync To Print Menu Item"), "GCode2D overflow menu should have sync-to-print item");

 				return Task.CompletedTask;
 			});


Probably fixed date/time unit test failure, which was getting a wrong day due to the timezone that appveyor is running in.

--- Tests/Noesis.Javascript.Tests/ConvertToJavascriptTests.cs
+++ Tests/Noesis.Javascript.Tests/ConvertToJavascriptTests.cs
@@ -129,11 +129,11 @@
         [TestMethod]
         public void SetDateTime()
         {
-            _context.SetParameter("val", new DateTime(2010,10,10));
+            _context.SetParameter("val", new DateTime(2010, 10, 10, 0, 0, 0, DateTimeKind.Utc));

             _context.Run("val.getUTCFullYear()").Should().BeOfType<int>().Which.Should().Be(2010);
-            _context.Run("val.getMonth()").Should().BeOfType<int>().Which.Should().Be(9);
-            _context.Run("val.getDate()").Should().BeOfType<int>().Which.Should().Be(10);
+            _context.Run("val.getUTCMonth()").Should().BeOfType<int>().Which.Should().Be(9);
+            _context.Run("val.getUTCDate()").Should().BeOfType<int>().Which.Should().Be(10);
         }

         [TestMethod]


Added newline at end of file

Added newline at end of file

--- Thinktecture.Relay.Server/Controller/IControllerLoader.cs
+++ Thinktecture.Relay.Server/Controller/IControllerLoader.cs
@@ -1,4 +1,4 @@
-using Autofac;
+using Autofac;

 namespace Thinktecture.Relay.Server.Controller
 {
@@ -6,4 +6,4 @@
 	{
 		void RegisterControllers(ContainerBuilder builder);
 	}
-}+}


Add event and property annotations to Slider

--- GTUI/Slider.cs
+++ GTUI/Slider.cs
@@ -7,7 +7,8 @@
     [DefaultEvent("ValueChanged")]
     public partial class Slider : UserControl
     {
-        [Description("Triggered when the slider value is changed.")]
+        [Browsable(true),Description("Triggered when the slider value is changed."),
+        Category("Action")]
         public EventHandler ValueChanged;

         protected float minimum = 0.0f;
@@ -24,21 +25,24 @@
             UpdateBounds();
         }

-        [Browsable(true), Description("The units of the value.")]
+        [Browsable(true), Category("Behavior"),
+        Description("The units of the value.")]
         public string Units
         {
             get { return unitsLabel.Text; }
             set { unitsLabel.Text = value ?? string.Empty; }
         }

-        [Browsable(true), Description("Show the minimum and maximum values below the slider.")]
+        [Browsable(true), Category("Behavior"),
+        Description("Show the minimum and maximum values below the slider.")]
         public bool ShowMinMaxValues
         {
             get { return minLabel.Visible && maxLabel.Visible; }
             set { minLabel.Visible = maxLabel.Visible = value; }
         }

-        [Browsable(true), Description("The slider value.")]
+        [Browsable(true), Category("Behavior"),
+        Description("The slider value.")]
         public float Value
         {
             get
@@ -70,7 +74,8 @@
             }
         }

-        [Browsable(true), Description("The minimum slider value.")]
+        [Browsable(true), Category("Behavior"),
+        Description("The minimum slider value.")]
         public float Minimum
         {
             get { return minimum; }
@@ -81,7 +86,8 @@
             }
         }

-        [Browsable(true), Description("The maximum slider value.")]
+        [Browsable(true), Category("Behavior"),
+        Description("The maximum slider value.")]
         public float Maximum
         {
             get { return maximum; }
@@ -92,7 +98,8 @@
             }
         }

-        [Browsable(true), Description("The finest resolution of the slider area.")]
+        [Browsable(true), Category("Behavior"),
+        Description("The finest resolution of the slider area.")]
         public float Resolution
         {
             get { return resolution; }
@@ -106,7 +113,8 @@
             }
         }

-        [Browsable(true), Description("The tick frequency in the slider area.")]
+        [Browsable(true), Category("Behavior"),
+        Description("The tick frequency in the slider area.")]
         public float TickFrequency
         {
             get { return tickFrequency; }
@@ -120,7 +128,8 @@
             }
         }

-        [Browsable(true), Description("The change from clicking on the slider area.")]
+        [Browsable(true), Category("Behavior"),
+        Description("The change from clicking on the slider area.")]
         public float LargeChange
         {
             get { return largeChange; }


[VsIntegration] Generate RETURN line for empty method bodies

--- VisualStudio/XSharpCodeDomProvider/XSharpCodeGenerator.cs
+++ VisualStudio/XSharpCodeDomProvider/XSharpCodeGenerator.cs
@@ -555,7 +555,14 @@
                     this.Indent++;
                     if (!this.IsCurrentInterface && ((e.Attributes & MemberAttributes.ScopeMask) != MemberAttributes.Abstract))
                     {
-                        this.GenerateStatements(e.Statements);
+                        if (e.Statements.Count == 0)
+                        {
+                            this.GenerateMethodReturnStatement(new CodeMethodReturnStatement());
+                        }
+                        else
+                        {
+                            this.GenerateStatements(e.Statements);
+                        }
                     }
                     this.Indent--;
                 }


Ruin test

Ruin test

--- WalletWasabi.Tests/UnitTests/Clients/WasabiClientTests.cs
+++ WalletWasabi.Tests/UnitTests/Clients/WasabiClientTests.cs
@@ -76,7 +76,7 @@

 			var ex = await Assert.ThrowsAsync<HttpRequestException>(async () =>
 				await client.GetTransactionsAsync(Network.Main, new[] { RandomUtils.GetUInt256() }, CancellationToken.None));
-			Assert.Equal("Bad Request\n\"Some RPC problem...\"", ex.Message);
+			Assert.Equal("Bad Request\nSome RPC problem...", ex.Message);
 		}

 		private static Transaction CreateTransaction()


dev: adds tests for get or set property issues of

NullGuardClauseAssertion.

--- test/Experiment.IdiomsUnitTest/Assertions/NullGuardClauseAssertionTest.cs
+++ test/Experiment.IdiomsUnitTest/Assertions/NullGuardClauseAssertionTest.cs
@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using System.Reflection;
 using Jwc.Experiment.Xunit;
 using Moq;
@@ -174,6 +173,30 @@
         {
             var sut = new NullGuardClauseAssertion(new FakeTestFixture());
             var property = new Properties<ClassWithGuardedMembers>().Select(x => x.Property);
+            Assert.DoesNotThrow(() => sut.Verify(property));
+        }
+
+        [Fact]
+        public void VerifyGetPropertyDoesNotThrow()
+        {
+            // Fixture setup
+            var sut = new NullGuardClauseAssertion(new FakeTestFixture());
+            var property = new Properties<ClassWithMembers>().Select(x => x.ReadOnlyProperty);
+            Assert.NotNull(property);
+
+            // Exercise system and Verify outcome
+            Assert.DoesNotThrow(() => sut.Verify(property));
+        }
+
+        [Fact]
+        public void VerifyUngarudedPrivateSetPropertyDoesNotThrow()
+        {
+            // Fixture setup
+            var sut = new NullGuardClauseAssertion(new FakeTestFixture());
+            var property = typeof(ClassWithMembers).GetProperty("PrivateSetProperty");
+            Assert.NotNull(property);
+
+            // Exercise system and Verify outcome
             Assert.DoesNotThrow(() => sut.Verify(property));
         }


Log unknown joystick axes only once

Log unknown joystick axes only once

The TryGetJoystickAxisSource in `applyAxisInput` should never fail now.

--- osu.Framework.Android/Input/AndroidJoystickHandler.cs
+++ osu.Framework.Android/Input/AndroidJoystickHandler.cs
@@ -116,9 +116,28 @@
             var motionRanges = device.MotionRanges;

             availableAxes = motionRanges != null && motionRanges.Count > 0
-                // skip Dpad axes as they're handled separately in `applyDpadInput`
-                ? motionRanges.Select(m => m.Axis).Where(a => a != Axis.HatX && a != Axis.HatY).Distinct().ToList()
+                ? motionRanges.Select(m => m.Axis).Where(isValid).Distinct().ToList()
                 : AndroidInputExtensions.ALL_AXES;
+
+            bool isValid(Axis axis)
+            {
+                switch (axis)
+                {
+                    // D-pad axes are handled separately in `applyDpadInput`
+                    case Axis.HatX:
+                    case Axis.HatY:
+                    // Brake and Gas axes mirror the left and right trigger and are therefore ignored
+                    case Axis.Gas:
+                    case Axis.Brake:
+                        return false;
+                }
+
+                if (axis.TryGetJoystickAxisSource(out _))
+                    return true;
+
+                Logger.Log($"Unknown joystick axis: {axis}");
+                return false;
+            }
         }

         protected override void OnGenericMotion(MotionEvent genericMotionEvent)
@@ -142,17 +161,8 @@

         private void applyAxisInput(MotionEvent motionEvent, int historyPosition, Axis axis)
         {
-            if (!axis.TryGetJoystickAxisSource(out var joystickAxisSource))
-            {
-                // Brake and Gas axes mirror the left and right trigger respectively, so they are not included in TryGetJoystickAxisSource to avoid double-reporting.
-                // don't log as they're not handled on purpose.
-                if (axis != Axis.Brake && axis != Axis.Gas && historyPosition == HISTORY_CURRENT)
-                    Logger.Log($"Unknown joystick axis: {axis}");
-
-                return;
-            }
-
-            if (motionEvent.TryGet(axis, out float value, historyPosition))
+            if (axis.TryGetJoystickAxisSource(out var joystickAxisSource)
+                && motionEvent.TryGet(axis, out float value, historyPosition))
             {
                 value = JoystickHandler.RescaleByDeadzone(value, DeadzoneThreshold.Value);
                 enqueueInput(new JoystickAxisInput(new JoystickAxis(joystickAxisSource, value)));


Remove unused template type parameter

Remove unused template type parameter

--- osu.Framework/Graphics/TransformSequenceExtensions.cs
+++ osu.Framework/Graphics/TransformSequenceExtensions.cs
@@ -10,13 +10,13 @@
 {
     public static class TransformSequenceExtensions
     {
-        public static TransformSequence<T> TransformTo<T, TValue>(this TransformSequence<T> t, Transform transform)
-            where T : ITransformable
-            => t.Append(o => o.TransformTo(transform));
-
         public static TransformSequence<T> TransformTo<T, TValue>(this TransformSequence<T> t, string propertyOrFieldName, TValue newValue, double duration = 0, EasingTypes easing = EasingTypes.None)
             where T : ITransformable
             => t.Append(o => o.TransformTo(propertyOrFieldName, newValue, duration, easing));
+
+        public static TransformSequence<T> TransformTo<T>(this TransformSequence<T> t, Transform transform)
+            where T : ITransformable
+            => t.Append(o => o.TransformTo(transform));

         public static TransformSequence<T> Spin<T>(this TransformSequence<T> t, double revolutionDuration, float startRotation = 0) where T : Drawable =>
             t.Loop(0, d => d.RotateTo(startRotation).RotateTo(startRotation + 360, revolutionDuration));


Disable failing tests temporarily

Disable failing tests temporarily

--- osu.Game.Tests/Beatmaps/Formats/OsuJsonDecoderTest.cs
+++ osu.Game.Tests/Beatmaps/Formats/OsuJsonDecoderTest.cs
@@ -113,6 +113,7 @@

         [TestCase(normal)]
         [TestCase(marathon)]
+        [Ignore("temporarily disabled pending DeepEqual fix (https://github.com/jamesfoster/DeepEqual/pull/35)")]
         // Currently fails:
         // [TestCase(with_sb)]
         public void TestParity(string beatmap)