Adding copy ctor for 'OptionalDelimitedList'

--- src/Http.Grammar/OptionalDelimitedList.cs
+++ src/Http.Grammar/OptionalDelimitedList.cs
@@ -8,6 +8,11 @@

     public class OptionalDelimitedList : Repetition
     {
+        public OptionalDelimitedList(OptionalDelimitedList delimitedList)
+            : base(delimitedList)
+        {
+        }
+
         public OptionalDelimitedList(Repetition repetition)
             : base(repetition)
         {


only take up to 40 links

only take up to 40 links

--- src/Icons/Services/IconFetchingService.cs
+++ src/Icons/Services/IconFetchingService.cs
@@ -94,7 +94,7 @@
             var links = doc.DocumentNode.SelectNodes(@"//head/link[@href]");
             if(links != null)
             {
-                foreach(var link in links)
+                foreach(var link in links.Take(40))
                 {
                     var hrefAttr = link.Attributes["href"];
                     if(string.IsNullOrWhiteSpace(hrefAttr?.Value))
@@ -130,11 +130,11 @@
                 {
                     iconUri = new Uri($"{uri.Scheme}://{icon.Path.Substring(2)}");
                 }
-                else if(Uri.TryCreate(icon.Path, UriKind.Relative, out Uri relUri))
+                else if(Uri.TryCreate(icon.Path, UriKind.Relative, out var relUri))
                 {
                     iconUri = ResolveUri($"{uri.Scheme}://{uri.Host}", baseUrl, relUri.OriginalString);
                 }
-                else if(Uri.TryCreate(icon.Path, UriKind.Absolute, out Uri absUri))
+                else if(Uri.TryCreate(icon.Path, UriKind.Absolute, out var absUri))
                 {
                     iconUri = absUri;
                 }


Updated the DocsGenerator

Updated the DocsGenerator

--- ExtendedEditor/Assets/DocsGenerator.cs
+++ ExtendedEditor/Assets/DocsGenerator.cs
@@ -8,8 +8,57 @@
 using UnityEngine;
 using System.Linq;

+[AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = false)]
+sealed class DocsIgnoreAttribute : Attribute {
+	public DocsIgnoreAttribute() { }
+}
+
+[AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = false)]
+sealed class DocsDescriptionAttribute : Attribute {
+	readonly string description;
+
+	public DocsDescriptionAttribute( string description ) {
+		this.description = description;
+	}
+
+	public string Description {
+		get { return description; }
+	}
+}
+
+[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false, AllowMultiple = true)]
+sealed class DocsParameterAttribute : Attribute {
+	readonly string parameter;
+	readonly string description;
+
+	public DocsParameterAttribute( string parameter, string description ) {
+		this.parameter = parameter;
+		this.description = description;
+	}
+
+	public string Parameter {
+		get { return parameter; }
+	}
+
+	public string Description {
+		get { return description; }
+	}
+}
+
+[AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
+sealed class DocsReturnValueAttribute : Attribute {
+	readonly string description;
+
+	public DocsReturnValueAttribute( string description ) {
+		this.description = description;
+	}
+
+	public string Description {
+		get { return description; }
+	}
+}
+
 public class DocsGenerator : MonoBehaviour {
-

 	private class FieldInfoComparer : IComparer<FieldInfo> {
 		public int Compare( FieldInfo f1, FieldInfo f2 ) {
@@ -49,7 +98,9 @@
 		var types = ext.Assembly.GetTypes();
 		foreach ( var item in types ) {
 			if ( item.Namespace == null ) continue;
+			if ( !item.IsPublic ) continue;
 			if ( item.Namespace.StartsWith( "TNRD" ) ) {
+				if ( item.GetCustomAttributes( typeof(DocsIgnoreAttribute), false ).Length > 0 ) continue;
 				if ( item.Namespace != null ) {
 					if ( item.ReflectedType == null ) {
 						var key = item.Namespace.Replace( "`1", "" );
@@ -127,7 +178,9 @@
 		var types = t.Assembly.GetTypes();
 		foreach ( var item in types ) {
 			if ( item.Namespace == null ) continue;
+			if ( !item.IsPublic ) continue;
 			if ( item.Namespace.StartsWith( "TNRD" ) ) {
+				if ( item.GetCustomAttributes( typeof(DocsIgnoreAttribute), false ).Length > 0 ) continue;

 				var builder = new StringBuilder();

@@ -151,17 +204,20 @@
 	}

 	private static string ItemStart( Type item ) {
+		var attr = item.GetCustomAttributes( typeof(DocsDescriptionAttribute), false );
+
+
 		return string.Format( @"

{0}

-
class in {1}

+
class in {1}

Description

-

-
", item.Name, item.Namespace );
+
{2}

+
", item.Name, item.Namespace, GetDescription( item ) );
 	}

 	private static string GenerateItemFields( Type item ) {
@@ -174,69 +230,87 @@
 					fields.RemoveAt( i + 1 );
 				}
 			}
-		}
-
-		if ( fields.Count > 0 ) {
-			var builder = new StringBuilder();
-
-			builder.Append( SubsectionStart( "Variables" ) );
-			foreach ( var variable in fields ) {
-				if ( variable.IsPrivate ) continue;
-				//builder.Append( SubsectionSegment( string.Format( "{2}.{0}-{1}.html", item.Name, variable.Name, item.Namespace ), variable.Name ) );
-				builder.Append( SubsectionSegment( "#", variable.Name ) );
-			}
-			builder.Append( SubsectionEnd() );
-
-			return builder.ToString();
-		}
-
-		return "";
+
+			if ( fields[i].GetCustomAttributes( typeof(DocsIgnoreAttribute), false ).Length > 0 ) {
+				fields.RemoveAt( i );
+			}
+		}
+		var builder = new StringBuilder();
+
+		builder.Append( SubsectionStart( "Fields" ) );
+		foreach ( var field in fields ) {
+			if ( field.IsPrivate ) continue;
+			//builder.Append( SubsectionSegment( string.Format( "{2}.{0}-{1}.html", item.Name, variable.Name, item.Namespace ), variable.Name ) );
+			builder.Append( SubsectionSegment( "#", field.Name, GetDescription( field ) ) );
+		}
+
+		if ( fields.Count == 0 ) {
+			builder.Append( SubsectionSegment( "#", "No fields visible", "-" ) );
+		}
+
+		builder.Append( SubsectionEnd() );
+
+		return builder.ToString();
 	}

 	private static string GenerateItemProperties( Type item ) {
 		var properties = item.GetProperties( BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly ).ToList();
 		properties.Sort( new PropertyInfoComparer() );
-
-		if ( properties.Count > 0 ) {
-			var builder = new StringBuilder();
-
-			builder.Append( SubsectionStart( "Properties" ) );
-			foreach ( var property in properties ) {
-				if ( !property.CanRead && !property.CanWrite ) continue;
-				//builder.Append( SubsectionSegment( string.Format( "{2}.{0}-{1}.html", item.Name, property.Name, item.Namespace ), property.Name ) );
-				builder.Append( SubsectionSegment( "#", property.Name ) );
-			}
-			builder.Append( SubsectionEnd() );
-
-			return builder.ToString();
-		}
-
-		return "";
+		for ( int i = properties.Count - 1; i >= 0; i-- ) {
+			if ( properties[i].GetCustomAttributes( typeof(DocsIgnoreAttribute), false ).Length > 0 ) {
+				properties.RemoveAt( i );
+			}
+		}
+
+		var builder = new StringBuilder();
+
+		builder.Append( SubsectionStart( "Properties" ) );
+		foreach ( var property in properties ) {
+			if ( !property.CanRead && !property.CanWrite ) continue;
+
+			//builder.Append( SubsectionSegment( string.Format( "{2}.{0}-{1}.html", item.Name, property.Name, item.Namespace ), property.Name ) );
+			builder.Append( SubsectionSegment( "#", property.Name, GetDescription( property ) ) );
+		}
+
+		if ( properties.Count == 0 ) {
+			builder.Append( SubsectionSegment( "#", "No properties visible", "-" ) );
+		}
+
+		builder.Append( SubsectionEnd() );
+
+		return builder.ToString();
 	}

 	private static string GenerateItemConstructors( Type item ) {
-		var constructors = item.GetConstructors( BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly );
-		if ( constructors.Length > 0 ) {
-			var builder = new StringBuilder();
-
-			builder.Append( SubsectionStart( "Constructors" ) );
-			for ( int i = 0; i < constructors.Length; i++ ) {
-				if ( constructors[i].IsPrivate ) continue;
-				builder.Append( SubsectionSegment(
-					string.Format( "{2}.{3}{0}-{0}.html",
-					item.Name,
-					constructors[i].Name,
-					item.Namespace,
-					item.ReflectedType == null ? "" : item.ReflectedType.Name + "." ), item.Name ) );
-				// breaking after the first, we only want one
-				break;
-			}
-			builder.Append( SubsectionEnd() );
-
-			return builder.ToString();
-		}
-
-		return "";
+		var constructors = item.GetConstructors( BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly ).ToList();
+		for ( int i = constructors.Count - 1; i >= 0; i-- ) {
+			if ( constructors[i].GetCustomAttributes( typeof(DocsIgnoreAttribute), false ).Length > 0 ) {
+				constructors.RemoveAt( i );
+			}
+		}
+
+		var builder = new StringBuilder();
+
+		builder.Append( SubsectionStart( "Constructors" ) );
+		for ( int i = 0; i < constructors.Count; i++ ) {
+			if ( constructors[i].IsPrivate ) continue;
+			builder.Append( SubsectionSegment(
+				string.Format( "{2}.{3}{0}-{0}.html",
+				item.Name,
+				constructors[i].Name,
+				item.Namespace,
+				item.ReflectedType == null ? "" : item.ReflectedType.Name + "." ), item.Name, GetDescription( constructors[i] ) ) );
+			// breaking after the first, we only want one
+			break;
+		}
+
+		if ( constructors.Count == 0 ) {
+			builder.Append( SubsectionSegment( "#", "No constructors visible", "-" ) );
+		}
+
+		builder.Append( SubsectionEnd() );
+
+		return builder.ToString();
 	}

 	private static string GenerateItemPublicFunctions( Type item ) {
@@ -249,28 +323,34 @@
 					methods.RemoveAt( i + 1 );
 				}
 			}
-		}
-
-		if ( methods.Count > 0 ) {
-			var builder = new StringBuilder();
-
-			builder.Append( SubsectionStart( "Public Functions" ) );
-			foreach ( var function in methods ) {
-				if ( function.IsPrivate ) continue;
-				if ( function.Name.StartsWith( "get_" ) || function.Name.StartsWith( "set_" ) ) continue;
-				builder.Append( SubsectionSegment(
-					string.Format( "{2}.{3}{0}-{1}.html",
-					item.Name,
-					function.Name,
-					item.Namespace,
-					item.ReflectedType == null ? "" : item.ReflectedType.Name + "." ), function.Name ) );
-			}
-			builder.Append( SubsectionEnd() );
-
-			return builder.ToString();
-		}
-
-		return "";
+
+			if ( methods[i].GetCustomAttributes( typeof(DocsIgnoreAttribute), false ).Length > 0 ) {
+				methods.RemoveAt( i );
+			}
+		}
+
+		var builder = new StringBuilder();
+
+		builder.Append( SubsectionStart( "Public Methods" ) );
+		foreach ( var method in methods ) {
+			if ( method.IsPrivate ) continue;
+			if ( method.Name.StartsWith( "get_" ) || method.Name.StartsWith( "set_" ) ) continue;
+
+			builder.Append( SubsectionSegment(
+				string.Format( "{2}.{3}{0}-{1}.html",
+				item.Name,
+				method.Name,
+				item.Namespace,
+				item.ReflectedType == null ? "" : item.ReflectedType.Name + "." ), method.Name, GetDescription( method ) ) );
+		}
+
+		if ( methods.Count == 0 ) {
+			builder.Append( SubsectionSegment( "#", "No methods visible", "-" ) );
+		}
+
+		builder.Append( SubsectionEnd() );
+
+		return builder.ToString();
 	}

 	private static string GenerateItemStaticFunctions( Type item ) {
@@ -283,27 +363,30 @@
 					methods.RemoveAt( i + 1 );
 				}
 			}
-		}
-
-		if ( methods.Count > 0 ) {
-			var builder = new StringBuilder();
-
-			builder.Append( SubsectionStart( "Static Functions" ) );
-			foreach ( var function in methods ) {
-				builder.Append( SubsectionSegment(
-					string.Format( "{2}.{3}{0}-{1}.html",
-					item.Name,
-					function.Name,
-					item.Namespace,
-					item.ReflectedType == null ? "" : item.ReflectedType.Name + "." ), function.Name ) );
-			}
-			builder.Append( SubsectionEnd() );
-
-
-			return builder.ToString();
-		}
-
-		return "";
+
+			if ( methods[i].GetCustomAttributes( typeof(DocsIgnoreAttribute), false ).Length > 0 ) {
+				methods.RemoveAt( i );
+			}
+		}
+		var builder = new StringBuilder();
+
+		builder.Append( SubsectionStart( "Static Methods" ) );
+		foreach ( var method in methods ) {
+			builder.Append( SubsectionSegment(
+				string.Format( "{2}.{3}{0}-{1}.html",
+				item.Name,
+				method.Name,
+				item.Namespace,
+				item.ReflectedType == null ? "" : item.ReflectedType.Name + "." ), method.Name, GetDescription( method ) ) );
+		}
+
+		if ( methods.Count == 0 ) {
+			builder.Append( SubsectionSegment( "#", "No static methods visible", "-" ) );
+		}
+
+		builder.Append( SubsectionEnd() );
+
+		return builder.ToString();
 	}

 	private static string SubsectionStart( string name ) {
@@ -313,13 +396,13 @@

", name );
 	}

-	private static string SubsectionSegment( string link, string name ) {
+	private static string SubsectionSegment( string link, string name, string description ) {
 		return string.Format( @"

 		{1}

-	...
-
", link, name );
+	{2}
+
", link, name, string.IsNullOrEmpty( description ) ? "..." : description );
 	}

 	private static string SubsectionEnd() {
@@ -336,6 +419,8 @@
 		var types = t.Assembly.GetTypes();
 		foreach ( var item in types ) {
 			if ( item.Namespace == null ) continue;
+			if ( item.GetCustomAttributes( typeof(DocsIgnoreAttribute), false ).Length > 0 ) continue;
+
 			if ( item.Namespace.StartsWith( "TNRD" ) ) {

 				// Not doing pages for fields or properties
@@ -352,6 +437,8 @@

 		foreach ( var field in fields ) {
 			if ( field.IsPrivate ) continue;
+			if ( field.GetCustomAttributes( typeof(DocsIgnoreAttribute), false ).Length > 0 ) continue;
+
 			var builder = new StringBuilder();

 			builder.Append( DocumentStart() );
@@ -397,6 +484,7 @@
 			var setm = property.GetGetMethod();

 			if ( !( getm == null || getm.IsFamily || getm.IsPublic ) && ( setm == null || !setm.IsFamily || setm.IsPublic ) ) continue;
+			if ( property.GetCustomAttributes( typeof(DocsIgnoreAttribute), false ).Length > 0 ) continue;

 			var builder = new StringBuilder();

@@ -456,12 +544,13 @@
 	}

 	private static void GenerateMemberMethods( Type parent ) {
-		var typeMethods = parent.GetMethods( BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly );
+		var typeMethods = parent.GetMethods( BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly );
 		var methodInfos = new Dictionary<string, List<MethodInfo>>();

 		foreach ( var item in typeMethods ) {
 			if ( item.IsPrivate ) continue;
 			if ( item.Name.StartsWith( "get_" ) || item.Name.StartsWith( "set_" ) ) continue;
+			if ( item.GetCustomAttributes( typeof(DocsIgnoreAttribute), false ).Length > 0 ) continue;

 			if ( methodInfos.ContainsKey( item.Name ) ) {
 				methodInfos[item.Name].Add( item );
@@ -513,12 +602,12 @@
 				}
 				parameters = parameters.TrimEnd( ',' );
 				parameters += " ";
-				parameters.Trim();
+				parameters = parameters.Trim();

 				builder.AppendFormat(
 @"

-	{0} {1} {2}({3});
-
", method.IsFamily ? "protected" : "public", GetType( method.ReturnType ), method.Name, parameters );
+	{0}{4} {1} {2}({3});
+
", method.IsFamily ? "protected" : "public", GetType( method.ReturnType ), method.Name, parameters, method.IsStatic ? " static" : "" );
 			}

 			builder.Append(
@@ -539,10 +628,10 @@

" );

-			builder.Append( @"

+			builder.AppendFormat( @"

Description

-
...

-
" );
+
{0}

+
", GetDescription( value ) );

 			builder.Append( DocumentEnd() );

@@ -568,7 +657,7 @@

 		foreach ( var item in methodInfos ) {
 			var name = parent.Name.Replace( "[T]", "" ).Replace( "`1", "" );
-            var value = item.Value[0];
+			var value = item.Value[0];
 			var path = string.Format( "{0}-{1}.html",
 				parent.ToString(), parent.Name )
 				.Replace( "+", "." )
@@ -605,7 +694,7 @@
 				}
 				parameters = parameters.TrimEnd( ',' );
 				parameters += " ";
-				parameters.Trim();
+				parameters = parameters.Trim();

 				builder.AppendFormat(
 @"

@@ -639,28 +728,6 @@
 			builder.Append( DocumentEnd() );

 			File.WriteAllText( path, builder.ToString() );
-		}
-	}
-
-	private static string GetType( Type item ) {
-		Type[] args;
-		switch ( item.Name ) {
-			case "Void":
-				return "void";
-			case "Int32":
-				return "int";
-			case "Boolean":
-				return "bool";
-			case "Single":
-				return "float";
-			case "Dictionary`2":
-				args = item.GetGenericArguments();
-				return string.Format( "Dictionary<{0}, {1}>", GetType( args[0] ), GetType( args[1] ) );
-			case "List`1":
-				args = item.GetGenericArguments();
-				return string.Format( "List<{0}>", GetType( args[0] ) );
-			default:
-				return item.Name;
 		}
 	}

@@ -745,6 +812,30 @@
 	//	return "";
 	//}
 	#endregion
+
+	private static string GetType( Type item ) {
+		Type[] args;
+		switch ( item.Name ) {
+			case "Void":
+				return "void";
+			case "Int32":
+				return "int";
+			case "Boolean":
+				return "bool";
+			case "Single":
+				return "float";
+			case "String":
+				return "string";
+			case "Dictionary`2":
+				args = item.GetGenericArguments();
+				return string.Format( "Dictionary<{0}, {1}>", GetType( args[0] ), GetType( args[1] ) );
+			case "List`1":
+				args = item.GetGenericArguments();
+				return string.Format( "List<{0}>", GetType( args[0] ) );
+			default:
+				return item.Name;
+		}
+	}

 	private static string DocumentStart() {
 		return @"<!DOCTYPE html>
@@ -803,4 +894,22 @@

 ";
 	}
+
+	private static string GetDescription( MemberInfo item ) {
+		var attr = item.GetCustomAttributes( typeof(DocsDescriptionAttribute), false );
+		if ( attr.Length > 0 ) {
+			return ( attr[0] as DocsDescriptionAttribute ).Description;
+		} else {
+			return "";
+		}
+	}
+
+	private static string GetDescription( ParameterInfo item ) {
+		var attr = item.GetCustomAttributes( typeof(DocsDescriptionAttribute), false );
+		if ( attr.Length > 0 ) {
+			return ( attr[0] as DocsDescriptionAttribute ).Description;
+		} else {
+			return "";
+		}
+	}
 }


Changed the returning DateTime.Elapsed value to a TimeSpan type

git-svn-id: 36ffe9fc6fb3fc911a0fa1910eeaa8f32b731f7d@17346 81fbe566-5dc4-48c1-bdea-7421811ca204

--- ExtensionMethods/DateTimeExtensions.cs
+++ ExtensionMethods/DateTimeExtensions.cs
@@ -17,7 +17,7 @@
         /// </summary>
         /// <param name="datetime">The datetime.</param>
         /// <returns></returns>
-        public static DateTime Elapsed(this DateTime datetime)
+        public static TimeSpan Elapsed(this DateTime datetime)
         {
             return DateTime.Now - datetime;
         }


sql sql优化

sql
sql优化

--- SurveyDesign/Government/AppSGXKZGL/CCBLFSAuditInfo.aspx.cs
+++ SurveyDesign/Government/AppSGXKZGL/CCBLFSAuditInfo.aspx.cs
@@ -372,6 +372,7 @@
                 SqlCommand cmd = new SqlCommand(sql, conn);

                 int a = cmd.ExecuteNonQuery();
+                sql = "";//每次执行完成sql后清空sql
             }

               // foreach (var item in v.ToList<TC_PrjItem_Emp>())


Allow word boundary delimiter to be set by user

--- FluentConsole/FluentConsoleSettings.cs
+++ FluentConsole/FluentConsoleSettings.cs
@@ -19,5 +19,10 @@
         /// </summary>
         public static int LineWrapWidth { get; set; } = ConsoleWrapper.BufferWidth;

+        /// <summary>
+        /// Gets or sets the delimter used when wrapping long lines of text. The default is a space character. Note: This value is ignored if
+        /// 'LineWrapOption' is set to 'Off'.
+        /// </summary>
+        public static char WordDelimiter { get; set; } = ' ';
     }
 }


Specify correct version and name in assembly info.

--- ForecastPCL/Properties/AssemblyInfo.cs
+++ ForecastPCL/Properties/AssemblyInfo.cs
@@ -6,12 +6,12 @@
 // General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
-[assembly: AssemblyTitle("Forecast.io PCL")]
+[assembly: AssemblyTitle("ForecastPCL")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Forecast.io PCL")]
-[assembly: AssemblyCopyright("Copyright ©  2014")]
+[assembly: AssemblyProduct("ForecastPCL")]
+[assembly: AssemblyCopyright("Copyright ©  2015")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 [assembly: NeutralResourcesLanguage("en")]
@@ -26,5 +26,5 @@
 // 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.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("2.1.0.0")]
+[assembly: AssemblyFileVersion("2.1.0.0")]


Update WorkOrder.cs

Update WorkOrder.cs

--- Test/AdventureWorksFunctionalModel/Production/WorkOrder.cs
+++ Test/AdventureWorksFunctionalModel/Production/WorkOrder.cs
@@ -29,9 +29,7 @@
         public virtual short? ScrapReasonID { get; init; }

         [MemberOrder(26)]
-#pragma warning disable 8618
-        public virtual ScrapReason ScrapReason { get; init; }
-#pragma warning restore 8618
+        public virtual ScrapReason? ScrapReason { get; init; }

         [MemberOrder(20)]
         public virtual int OrderQty { get; init; }


Improvements

Improvements

Avoid calling Execute on a Command already completed while in
ParallelCommands

--- FrozenCore/Commands/ParallelCommand.cs
+++ FrozenCore/Commands/ParallelCommand.cs
@@ -30,7 +30,10 @@
             IsComplete = false;
             foreach (Command c in _commands)
             {
-                c.Execute(inSecondsPast, inGameObject);
+                if (!c.IsComplete)
+                {
+                    c.Execute(inSecondsPast, inGameObject);
+                }
                 IsComplete &= c.IsComplete;
             }
         }


Roads are now shown by default

Roads are now shown by default

--- Navier-Boats/Navier-Boats/Navier-Boats/Engine/System/ConsoleVars.cs
+++ Navier-Boats/Navier-Boats/Navier-Boats/Engine/System/ConsoleVars.cs
@@ -36,6 +36,7 @@
         private ConsoleVars()
         {
             debugDraw = false;
+            ShowRoads = true;
         }

         #endregion


Address code review feedback

Address code review feedback

--- test/PowerShellCmdlets.Test/InstallPackageCommandTest.cs
+++ test/PowerShellCmdlets.Test/InstallPackageCommandTest.cs
@@ -624,7 +624,7 @@
             sharedRepository.Setup(s => s.AddPackage(packageC)).Verifiable();

             var mockRepository = new Mock<IPackageRepository>();
-            mockRepository.Setup(c => c.GetPackages()).Returns(GetPackagesWithException().AsQueryable());
+            mockRepository.Setup(c => c.GetPackages()).Returns(GetPackagesWithException().AsQueryable()).Verifiable();
             var packageRepository = new AggregateRepository(new[] {
                 new MockPackageRepository {
                     packageA
@@ -650,6 +650,7 @@

             // Assert
             sharedRepository.Verify();
+            mockRepository.Verify();
         }

         [Fact]


more assertions... and then commented out, because I don't know what desired deserializer behavior is

--- test/UnitTests/Serialization/JsonApiDeSerializerTests.cs
+++ test/UnitTests/Serialization/JsonApiDeSerializerTests.cs
@@ -649,13 +649,23 @@
             }";

             // act
-            var result = deserializer.Deserialize<OneToManyDependent>(contentString);
+            var result = deserializer.Deserialize<OneToManyIndependent>(contentString);

             // assert
             Assert.NotNull(result);
             Assert.Equal(1, result.Id);
             Assert.NotNull(result.ManyToManys);
             Assert.Equal(2, result.ManyToManys.Count);
+
+            // TODO: not sure if this should be a thing that works?
+            //       could this cause cycles in the graph?
+            // Assert.NotNull(result.ManyToManys[0].Dependent);
+            // Assert.NotNull(result.ManyToManys[0].Independent);
+            // Assert.NotNull(result.ManyToManys[1].Dependent);
+            // Assert.NotNull(result.ManyToManys[1].Independent);
+
+            // Assert.Equal(result.ManyToManys[0].Dependent, result.ManyToManys[1].Dependent);
+            // Assert.NotEqual(result.ManyToManys[0].Independent, result.ManyToManys[1].Independent);
         }

         private JsonApiDeSerializer GetDeserializer(ContextGraphBuilder contextGraphBuilder)
@@ -681,9 +691,9 @@
         private class ManyToManyNested : Identifiable
         {
             [Attr("name")] public string Name { get; set; }
-            [HasOne("dependent")] public OneToManyDependent Dependents { get; set; }
+            [HasOne("dependent")] public OneToManyDependent Dependent { get; set; }
             public int DependentId { get; set; }
-            [HasOne("independent")] public OneToManyIndependent Independents { get; set; }
+            [HasOne("independent")] public OneToManyIndependent Independent { get; set; }
             public int InependentId { get; set; }
         }


test(domain): test build vsts

test(domain): test build vsts

--- tests/Application.Seedwork.Tests/Mocks/ProjectionTest.cs
+++ tests/Application.Seedwork.Tests/Mocks/ProjectionTest.cs
@@ -3,5 +3,6 @@
     internal class ProjectionTest
     {
         public int Id { get; set; }
+        public string Name { get; set; }
     }
 }


Fix broken screenshot generation

Fix broken screenshot generation

Fix screenshot generation failing if the directory did not exist.
Fix incorrect format string used for years in the file name which just used literal "YYYY" instead.

--- tests/LondonTravel.Site.Tests/Integration/BrowserTest.cs
+++ tests/LondonTravel.Site.Tests/Integration/BrowserTest.cs
@@ -301,9 +301,15 @@
                     Screenshot screenshot = camera.GetScreenshot();

                     string directory = Path.GetDirectoryName(typeof(BrowserTest).Assembly.Location);
-                    string fileName = $"{testName}_{DateTimeOffset.UtcNow:YYYY-MM-dd-HH-mm-ss}.png";
-
-                    fileName = Path.Combine(directory, "screenshots", fileName);
+                    directory = Path.Combine(directory, "screenshots");
+
+                    string fileName = $"{testName}_{DateTimeOffset.UtcNow:yyyy-MM-dd-HH-mm-ss}.png";
+                    fileName = Path.Combine(directory, fileName);
+
+                    if (!Directory.Exists(directory))
+                    {
+                        Directory.CreateDirectory(directory);
+                    }

                     screenshot.SaveAsFile(fileName);
                 }


Override ToString()

Override ToString()

Override ToString() to make it easier to see the state of the burrows.

--- src/AdventOfCode/Puzzles/Y2021/Day23.cs
+++ src/AdventOfCode/Puzzles/Y2021/Day23.cs
@@ -118,6 +118,37 @@

             return string.IsNullOrWhiteSpace(Hallway.Substring(startIndex, length));
         }
+
+        public override string ToString()
+        {
+            var builder = new StringBuilder()
+                .AppendLine("#############")
+                .Append('#')
+                .Append(Hallway.Replace(' ', '.'))
+                .Append('#')
+                .AppendLine()
+                .Append("###")
+                .Append(Amber[0])
+                .Append('#')
+                .Append(Bronze[0])
+                .Append('#')
+                .Append(Copper[0])
+                .Append('#')
+                .Append(Desert[0])
+                .AppendLine("###")
+                .Append("  #")
+                .Append(Amber[1])
+                .Append('#')
+                .Append(Bronze[1])
+                .Append('#')
+                .Append(Copper[1])
+                .Append('#')
+                .Append(Desert[1])
+                .AppendLine("#  ")
+                .AppendLine("  #########  ");
+
+            return builder.ToString();
+        }
     }

     private sealed class Burrow : IWeightedGraph<State>


docs: `formatted` readability fix (#6627)

Signed-off-by: Ryan Russell <46f1a0bd5592a2f9244ca321b129902a06b53e03@ryanrussell.org>

Signed-off-by: Ryan Russell <46f1a0bd5592a2f9244ca321b129902a06b53e03@ryanrussell.org>

--- ToolBox/RandomDataGenerator/RandomDataGeneratorSettings.cs
+++ ToolBox/RandomDataGenerator/RandomDataGeneratorSettings.cs
@@ -194,7 +194,7 @@
             else if (!bool.TryParse(includeCoarseString, out includeCoarse))
             {
                 failed = true;
-                Log.Error($"RandomDataGeneratorSettings(): Optional parameter --include-coarse was incorrectly formated. Please specify a valid boolean. Value provided: '{includeCoarseString}'. Valid values: 'true' or 'false'");
+                Log.Error($"RandomDataGeneratorSettings(): Optional parameter --include-coarse was incorrectly formatted. Please specify a valid boolean. Value provided: '{includeCoarseString}'. Valid values: 'true' or 'false'");
             }
             else if (includeCoarse && securityType != SecurityType.Equity)
             {
@@ -211,7 +211,7 @@
             {
                 var validValues = string.Join(", ", Enum.GetValues(typeof(DataDensity))).Cast<DataDensity>();
                 failed = true;
-                Log.Error($"RandomDataGeneratorSettings(): Optional parameter --data-density was incorrectly formated. Please specify a valid DataDensity. Value provided: '{dataDensityString}'. Valid values: {validValues}");
+                Log.Error($"RandomDataGeneratorSettings(): Optional parameter --data-density was incorrectly formatted. Please specify a valid DataDensity. Value provided: '{dataDensityString}'. Valid values: {validValues}");
             }

             // --quote-trade-ratio


Eliminate sb pool leak in StringExtensions

--- src/AngleSharp/Text/StringExtensions.cs
+++ src/AngleSharp/Text/StringExtensions.cs
@@ -648,7 +648,11 @@
                     var character = value[i];

                     if (character == Symbols.Null)
+                    {
+                        builder.ReturnToPool();
+
                         throw new DomException(DomError.InvalidCharacter);
+                    }

                     if (character == Symbols.DoubleQuote || character == Symbols.ReverseSolidus)
                     {


Corrected Method order in TimeSpanExtensions

--- src/BCLExtensions/TimeSpanExtensions.cs
+++ src/BCLExtensions/TimeSpanExtensions.cs
@@ -8,6 +8,18 @@
     public static class TimeSpanExtensions
     {
         /// <summary>
+        /// Adds the specified duration from the provided <see cref="System.DateTime" />.
+        /// </summary>
+        /// <param name="duration">The duration.</param>
+        /// <param name="dateTime">The date time.</param>
+        /// <returns>The calculated Result DateTime.</returns>
+        /// <exception cref="ArgumentOutOfRangeException"></exception>
+        public static DateTime After(this TimeSpan duration, DateTime dateTime)
+        {
+            return dateTime + duration;
+        }
+
+        /// <summary>
         /// Substracts the specified duration from the current DateTime.Now value.
         /// </summary>
         /// <param name="duration">The duration.</param>
@@ -15,16 +27,6 @@
         public static DateTime Ago(this TimeSpan duration)
         {
             return DateTime.Now - duration;
-        }
-
-        /// <summary>
-        /// Adds the specified duration from the current DateTime.Now value.
-        /// </summary>
-        /// <param name="duration">The duration.</param>
-        /// <returns>The calculated Result DateTime.</returns>
-        public static DateTime FromNow(this TimeSpan duration)
-        {
-            return DateTime.Now + duration;
         }

         /// <summary>
@@ -40,15 +42,13 @@
         }

         /// <summary>
-        /// Adds the specified duration from the provided <see cref="System.DateTime" />.
+        /// Adds the specified duration from the current DateTime.Now value.
         /// </summary>
         /// <param name="duration">The duration.</param>
-        /// <param name="dateTime">The date time.</param>
         /// <returns>The calculated Result DateTime.</returns>
-        /// <exception cref="ArgumentOutOfRangeException"></exception>
-        public static DateTime After(this TimeSpan duration, DateTime dateTime)
+        public static DateTime FromNow(this TimeSpan duration)
         {
-            return dateTime + duration;
+            return DateTime.Now + duration;
         }
     }
 }


Fix comment to use proper assembly name (SIL.Windows.Forms)

--- src/BloomExe/Workspace/WorkspaceView.cs
+++ src/BloomExe/Workspace/WorkspaceView.cs
@@ -636,7 +636,7 @@
 		private void _trainingVideosMenuItem_Click(object sender, EventArgs e)
 		{
 			var path = FileLocator.GetFileDistributedWithApplication(false,"infoPages", "TrainingVideos-en.md");
-			//enhance: change the name of this class in libpalaso to just "MarkDownDialog"
+			//enhance: change the name of this class in SIL.Windows.Forms to just "MarkDownDialog"
 			using(var dlg = new ShowReleaseNotesDialog(global::Bloom.Properties.Resources.Bloom, path))
 			{
 				dlg.Text = LocalizationManager.GetString("HelpMenu.trainingVideos", "Training Videos");
@@ -891,4 +891,4 @@
 			base.OnRenderItemText(e);
 		}
 	}
-}+}


Lucene return log order by date.

Lucene return log order by date.

--- src/CK.Glouton.Lucene/LuceneSearcher.cs
+++ src/CK.Glouton.Lucene/LuceneSearcher.cs
@@ -16,6 +16,7 @@
     public class LuceneSearcher : ILuceneSearcher
     {
         private readonly IndexSearcher _indexSearcher;
+        private readonly Sort _sort;

         /// <summary>
         /// Basic Searcher in a Lucene index for CK.Monitoring log.
@@ -25,6 +26,9 @@
         public LuceneSearcher( MultiReader multiReader )
         {
             _indexSearcher = new IndexSearcher( multiReader );
+            _sort = new Sort(
+                SortField.FIELD_SCORE,
+                new SortField(LogField.LOG_TIME, SortFieldType.STRING));
         }

         /// <summary>
@@ -48,7 +52,7 @@
             if( searchConfiguration.WantAll )
                 return Search( searchConfiguration, GetAll( searchConfiguration.All ) );

-            return CreateLogsResult( _indexSearcher?.Search(  CreateQuery( searchConfiguration ) , searchConfiguration.MaxResult ) );
+            return CreateLogsResult( _indexSearcher?.Search(  CreateQuery( searchConfiguration ) , searchConfiguration.MaxResult, _sort ) );
         }

         private Query GetAll( LuceneWantAll all )
@@ -141,7 +145,7 @@

         private List<ILogViewModel> Search( LuceneSearcherConfiguration configuration, Query searchQuery )
         {
-            return CreateLogsResult( _indexSearcher?.Search( searchQuery, configuration.MaxResult ) );
+            return CreateLogsResult( _indexSearcher?.Search( searchQuery, configuration.MaxResult, _sort ) );
         }

         public Document GetDocument( ScoreDoc scoreDoc )
@@ -156,7 +160,7 @@

         public Document GetDocument( string key, string value, int maxResult )
         {
-            return GetDocument( _indexSearcher?.Search( new TermQuery( new Term( key, value ) ), maxResult ).ScoreDocs.First() );
+            return GetDocument( _indexSearcher?.Search( new TermQuery( new Term( key, value ) ), maxResult, _sort ).ScoreDocs.First() );
         }

         private bool CheckSearchConfiguration( LuceneSearcherConfiguration configuration ) // TODO: Check if the check is good.


Restore previously active document after cleanup

--- src/Command/CleanupDirtyFilesCommand.cs
+++ src/Command/CleanupDirtyFilesCommand.cs
@@ -102,6 +102,8 @@

             filesToCleanup = filesToCleanup.Where(f => extensionToUpdate.Any(f.EndsWith)).Select(f => Path.Combine(solutionPath, f)).ToList();

+            var previouslyActiveDocument = dte.ActiveDocument;
+
             foreach (var file in filesToCleanup)
             {
                 var isClosed = !dte.ItemOperations.IsFileOpen(file);
@@ -116,6 +118,8 @@
                 if (!document.Saved) document.Save();
                 if (isClosed) document.Close();
             }
+
+            previouslyActiveDocument?.Activate();
         }
     }
 }


Small bugfix - prevents looking for solution in the parent dir of
a root (e.g. c:\), which throws a null reference exception.

--HG--
extra : rebase_source : 9a08c88e29b4f548274f9726ad4bcb45e2a155f4

--- src/CommandLine/Common/ProjectHelper.cs
+++ src/CommandLine/Common/ProjectHelper.cs
@@ -51,6 +51,8 @@
                 }

                 path = Path.GetDirectoryName(path);
+                //When you get to c:\, the parent path is null.
+                if (path == null) break;

                 depth++;
             } while (depth < maxDepth);


Fixed FindMonoPath to return Mono base path and not binary path.

--- src/Core/Toolchains/ManagedToolchain.cs
+++ src/Core/Toolchains/ManagedToolchain.cs
@@ -10,9 +10,9 @@
         public static string FindMonoPath()
         {
             if (Platform.IsWindows)
-                return @"C:\\Program Files (x86)\\Mono\bin";
+                return @"C:\Program Files (x86)\Mono";
             else if (Platform.IsMacOS)
-                return "/Library/Frameworks/Mono.framework/Versions/Current/bin";
+                return "/Library/Frameworks/Mono.framework/Versions/Current";

             throw new NotImplementedException();
         }
@@ -35,7 +35,8 @@

         public static string FindCSharpCompilerPath()
         {
-            return Path.Combine(FindCSharpCompilerDir(), Platform.IsWindows ? "csc.exe" : "mcs");
+            return Path.Combine(FindCSharpCompilerDir(), "bin",
+                Platform.IsWindows ? "csc.exe" : "mcs");
         }
     }
 }


Fixed NRE in WebPagesTransformer in method ProcessGeneratedCode - the _razorHost was never initialized in Initialize method. (#91)

--- RazorGenerator.Core.v1/CodeTransformers/AggregateCodeTransformer.cs
+++ RazorGenerator.Core.v1/CodeTransformers/AggregateCodeTransformer.cs
@@ -13,6 +13,8 @@

         public override void Initialize(RazorHost razorHost, IDictionary<string, string> directives)
         {
+            base.Initialize(razorHost, directives);
+
             foreach (var transformer in CodeTransformers)
             {
                 transformer.Initialize(razorHost, directives);


IncrementalCacheOptimizeThreadSafe mostly updated to new model.

--- SIMDPrototyping/Trees/SingleArray/Tree_IncrementalCacheOptimizer.cs
+++ SIMDPrototyping/Trees/SingleArray/Tree_IncrementalCacheOptimizer.cs
@@ -305,15 +305,25 @@
         }

-
-        public unsafe void IncrementalCacheOptimizeThreadSafe(int nodeIndex)
+        /// <summary>
+        /// Moves the children if the specified node into the correct relative position in memory.
+        /// Takes care to avoid contested moves in multithreaded contexts. May not successfully
+        /// complete all desired moves if contested.
+        /// </summary>
+        /// <param name="nodeIndex">Node whose children should be optimized.</param>
+        /// <returns>True if no other threads contested the optimization, otherwise false.
+        /// Will return true even if not all nodes are optimized if the reason was a target index outside of the node list bounds.</returns>
+        public unsafe bool IncrementalCacheOptimizeThreadSafe(int nodeIndex)
         {
             //Multithreaded cache optimization attempts to acquire a lock on every involved node.
             //If any lock fails, it just abandons the entire attempt.
             //That's acceptable- the incremental optimization only cares about eventual success.
+
+            //TODO: could attempt to compare child pointers without locks. Unsafe, but acceptable as an optimization prepass. Would avoid some interlocks.
+            //It's a PERFORMANCE question, though, so make sure you measure it.
             var node = nodes + nodeIndex;
-            bool nodeLock = 0 == Interlocked.CompareExchange(ref node->RefineFlag, 1, 0);
-            if (nodeLock)
+            bool success = true;
+            if (0 == Interlocked.CompareExchange(ref node->RefineFlag, 1, 0))
             {
                 var children = &node->ChildA;

@@ -343,24 +353,54 @@
                     if (children[i] >= 0)
                     {
                         //Lock before comparing the children to stop the children from changing.
-                        if (0 == Interlocked.CompareExchange(ref nodes[children[i]].RefineFlag, 1, 0))
+                        if (TryLock(ref children[i]))
                         {
-                            if (children[i] != targetIndex)
+                            var originalChildIndex = children[i];
+                            //While we checked if children[i] != targetIndex earlier as an early-out, it must be done post-lock for correctness because children[i] could have changed.
+                            //Attempting a swap between an index and itself is invalid.
+                            if (originalChildIndex != targetIndex)
                             {
-                                var originalChildIndex = children[i];
-                                if (0 == Interlocked.CompareExchange(ref nodes[targetIndex].RefineFlag, 1, 0))
-                                {
-                                    SwapNodes(originalChildIndex, targetIndex);
-                                    //Unlock.
-                                    //The refined node was swapped into the child's old position. Clear its flag.
-                                    nodes[originalChildIndex].RefineFlag = 0;
-                                    //break;
-                                }
+                                //Now lock all of this child's children.
+                                var child = nodes + originalChildIndex;
+                                var grandchildren = &child->ChildA;
+                                int lockedChildrenCount = child->ChildCount;
+                                for (int grandchildIndex = 0; grandchildIndex < child->ChildCount; ++grandchildIndex)
+                                {
+                                    if (!TryLock(ref grandchildren[grandchildIndex]))
+                                    {
+                                        lockedChildrenCount = grandchildIndex;
+                                        break;
+                                    }
+                                }
+                                if (lockedChildrenCount == child->ChildCount)
+                                {
+                                    if (!TrySwapNodeWithTargetThreadSafe(originalChildIndex, targetIndex))
+                                    {
+                                        //Failed target lock.
+                                        success = false;
+                                    }
+                                }
+                                else
+                                {
+                                    //Failed child lock.
+                                    success = false;
+                                }
+
+                                //Unlock all children.
+                                for (int grandchildIndex = lockedChildrenCount - 1; grandchildIndex >= 0; --grandchildIndex)
+                                {
+                                    nodes[grandchildren[grandchildIndex]].RefineFlag = 0;
+                                }
+
                             }
                             //Unlock. children[i] is either the targetIndex, if a swap went through, or it's the original child index if it didn't.
                             //Those are the proper targets.
                             nodes[children[i]].RefineFlag = 0;
                         }
+                        else
+                        {
+                            success = false;
+                        }
                         //Leafcounts cannot change due to other threads.
                         targetIndex += leafCounts[i] - 1; //Only works on 2-ary trees.
                     }
@@ -370,6 +410,11 @@
                 //Unlock the node.
                 node->RefineFlag = 0;
             }
+            else
+            {
+                success = false;
+            }
+            return success;
         }

         public unsafe void IncrementalCacheOptimize(int nodeIndex)


NormalWindowProxy.Ok() wait until IsClosed

--- Signum.Windows.Extensions.UIAutomation/Proxies/NormalWindowProxy.cs
+++ Signum.Windows.Extensions.UIAutomation/Proxies/NormalWindowProxy.cs
@@ -35,7 +35,12 @@

         public AutomationElement LeftExpander
         {
-            get { return Element.ChildById("expander"); }
+            get { return Element.ChildById("widgetPanel").ChildById("expander"); }
+        }
+
+        public AutomationElement LeftExpanderButton
+        {
+            get { return LeftExpander.ChildById("HeaderSite"); }
         }

         AutomationElement mainControl;
@@ -57,7 +62,10 @@

         public void Ok()
         {
-            ButtonBar.OkButton.ButtonInvoke();
+           ButtonBar.OkButton.ButtonInvoke();
+
+           Element.Wait(() => IsClosed,
+           actionDescription: () => "Waiting to close window after OK {0}".Formato(EntityId));
         }

         public AutomationElement OkCapture()
@@ -93,7 +101,6 @@
                     mb.CancelButton.ButtonInvoke();
             }
         }
-
         public void Execute(Enum operationKey, int? timeOut = null)
         {
             var time = timeOut ?? OperationTimeouts.ExecuteTimeout;


Small changes to code layout #1

Small changes to code layout
#1

--- Source/Backend/Kf.Numaris.Api/Validation/Numbers/NumberValidator.cs
+++ Source/Backend/Kf.Numaris.Api/Validation/Numbers/NumberValidator.cs
@@ -42,18 +42,15 @@
         }

         public virtual IValidationResult Validate(string[] input)
-        {
-            var fieldValidators = OrderedFieldValidators.Select((fv, i) => fv.Validate(input[i]));
-            var multipleFieldsValidators = EvaluateMultipleFieldsValidators();
-            return new ValidationResult(fieldValidators.Concat(multipleFieldsValidators));
-        }
+            => new ValidationResult(
+                    OrderedFieldValidators.Select((fv, i) => fv.Validate(input[i]))
+                    .Concat(EvaluateMultipleFieldsValidators())
+               );

         public virtual IValidationResult Validate(string input)
             => Validate(StringParser != null ? StringParser.Parse(input) : new[] { input });

         private IEnumerable<IPartialValidationResult> EvaluateMultipleFieldsValidators()
-        {
-            return new List<IPartialValidationResult>();
-        }
+            => new List<IPartialValidationResult>();
     }
 }


Linux- install fonts on ubuntu

Linux- install fonts on ubuntu

--- Source/Engine/AGS.Engine.Desktop/Drawing/DesktopFontFamilyLoader.cs
+++ Source/Engine/AGS.Engine.Desktop/Drawing/DesktopFontFamilyLoader.cs
@@ -18,9 +18,10 @@
         private PrivateFontCollection _fontCollection;
 		private int _lastFontInCollection;
         private Dictionary<string, FontFamily> _families;
-		private bool _restartNeeded;
+		private Action _refreshFontCache;

 		private const string MAC_FONT_LIBRARY = "/Library/Fonts";
+        private readonly string LINUX_FONT_LIBRARY = $"{Environment.GetEnvironmentVariable("HOME")}/.fonts"; //or: /usr/share/fonts/(truetype)

 		public DesktopFontFamilyLoader(IResourceLoader resources)
 		{
@@ -35,13 +36,7 @@
 			{
 				LoadFontFamily(path);
 			}
-			if (!_restartNeeded) return;
-
-			//todo: If we can't find a better way, at least show a message box that we're gonna attempt to restart as new fonts were installed
-			string processPath = Assembly.GetEntryAssembly().CodeBase;
-			ProcessStartInfo info = new ProcessStartInfo("mono", processPath) { UseShellExecute = false };
-			Process.Start(info);
-			Environment.Exit(0);
+            _refreshFontCache?.Invoke();
 		}

         public FontFamily LoadFontFamily(string path)
@@ -60,7 +55,6 @@

 			Marshal.Copy(buffer, 0, fontPtr, buffer.Length);

-			//todo: make this work on linux: http://stackoverflow.com/questions/32406859/privatefontcollection-in-mono-3-2-8-on-linux-ubuntu-14-04-1
 			_fontCollection.AddMemoryFont(fontPtr, buffer.Length);

 			//Marshal.FreeCoTaskMem(fontPtr); The pointer should not be released: See Hans Passant's answer on this: http://stackoverflow.com/questions/25583394/privatefontcollection-addmemoryfont-producing-random-errors-on-windows-server-20
@@ -72,6 +66,10 @@
 			{
 				return loadFontFamilyOnMac(path, buffer, family);
 			}
+            else if (isLinux())
+            {
+                return loadFontFamilyOnLinux(path, buffer, family);
+            }

 			return family;
 		}
@@ -84,17 +82,55 @@
 			if (!File.Exists(path))
 			{
 				File.WriteAllBytes(path, buffer);
-				//todo: installing a font on a mac doesn't catch unless you restart.. need to find a better way
-				_restartNeeded = true;
+                //todo: installing a font on a mac doesn't catch unless you restart.. need to find a better way
+                _refreshFontCache = restart;
 			}
 			return new FontFamily (family.Name);
 		}
+
+        //https://wiki.ubuntu.com/Fonts
+        private FontFamily loadFontFamilyOnLinux(string path, byte[] buffer, FontFamily family)
+        {
+            string filename = Path.GetFileName(path);
+            path = Path.Combine(LINUX_FONT_LIBRARY, filename);
+            if (!Directory.Exists(LINUX_FONT_LIBRARY))
+            {
+                Directory.CreateDirectory(LINUX_FONT_LIBRARY);
+            }
+            if (!File.Exists(path))
+            {
+                File.WriteAllBytes(path, buffer);
+                _refreshFontCache = () => {
+                    Debug.WriteLine("Refreshing font cache");
+                    ProcessStartInfo info = new ProcessStartInfo("fc-cache", "-f -v") { UseShellExecute = false };
+                    var process = Process.Start(info);
+                    process.WaitForExit();
+                    Debug.WriteLine("Completed refreshing font cache, restarting...");
+                    restart();
+                };
+            }
+            return new FontFamily(family.Name);
+        }

 		private bool isMac()
 		{
 			if (Path.DirectorySeparatorChar != '/') return false;
 			return Directory.Exists(MAC_FONT_LIBRARY);
 		}
+
+        private bool isLinux()
+        {
+            return Path.DirectorySeparatorChar == '/';
+        }
+
+        private void restart()
+        {
+            //todo: If we can't find a better way, at least show a message box that we're gonna attempt to restart as new fonts were installed
+            string processPath = Assembly.GetEntryAssembly().CodeBase;
+            ProcessStartInfo info = new ProcessStartInfo("mono", processPath) { UseShellExecute = false };
+            Process.Start(info);
+            Environment.Exit(0);
+        }
 	}
 }


naming

naming

--- Test.Integration/ControllerTests/JobControllerTests/GetJobShould.cs
+++ Test.Integration/ControllerTests/JobControllerTests/GetJobShould.cs
@@ -50,11 +50,11 @@
         {
             var model = TestObjectGetter.GetAddUpdateJobViewModel();
             var requestContent = RequestHelper.GetRequestContentFromObject(model);
-            var postResponse = _client.PostAsync($"{ControllerRouteEnum.JOB}", requestContent).Result;
-            _jobId = RequestHelper.GetObjectFromResponseContent<JobViewModel>(postResponse).Id;
+            var response = _client.PostAsync($"{ControllerRouteEnum.JOB}", requestContent).Result;
+            _jobId = RequestHelper.GetObjectFromResponseContent<JobViewModel>(response).Id;

-            var getResponse = _client.GetAsync($"{ControllerRouteEnum.JOB}/{_jobId}").Result;
-            var serializedContent = RequestHelper.GetObjectFromResponseContent<JobViewModel>(getResponse);
+            response = _client.GetAsync($"{ControllerRouteEnum.JOB}/{_jobId}").Result;
+            var serializedContent = RequestHelper.GetObjectFromResponseContent<JobViewModel>(response);

             var isCorrectViewModel = AssertHelper.AreJobViewModelsEqual(model, serializedContent);
             Assert.IsTrue(isCorrectViewModel);


Removed unit tests because the ICO patch had to be reverted due to TGA issues.

--- Tests/Magick.NET.Tests/Shared/MagickImageInfoTests/TheReadMethod.cs
+++ Tests/Magick.NET.Tests/Shared/MagickImageInfoTests/TheReadMethod.cs
@@ -92,24 +92,6 @@
             }

             [TestMethod]
-            public void ShouldDetectIcoFormatFromByteArray()
-            {
-                var data = new byte[] { 0, 0, 1, 0, 0, 0 };
-
-                IMagickImageInfo imageInfo = new MagickImageInfo(data);
-                Assert.AreEqual(MagickFormat.Ico, imageInfo.Format);
-            }
-
-            [TestMethod]
-            public void ShouldDetectCurFormatFromByteArray()
-            {
-                var data = new byte[] { 0, 0, 2, 0, 0, 0 };
-
-                IMagickImageInfo imageInfo = new MagickImageInfo(data);
-                Assert.AreEqual(MagickFormat.Cur, imageInfo.Format);
-            }
-
-            [TestMethod]
             public void ShouldReturnTheCorrectInformation()
             {
                 IMagickImageInfo imageInfo = new MagickImageInfo();


[Editor API] - Added function to display the currently active panel within the content view.

--- Tools/Editor/Gorgon.Editor.API/UI/Views/VisualContentBaseControl.cs
+++ Tools/Editor/Gorgon.Editor.API/UI/Views/VisualContentBaseControl.cs
@@ -243,7 +243,7 @@
         /// <summary>
         /// Function to set up the scroll bars.
         /// </summary>
-        private void SetupScrollBars()
+        protected void SetupScrollBars()
         {
             DisableScrollEvents();

@@ -365,6 +365,33 @@
             SetupScrollBars();
         }

+        /// <summary>
+        /// Function to show the current panel assigned to the <see cref="IVisualEditorContent.CurrentPanel"/> property.
+        /// </summary>
+        protected void ShowCurrentPanel()
+        {
+            if (_dataContext.CurrentPanel is null)
+            {
+                HideHostedPanels();
+                SetupScrollBars();
+                return;
+            }
+
+            string viewModelTypeName = _dataContext.CurrentPanel.GetType().FullName;
+            Control hostControl = GetRegisteredPanel<EditorSubPanelCommon>(viewModelTypeName);
+
+            if (hostControl is null)
+            {
+#if DEBUG
+                GorgonDialogs.ErrorBox(GorgonApplication.MainForm, string.Format(Resources.GOREDIT_ERR_HOST_PANEL_NULL, viewModelTypeName));
+#endif
+                return;
+            }
+
+            ShowHostedPanel(hostControl);
+            SetupScrollBars();
+        }
+
         /// <summary>Function called when a property is changing on the data context.</summary>
         /// <param name="propertyName">The name of the property that is updating.</param>
         /// <remarks>Implementors should override this method in order to handle a property change notification from their data context.</remarks>
@@ -403,26 +430,7 @@
             switch (propertyName)
             {
                 case nameof(IVisualEditorContent.CurrentPanel):
-                    if (_dataContext.CurrentPanel is null)
-                    {
-                        HideHostedPanels();
-                        SetupScrollBars();
-                        break;
-                    }
-
-                    string viewModelTypeName = _dataContext.CurrentPanel.GetType().FullName;
-                    Control hostControl = GetRegisteredPanel<EditorSubPanelCommon>(viewModelTypeName);
-
-                    if (hostControl is null)
-                    {
-#if DEBUG
-                        GorgonDialogs.ErrorBox(GorgonApplication.MainForm, string.Format(Resources.GOREDIT_ERR_HOST_PANEL_NULL, viewModelTypeName));
-#endif
-                        return;
-                    }
-
-                    ShowHostedPanel(hostControl);
-                    SetupScrollBars();
+                    ShowCurrentPanel();
                     break;
             }
         }


Other IFrames in page bug fix

Other IFrames in page bug fix

--- WebApp-DistributedSignOut-DotNet/Views/Shared/_SingleSignOut.cshtml
+++ WebApp-DistributedSignOut-DotNet/Views/Shared/_SingleSignOut.cshtml
@@ -68,7 +68,7 @@
                 window.addEventListener("message", rp_receiveMessage, false);
             }

-        } else if (window.location.pathname == "/Account/SingleSignOut") {
+        } else if (window.location.pathname == "/Account/SingleSignOut" && window.top.op_frame && window == window.top.op_frame.contentWindow) {
             // If we come to the SingleSignOut page in the iframe, the user has been logged out.
             // Redirect the browser window to the same page.
             try {
@@ -80,10 +80,11 @@
                     "?redirectUri=" + encodeURIComponent(window.parent.location.href);
             }

-        } else {
+        } else if (window.top.op_frame && window == window.top.op_frame.contentWindow) {
             // If a page in the app is loaded in the iframe (& it's not the SingleSignOut page),
             // the user is still logged into AAD, but the session changed for some reason.
             // Restart the timer on the top window and point the iframe back to check session endpoint
+            clearInterval(window.top.timerID);
             window.top.timerID = window.top.setTimer(window.top.check_session, "@WebAppDistributedSignOutDotNet.App_Start.OwinStartup.SessionState",
                 "@WebAppDistributedSignOutDotNet.App_Start.OwinStartup.ClientId", "@WebAppDistributedSignOutDotNet.App_Start.OwinStartup.AADInstance");
             window.top.op_frame.src = "@WebAppDistributedSignOutDotNet.App_Start.OwinStartup.CheckSessionIFrame";


Fix ServiceBus APIs to use correct behavior

--- WindowsAzurePowershell/src/ServiceManagement/Contract/ServiceBus.cs
+++ WindowsAzurePowershell/src/ServiceManagement/Contract/ServiceBus.cs
@@ -29,7 +29,7 @@
         /// Gets a service bus namespace.
         /// </summary>
         [OperationContract(AsyncPattern = true)]
-        [ODataBehavior(typeof(ServiceBusNamespace))]
+        [ServiceBusBehavior(typeof(ServiceBusNamespace))]
         [WebGet(UriTemplate = @"{subscriptionId}/services/servicebus/namespaces/{name}")]
         IAsyncResult BeginGetServiceBusNamespace(string subscriptionId, string name, AsyncCallback callback, object state);

@@ -39,7 +39,7 @@
         /// Gets service bus namespaces associated with a subscription.
         /// </summary>
         [OperationContract(AsyncPattern = true)]
-        [ODataBehavior(typeof(ServiceBusNamespace))]
+        [ServiceBusBehavior(typeof(ServiceBusNamespace))]
         [WebGet(UriTemplate = @"{subscriptionId}/services/servicebus/namespaces")]
         IAsyncResult BeginListServiceBusNamespaces(string subscriptionId, AsyncCallback callback, object state);

@@ -49,7 +49,7 @@
         /// Gets service bus regions associated with a subscription.
         /// </summary>
         [OperationContract(AsyncPattern = true)]
-        [ODataBehavior(typeof(ServiceBusRegion))]
+        [ServiceBusBehavior(typeof(ServiceBusRegion))]
         [WebGet(UriTemplate = @"{subscriptionId}/services/servicebus/regions")]
         IAsyncResult BeginListServiceBusRegions(string subscriptionId, AsyncCallback callback, object state);

@@ -59,7 +59,7 @@
         /// Creates a new service bus namespace.
         /// </summary>
         [OperationContract(AsyncPattern = true)]
-        [ODataBehavior(typeof(ServiceBusNamespace))]
+        [ServiceBusBehavior(typeof(ServiceBusNamespace))]
         [WebInvoke(Method = "PUT", UriTemplate = @"{subscriptionId}/services/servicebus/namespaces/{name}")]
         IAsyncResult BeginCreateServiceBusNamespace(string subscriptionId, ServiceBusNamespace namespaceDescription, string name, AsyncCallback callback, object state);

@@ -78,7 +78,7 @@
         /// Checks if service bus namespace exists or not.
         /// </summary>
         [OperationContract(AsyncPattern = true)]
-        [ODataBehavior(typeof(ServiceBusNamespaceAvailabiliyResponse))]
+        [ServiceBusBehavior(typeof(ServiceBusNamespaceAvailabiliyResponse))]
         [WebGet(UriTemplate = @"{subscriptionId}/services/servicebus/CheckNamespaceAvailability/?namespace={name}")]
         IAsyncResult BeginIsServiceBusNamespaceAvailable(string subscriptionId, string name, AsyncCallback callback, object state);


Spelling fix in a comment.

Spelling fix in a comment.

--- src/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs
+++ src/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs
@@ -121,7 +121,7 @@
     /// disambiguate).   However if they nest you need to use another EventSource event because the rules of EventSource
     /// activities state that a start of the same event terminates any existing activity of the same name.
     ///
-    /// As its name suggests RecursiveActivit1Start, is marked as recursive and thus can be used when the activity can nest with
+    /// As its name suggests RecursiveActivity1Start, is marked as recursive and thus can be used when the activity can nest with
     /// itself.   This should not be a 'top most' activity because it is not 'self healing' (if you miss a stop, then the
     /// activity NEVER ends).
     ///


Só mexi na products.cs

Só mexi na products.cs

--- TestC/TestC/Models/Product.cs
+++ TestC/TestC/Models/Product.cs
@@ -8,7 +8,7 @@
 {
     public class Product
     {
-        public int ProductId { get; set; }
+        public int ProductIds { get; set; }
         public string Name { get; set; }
         public string Type { get; set; }
         public string Brand { get; set; }


add user agent to the http request

add user agent to the http request

--- TpfrClient/Runtime/Network.cs
+++ TpfrClient/Runtime/Network.cs
@@ -69,6 +69,7 @@

             httpRequest.Date = DateTime.UtcNow;
             httpRequest.Host = CreateHostString();
+            httpRequest.UserAgent = "Spectra Tpfr";

             return new TpfrHttpWebRequest(httpRequest);
         }


Missed one.

Missed one.

--- Trunk/MageCrawl/EntryPoint.cs
+++ Trunk/MageCrawl/EntryPoint.cs
@@ -13,12 +13,8 @@
 #endif
             {
                 UIHelper.SetupUI();
-                WelcomeWindow.Result result;
-
-                using (WelcomeWindow welcomeWindow = new WelcomeWindow())
-                {
-                    result = welcomeWindow.Run();
-                }
+                WelcomeWindow welcomeWindow = new WelcomeWindow();
+                WelcomeWindow.Result result = welcomeWindow.Run();

                 if (result.Quitting || TCODConsole.isWindowClosed())
                     return;


null ref check

null ref check

--- AIMS_DB_IATI.WebAPI/Controllers/IATIImportController.cs
+++ AIMS_DB_IATI.WebAPI/Controllers/IATIImportController.cs
@@ -776,6 +776,8 @@
         {
             var IsNotFoundInAims = true;

+            if (org == null) return;
+
             var exAgencies = Sessions.iOrgs.ExecutingAgencies;

             //var exAgencies = isFilterByType ? $filter('filter')($scope.ExecutingAgencies, { ExecutingAgencyTypeId: org.ExecutingAgencyTypeId }) : $scope.ExecutingAgencies;
@@ -798,7 +800,7 @@
                 var minDistance = 1000;
                 for (var i = 0; i < exAgencies.Count; i++)
                 {
-                    var distance = getEditDistance(org.Name.ToLower(), exAgencies[i].Name.ToLower());
+                    var distance = getEditDistance(org?.Name?.ToLower(), exAgencies[i].Name?.ToLower());
                     if (minDistance > distance)
                     {
                         minDistance = distance;
@@ -808,10 +810,10 @@

                 if (agencyGuessed != null)
                 {
-                    var tolaratedDistance = isFilterByType ? (org.Name.Length + agencyGuessed.Name.Length) / 2 : ((org.Name.Length + agencyGuessed.Name.Length) / 2) * 50 / 100;
+                    var tolaratedDistance = isFilterByType ? (org?.Name?.Length + agencyGuessed?.Name?.Length) / 2 : ((org?.Name?.Length + agencyGuessed?.Name?.Length) / 2) * 50 / 100;
                     if (minDistance < tolaratedDistance)
                     {
-                        org.AllID = agencyGuessed.AllID;
+                        org.AllID = agencyGuessed?.AllID;

                         if (!isFilterByType) org.ExecutingAgencyTypeId = agencyGuessed.ExecutingAgencyTypeId;
                     }
@@ -827,8 +829,8 @@
         // Compute the edit distance between the two given strings
         protected int getEditDistance(string a, string b)
         {
-            if (a.Length == 0) return b.Length;
-            if (b.Length == 0) return a.Length;
+            if (a == null || a.Length == 0) return b.Length;
+            if (b == null || b.Length == 0) return a.Length;

             var matrix = new int[b.Length+1, a.Length+1];


Implemented editing of deepmap.

Implemented editing of deepmap.

git-svn-id: 202854949822ddacd36021ecd5ce27e3c9ec9cb0@540 dc34a4ac-3e42-4537-918b-2dea8b01751e

--- Adventure/Editor/StoryDesigner/StoryDesigner/RoomDlg.cs
+++ Adventure/Editor/StoryDesigner/StoryDesigner/RoomDlg.cs
@@ -156,6 +156,7 @@
         {
             mDragObject = null;
             mDragDepth = false;
+            mDragDepthBottom = false;
         }

         void RoomDlg_MouseMove(object sender, MouseEventArgs e)
@@ -189,6 +190,26 @@
                 if (!mDragDepth)
                     return;
                 modifyWalkmap(e.X, e.Y);
+            }
+            else if (mMode == ViewMode.Deepmap)
+            {
+                int depth = (e.Y + mData.WalkGridSize / 2 + mRoom.ScrollOffset.y) / mData.WalkGridSize;
+                if (mDragDepth)
+                {
+                    if (depth < 1)
+                        depth = 1;
+                    if (depth >= mRoom.Depthmap.y)
+                        depth = mRoom.Depthmap.y - 1;
+                    mRoom.Depthmap.x = depth;
+                }
+                if (mDragDepthBottom)
+                {
+                    if (depth <= mRoom.Depthmap.x)
+                        depth = mRoom.Depthmap.x + 1;
+                    if (depth >= mRoom.Size.y/mData.WalkGridSize)
+                        depth = mRoom.Size.y/mData.WalkGridSize-1;
+                    mRoom.Depthmap.y = depth;
+                }
             }
         }

@@ -242,6 +263,14 @@
                 modifyWalkmap(pos.x, pos.y);
                 mDragDepth = true;
             }
+            else if (mMode == ViewMode.Deepmap)
+            {
+                int depth = (e.Y+mData.WalkGridSize/2+mRoom.ScrollOffset.y) / mData.WalkGridSize;
+                if (depth == mRoom.Depthmap.x)
+                    mDragDepth = true;
+                if (depth == mRoom.Depthmap.y)
+                    mDragDepthBottom = true;
+            }
         }

         void RoomDlg_Paint(object sender, PaintEventArgs e)
@@ -282,6 +311,14 @@
             int wmscale = mRoom.DoubleWalkmap ? 2 : 1;
             int wmx = wmscale * mp.x / mData.WalkGridSize;
             int wmy = wmscale * mp.y / mData.WalkGridSize;
+            if (wmx < 0)
+                wmx = 0;
+            if (wmy < 0)
+                wmy = 0;
+            if (wmx > mRoom.Walkmap.GetUpperBound(0))
+                wmx = mRoom.Walkmap.GetUpperBound(0);
+            if (wmy > mRoom.Walkmap.GetUpperBound(1))
+                wmy = mRoom.Walkmap.GetUpperBound(1);
             bool wmfree = mRoom.Walkmap[wmx, wmy].isFree;
             Font f = new Font(Fonts.DefaultFont.FontFamily, 11);
             if (mMode == ViewMode.Objects){
@@ -527,6 +564,7 @@
             mRoom.Walkmap[x, y].isFree = value;
         }

+        //general
         private Room mRoom;
         private AdvData mData;
         private DrawableObject mDragObject;
@@ -535,9 +573,12 @@
         private RoomCtrlDlg mControl;
         private Vec2i mMousePos;
         private ViewMode mMode;
+        //walkmap
         private string mPendingImage;
         private int mWalkmapPaintMode = 0;
         private string mCopiedWMScript = null;
+        //deepmap
+        bool mDragDepthBottom;

         private void addAsBackgroundToolStripMenuItem_Click(object sender, EventArgs e)
         {


add 'reset flight'

add 'reset flight'

--- AirlineTicketOffice.Main/ViewModel/Flights/FlightsVM.cs
+++ AirlineTicketOffice.Main/ViewModel/Flights/FlightsVM.cs
@@ -59,6 +59,8 @@
             });

             ReceiveFlight();
+
+            this.Flight = null;
         }

@@ -244,8 +246,7 @@
                     _SendNewTicketCommand = new RelayCommand(() =>
                     {
                         if (this.Flight != null)
-                        {
-                            _navigationService.NavigateTo("NewTicketViewKey", "New Ticket Window");
+                        {

                             Messenger.Default.Send<MessageToNewTicket>(new MessageToNewTicket()
                             {
@@ -257,7 +258,16 @@
                                 MessageStatusFromFlight = "New Ticket Window"
                             });

-
+                            // 'Reset' flight (user must select flight).
+                            this.Flight = null;
+
+                            _navigationService.NavigateTo("NewTicketViewKey", "New Ticket Window");
+
+                        }
+                        else
+                        {
+                            this.ForegroundForUser = "#ff420e";
+                            this.MessageForUser = "You Need Select Flight.";
                         }

                     });
@@ -454,8 +464,11 @@
                 {
                     _sendFlightCommand = new RelayCommand<FlightModel>((f) =>
                     {
+
                         if (f != null)
                         {
+                            this.Flight = new FlightModel();
+
                             Messenger.Default.Send<MessageFlight>(new MessageFlight()
                             {
                                 SendFlight = f


CandleBuilderMessageAdapter. Join derived subscription into single SeriesInfo.


A bit of an ugly hack here. After we are done writing we check if there are any pending send file operations.  I am thinking it would be best to move all this into a generic queue.

--- src/Mango/Mango.Server/HttpTransaction.cs
+++ src/Mango/Mango.Server/HttpTransaction.cs
@@ -23,6 +23,7 @@

 		private bool aborted;
 		private bool connection_finished;
+		private string send_file;

 		public HttpTransaction (HttpServer server, IOStream stream, Socket socket, HttpConnectionCallback callback)
 		{
@@ -70,6 +71,11 @@
 			set;
 		}

+		public bool ConnectionFinished {
+			get {
+				return (connection_finished && send_file == null);
+			}
+		}
 		public void Abort (int status, string message, params object [] p)
 		{
 			aborted = true;
@@ -82,23 +88,41 @@

 		public void SendFile (string file)
 		{
-			IOStream.SendFile (file);
+			if (IOStream.IsWriting) {
+				send_file = file;
+				return;
+			}
+
+			IOStream.SendFile (file, OnSendFileFinished);
 		}

 		public void Finish ()
 		{
 			connection_finished = true;

-			if (!IOStream.IsWriting)
+			if (!IOStream.IsWriting && send_file == null)
 				FinishResponse ();
 		}

 		private void OnWriteFinished ()
 		{
-			if (connection_finished)
+			if (send_file != null) {
+				IOStream.SendFile (send_file, OnSendFileFinished);
+				return;
+			}
+
+			if (ConnectionFinished)
 				FinishResponse ();
 		}

+		private void OnSendFileFinished ()
+		{
+			send_file = null;
+
+			if (ConnectionFinished)
+				FinishResponse ();
+		}
+
 		private void FinishResponse ()
 		{
 			bool disconnect = true;


(Fix warning) Added missing annotation for new param in TokenRefreshedEventArgs (#370)

* Added Identity Token to TokenRefreshEventArgs

This change allows updating the identity token cached at the client with the latest identity token coming from token renewal

* Make Identity Token optional in TokenRefreshEventArgs to prevent breaking changes

* Added missing annotation for new param in TokenRefreshedEventArgs (fixes related warning)

--- src/OidcClient/TokenRefreshedEventArgs.cs
+++ src/OidcClient/TokenRefreshedEventArgs.cs
@@ -17,6 +17,7 @@
         /// <param name="accessToken">The access token.</param>
         /// <param name="refreshToken">The refresh token.</param>
         /// <param name="expiresIn">The expires in.</param>
+        /// <param name="identityToken">The identity token (optional).</param>
         public TokenRefreshedEventArgs(string accessToken, string refreshToken, int expiresIn, string identityToken = null)
         {
             AccessToken = accessToken;


attempt to have the lobbymanager not crash with a 'Queue empty.' message

--- src/OpenSage.Game/Network/LobbyManager.cs
+++ src/OpenSage.Game/Network/LobbyManager.cs
@@ -72,6 +72,7 @@
             _manager.Stop();

             _isRunning = false;
+            _thread.Interrupt();
             _thread.Join();
             _thread = null;
         }


Fix NullReferenceException

Fix NullReferenceException

Fix NullReferenceException if the page content does not load.

--- tests/LondonTravel.Site.Tests/Pages/PageBase.cs
+++ tests/LondonTravel.Site.Tests/Pages/PageBase.cs
@@ -17,10 +17,27 @@
     protected abstract string RelativeUri { get; }

     public async Task<bool> IsAuthenticatedAsync()
-        => bool.Parse(await (await Navigator.Page.QuerySelectorAsync("[data-id='content']"))!.GetAttributeAsync("data-authenticated") ?? bool.FalseString);
+    {
+        const string ContentSelector = "[data-id='content']";
+
+        var content = await Navigator.Page.QuerySelectorAsync(ContentSelector);
+        content.ShouldNotBeNull($"Could not find selector '{ContentSelector}'.");
+
+        string? isAuthenticated = await content.GetAttributeAsync("data-authenticated");
+
+        return bool.Parse(isAuthenticated ?? bool.FalseString);
+    }

     public async Task<string> UserNameAsync()
-        => (await (await Navigator.Page.QuerySelectorAsync(UserNameSelector))!.InnerTextAsync()).Trim();
+    {
+        var element = await Navigator.Page.QuerySelectorAsync(UserNameSelector);
+        element.ShouldNotBeNull($"Could not find selector '{UserNameSelector}'.");
+
+        string userName = await element.InnerTextAsync();
+        userName.ShouldNotBeNull();
+
+        return userName.Trim();
+    }

     public async Task<HomePage> SignOutAsync()
     {


added skip

added skip

--- tests/NLog.UnitTests/Targets/FileTargetTests.cs
+++ tests/NLog.UnitTests/Targets/FileTargetTests.cs
@@ -497,7 +497,8 @@
             }
         }

-        [Fact]
+        [Fact(Skip = "this is not supported, because we cannot create multiple archive files with  ArchiveNumberingMode.Date (for one day)")]
+
         public void ArchiveAboveSizeWithArchiveNumberingModeDate_maxfiles_o()
         {
             var tempPath = Path.Combine(Path.GetTempPath(), "ArchiveEveryCombinedWithArchiveAboveSize_" + Guid.NewGuid().ToString());
@@ -551,7 +552,8 @@
                     StringRepeat(250, "eee\n"),
                     Encoding.UTF8);

-
+                //DUNNO what to expected!
+                //try (which fails)
                 AssertFileContents(
                     Path.Combine(tempPath, string.Format("archive/{0}.txt", archiveFileName)),
                    StringRepeat(250, "aaa\n") +  StringRepeat(250, "bbb\n") + StringRepeat(250, "ccc\n") + StringRepeat(250, "ddd\n"),
@@ -567,6 +569,7 @@
                     Directory.Delete(tempPath, true);
             }
         }
+

         [Fact]
         public void DeleteArchiveFilesByDate()


Refactor configuration actions

Refactor configuration actions

--- src/SIM.Pipelines/ConfigurationActions.cs
+++ src/SIM.Pipelines/ConfigurationActions.cs
@@ -649,38 +649,21 @@

             break;
           }
-
+
           case "rename":
           {
-            var skipOnError = instruction.GetAttribute("skipOnError");
-            string fromFileName = instruction.GetAttribute("from");
-            string toFileName = instruction.GetAttribute("to");
+            var skipOnErrorText = instruction.GetAttribute("skipOnError");
+            var skipOnError = skipOnErrorText.EqualsIgnoreCase("true");
+            var fromFileName = instruction.GetAttribute("from");
+            var toFileName = instruction.GetAttribute("to");

             if (!string.IsNullOrEmpty(fromFileName) && !string.IsNullOrEmpty(toFileName))
             {
-              string includeFolderPath = Path.Combine(instance.WebRootPath, "app_config\\include");
-              string fromPath = Path.Combine(includeFolderPath, fromFileName);
-              string toPath = Path.Combine(includeFolderPath, toFileName);
-
-              try
-              {
-                if (!FileSystem.FileSystem.Local.File.Exists(fromPath) && FileSystem.FileSystem.Local.File.Exists(toPath))
-                {
-                  Log.Warn("The moving does not seem to be needed");
-                  break;
-                }
-
-                FileSystem.FileSystem.Local.File.Move(fromPath, toPath);
-              }
-              catch (Exception ex)
-              {
-                if (!skipOnError.EqualsIgnoreCase("true"))
-                {
-                  throw;
-                }
-
-                Log.Error(ex, "Cannot rename file {0}", fromPath);
-              }
+              var includeFolderPath = Path.Combine(instance.WebRootPath, "app_config\\include");
+              var fromPath = Path.Combine(includeFolderPath, fromFileName);
+              var toPath = Path.Combine(includeFolderPath, toFileName);
+
+              RenameFile(fromPath, toPath, skipOnError);
             }

             break;
@@ -689,6 +672,29 @@
       }

       config.Save();
+    }
+
+    private static void RenameFile(string fromPath, string toPath, bool skipOnError)
+    {
+      try
+      {
+        if (!FileSystem.FileSystem.Local.File.Exists(fromPath) && FileSystem.FileSystem.Local.File.Exists(toPath))
+        {
+          Log.Warn("The moving does not seem to be needed");
+          return;
+        }
+
+        FileSystem.FileSystem.Local.File.Move(fromPath, toPath);
+      }
+      catch (Exception ex)
+      {
+        if (!skipOnError)
+        {
+          throw;
+        }
+
+        Log.Error(ex, "Cannot rename file {0} to {1}", fromPath, toPath);
+      }
     }

     private static void ProcessActions(Instance instance, SqlConnectionStringBuilder connectionString,


Update assembly version

Update assembly version

--- src/SagePayMvc/Properties/AssemblyInfo.cs
+++ src/SagePayMvc/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // 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.*")]
-[assembly: AssemblyVersion("4.0.0.0")]
-[assembly: AssemblyFileVersion("4.0.0.0")]
+[assembly: AssemblyVersion("5.0.0.0")]
+[assembly: AssemblyFileVersion("5.0.0.0")]


Invalid AST : Return valid part of member expression

--- src/Scriban/Parsing/Parser.Expressions.cs
+++ src/Scriban/Parsing/Parser.Expressions.cs
@@ -245,7 +245,7 @@
                         else
                         {
                             LogError(nextToken, $"Invalid token `{nextToken.Type}`. The dot operator is expected to be followed by a plain identifier");
-                            return null;
+                            return leftOperand;
                         }
                         continue;
                     }


Extra logic for default assembly resolve

--- src/Shared/PlatformSupport/AssetLoader.cs
+++ src/Shared/PlatformSupport/AssetLoader.cs
@@ -118,6 +118,13 @@
             if (uri.Scheme == "res")
             {
                 var (asm, path) = GetResAsmAndPath(uri);
+                if (asm == null)
+                {
+                    throw new ArgumentException(
+                        "No default assembly, entry assembly or explicit assembly specified; " +
+                        "don't know where to look up for the resource, try specifying assembly explicitly.");
+                }
+
                 if (asm?.AvaloniaResources == null)
                     return Enumerable.Empty<Uri>();
                 path = path.TrimEnd('/') + '/';
@@ -167,6 +174,10 @@
             if (uri.Scheme == "res")
             {
                 var (asm, path) = GetResAsmAndPath(uri);
+                if(asm == null)
+                    throw new ArgumentException(
+                        "No default assembly, entry assembly or explicit assembly specified; " +
+                        "don't know where to look up for the resource, try specifying assembly explicitly.");
                 if (asm.AvaloniaResources == null)
                     return null;
                 asm.AvaloniaResources.TryGetValue(path, out var desc);
@@ -189,13 +200,6 @@
             }

             var asm = (asmPart == null ? null : GetAssembly(asmPart)) ?? _defaultAssembly;
-            if (asm == null)
-            {
-                throw new ArgumentException(
-                    "No default assembly, entry assembly or explicit assembly specified; " +
-                    "don't know where to look up for the resource, try specifying assembly explicitly.");
-            }
-
             return (asm, path);
         }

@@ -203,12 +207,20 @@
         {
             if (uri != null)
             {
-                var qs = ParseQueryString(uri);
-                string assemblyName;
-
-                if (qs.TryGetValue("assembly", out assemblyName))
-                {
-                    return GetAssembly(assemblyName);
+                if (!uri.IsAbsoluteUri)
+                    return null;
+                if (uri.Scheme == "res")
+                    return GetResAsmAndPath(uri).asm;
+
+                if (uri.Scheme == "resm")
+                {
+                    var qs = ParseQueryString(uri);
+                    string assemblyName;
+
+                    if (qs.TryGetValue("assembly", out assemblyName))
+                    {
+                        return GetAssembly(assemblyName);
+                    }
                 }
             }


removed the extra Advance

removed the extra Advance

--- src/SuperSocket.Channel/VirtualChannel.cs
+++ src/SuperSocket.Channel/VirtualChannel.cs
@@ -23,16 +23,7 @@

         public async ValueTask<FlushResult> WritePipeDataAsync(Memory<byte> memory, CancellationToken cancellationToken)
         {
-            var writer = In.Writer;
-
-            try
-            {
-                return await In.Writer.WriteAsync(memory, cancellationToken);
-            }
-            finally
-            {
-                writer.Advance(memory.Length);
-            }
+            return await In.Writer.WriteAsync(memory, cancellationToken);
         }
     }
 }


Fixed a minor bug.

Fixed a minor bug.

--- src/Telebot/Types/InlineKeyboardButton.cs
+++ src/Telebot/Types/InlineKeyboardButton.cs
@@ -8,6 +8,18 @@
     [JsonObject(MemberSerialization.OptIn)]
     public class InlineKeyboardButton
     {
+        #region Constructors and Destructors
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="InlineKeyboardButton"/> class.
+        /// </summary>
+        public InlineKeyboardButton()
+        {
+            this.Url = string.Empty;
+        }
+
+        #endregion
+
         #region Public Properties

         /// <summary>


use this message/span

use this message/span

--- src/VisualLinter/Linting/MessageMarker.cs
+++ src/VisualLinter/Linting/MessageMarker.cs
@@ -7,23 +7,23 @@
         internal EslintMessage Message { get; }
         internal SnapshotSpan Span { get; }

-        internal MessageMarker(SnapshotSpan span, EslintMessage message)
+        internal MessageMarker(EslintMessage message, SnapshotSpan span)
         {
             Message = message;
             Span = span;
         }

-        internal static MessageMarker Clone(MessageMarker marker)
+        internal MessageMarker Clone()
         {
-            return new MessageMarker(marker.Span, marker.Message);
+            return new MessageMarker(Message, Span);
         }

-        internal MessageMarker CloneAndTranslateTo(MessageMarker marker, ITextSnapshot newSnapshot)
+        internal MessageMarker CloneAndTranslateTo(ITextSnapshot newSnapshot)
         {
-            var newSpan = marker.Span.TranslateTo(newSnapshot, SpanTrackingMode.EdgeExclusive);
+            var newSpan = Span.TranslateTo(newSnapshot, SpanTrackingMode.EdgeExclusive);

-            return newSpan.Length == marker.Span.Length
-                ? new MessageMarker(newSpan, marker.Message)
+            return Span.Length == newSpan.Length
+                ? new MessageMarker(Message, newSpan)
                 : null;
         }
     }


Support optional constructor init for outer

--- src/WebApiToTypeScript/TypeScriptBlock.cs
+++ src/WebApiToTypeScript/TypeScriptBlock.cs
@@ -34,6 +34,11 @@
             = new List<ITypeScriptCode>();

         public TypeScriptBlock Parent { get; set; }
+
+        public TypeScriptBlock(string outer = "")
+        {
+            Outer = outer;
+        }

         public TypeScriptBlock AddBlock(string outer = null)
         {


Can't test for username extrapolation anymore, since it was removed due to complaints

--- App/StackExchange.DataExplorer.Tests/Models/TestUser.cs
+++ App/StackExchange.DataExplorer.Tests/Models/TestUser.cs
@@ -31,15 +31,6 @@
         }

         [TestMethod]
-        public void TestUserNameExtrapolation() {
-            var u1 = User.CreateUser("", "a@a.com", "xyz");
-            var u2 = User.CreateUser(null, "a@ab.com", "xyz1");
-
-            Assert.AreEqual("a", u1.Login);
-            Assert.AreEqual("a1", u2.Login);
-        }
-
-        [TestMethod]
         public void TestNoName() {

             Current.DB.Users.DeleteAllOnSubmit(Current.DB.Users.Where(u => u.Login.StartsWith("jon.doe")));


Skeleton was broken.

Skeleton was broken.

--- Assets/MapGen/MultiMatcher/TokenLists/PlantTokenList.cs
+++ Assets/MapGen/MultiMatcher/TokenLists/PlantTokenList.cs
@@ -17,7 +17,7 @@
         }
     }

-    private void PopulateWordLists()
+    private static void PopulateWordLists()
     {
         throw new NotImplementedException();
     }


BlockingCollectionAdapter: fixed the cancellation

--- AsyncCollections.Benchmark/BlockingCollectionAdapter.cs
+++ AsyncCollections.Benchmark/BlockingCollectionAdapter.cs
@@ -31,7 +31,7 @@

 		public Task<T> TakeAsync( System.Threading.CancellationToken cancellationToken )
 		{
-			T item = _collection.Take();
+			T item = _collection.Take( cancellationToken );
 			return Task.FromResult( item );
 		}


ISolrCoreAdmin builder for Windsor

ISolrCoreAdmin builder for Windsor

Conflicts:
	Castle.Facilities.SolrNetIntegration/SolrNetFacility.cs

--- Castle.Facilities.SolrNetIntegration/SolrNetFacility.cs
+++ Castle.Facilities.SolrNetIntegration/SolrNetFacility.cs
@@ -221,6 +221,15 @@
             }
         }

+        public ISolrCoreAdmin BuildCoreAdmin(string url) {
+            var conn = new SolrConnection(url);
+            return BuildCoreAdmin(conn);
+        }
+
+        public ISolrCoreAdmin BuildCoreAdmin(ISolrConnection conn) {
+            return new SolrCoreAdmin(conn, Kernel.Resolve<ISolrHeaderResponseParser>(), Kernel.Resolve<ISolrStatusResponseParser>());
+        }
+
         private static void ValidateUrl(string s) {
             try {
                 UriValidator.ValidateHTTP(s);


don't remove the variant tags that are part of the name for better filtering

--- ARKBreedingStats/species/Species.cs
+++ ARKBreedingStats/species/Species.cs
@@ -168,10 +168,9 @@
         /// </summary>
         public void InitializeNames()
         {
-            // ignore variants that already appear in the species name, e.g. Corrupted
             if (variants != null && variants.Any())
             {
-                VariantInfo = string.Join(", ", variants.Where(v => !name.Contains(v)));
+                VariantInfo = string.Join(", ", variants);
             }

             DescriptiveName = name + (string.IsNullOrEmpty(VariantInfo) ? string.Empty : " (" + VariantInfo + ")");


Fixed bug where retreiving mulitiple infrastructure artifacts failed

--- ConDep.Dsl/SemanticModel/ConDepConfigurationExecutor.cs
+++ ConDep.Dsl/SemanticModel/ConDepConfigurationExecutor.cs
@@ -256,10 +256,16 @@
         private static IEnumerable<InfrastructureArtifact> GetInfrastructureArtifactForApplication(ConDepSettings settings, ApplicationArtifact application)
         {
             var typeName = typeof (IDependOnInfrastructure<>).Name;
-            var typeInterface = application.GetType().GetInterface(typeName);
-            var infrastructureTypes = typeInterface.GetGenericArguments();
-
-            return infrastructureTypes.Select(type => settings.Options.Assembly.CreateInstance(type.FullName) as InfrastructureArtifact);
+            var typeInterfaces = application.GetType().GetInterfaces();
+
+            var infraInterfaces = typeInterfaces.Where(x => x.Name == typeName);
+            foreach (var infraInterface in infraInterfaces)
+            {
+                var infrastructureType = infraInterface.GetGenericArguments().Single();
+
+                var infrastructureInstance = settings.Options.Assembly.CreateInstance(infrastructureType.FullName) as InfrastructureArtifact;
+                yield return infrastructureInstance;
+            }
         }
     }
 }


Switch to forward slash separator

Switch to forward slash separator

- Issue MatterHackers/MCCentral#2500
Use forward slash as content separator instead of right arrow

--- CustomWidgets/LibrarySelector/FolderBreadCrumbWidget.cs
+++ CustomWidgets/LibrarySelector/FolderBreadCrumbWidget.cs
@@ -105,13 +105,10 @@
 					if (!firstItem)
 					{
 						// Add separator
-						this.AddChild(new TextWidget(">", textColor: ActiveTheme.Instance.PrimaryTextColor)
-						{
-							VAnchor = VAnchor.Center,
-							Margin = new BorderDouble(right: 5)
-						});
+						this.CreateSeparator(theme);
 					}

+					// Create a button for each container
 					Button containerButton =  linkButtonFactory.Generate(container.Name);
 					containerButton.Name = "Bread Crumb Button " + container.Name;
 					containerButton.VAnchor = VAnchor.Center;
@@ -128,11 +125,7 @@
 				if (haveFilterRunning)
 				{
 					// Add separator ;
-					this.AddChild(new TextWidget(">", textColor: ActiveTheme.Instance.PrimaryTextColor)
-					{
-						VAnchor = VAnchor.Center,
-						Margin = new BorderDouble(right: 5)
-					});
+					this.CreateSeparator(theme);

 					Button searchResultsButton = null;
 					if (UserSettings.Instance.IsTouchScreen)
@@ -173,5 +166,14 @@
 				}
 			}
 		}
+
+		private void CreateSeparator(ThemeConfig theme)
+		{
+			this.AddChild(new TextWidget("/", pointSize: theme.FontSize11, textColor: ActiveTheme.Instance.PrimaryTextColor)
+			{
+				VAnchor = VAnchor.Center,
+				Margin = new BorderDouble(right: 5)
+			});
+		}
 	}
 }


Fix TagRelease typo (unnecessary $)

Fix TagRelease typo (unnecessary $)

--- tools/Google.Cloud.Tools.TagReleases/Program.cs
+++ tools/Google.Cloud.Tools.TagReleases/Program.cs
@@ -87,7 +87,7 @@

             await MakeReleasesAsync(client, newReleases, commit);
             Console.WriteLine();
-            Console.WriteLine($"Release tags created. Next step: run ./buildrelease.sh ${commit}");
+            Console.WriteLine($"Release tags created. Next step: run ./buildrelease.sh {commit}");
             return 0;
         }

@@ -183,4 +183,4 @@
             }
         }
     }
-}+}


Corrigida mensagem de erro.

Corrigida mensagem de erro.

--- AnaliseSintatica/ParserConstants.cs
+++ AnaliseSintatica/ParserConstants.cs
@@ -177,7 +177,7 @@
             "encontrado {0} esperado escreva",//Era esperado escreva
             "encontrado {0} esperado falso",//Era esperado falso
             "encontrado {0} esperado fim",//Era esperado fim
-            "enocntrado {0} esperado função",//Era esperado funcao
+            "encontrado {0} esperado função",//Era esperado funcao
             "encontrado {0} esperado início",//Era esperado inicio
             "encontrado {0} esperado inteiro",//Era esperado inteiro
             "encontrado {0} esperado interrompa",//Era esperado interrompa


Verify that JsonPacket.EventID is not only a non-null string, but a valid GUID

--- src/tests/SharpRaven.UnitTests/Data/JsonPacketTests.cs
+++ src/tests/SharpRaven.UnitTests/Data/JsonPacketTests.cs
@@ -64,12 +64,13 @@

         [Test]
-        public void Constructor_ProjectAndException_EventIDIsNotNull()
+        public void Constructor_ProjectAndException_EventIDIsValidGuid()
         {
             var project = Guid.NewGuid().ToString();
             var json = new JsonPacket(project, new Exception("Error"));

             Assert.That(json.EventID, Is.Not.Null.Or.Empty, "EventID");
+            Assert.That(Guid.Parse(json.EventID), Is.Not.Null);
         }

@@ -115,12 +116,13 @@

         [Test]
-        public void Constructor_Project_EventIDIsNotNull()
+        public void Constructor_Project_EventIDIsValidGuid()
         {
             var project = Guid.NewGuid().ToString();
             var json = new JsonPacket(project);

             Assert.That(json.EventID, Is.Not.Null.Or.Empty, "EventID");
+            Assert.That(Guid.Parse(json.EventID), Is.Not.Null);
         }


Give Share version to public

Give Share version to public

--- Aphysoft.Share/Application/Share.cs
+++ Aphysoft.Share/Application/Share.cs
@@ -784,7 +784,7 @@

         #region Methods

-        internal static string Version()
+        public static string Version()
         {
             return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Build.ToString() + "." + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Revision;
         }


Changed Button to class and started drawing buttons with parameters in foldouts

--- Assets/EasyButtons/Editor/Button.cs
+++ Assets/EasyButtons/Editor/Button.cs
@@ -8,7 +8,7 @@
     using UnityEngine;
     using Object = UnityEngine.Object;

-    internal readonly struct Button
+    internal class Button
     {
         private readonly string _name;
         private readonly ButtonSpacing _spacing;
@@ -16,6 +16,8 @@
         private readonly bool _hasParams;
         private readonly MethodInfo _method;
         private readonly ParamInfo[] _parameters;
+
+        private bool _expanded;

         public Button(MethodInfo method, ButtonAttribute buttonAttribute)
         {
@@ -39,22 +41,22 @@

         public void Draw(IEnumerable<Object> targets)
         {
-            bool previousValue = GUI.enabled;
-            GUI.enabled = _enabled;
-
-            DrawButtonWithSpacing(targets);
-
-            foreach (ParamInfo param in _parameters)
+            DrawWithEnabledGUI(_enabled, () =>
             {
-                param.Draw();
-            }
-
-            GUI.enabled = previousValue;
+                if (_hasParams)
+                {
+                    DrawFoldout();
+                }
+                else
+                {
+                    DrawButtonWithSpacing(targets);
+                }
+            });
         }

         private void Invoke(IEnumerable<Object> objects)
         {
-            var paramValues = _hasParams ? _parameters.Select(param => param.GetValue()).ToArray() : null;
+            var paramValues = _hasParams ? _parameters.Select(param => param.Value).ToArray() : null;

             foreach (Object obj in objects)
             {
@@ -76,6 +78,40 @@
                 GUILayout.Space(spacingHeight);
         }

+        private void DrawFoldout()
+        {
+            _expanded = DrawInFoldout(_expanded, _name, () =>
+            {
+                foreach (ParamInfo param in _parameters)
+                {
+                    param.Draw();
+                }
+            });
+        }
+
+        private static void DrawWithEnabledGUI(bool enabled, Action drawStuff)
+        {
+            bool previousValue = GUI.enabled;
+            GUI.enabled = enabled;
+            drawStuff();
+            GUI.enabled = previousValue;
+        }
+
+        private static bool DrawInFoldout(bool expanded, string name, Action drawStuff)
+        {
+            expanded = EditorGUILayout.BeginFoldoutHeaderGroup(expanded, name);
+
+            if (expanded)
+            {
+                EditorGUI.indentLevel++;
+                drawStuff();
+                EditorGUI.indentLevel--;
+            }
+
+            EditorGUILayout.EndFoldoutHeaderGroup();
+            return expanded;
+        }
+
         private readonly struct ParamInfo
         {
             private readonly FieldInfo _fieldInfo;
@@ -90,7 +126,7 @@
                 _editor = Editor.CreateEditor(_scriptableObj, typeof(NoScriptFieldEditor));
             }

-            public object GetValue() => _fieldInfo.GetValue(_scriptableObj);
+            public object Value => _fieldInfo.GetValue(_scriptableObj);

             public void Draw()
             {


Adding arguments to ci static method

Adding arguments to ci static method

--- Assets/Editor/CI/CIBackendEditor.cs
+++ Assets/Editor/CI/CIBackendEditor.cs
@@ -35,7 +35,6 @@
 		CIBuilder.DoBuild (BuildTarget.Android, filepath);
 	}

-	[MenuItem ("Tools/CI/Perform Build")]
 	private static void PerformBuild ()
 	{
 		string platform = CommandLineReader.GetCustomArgument("Platform").ToLower ();


bug fix - MySql's foreign key constrains must be looked up in lowercase

--- DbLinq/Vendor/Implementation/SchemaLoader.ForeignKey.cs
+++ DbLinq/Vendor/Implementation/SchemaLoader.ForeignKey.cs
@@ -72,6 +72,13 @@
             var referencedTable = schema.Tables.FirstOrDefault(t => referencedFullDbName == t.Name);
             if (referencedTable == null)
             {
+                //try case-insensitive match
+                //reason: MySql's Key_Column_Usage table contains both 'Northwind' and 'northwind'
+                referencedTable = schema.Tables.FirstOrDefault(t => referencedFullDbName.ToLower() == t.Name.ToLower());
+            }
+
+            if (referencedTable == null)
+            {
                 ReportForeignKeyError(schema, referencedFullDbName);
             }
             else


[ReignOfKings] Fix ReplyWith

[ReignOfKings] Fix ReplyWith

Use PlayerMessageEvent instead of PlayerErrorEvent as it was causing text to be displayed in red

--- Games/Unity/Oxide.Game.ReignOfKings/ReignOfKingsCore.cs
+++ Games/Unity/Oxide.Game.ReignOfKings/ReignOfKingsCore.cs
@@ -967,7 +967,7 @@
         private static void ReplyWith(Player player, string message)
         {
             if (player.IsServer) Console.AddMessage(message);
-            else EventManager.CallEvent(new PlayerErrorEvent(player.Id, message));
+            else EventManager.CallEvent(new PlayerMessageEvent(player.Id, message));
         }

         /// <summary>