改用最新的反射器和反射扩展方法。 :metal:

改用最新的反射器和反射扩展方法。 :metal:

--- src/Data/DataDictionaries.cs
+++ src/Data/DataDictionaries.cs
@@ -33,9 +33,12 @@

 using System;
 using System.Linq;
+using System.Reflection;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq.Expressions;
+
+using Zongsoft.Reflection;

 namespace Zongsoft.Data
 {
@@ -1160,14 +1163,27 @@

 		#region 成员字段
 		private object _data;
-		private readonly Reflection.MemberTokenCollection _members;
+		private readonly IDictionary<string, MemberInfo> _members;
 		#endregion

 		#region 构造函数
 		public ObjectDictionary(object data)
 		{
 			_data = data ?? throw new ArgumentNullException(nameof(data));
-			_members = Reflection.MemberTokenProvider.Default.GetMembers(_data.GetType());
+			_members = new Dictionary<string, MemberInfo>(StringComparer.OrdinalIgnoreCase);
+
+			foreach(var field in data.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance))
+			{
+				_members.Add(field.Name, field);
+			}
+
+			foreach(var property in data.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance))
+			{
+				var parameters = property.GetIndexParameters();
+
+				if(parameters == null || parameters.Length == 0)
+					_members.Add(property.Name, property);
+			}
 		}
 		#endregion

@@ -1204,7 +1220,7 @@
 		{
 			get
 			{
-				return _members.Keys.ToArray();
+				return _members.Keys;
 			}
 		}

@@ -1212,7 +1228,18 @@
 		{
 			get
 			{
-				return _members.Values.Select(p => p.GetValue(ref _data)).ToArray();
+				return _members.Values.Select(member =>
+				{
+					switch(member.MemberType)
+					{
+						case MemberTypes.Field:
+							return ((FieldInfo)member).GetGetter().Invoke(ref _data);
+						case MemberTypes.Property:
+							return ((PropertyInfo)member).GetGetter().Invoke(ref _data);
+						default:
+							return null;
+					}
+				}).ToArray();
 			}
 		}
 		#endregion
@@ -1220,7 +1247,7 @@
 		#region 公共方法
 		public bool Contains(string name)
 		{
-			return _members.Contains(name);
+			return _members.ContainsKey(name);
 		}

 		public bool HasChanges(params string[] names)
@@ -1230,7 +1257,7 @@

 			foreach(var name in names)
 			{
-				if(name != null && name.Length > 0 && _members.Contains(name))
+				if(name != null && name.Length > 0 && _members.ContainsKey(name))
 					return true;
 			}

@@ -1249,12 +1276,12 @@

 		public object GetValue(string name)
 		{
-			return _members.Get(name).GetValue(ref _data);
+			return _members[name].GetValue(ref _data);
 		}

 		public TValue GetValue<TValue>(string name, TValue defaultValue)
 		{
-			if(_members.TryGet(name, out var member))
+			if(_members.TryGetValue(name, out var member))
 				return (TValue)Convert.ChangeType(member.GetValue(ref _data), typeof(TValue));

 			return defaultValue;
@@ -1270,7 +1297,7 @@
 			if(valueFactory == null)
 				throw new ArgumentNullException(nameof(valueFactory));

-			if(!_members.TryGet(name, out var member))
+			if(!_members.TryGetValue(name, out var member))
 				throw new KeyNotFoundException($"The specified '{name}' is not a member of the '{_data.GetType().FullName}' type.");

 			if(predicate == null || predicate((TValue)Convert.ChangeType(member.GetValue(ref _data), typeof(TValue))))
@@ -1279,7 +1306,7 @@

 		public bool TryGetValue<TValue>(string name, out TValue value)
 		{
-			if(_members.TryGet(name, out var member))
+			if(_members.TryGetValue(name, out var member))
 			{
 				value = (TValue)Convert.ChangeType(member.GetValue(ref _data), typeof(TValue));
 				return true;
@@ -1291,7 +1318,7 @@

 		public bool TryGetValue<TValue>(string name, Action<TValue> got)
 		{
-			if(_members.TryGet(name, out var member))
+			if(_members.TryGetValue(name, out var member))
 			{
 				got?.Invoke((TValue)Convert.ChangeType(member.GetValue(ref _data), typeof(TValue)));
 				return true;
@@ -1310,7 +1337,7 @@
 			if(valueFactory == null)
 				throw new ArgumentNullException(nameof(valueFactory));

-			if(_members.TryGet(name, out var member))
+			if(_members.TryGetValue(name, out var member))
 			{
 				if(predicate == null || predicate((TValue)Convert.ChangeType(member.GetValue(ref _data), typeof(TValue))))
 				{
@@ -1517,7 +1544,7 @@
 		{
 			foreach(var key in _members.Keys)
 			{
-				yield return new KeyValuePair<string, object>(key, _members.Get(key).GetValue(ref _data));
+				yield return new KeyValuePair<string, object>(key, _members[key].GetValue(ref _data));
 			}
 		}


Update test files to react to new `TagHelperScopeManager` contract.

#720

--- test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperScopeManagerTest.cs
+++ test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperScopeManagerTest.cs
@@ -15,7 +15,7 @@
         public void Begin_DoesNotRequireParentExecutionContext()
         {
             // Arrange & Act
-            var scopeManager = new TagHelperScopeManager();
+            var scopeManager = CreateDefaultScopeManager();

             // Act
             var executionContext = BeginDefaultScope(scopeManager, tagName: "p");
@@ -31,7 +31,7 @@
         public void Begin_ReturnedExecutionContext_ItemsAreRetrievedFromParentExecutionContext()
         {
             // Arrange
-            var scopeManager = new TagHelperScopeManager();
+            var scopeManager = CreateDefaultScopeManager();
             var parentExecutionContext = BeginDefaultScope(scopeManager, tagName: "p");
             parentExecutionContext.Items["test-entry"] = 1234;

@@ -48,7 +48,7 @@
         public void Begin_DoesShallowCopyOfParentItems()
         {
             // Arrange
-            var scopeManager = new TagHelperScopeManager();
+            var scopeManager = CreateDefaultScopeManager();
             var parentComplexObject = new Dictionary<string, int>(StringComparer.Ordinal);
             var parentExecutionContext = BeginDefaultScope(scopeManager, tagName: "p");
             parentExecutionContext.Items["test-entry"] = parentComplexObject;
@@ -70,7 +70,7 @@
         public void Begin_ReturnedExecutionContext_ItemsModificationDoesNotAffectParent()
         {
             // Arrange
-            var scopeManager = new TagHelperScopeManager();
+            var scopeManager = CreateDefaultScopeManager();
             var parentExecutionContext = BeginDefaultScope(scopeManager, tagName: "p");
             parentExecutionContext.Items["test-entry"] = 1234;
             var executionContext = BeginDefaultScope(scopeManager, tagName: "p");
@@ -91,7 +91,7 @@
         public void Begin_ReturnedExecutionContext_ItemsInsertionDoesNotAffectParent()
         {
             // Arrange
-            var scopeManager = new TagHelperScopeManager();
+            var scopeManager = CreateDefaultScopeManager();
             var parentExecutionContext = BeginDefaultScope(scopeManager, tagName: "p");
             var executionContext = BeginDefaultScope(scopeManager, tagName: "p");

@@ -109,7 +109,7 @@
         public void Begin_ReturnedExecutionContext_ItemsRemovalDoesNotAffectParent()
         {
             // Arrange
-            var scopeManager = new TagHelperScopeManager();
+            var scopeManager = CreateDefaultScopeManager();
             var parentExecutionContext = BeginDefaultScope(scopeManager, tagName: "p");
             parentExecutionContext.Items["test-entry"] = 1234;
             var executionContext = BeginDefaultScope(scopeManager, tagName: "p");
@@ -128,7 +128,7 @@
         public void Begin_CreatesContexts_TagHelperOutput_WithAppropriateTagName()
         {
             // Arrange
-            var scopeManager = new TagHelperScopeManager();
+            var scopeManager = CreateDefaultScopeManager();

             // Act
             var executionContext = BeginDefaultScope(scopeManager, tagName: "p");
@@ -142,7 +142,7 @@
         public void Begin_CanNest()
         {
             // Arrange
-            var scopeManager = new TagHelperScopeManager();
+            var scopeManager = CreateDefaultScopeManager();

             // Act
             var executionContext = BeginDefaultScope(scopeManager, tagName: "p");
@@ -160,7 +160,7 @@
         public void Begin_SetsExecutionContexts_TagHelperOutputTagMode(TagMode tagMode)
         {
             // Arrange
-            var scopeManager = new TagHelperScopeManager();
+            var scopeManager = CreateDefaultScopeManager();

             // Act
             var executionContext = BeginDefaultScope(scopeManager, "p", tagMode);
@@ -174,7 +174,7 @@
         public void End_ReturnsParentExecutionContext()
         {
             // Arrange
-            var scopeManager = new TagHelperScopeManager();
+            var scopeManager = CreateDefaultScopeManager();

             // Act
             var executionContext = BeginDefaultScope(scopeManager, tagName: "p");
@@ -190,7 +190,7 @@
         public void End_ReturnsNullIfNoNestedContext()
         {
             // Arrange
-            var scopeManager = new TagHelperScopeManager();
+            var scopeManager = CreateDefaultScopeManager();

             // Act
             var executionContext = BeginDefaultScope(scopeManager, tagName: "p");
@@ -206,7 +206,7 @@
         public void End_ThrowsIfNoScope()
         {
             // Arrange
-            var scopeManager = new TagHelperScopeManager();
+            var scopeManager = CreateDefaultScopeManager();
             var expectedError = string.Format(
                 "Must call '{2}.{1}' before calling '{2}.{0}'.",
                 nameof(TagHelperScopeManager.End),
@@ -222,6 +222,13 @@
             Assert.Equal(expectedError, ex.Message);
         }

+        private static TagHelperScopeManager CreateDefaultScopeManager()
+        {
+            return new TagHelperScopeManager(
+                startTagHelperWritingScope: _ => { },
+                endTagHelperWritingScope: () => new DefaultTagHelperContent());
+        }
+
         private static TagHelperExecutionContext BeginDefaultScope(
             TagHelperScopeManager scopeManager,
             string tagName,
@@ -231,9 +238,7 @@
                 tagName,
                 tagMode,
                 uniqueId: string.Empty,
-                executeChildContentAsync: async () => await Task.FromResult(result: true),
-                startTagHelperWritingScope: _ => { },
-                endTagHelperWritingScope: () => new DefaultTagHelperContent());
+                executeChildContentAsync: async () => await Task.FromResult(result: true));
         }
     }
 }


Showroom: Adjust scene menu position and rotation

--- Assets/VisualiseR/Code/Scripts/VisualiseR/Showroom/Controller/ShowShowroomSceneMenuCommand.cs
+++ Assets/VisualiseR/Code/Scripts/VisualiseR/Showroom/Controller/ShowShowroomSceneMenuCommand.cs
@@ -49,14 +49,17 @@
             Vector3 shift = Camera.main.transform.forward.normalized * 4;
             Vector3 pos = Camera.main.transform.position + shift;
             sceneMenu.transform.position = pos;
-            if (sceneMenu.transform.position.y < 0)
+            if (sceneMenu.transform.localPosition.y < 0)
             {
-                sceneMenu.transform.position = new Vector3(pos.x, 0, pos.z);
+                sceneMenu.transform.localPosition = new Vector3(sceneMenu.transform.localPosition.x, 0, sceneMenu.transform.localPosition.z);
             }

             Vector3 relativePos = Camera.main.transform.position - pos;
             sceneMenu.transform.rotation = Quaternion.LookRotation(relativePos);
             sceneMenu.transform.Rotate(0, 180, 0);
+            var rot = sceneMenu.transform.eulerAngles;
+            rot.x = 0;
+            sceneMenu.transform.eulerAngles = rot;
         }
     }
 }


remove the directory check

remove the directory check

--- src/umbraco.cms/businesslogic/utilities/Zip.cs
+++ src/umbraco.cms/businesslogic/utilities/Zip.cs
@@ -12,11 +12,6 @@
     {
         public static void UnPack(string ZipFilePath, string UnPackDirectory, bool DeleteZipFile)
         {
-            if (Directory.Exists(UnPackDirectory) != true)
-            {
-                Directory.CreateDirectory(UnPackDirectory);
-            }
-
             ZipFile.ExtractToDirectory(ZipFilePath, UnPackDirectory);

             if (DeleteZipFile)


Small change

Small change

--- ITCC.HTTP/Utils/PingJsonConverter.cs
+++ ITCC.HTTP/Utils/PingJsonConverter.cs
@@ -25,10 +25,7 @@
             throw new NotImplementedException();
         }

-        public override bool CanConvert(Type objectType)
-        {
-            return objectType == typeof (PingResponse);
-        }
+        public override bool CanConvert(Type objectType) => objectType == typeof (PingResponse);

         public override bool CanRead => false;
     }


#18 Show error message for bad arguments

--- Jira.WallboardScreensaver/Program.cs
+++ Jira.WallboardScreensaver/Program.cs
@@ -67,7 +67,9 @@
                     Application.Run(Present<ScreensaverForm, IScreensaverView>());
                     break;
                 default:
-                    throw new ArgumentException($"Unknown argument value: `{args[0]}`.");
+                    var errors = Container.Resolve<IErrorMessageService>();
+                    errors.ShowErrorMessage(null, $"Unknown argument value '{args[0]}'.", "Invalid Command-Line");
+                    break;
             }
         }
     }


Cleanup

Cleanup

--- LmpClient/Utilities/CoroutineUtil.cs
+++ LmpClient/Utilities/CoroutineUtil.cs
@@ -37,11 +37,11 @@
             {
                 try
                 {
-                    action();
+                    action.Invoke();
                 }
                 catch (Exception e)
                 {
-                    LunaLog.LogError($"Error in delayed coroutine: {routineName}. Details {e}");
+                    LunaLog.LogError($"Error in run coroutine: {routineName}. Details {e}");
                 }
                 action.Invoke();
                 amountOfFrames--;
@@ -56,13 +56,12 @@
             {
                 try
                 {
-                    action();
+                    action.Invoke();
                 }
                 catch (Exception e)
                 {
-                    LunaLog.LogError($"Error in delayed coroutine: {routineName}. Details {e}");
+                    LunaLog.LogError($"Error in run coroutine: {routineName}. Details {e}");
                 }
-                action.Invoke();
                 amountOfSeconds -= Time.deltaTime;

                 yield return 0;


Instead of using string concatenation use Path.Combine for directory and file paths

--- MCServer-World-Converter/MainForm.cs
+++ MCServer-World-Converter/MainForm.cs
@@ -87,7 +87,7 @@

             string sourcePath = sourceTextBox.Text;
             string outputPath = outputTextBox.Text;
-            string playerPath = outputPath + "\\players";
+            string playerPath = Path.Combine(outputPath, "players");

             if (!Directory.Exists(playerPath))
             {
@@ -96,31 +96,30 @@

             NbtWorld world = NbtWorld.Open(sourcePath);

-            if (Directory.Exists(outputPath + "\\" + world.Level.LevelName))
+            if (Directory.Exists(Path.Combine(outputPath, world.Level.LevelName)))
             {
                 MessageBox.Show("World folder exists already, stopping.");
                 return;
             }
             else
             {
-                Directory.CreateDirectory(outputPath + "\\" + world.Level.LevelName);
-            }
-
-            DirectoryCopy(sourcePath, outputPath + "\\" + world.Level.LevelName, true);
-
-
-            IniFile iniFile = new IniFile(outputPath + "\\" + world.Level.LevelName + "\\" + "world.ini");
+                Directory.CreateDirectory(Path.Combine(outputPath, world.Level.LevelName));
+            }
+
+            DirectoryCopy(sourcePath, Path.Combine(outputPath, world.Level.LevelName), true);
+
+
+            IniFile iniFile = new IniFile(Path.Combine(outputPath, world.Level.LevelName, "world.ini"));
             iniFile.WriteValue("General", "Gamemode", ((int)world.Level.GameType).ToString());
             iniFile.WriteValue("General", "TimeInTicks", world.Level.Time.ToString());
             iniFile.WriteValue("SpawnPosition", "X", world.Level.Spawn.X.ToString());
             iniFile.WriteValue("SpawnPosition", "Y", world.Level.Spawn.Y.ToString());
             iniFile.WriteValue("SpawnPosition", "Z", world.Level.Spawn.Z.ToString());
             iniFile.WriteValue("Seed", "Seed", world.Level.RandomSeed.ToString());
-
-
-            if (File.Exists(sourcePath + "\\..\\server.properties"))
-            {
-                IDictionary<string, string> serverProperties = ReadDictionaryFile(sourcePath + "\\..\\server.properties");
+
+            if (File.Exists(Path.Combine(Directory.GetParent(sourcePath).FullName, "server.properties")))
+            {
+                IDictionary<string, string> serverProperties = ReadDictionaryFile(Path.Combine(Directory.GetParent(sourcePath).FullName, "server.properties"));
                 iniFile.WriteValue("Mechanics", "CommandBlocksEnabled", (serverProperties["enable-command-block"] == "true" ? 1 : 0).ToString());
                 iniFile.WriteValue("Mechanics", "PVPEnabled", (serverProperties["pvp"] == "true" ? 1 : 0).ToString());
                 iniFile.WriteValue("SpawnPosition", "MaxViewDistance", serverProperties["view-distance"]);
@@ -151,13 +150,13 @@
                 rootObject.Add("world", player.World);
                 rootObject.Add("xpCurrent", player.XPLevel);
                 rootObject.Add("xpTotal", player.XPTotal);
-
+
                 string uuidPrefix = player.Name.Substring(0, 2);
-                string outputFile = playerPath + "\\" + uuidPrefix + "\\" + player.Name.Substring(2) + ".json";
-
-                if (!Directory.Exists(playerPath + "\\" + uuidPrefix))
-                {
-                    Directory.CreateDirectory(playerPath + "\\" + uuidPrefix);
+                string outputFile = Path.Combine(playerPath, uuidPrefix, player.Name.Substring(2) + ".json");
+
+                if (!Directory.Exists(Path.Combine(playerPath, uuidPrefix)))
+                {
+                    Directory.CreateDirectory(Path.Combine(playerPath, uuidPrefix));
                 }

                 StreamWriter writer = new StreamWriter(outputFile);


Arquivo copiado em lugar errado realocado para a pasta destino


Added checks so that blank lines are not being written if schema and item properties are not init.

--- OTAEdit/InputOutput/OtaInputOutput.cs
+++ OTAEdit/InputOutput/OtaInputOutput.cs
@@ -82,14 +82,22 @@
         {
             wr.WriteLine("\t[" + schemaModel.GetName + "]");
             wr.WriteLine("\t\t{");
-            wr.WriteLine("\t\t" + schemaModel.GetWriteString("Type") + ";");
-            wr.WriteLine("\t\t" + schemaModel.GetWriteString("aiprofile") + ";");
-            wr.WriteLine("\t\t" + schemaModel.GetWriteString("SurfaceMetal") + ";");
-            wr.WriteLine("\t\t" + schemaModel.GetWriteString("MohoMetal") + ";");
-            wr.WriteLine("\t\t" + schemaModel.GetWriteString("HumanMetal") + ";");
-            wr.WriteLine("\t\t" + schemaModel.GetWriteString("ComputerMetal") + ";");
-            wr.WriteLine("\t\t" + schemaModel.GetWriteString("HumanEnergy") + ";");
-            wr.WriteLine("\t\t" + schemaModel.GetWriteString("ComputerEnergy") + ";");
+            if (schemaModel.Properties.ContainsKey("Type"))
+                wr.WriteLine("\t\t" + schemaModel.GetWriteString("Type") + ";");
+            if (schemaModel.Properties.ContainsKey("aiprofile"))
+                wr.WriteLine("\t\t" + schemaModel.GetWriteString("aiprofile") + ";");
+            if (schemaModel.Properties.ContainsKey("SurfaceMetal"))
+                wr.WriteLine("\t\t" + schemaModel.GetWriteString("SurfaceMetal") + ";");
+            if (schemaModel.Properties.ContainsKey("MohoMetal"))
+                wr.WriteLine("\t\t" + schemaModel.GetWriteString("MohoMetal") + ";");
+            if (schemaModel.Properties.ContainsKey("HumanMetal"))
+                wr.WriteLine("\t\t" + schemaModel.GetWriteString("HumanMetal") + ";");
+            if (schemaModel.Properties.ContainsKey("ComputerMetal"))
+                wr.WriteLine("\t\t" + schemaModel.GetWriteString("ComputerMetal") + ";");
+            if (schemaModel.Properties.ContainsKey("HumanEnergy"))
+                wr.WriteLine("\t\t" + schemaModel.GetWriteString("HumanEnergy") + ";");
+            if (schemaModel.Properties.ContainsKey("ComputerEnergy"))
+                wr.WriteLine("\t\t" + schemaModel.GetWriteString("ComputerEnergy") + ";");
             if (schemaModel.UseWeapon)
             {
                 wr.WriteLine("\t\t" + schemaModel.GetWriteString("MeteorWeapon") + ";");
@@ -137,15 +145,24 @@
         {
             wr.WriteLine("\t\t\t" + itemModel.GetItemIdentifier);
             wr.WriteLine("\t\t\t\t{");
-            wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("Unitname") + ";");
-            wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("Ident") + ";");
-            wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("XPos") + ";");
-            wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("YPos") + ";");
-            wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("ZPos") + ";");
-            wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("Player") + ";");
-            wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("HealthPercentage") + ";");
-            wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("Angle") + ";");
-            wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("Kills") + ";");
+            if (itemModel.Properties.ContainsKey("Unitname"))
+                wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("Unitname") + ";");
+            if (itemModel.Properties.ContainsKey("Ident"))
+                wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("Ident") + ";");
+            if (itemModel.Properties.ContainsKey("XPos"))
+                wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("XPos") + ";");
+            if (itemModel.Properties.ContainsKey("YPos"))
+                wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("YPos") + ";");
+            if (itemModel.Properties.ContainsKey("ZPos"))
+                wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("ZPos") + ";");
+            if (itemModel.Properties.ContainsKey("Player"))
+                wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("Player") + ";");
+            if (itemModel.Properties.ContainsKey("HealthPercentage"))
+                wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("HealthPercentage") + ";");
+            if (itemModel.Properties.ContainsKey("Angle"))
+                wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("Angle") + ";");
+            if (itemModel.Properties.ContainsKey("Kills"))
+                wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("Kills") + ";");
             if (itemModel.Properties.ContainsKey("InitialMission"))
                 wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("InitialMission") + ";");
             wr.WriteLine("\t\t\t\t}");
@@ -155,9 +172,12 @@
         {
             wr.WriteLine("\t\t\t" + itemModel.GetItemIdentifier);
             wr.WriteLine("\t\t\t\t{");
-            wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("Featurename") + ";");
-            wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("XPos") + ";");
-            wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("ZPos") + ";");
+            if (itemModel.Properties.ContainsKey("Featurename"))
+                wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("Featurename") + ";");
+            if (itemModel.Properties.ContainsKey("XPos"))
+                wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("XPos") + ";");
+            if (itemModel.Properties.ContainsKey("ZPos"))
+                wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("ZPos") + ";");
             wr.WriteLine("\t\t\t\t}");
         }

@@ -165,9 +185,12 @@
         {
             wr.WriteLine("\t\t\t" + itemModel.GetItemIdentifier);
             wr.WriteLine("\t\t\t\t{");
-            wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("specialwhat") + ";");
-            wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("XPos") + ";");
-            wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("ZPos") + ";");
+            if (itemModel.Properties.ContainsKey("specialwhat"))
+                wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("specialwhat") + ";");
+            if (itemModel.Properties.ContainsKey("XPos"))
+                wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("XPos") + ";");
+            if (itemModel.Properties.ContainsKey("ZPos"))
+                wr.WriteLine("\t\t\t\t" + itemModel.GetWriteString("ZPos") + ";");
             wr.WriteLine("\t\t\t\t}");
         }
         #endregion


well that was a silly merge

well that was a silly merge

--- Octokit/Clients/RepositoriesClient.cs
+++ Octokit/Clients/RepositoriesClient.cs
@@ -25,6 +25,8 @@
             CommitStatus = new CommitStatusClient(apiConnection);
             RepoCollaborators = new RepoCollaboratorsClient(apiConnection);
             Statistics = new StatisticsClient(apiConnection);
+            Deployment = new DeploymentsClient(apiConnection);
+            PullRequest = new PullRequestsClient(apiConnection);
         }

         /// <summary>


patch kill by UUID

patch kill by UUID

Signed-off-by: Melanie <0ecfbc3894c7b8e374232cadc0afa67162a600be@t-data.com>

--- OpenSim/Region/Application/OpenSim.cs
+++ OpenSim/Region/Application/OpenSim.cs
@@ -343,6 +343,10 @@
                                           "Add-InventoryHost <host>",
                                           String.Empty, RunCommand);

+            m_console.Commands.AddCommand("region", false, "killuuid",
+                                          "killuuid <UUID>",
+                                          "kill an object by UUID", KillUUID);
+
             if (ConfigurationSettings.Standalone)
             {
                 m_console.Commands.AddCommand("region", false, "create user",
@@ -1332,6 +1336,60 @@
             return result;
         }

+        /// <summary>
+        /// Kill an object given its UUID.
+        /// </summary>
+        /// <param name="cmdparams"></param>
+        protected void KillUUID(string module, string[] cmdparams)
+        {
+            if (cmdparams.Length > 1)
+            {
+                UUID id = UUID.Zero;
+                SceneObjectGroup grp = null;
+                Scene sc = null;
+
+                try
+                {
+                    Guid x = new Guid((string)cmdparams[1]);
+                    id = (UUID)(string)cmdparams[1];
+                }
+                catch (Exception)
+                {
+                    m_log.Error("[KillUUID]: Error bad UUID formating !");
+                    return;
+                }
+
+                m_sceneManager.ForEachScene(
+                    delegate(Scene scene)
+                    {
+                        if (scene.Entities[id] != null)
+                        {
+                            grp = (SceneObjectGroup) scene.Entities[id];
+                            sc = scene;
+                        }
+                    });
+
+                if (grp == null)
+                    m_log.ErrorFormat("[KillUUID]: Given UUID {0} not found !", id);
+                else
+                {
+                    m_log.InfoFormat("[KillUUID]: Found UUID {0} in scene {1}", id, sc.RegionInfo.RegionName);
+                    try
+                    {
+                        sc.DeleteSceneObject(grp, false);
+                    }
+                    catch (Exception e)
+                    {
+                        m_log.ErrorFormat("[KillUUID]: Error while removing objects from scene: " + e);
+                    }
+                }
+            }
+            else
+            {
+                m_log.Error("[KillUUID]: Usage: killuuid <UUID>");
+            }
+        }
+
         #endregion
     }
 }


Decoder - GetExpression saving progress

Decoder - GetExpression saving progress

--- PRGReaderLibrary/Utilities/Decoder.cs
+++ PRGReaderLibrary/Utilities/Decoder.cs
@@ -127,6 +127,8 @@
             {
                 switch (source[offset])
                 {
+                    #region Identifiers
+
                     case (byte)PCODE_CONST.LOCAL_POINT_PRG:
                         EditorTokenInfo localpoint = new EditorTokenInfo("Identifier", "Identifier");
                         localpoint.Token = source[offset];
@@ -136,6 +138,11 @@
                         localpoint.Text = GetIdentifierLabel(source, ref offset); //increments offset after reading identifier
                         ExprTokens.Add(localpoint);
                         break;
+
+                    #endregion
+
+                    #region Numeric Constants
+
                     case (byte)PCODE_CONST.CONST_VALUE_PRG:
                         //TODO: Set a EditorTokenInfo for a numeric constant value
                         //.Text should be ready with decoded value
@@ -145,16 +152,81 @@
                         ExprTokens.Add(constvalue);
                         break;

+                    #endregion
+
+                    #region Single Tokens

                     case (byte)TYPE_TOKEN.PLUS:
                         EditorTokenInfo plustoken = new EditorTokenInfo("+","PLUS");
+                        plustoken.Token = source[offset];
                         ExprTokens.Add(plustoken);
+                        offset++;
                         break;
                     case (byte)TYPE_TOKEN.MINUS:
                         EditorTokenInfo minustoken = new EditorTokenInfo("-", "MINUS");
+                        minustoken.Token = source[offset];
                         ExprTokens.Add(minustoken);
-                        break;
-
+                        offset++;
+                        break;
+                    case (byte)TYPE_TOKEN.DIV:
+                        EditorTokenInfo divtoken = new EditorTokenInfo("/", "DIV");
+                        divtoken.Token = source[offset];
+                        ExprTokens.Add(divtoken);
+                        offset++;
+                        break;
+                    case (byte)TYPE_TOKEN.IDIV:
+                        EditorTokenInfo idivtoken = new EditorTokenInfo("\\", "IDIV");
+                        idivtoken.Token = source[offset];
+                        ExprTokens.Add(idivtoken);
+                        offset++;
+                        break;
+                    case (byte)TYPE_TOKEN.MUL:
+                        EditorTokenInfo multoken = new EditorTokenInfo("*", "MUL");
+                        multoken.Token = source[offset];
+                        ExprTokens.Add(multoken);
+                        offset++;
+                        break;
+                    case (byte)TYPE_TOKEN.POW:
+                        EditorTokenInfo powtoken = new EditorTokenInfo("^", "POW");
+                        powtoken.Token = source[offset];
+                        ExprTokens.Add(powtoken);
+                        offset++;
+                        break;
+                    case (byte)TYPE_TOKEN.MOD:
+                        EditorTokenInfo modtoken = new EditorTokenInfo("MOD", "MOD");
+                        modtoken.Token = source[offset];
+                        ExprTokens.Add(modtoken);
+                        offset++;
+                        break;
+                    case (byte)TYPE_TOKEN.LT:
+                        EditorTokenInfo lttoken = new EditorTokenInfo("<", "LT");
+                        lttoken.Token = source[offset];
+                        ExprTokens.Add(lttoken);
+                        offset++;
+                        break;
+                    case (byte)TYPE_TOKEN.LE:
+                        EditorTokenInfo letoken = new EditorTokenInfo("<=", "LE");
+                        letoken.Token = source[offset];
+                        ExprTokens.Add(letoken);
+                        offset++;
+                        break;
+                    case (byte)TYPE_TOKEN.GT:
+                        EditorTokenInfo gttoken = new EditorTokenInfo(">", "GT");
+                        gttoken.Token = source[offset];
+                        ExprTokens.Add(gttoken);
+                        offset++;
+                        break;
+                    case (byte)TYPE_TOKEN.GE:
+                        EditorTokenInfo getoken = new EditorTokenInfo(">=", "GE");
+                        getoken.Token = source[offset];
+                        ExprTokens.Add(getoken);
+                        offset++;
+                        break;
+
+
+                    #endregion
+
+                    #region End of expressions (MARKERS)

                     case (byte)LINE_TOKEN.EOF:
@@ -167,8 +239,10 @@
                         isEOL = true;
                         //expression ends here, this byte-token should be processed outside this function
                         break;
+
+                    #endregion
                 }
-
+
             }
             return null;
         }


Add AadDefault authentication mode.

Add AadDefault authentication mode.

--- PSql/_Data/AzureAuthenticationMode.cs
+++ PSql/_Data/AzureAuthenticationMode.cs
@@ -82,5 +82,62 @@
         ///   the <see cref="SqlContext.Credential"/> should be null.
         ///
         AadManagedIdentity = 7, // ActiveDirectoryManagedIdentity
+
+        ///
+        ///   Azure Active Directory default authentication mode.  This mode
+        ///   attempts multiple non-interactive
+        ///   authentication methods sequentially.
+        ///
+        /// <remarks>
+        ///   <para>
+        ///   This mode attempts in order:
+        ///   </para>
+        ///   <list type="bullet">
+        ///     <item>
+        ///       <term>Environment</term>
+        ///       <description>
+        ///         Credential
+        ///         configured in environment variables.
+        ///       </description>
+        ///     </item>
+        ///     <item>
+        ///       <term>Managed Identity</term>
+        ///       <description>
+        ///         Managed identity configured for the Azure resource running
+        ///         the current PowerShell session.  For a user-assigned
+        ///         identity, the <see cref="SqlContext.Credential"/>
+        ///         property's username should be the object ID of the
+        ///         identity; the password is ignored.  For a system-assigned
+        ///         identity, the the <see cref="SqlContext.Credential"/>
+        ///         should be null.
+        ///       </description>
+        ///     </item>
+        ///     <item>
+        ///       <term>Shared Token Cache</term>
+        ///       <description>
+        ///         Local cache shared between Microsoft applications.
+        ///       </description>
+        ///     </item>
+        ///     <item>
+        ///       <term>Visual Studio</term>
+        ///       <description>
+        ///         Token cached by Visual Studio.
+        ///       </description>
+        ///     </item>
+        ///     <item>
+        ///       <term>Visual Studio Code</term>
+        ///       <description>
+        ///         Token cached by Visual Studio Code.
+        ///       </description>
+        ///     </item>
+        ///     <item>
+        ///       <term>Azure CLI</term>
+        ///       <description>
+        ///         Token cached by the Azure CLI.
+        ///       </description>
+        ///     </item>
+        ///   </list>
+        /// </remarks>
+        AadDefault = 9, // ActiveDirectoryDefault
     }
 }


HELO Hostname no longer needs the HOSTS file to be set.

--- MantaCore/Smtp/SmtpOutboundClient.cs
+++ MantaCore/Smtp/SmtpOutboundClient.cs
@@ -236,12 +236,9 @@
 			_LastActive = DateTime.UtcNow;
 			IsActive = true;

-			// Get the hostname of the IP address that we are connecting from.
-			string hostname = System.Net.Dns.GetHostEntry(this.SmtpStream.LocalAddress).HostName;
-
 			// We have connected to the MX, Say EHLO.
 			_LastActive = DateTime.UtcNow;
-			await SmtpStream.WriteLineAsync("EHLO " + hostname);
+			await SmtpStream.WriteLineAsync("EHLO " + MtaIpAddress.Hostname);
 			string response = await SmtpStream.ReadAllLinesAsync();
 			if (response.StartsWith("421"))
 			{
@@ -254,7 +251,7 @@
 				if (!response.StartsWith("2"))
 				{
 					// If server didn't respond with a success code on hello then we should retry with HELO
-					await SmtpStream.WriteLineAsync("HELO " + hostname);
+					await SmtpStream.WriteLineAsync("HELO " + MtaIpAddress.Hostname);
 					response = await SmtpStream.ReadAllLinesAsync();
 					_LastActive = DateTime.UtcNow;
 					if (!response.StartsWith("250"))


Fix crash when saving after lifting and moving tiles

--- Mappy/Operations/OperationFactory.cs
+++ Mappy/Operations/OperationFactory.cs
@@ -81,7 +81,7 @@
             var positionedTile = new Positioned<IMapTile>(tile, new Point(x, y));

             var addOp = new AddFloatingTileOperation(map, positionedTile);
-            var clearBitmapOp = new FillAreaOperation<Bitmap>(map.Tile.TileGrid, x, y, width, height, null);
+            var clearBitmapOp = new FillAreaOperation<Bitmap>(map.Tile.TileGrid, x, y, width, height, Globals.DefaultTile);
             var clearHeightOp = new FillAreaOperation<int>(map.Tile.HeightGrid, x * 2, y * 2, width * 2, height * 2, 0);

             return new CompositeOperation(addOp, clearBitmapOp, clearHeightOp);


Proposed fix for #703. The popup is not properly repositioning itself when its anchor control is moved. This updates the popup's position whenever the position between the two has changed.

--- MaterialDesignThemes.Wpf/PopupBox.cs
+++ MaterialDesignThemes.Wpf/PopupBox.cs
@@ -1,10 +1,8 @@
-using System;
+using ControlzEx;
+using System;
 using System.ComponentModel;
-using System.Diagnostics;
 using System.Linq;
 using System.Runtime.InteropServices;
-using System.Text;
-using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Controls.Primitives;
@@ -12,7 +10,6 @@
 using System.Windows.Markup;
 using System.Windows.Media;
 using System.Windows.Media.Animation;
-using ControlzEx;

 namespace MaterialDesignThemes.Wpf
 {
@@ -110,13 +107,19 @@
         private ContentControl _popupContentControl;
         private ToggleButton _toggleButton;
         private Point _popupPointFromLastRequest;
+        private Point _lastRelativePositon;

         static PopupBox()
         {
             DefaultStyleKeyProperty.OverrideMetadata(typeof(PopupBox), new FrameworkPropertyMetadata(typeof(PopupBox)));
             ToolTipService.IsEnabledProperty.OverrideMetadata(typeof(PopupBox), new FrameworkPropertyMetadata(null, CoerceToolTipIsEnabled));
             EventManager.RegisterClassHandler(typeof(PopupBox), Mouse.LostMouseCaptureEvent, new MouseEventHandler(OnLostMouseCapture));
-            EventManager.RegisterClassHandler(typeof(PopupBox), Mouse.MouseDownEvent, new MouseButtonEventHandler(OnMouseButtonDown), true);
+            EventManager.RegisterClassHandler(typeof(PopupBox), Mouse.MouseDownEvent, new MouseButtonEventHandler(OnMouseButtonDown), true);
+        }
+
+        public PopupBox()
+        {
+            LayoutUpdated += OnLayoutUpdated;
         }

         public static readonly DependencyProperty ToggleContentProperty = DependencyProperty.Register(
@@ -229,8 +232,8 @@
                 else
                     Mouse.Capture(null);
             }
-
-            popupBox.AnimateChildrenIn(!newValue);
+
+            popupBox.AnimateChildrenIn(!newValue);
             popupBox._popup?.RefreshPosition();

             VisualStateManager.GoToState(popupBox, newValue ? PopupIsOpenStateName : PopupIsClosedStateName, true);
@@ -239,7 +242,6 @@
                 popupBox.OnOpened();
             else
                 popupBox.OnClosed();
-
         }

         /// <summary>
@@ -398,7 +400,7 @@
             if (_popup != null)
                 _popup.Loaded += PopupOnLoaded;
             if (_toggleButton != null)
-                _toggleButton.PreviewMouseLeftButtonUp += ToggleButtonOnPreviewMouseLeftButtonUp;
+                _toggleButton.PreviewMouseLeftButtonUp += ToggleButtonOnPreviewMouseLeftButtonUp;

             VisualStateManager.GoToState(this, IsPopupOpen ? PopupIsOpenStateName : PopupIsClosedStateName, false);
         }
@@ -408,7 +410,7 @@
             base.OnIsKeyboardFocusWithinChanged(e);

             if (IsPopupOpen && !IsKeyboardFocusWithin)
-            {
+            {
                 Close();
             }
         }
@@ -439,8 +441,21 @@

                 SetCurrentValue(IsPopupOpenProperty, true);
             }
-
             base.OnMouseEnter(e);
+        }
+
+        private void OnLayoutUpdated(object sender, EventArgs eventArgs)
+        {
+            if (_popupContentControl != null && _popup != null &&
+                (PopupMode == PopupBoxPopupMode.MouseOver || PopupMode == PopupBoxPopupMode.MouseOverEager))
+            {
+                Point relativePosition = _popupContentControl.TranslatePoint(new Point(), this);
+                if (relativePosition != _lastRelativePositon)
+                {
+                    _popup.RefreshPosition();
+                    _lastRelativePositon = _popupContentControl.TranslatePoint(new Point(), this);
+                }
+            }
         }

         protected override void OnMouseLeave(MouseEventArgs e)
@@ -461,16 +476,16 @@

         private CustomPopupPlacement[] GetPopupPlacement(Size popupSize, Size targetSize, Point offset)
         {
-            double x, y;
-
+            double x, y;
+
             if (FlowDirection == FlowDirection.RightToLeft)
                 offset.X += targetSize.Width / 2;
-
+
             switch (PlacementMode)
             {
                 case PopupBoxPlacementMode.BottomAndAlignLeftEdges:
                     x = 0 - Math.Abs(offset.X*3);
-                    y = targetSize.Height - Math.Abs(offset.Y);
+                    y = targetSize.Height - Math.Abs(offset.Y);
                     break;
                 case PopupBoxPlacementMode.BottomAndAlignRightEdges:
                     x = 0 - popupSize.Width + targetSize.Width - offset.X;
@@ -699,7 +714,7 @@
         }

         protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
-        {
+        {
             if (IsPopupOpen && !StaysOpen)
             {
                 Close();
@@ -735,7 +750,7 @@

             Close();
             Mouse.Capture(null);
-            mouseButtonEventArgs.Handled = true;
+            mouseButtonEventArgs.Handled = true;
         }

         private static object CoerceToolTipIsEnabled(DependencyObject dependencyObject, object value)


fleshing out snackbar message queue

fleshing out snackbar message queue

--- MaterialDesignThemes.Wpf/Snackbar.cs
+++ MaterialDesignThemes.Wpf/Snackbar.cs
@@ -1,6 +1,8 @@
 using System;
+using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.Linq;
+using System.Runtime.InteropServices;
 using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
@@ -44,7 +46,7 @@

         Multiple windows...having the option for one shared queue is nice...if a notification comes in, we can route to the foreground window...

-
+        * need to pause timers if a dialog is shown

         <Snackbar MessageQueue="{Binding MessageQueue}" />

@@ -57,52 +59,137 @@
         void Post(object content, object actionContent, Action actionHandler);

         void Post<TArgument>(object content, object actionContent, Action<TArgument> actionHandler, TArgument actionArgument);
+    }
+
+    internal class SnackbarMessage
+    {
+        public SnackbarMessage(object content, object actionContent = null, object actionHandler = null, object actionArgument = null, Type argumentType = null)
+        {
+            Content = content;
+            ActionContent = actionContent;
+            ActionHandler = actionHandler;
+            ActionArgument = actionArgument;
+            ArgumentType = argumentType;
+        }
+
+        public object Content { get; }
+
+        public object ActionContent { get; }
+
+        public object ActionHandler { get; }
+
+        public object ActionArgument { get; }
+
+        public Type ArgumentType { get; }
     }

-    internal class SnackbarMessageQueueRegistration
+    public class SnackbarMessageQueue : ISnackbarMessageQueue, IDisposable
     {
-        public SnackbarMessageQueueRegistration(Snackbar2 snackbar2)
-        {
-            Snackbar2 = snackbar2;
-        }
-
-        public Snackbar2 Snackbar2 { get; }
-    }
-
-    public class SnackbarMessageQueue : ISnackbarMessageQueue
-    {
-        private readonly IList<SnackbarMessageQueueRegistration> _pairedSnackbars = new List<SnackbarMessageQueueRegistration>();
+        private readonly HashSet<Snackbar2> _pairedSnackbars = new HashSet<Snackbar2>();
+        private readonly Queue<SnackbarMessage> _snackbarMessages = new Queue<SnackbarMessage>();
+        private readonly ManualResetEvent _disposedEvent = new ManualResetEvent(false);
+        private bool _isDisposed;
+
+        public SnackbarMessageQueue()
+        {
+            Task.Factory.StartNew(Pump);
+        }

         //oh if only I had Disposable.Create in this lib :)  tempted to copy it in like dragabalz,
         //but this is an internal method so no one will know my direty Action disposer...
         internal Action Pair(Snackbar2 snackbar)
         {
-            //assume this internal method is on Dispatcher
-
             if (snackbar == null) throw new ArgumentNullException(nameof(snackbar));

-      //      if (_pairedSnackbars)
-        //    _pairedSnackbars.Add(snackbar);
-
-          //  return () => _pairedSnackbars.Remove(snackbar);
-            return null;
-
-            //TODO worry about loading unloading...could cause a little leaky if u not carefull...
+            _pairedSnackbars.Add(snackbar);
+
+            return () => _pairedSnackbars.Remove(snackbar);
         }

         public void Post(object content)
         {
-            throw new NotImplementedException();
+            if (content == null) throw new ArgumentNullException(nameof(content));
+
+            _snackbarMessages.Enqueue(new SnackbarMessage(content));
+            _messageWaitingEvent.Set();
         }

         public void Post(object content, object actionContent, Action actionHandler)
         {
-            throw new NotImplementedException();
+            if (content == null) throw new ArgumentNullException(nameof(content));
+
+            _snackbarMessages.Enqueue(new SnackbarMessage(content, actionContent, actionHandler));
+            _messageWaitingEvent.Set();
         }

         public void Post<TArgument>(object content, object actionContent, Action<TArgument> actionHandler, TArgument actionArgument)
         {
-            throw new NotImplementedException();
+            if (content == null) throw new ArgumentNullException(nameof(content));
+
+            if (actionContent != null ^ actionHandler != null ^ actionArgument != null)
+            {
+                throw new ArgumentException("All action arguments must be provided if any are provided.", nameof(actionContent));
+            }
+
+            var argumentType = actionArgument != null ? typeof(TArgument) : null;
+
+            _snackbarMessages.Enqueue(new SnackbarMessage(content, actionContent, actionHandler, actionArgument, argumentType));
+            _messageWaitingEvent.Set();
+        }
+
+        private readonly ManualResetEvent _messageWaitingEvent = new ManualResetEvent(false);
+
+        private async void Pump()
+        {
+            while (!_isDisposed)
+            {
+                var eventId = WaitHandle.WaitAny(new WaitHandle[] {_disposedEvent, _messageWaitingEvent});
+                if (eventId == 0) continue;
+
+                //find a target
+                var snackbar = _pairedSnackbars.FirstOrDefault(sb =>
+                {
+                    if (!sb.IsLoaded || sb.Visibility != Visibility.Visible) return false;
+                    var window = Window.GetWindow(sb);
+                    return window != null && window.WindowState != WindowState.Minimized;
+                });
+
+                if (snackbar != null)
+                {
+                    var message = _snackbarMessages.Dequeue();
+                    //TODO check duplicates
+                    //TODO manage awaiting of animations
+                    //TODO action callbacks
+                    await Show(snackbar, message);
+
+                    //THOUGHT: I think we need a complete "SnackbarMessage" control, within the Snackbar...to ensure the callbacks are safely wired to the correct Post message
+                }
+
+                if (_snackbarMessages.Count > 0)
+                    _messageWaitingEvent.Set();
+            }
+
+        }
+
+        private async Task Show(Snackbar2 snackbar, SnackbarMessage message)
+        {
+            await Task.Run(() =>
+            {
+                //TODO set message on snackbar
+                snackbar.Dispatcher.BeginInvoke(new Action(() => { }));
+
+                //wait
+                _disposedEvent.WaitOne(3000);
+
+                //remove message on snackbar
+                snackbar.Dispatcher.BeginInvoke(new Action(() => { }));
+            });
+        }
+
+        public void Dispose()
+        {
+            _isDisposed = true;
+            _disposedEvent.Set();
         }
     }


Add test

Add test

--- MathSample/DecimalConsole/Program.cs
+++ MathSample/DecimalConsole/Program.cs
@@ -17,6 +17,8 @@

             RealDecimal_Inequality();
             RealDecimal_Add();
+            RealDecimal_Multiply();
+            RealDecimal_Power();

             EnumerableHelperTest();
         }
@@ -151,6 +153,32 @@
             Test(-1, -2, 1);
         }

+        static void RealDecimal_Multiply()
+        {
+            void Test(RealDecimal expected, RealDecimal d1, RealDecimal d2)
+            {
+                if (expected != d1 * d2) WriteLine($"{expected} != {d1} * {d2}");
+            }
+
+            Test(0, 0, 0);
+            Test(0, 0, 1);
+            Test(0, 0, -1);
+            Test(0, 1, 0);
+            Test(0, -1, 0);
+
+            Test(6, 3, 2);
+            Test(6, -3, -2);
+            Test(-6, 3, -2);
+            Test(-6, -3, 2);
+        }
+
+        static void RealDecimal_Power()
+        {
+            var d2_31 = (RealDecimal)(-2) ^ 31;
+            var d3_30 = (RealDecimal)3 ^ 30;
+            var d3_100 = (RealDecimal)3 ^ 100;
+        }
+
         static void EnumerableHelperTest()
         {
             var a = Enumerable.Range(0, 10).ToArray()


Submodules really inflate my commits...

Submodules really inflate my commits...

--- MemoryManagement/DisposeWatchable.cs
+++ MemoryManagement/DisposeWatchable.cs
@@ -4,7 +4,7 @@
 using System.Text;
 using System.Threading.Tasks;
 using Extensions;
-using GoodInterfaces.Memory;
+using Interfaces;

 namespace MemoryManagement
 {


Method overrides to manually provide version number if necessary.

--- Mindscape.Raygun4Net/RaygunClient.cs
+++ Mindscape.Raygun4Net/RaygunClient.cs
@@ -301,6 +301,26 @@
     }

     /// <summary>
+    /// Sends a message ro the Raygun.io endpoint based on the given <see cref="ApplicationUnhandledExceptionEventArgs"/>.
+    /// </summary>
+    /// <param name="args">The <see cref="ApplicationUnhandledExceptionEventArgs"/> containing the exception information.</param>
+    /// <param name="tags">A list of tags to send with the message.</param>
+    /// <param name="userCustomData">Custom data to send with the message.</param>
+    /// <paramref name="version">The version of the running application.</paramref>
+    public void Send(ApplicationUnhandledExceptionEventArgs args, IList<string> tags, IDictionary userCustomData, string version)
+    {
+      SetCallingAssembly(Assembly.GetCallingAssembly());
+      if (!(args.ExceptionObject is ExitException))
+      {
+        bool handled = args.Handled;
+        args.Handled = true;
+        RaygunMessage message = CreateMessage(args.ExceptionObject, tags, userCustomData);
+        message.Details.Version = version;
+        Send(message, false, !handled);
+      }
+    }
+
+    /// <summary>
     /// Sends a message to the Raygun.io endpoint based on the given <see cref="Exception"/>.
     /// </summary>
     /// <param name="exception">The <see cref="Exception"/> to send in the message.</param>
@@ -346,6 +366,31 @@
       SetCallingAssembly(Assembly.GetCallingAssembly());
       bool calledFromUnhandled = IsCalledFromApplicationUnhandledExceptionHandler();
       Send(exception, tags, userCustomData, calledFromUnhandled);
+    }
+
+    /// <summary>
+    /// Sends a message to the Raygun.io endpoint based on the given <see cref="Exception"/>.
+    /// </summary>
+    /// <param name="exception">The <see cref="Exception"/> to send in the message.</param>
+    /// <param name="tags">A list of tags to send with the message.</param>
+    /// <param name="userCustomData">Custom data to send with the message.</param>
+    /// <param name="version">The version of the running application.</param>
+    public void Send(Exception exception, IList<string> tags, IDictionary userCustomData, string version)
+    {
+      SetCallingAssembly(Assembly.GetCallingAssembly());
+      bool calledFromUnhandled = IsCalledFromApplicationUnhandledExceptionHandler();
+      Send(exception, tags, userCustomData, version, calledFromUnhandled);
+    }
+
+    private void Send(Exception exception, IList<string> tags, IDictionary userCustomData, string version, bool calledFromUnhandled)
+    {
+      if (!(exception is ExitException))
+      {
+        exception.Data.Add("Message", exception.Message); // TODO is this needed?
+        RaygunMessage message = CreateMessage(exception, tags, userCustomData);
+        message.Details.Version = version;
+        Send(message, calledFromUnhandled, false);
+      }
     }

     private void Send(Exception exception, IList<string> tags, IDictionary userCustomData, bool calledFromUnhandled)


Added WindowOptions.Standalone

Added WindowOptions.Standalone

--- Miruken.Mvc/Options/WindowOptions.cs
+++ Miruken.Mvc/Options/WindowOptions.cs
@@ -22,6 +22,7 @@
     {
         public bool?       NewWindow  { get; set; }
         public bool?       Modal      { get; set; }
+        public bool?       Standalone { get; set; }
         public Screen      Screen     { get; set; }
         public ScreenFill? FillScreen { get; set; }
         public Rectangle?  Frame      { get; set; }
@@ -33,6 +34,9 @@

             if (Modal.HasValue && !other.Modal.HasValue)
                 other.Modal = Modal;
+
+            if (Standalone.HasValue && !other.Standalone.HasValue)
+                other.Standalone = Standalone;

             if (Screen != null && other.Screen == null)
                 other.Screen = Screen;


All stylecop warnings fixed

All stylecop warnings fixed

--- Movies/Web/Movies.Web/Global.asax.cs
+++ Movies/Web/Movies.Web/Global.asax.cs
@@ -1,14 +1,12 @@
 namespace Movies.Web
 {
-    using System;
-    using System.Collections.Generic;
-    using System.Linq;
-    using System.Web;
     using System.Web.Mvc;
     using System.Web.Optimization;
     using System.Web.Routing;

+#pragma warning disable SA1649 // File name must match first type name
     public class MvcApplication : System.Web.HttpApplication
+#pragma warning restore SA1649 // File name must match first type name
     {
         protected void Application_Start()
         {


adjusted futility

adjusted futility

--- NoraGrace/NoraGrace.Engine/Search.cs
+++ NoraGrace/NoraGrace.Engine/Search.cs
@@ -578,12 +578,12 @@

         public int MarginFutilityPre(SearchDepth depth)
         {
-            return 130 + (depth.ToPly() * 45);
+            return 110 + (depth.ToPly() * 35);
         }

         public int MarginFutilityPost(SearchDepth depth)
         {
-            return 100 + (depth.ToPly() * 40);
+            return 90 + (depth.ToPly() * 35);
         }

         public int MarginRazor(SearchDepth depth)
@@ -722,7 +722,6 @@
 			score = -INFINITY;
 			//bool haslegalmove = false;
 			int legalMovesTried = 0;
-			int blunders = 0;
             Move bestmove = Move.EMPTY;

             CheckInfo checkInfo = CheckInfo.Generate(board, board.WhosTurn.PlayerOther());
@@ -733,8 +732,6 @@
                 Move move = moveData.Move;

 				CurrentVariation[ply] = move;
-
-                bool move_will_give_check = MoveInfo.CausesCheck(move, board, ref checkInfo);

                 var moveGain = _moveBuffer.History.ReadMaxPositionalGain(board.PieceAt(move.From()), move.To());

@@ -743,12 +740,22 @@
                     && moveData.Flags == 0
                     && depth.ToPly() <= 3
                     && !in_check_before_move
-                    && !move_will_give_check
                     && legalMovesTried > 3)
                 {
                     if (init_score + moveGain + MarginFutilityPre(depth.SubstractPly(1)) < alpha)
                     {
-                        continue;
+                        if (move.CausesCheck(board, ref checkInfo))
+                        {
+                            //process normal
+                        }
+                        else if (move.MakesThreat(board) && moveData.SEE >= 0)
+                        {
+                            //process normal
+                        }
+                        else
+                        {
+                            continue;
+                        }
                     }
                 }


Adding validation to only send email if there is at least one reciepient

--- Notification/NotificationProvider.cs
+++ Notification/NotificationProvider.cs
@@ -260,7 +260,7 @@
                 if (notification.CurrentUser)
                 {
                     var currentUser = context.GetIDbSet<User>().Find(Joe.Security.Security.Provider.UserID);
-                    if (currentUser != null && !toList.Contains(currentUser.Email))
+                    if (currentUser != null && !String.IsNullOrWhiteSpace(currentUser.Email) && !toList.Contains(currentUser.Email))
                         toList.Add(currentUser.Email);
                 }
                 if (notification.Owner != null)
@@ -274,13 +274,13 @@
                             if (typeof(IUser).IsAssignableFrom(ownerInfo.PropertyType))
                             {
                                 var iUser = ownerValue as IUser;
-                                if (iUser != null && !toList.Contains(iUser.Email))
+                                if (iUser != null && !String.IsNullOrWhiteSpace(iUser.Email) && !toList.Contains(iUser.Email))
                                     toList.Add(iUser.Email);
                             }
                             else if (ownerInfo.PropertyType == typeof(String))
                             {
                                 var user = context.GetIDbSet<User>().Find(ownerValue);
-                                if (user != null && !toList.Contains(user.Email))
+                                if (user != null && !String.IsNullOrWhiteSpace(user.Email) && !toList.Contains(user.Email))
                                     toList.Add(user.Email);
                             }
                         }
@@ -295,9 +295,9 @@

                 Email<INotificationEmail> email = new Email<INotificationEmail>()
                 {
-                    BCC = notification.Bcc.Select(user => user.Email).ToList(),
-                    CC = notification.CC.Select(user => user.Email).ToList(),
-                    To = toList,
+                    BCC = notification.Bcc.Select(user => user.Email).Where(emailAddress => String.IsNullOrWhiteSpace(emailAddress)).ToList(),
+                    CC = notification.CC.Select(user => user.Email).Where(emailAddress => String.IsNullOrWhiteSpace(emailAddress)).ToList(),
+                    To = toList.Where(emailAddress => String.IsNullOrWhiteSpace(emailAddress)).ToList(),
                     Subject = notification.Subject,
                     Model = notificationEmail
                 };
@@ -311,8 +311,8 @@
                         context.SaveChanges();
                     }
                 }
-
-                emailProvider.SendMail(email);
+                if (email.To.Count() > 0 || email.BCC.Count() > 0 || email.CC.Count() > 0)
+                    emailProvider.SendMail(email);
             }
         }


test: cleanup topics from autofac integration test

--- NsqSharp.Tests/Bus/AutofacBusTest.cs
+++ NsqSharp.Tests/Bus/AutofacBusTest.cs
@@ -4,6 +4,7 @@
 using System.Threading;
 using Autofac;
 using Newtonsoft.Json;
+using NsqSharp.Api;
 using NsqSharp.Bus;
 using NsqSharp.Bus.Configuration;
 using NsqSharp.Bus.Configuration.BuiltIn;
@@ -20,6 +21,15 @@
 #endif
     public class AutofacBusTest
     {
+        private static readonly NsqdHttpClient _nsqdHttpClient;
+        private static readonly NsqLookupdHttpClient _nsqLookupdHttpClient;
+
+        static AutofacBusTest()
+        {
+            _nsqdHttpClient = new NsqdHttpClient("http://127.0.0.1:4151", TimeSpan.FromSeconds(5));
+            _nsqLookupdHttpClient = new NsqLookupdHttpClient("http://127.0.0.1:4161", TimeSpan.FromSeconds(5));
+        }
+
         [Test]
         public void AutofacContainerTest()
         {
@@ -91,6 +101,8 @@
             finally
             {
                 BusService.Stop();
+                _nsqdHttpClient.DeleteTopic(topicName);
+                _nsqLookupdHttpClient.DeleteTopic(topicName);
             }
         }


Split ListReplaceTest into individual tests for each function.

--- OpenKh.Tests/Patcher/PatcherTests.cs
+++ OpenKh.Tests/Patcher/PatcherTests.cs
@@ -515,7 +515,7 @@
         }

         [Fact]
-        public void ListReplaceTest()
+        public void ListReplaceFmlvTest()
         {
             var patcher = new PatcherProcessor();
             var serializer = new Serializer();
@@ -539,94 +539,6 @@
                                 {
                                     Name = "FmlvList.yml",
                                     Type = "fmlv"
-                                }
-                            }
-                        }
-                    }
-                },
-                new AssetFile
-                {
-                    Name = "lvup.bin",
-                    Method = "binarc",
-                    Source = new List<AssetFile>
-                    {
-                        new AssetFile
-                        {
-                            Name = "lvup",
-                            Method = "listreplace",
-                            Type = "List",
-                            Source = new List<AssetFile>
-                            {
-                                new AssetFile
-                                {
-                                    Name = "LvupList.yml",
-                                    Type = "lvup"
-                                }
-                            }
-                        }
-                    }
-                },
-                new AssetFile
-                {
-                    Name = "bons.bin",
-                    Method = "binarc",
-                    Source = new List<AssetFile>
-                    {
-                        new AssetFile
-                        {
-                            Name = "bons",
-                            Method = "listreplace",
-                            Type = "List",
-                            Source = new List<AssetFile>
-                            {
-                                new AssetFile
-                                {
-                                    Name = "BonsList.yml",
-                                    Type = "bons"
-                                }
-                            }
-                        }
-                    }
-                },
-                new AssetFile
-                {
-                    Name = "trsr.bin",
-                    Method = "binarc",
-                    Source = new List<AssetFile>
-                    {
-                        new AssetFile
-                        {
-                            Name = "trsr",
-                            Method = "listreplace",
-                            Type = "List",
-                            Source = new List<AssetFile>
-                            {
-                                new AssetFile
-                                {
-                                    Name = "TrsrList.yml",
-                                    Type = "trsr"
-                                }
-                            }
-                        }
-                    }
-                },
-                new AssetFile
-                {
-                    Name = "item.bin",
-                    Method = "binarc",
-                    Source = new List<AssetFile>
-                    {
-                        new AssetFile
-                        {
-                            Name = "item",
-                            Method = "listreplace",
-                            Type = "List",
-                            Source = new List<AssetFile>
-                            {
-                                new AssetFile
-                                {
-                                    Name = "ItemList.yml",
-                                    Type = "item"
                                 }
                             }
                         }
@@ -674,11 +586,57 @@

             #endregion

+            patcher.Patch(AssetsInputDir, ModOutputDir, patch, ModInputDir);
+
+            AssertFileExists(ModOutputDir, "fmlv.bin");
+
+            File.OpenRead(Path.Combine(ModOutputDir, "fmlv.bin")).Using(stream =>
+            {
+                var fmlv = Kh2.Battle.Fmlv.Read(stream);
+                Assert.True(fmlv[0] == testFmlv);
+            });
+        }
+
+        [Fact]
+        public void ListReplaceLvupTest()
+        {
+            var patcher = new PatcherProcessor();
+            var serializer = new Serializer();
+            var patch = new Metadata
+            {
+                Assets = new List<AssetFile>
+                {
+                new AssetFile
+                {
+                    Name = "lvup.bin",
+                    Method = "binarc",
+                    Source = new List<AssetFile>
+                    {
+                        new AssetFile
+                        {
+                            Name = "lvup",
+                            Method = "listreplace",
+                            Type = "List",
+                            Source = new List<AssetFile>
+                            {
+                                new AssetFile
+                                {
+                                    Name = "LvupList.yml",
+                                    Type = "lvup"
+                                }
+                            }
+                        }
+                    }
+                }
+                }
+            };
+
             #region lvupPatch

             File.Create(Path.Combine(AssetsInputDir, "lvup.bin")).Using(stream =>
             {
-                var fmlvStream = new Kh2.Battle.Lvup {
+                var fmlvStream = new Kh2.Battle.Lvup
+                {
                     Characters = new List<Kh2.Battle.Lvup.PlayableCharacter>
                     {
                         new Kh2.Battle.Lvup.PlayableCharacter
@@ -736,6 +694,51 @@

             #endregion

+            patcher.Patch(AssetsInputDir, ModOutputDir, patch, ModInputDir);
+
+            AssertFileExists(ModOutputDir, "lvup.bin");
+
+            File.OpenRead(Path.Combine(ModOutputDir, "lvup.bin")).Using(stream =>
+            {
+                var lvup = Kh2.Battle.Lvup.Read(stream);
+                Assert.True(lvup.Characters[0].Levels[0] == soraLevel0);
+            });
+        }
+
+        [Fact]
+        public void ListReplaceBonsTest()
+        {
+            var patcher = new PatcherProcessor();
+            var serializer = new Serializer();
+            var patch = new Metadata
+            {
+                Assets = new List<AssetFile>
+                {
+                new AssetFile
+                {
+                    Name = "bons.bin",
+                    Method = "binarc",
+                    Source = new List<AssetFile>
+                    {
+                        new AssetFile
+                        {
+                            Name = "bons",
+                            Method = "listreplace",
+                            Type = "List",
+                            Source = new List<AssetFile>
+                            {
+                                new AssetFile
+                                {
+                                    Name = "BonsList.yml",
+                                    Type = "bons"
+                                }
+                            }
+                        }
+                    }
+                },
+                }
+            };
+
             #region bonsPatch

             File.Create(Path.Combine(AssetsInputDir, "bons.bin")).Using(stream =>
@@ -765,6 +768,51 @@

             #endregion

+            patcher.Patch(AssetsInputDir, ModOutputDir, patch, ModInputDir);
+
+            AssertFileExists(ModOutputDir, "bons.bin");
+
+            File.OpenRead(Path.Combine(ModOutputDir, "bons.bin")).Using(stream =>
+            {
+                var bons = Kh2.Battle.Bons.Read(stream);
+                Assert.True(bons[0] == testBons[0]);
+            });
+        }
+
+        [Fact]
+        public void ListReplaceTrsrTest()
+        {
+            var patcher = new PatcherProcessor();
+            var serializer = new Serializer();
+            var patch = new Metadata
+            {
+                Assets = new List<AssetFile>
+                {
+                new AssetFile
+                {
+                    Name = "trsr.bin",
+                    Method = "binarc",
+                    Source = new List<AssetFile>
+                    {
+                        new AssetFile
+                        {
+                            Name = "trsr",
+                            Method = "listreplace",
+                            Type = "List",
+                            Source = new List<AssetFile>
+                            {
+                                new AssetFile
+                                {
+                                    Name = "TrsrList.yml",
+                                    Type = "trsr"
+                                }
+                            }
+                        }
+                    }
+                }
+                }
+            };
+
             #region trsrPatch
             File.Create(Path.Combine(AssetsInputDir, "trsr.bin")).Using(stream =>
             {
@@ -791,6 +839,51 @@
             File.WriteAllText(Path.Combine(ModInputDir, "TrsrList.yml"), serializer.Serialize(testTrsr));
             #endregion

+            patcher.Patch(AssetsInputDir, ModOutputDir, patch, ModInputDir);
+
+            AssertFileExists(ModOutputDir, "trsr.bin");
+
+            File.OpenRead(Path.Combine(ModOutputDir, "trsr.bin")).Using(stream =>
+            {
+                var trsr = Kh2.SystemData.Trsr.Read(stream);
+                Assert.True(trsr[0] == testTrsr[0]);
+            });
+        }
+
+        [Fact]
+        public void ListReplaceItemTest()
+        {
+            var patcher = new PatcherProcessor();
+            var serializer = new Serializer();
+            var patch = new Metadata
+            {
+                Assets = new List<AssetFile>
+                {
+                new AssetFile
+                {
+                    Name = "item.bin",
+                    Method = "binarc",
+                    Source = new List<AssetFile>
+                    {
+                        new AssetFile
+                        {
+                            Name = "item",
+                            Method = "listreplace",
+                            Type = "List",
+                            Source = new List<AssetFile>
+                            {
+                                new AssetFile
+                                {
+                                    Name = "ItemList.yml",
+                                    Type = "item"
+                                }
+                            }
+                        }
+                    }
+                }
+                }
+            };
+
             #region itemPatch
             File.Create(Path.Combine(AssetsInputDir, "item.bin")).Using(stream =>
             {
@@ -837,39 +930,15 @@
             };

             File.WriteAllText(Path.Combine(ModInputDir, "ItemList.yml"), serializer.Serialize(testItem));
-
+

             #endregion

             patcher.Patch(AssetsInputDir, ModOutputDir, patch, ModInputDir);

-            AssertFileExists(ModOutputDir, "fmlv.bin");
-            AssertFileExists(ModOutputDir, "lvup.bin");
-            AssertFileExists(ModOutputDir, "bons.bin");
-            AssertFileExists(ModOutputDir, "trsr.bin");
             AssertFileExists(ModOutputDir, "item.bin");

-            File.OpenRead(Path.Combine(ModOutputDir, "fmlv.bin")).Using(stream =>
-            {
-                var fmlv = Kh2.Battle.Fmlv.Read(stream);
-                Assert.True(fmlv[0] == testFmlv);
-            });
-            File.OpenRead(Path.Combine(ModOutputDir, "lvup.bin")).Using(stream =>
-            {
-                var lvup = Kh2.Battle.Lvup.Read(stream);
-                Assert.True(lvup.Characters[0].Levels[0] == soraLevel0);
-            });
-            File.OpenRead(Path.Combine(ModOutputDir, "bons.bin")).Using(stream =>
-            {
-                var bons = Kh2.Battle.Bons.Read(stream);
-                Assert.True(bons[0] == testBons[0]);
-            });
-            File.OpenRead(Path.Combine(ModOutputDir, "trsr.bin")).Using(stream =>
-            {
-                var trsr = Kh2.SystemData.Trsr.Read(stream);
-                Assert.True(trsr[0] == testTrsr[0]);
-            });
             File.OpenRead(Path.Combine(ModOutputDir, "item.bin")).Using(stream =>
             {
                 var item = Kh2.SystemData.Item.Read(stream);


In pCampbot, change "show status" command to "show bots"

--- OpenSim/Tools/pCampBot/BotManager.cs
+++ OpenSim/Tools/pCampBot/BotManager.cs
@@ -110,8 +110,8 @@
                     "Show regions known to bots",
                     HandleShowRegions);

-            m_console.Commands.AddCommand("bot", false, "show status",
-                    "show status",
+            m_console.Commands.AddCommand("bot", false, "show bots",
+                    "show bots",
                     "Shows the status of all bots",
                     HandleShowStatus);


Added code generation for packrat parsing.

--- Pegasus/Compiler/GenerateCodePass.cs
+++ Pegasus/Compiler/GenerateCodePass.cs
@@ -47,6 +47,7 @@
             private readonly Dictionary<string, int> variables = new Dictionary<string, int>();
             private Grammar grammar;
             private string currentResultName = null;
+            private bool packrat = false;

             public GenerateCodeExpressionTreeWlaker(CompileResult result, IndentedTextWriter codeWriter)
             {
@@ -141,11 +142,25 @@
                     this.code.WriteLineNoTabs(string.Empty);
                 }

+                if (this.packrat)
+                {
+                    this.code.WriteLine("private Dictionary<string, object> storage;");
+                }
+
                 var type = this.GetResultType(grammar.Rules[0].Expression);

                 this.code.WriteLine("public " + type + " Parse(string subject, string fileName = null)");
                 this.code.WriteLine("{");
                 this.code.Indent++;
+
+                if (this.packrat)
+                {
+                    this.code.WriteLine("try");
+                    this.code.WriteLine("{");
+                    this.code.Indent++;
+                    this.code.WriteLine("this.storage = new Dictionary<string, object>();");
+                }
+
                 this.code.WriteLine("var cursor = new Cursor(subject, 0, fileName);");
                 this.code.WriteLine("var result = this." + EscapeName(grammar.Rules[0].Identifier.Name) + "(ref cursor);");
                 this.code.WriteLine("if (result == null)");
@@ -155,6 +170,19 @@
                 this.code.Indent--;
                 this.code.WriteLine("}");
                 this.code.WriteLine("return result.Value;");
+
+                if (this.packrat)
+                {
+                    this.code.Indent--;
+                    this.code.WriteLine("}");
+                    this.code.WriteLine("finally");
+                    this.code.WriteLine("{");
+                    this.code.Indent++;
+                    this.code.WriteLine("this.storage = null;");
+                    this.code.Indent--;
+                    this.code.WriteLine("}");
+                }
+
                 this.code.Indent--;
                 this.code.WriteLine("}");

@@ -300,7 +328,32 @@

                 this.currentResultName = this.CreateVariable("r");
                 this.code.WriteLine("IParseResult<" + type + "> " + this.currentResultName + " = null;");
+
+                if (this.packrat)
+                {
+                    this.code.WriteLine("var storageKey = " + ToLiteral(rule.Identifier.Name + ":") + " + cursor.Location;");
+                    this.code.WriteLine("if (this.storage.ContainsKey(storageKey))");
+                    this.code.WriteLine("{");
+                    this.code.Indent++;
+                    this.code.WriteLine(this.currentResultName + " = (IParseResult<" + type + ">)this.storage[storageKey];");
+                    this.code.WriteLine("if (" + this.currentResultName + " != null)");
+                    this.code.WriteLine("{");
+                    this.code.Indent++;
+                    this.code.WriteLine("cursor = " + this.currentResultName + ".EndCursor;");
+                    this.code.Indent--;
+                    this.code.WriteLine("}");
+                    this.code.WriteLine("return " + this.currentResultName + ";");
+                    this.code.Indent--;
+                    this.code.WriteLine("}");
+                }
+
                 base.WalkRule(rule);
+
+                if (this.packrat)
+                {
+                    this.code.WriteLine("this.storage[storageKey] = " + this.currentResultName + ";");
+                }
+
                 this.code.WriteLine("return " + this.currentResultName + ";");
                 this.currentResultName = null;


FIX recursion on ParseNodeList

FIX recursion on ParseNodeList

--- RDFSharp/Model/Serializers/RDFXml.cs
+++ RDFSharp/Model/Serializers/RDFXml.cs
@@ -520,81 +520,81 @@
                                                                             : new RDFResource(predNode.NamespaceURI + predNode.LocalName));
                         #endregion

-                        #region collection
-                        //Check if there is a "rdf:parseType=Collection" attribute
-                        XmlAttribute rdfCollect = GetParseTypeCollectionAttribute(predNode);
-                        if (rdfCollect != null)
-                        {
-                            ParseCollectionElements(xmlBase, predNode, subj, pred, result, xmlLangPred);
-                            continue;
-                        }
-                        #endregion
-
-                        #region container
-                        //Check if there is a "rdf:[Bag|Seq|Alt]" child node
-                        XmlNode container = GetContainerNode(predNode);
-                        if (container != null)
-                        {
-                            //Distinguish the right type of RDF container to build
-                            if (container.LocalName.Equals(RDFVocabulary.RDF.PREFIX + ":Bag", StringComparison.Ordinal) || container.LocalName.Equals("Bag", StringComparison.Ordinal))
-                                ParseContainerElements(RDFModelEnums.RDFContainerTypes.Bag, container, subj, pred, result);
-                            else if (container.LocalName.Equals(RDFVocabulary.RDF.PREFIX + ":Seq", StringComparison.Ordinal) || container.LocalName.Equals("Seq", StringComparison.Ordinal))
-                                ParseContainerElements(RDFModelEnums.RDFContainerTypes.Seq, container, subj, pred, result);
-                            else if (container.LocalName.Equals(RDFVocabulary.RDF.PREFIX + ":Alt", StringComparison.Ordinal) || container.LocalName.Equals("Alt", StringComparison.Ordinal))
-                                ParseContainerElements(RDFModelEnums.RDFContainerTypes.Alt, container, subj, pred, result);
-                        }
-                        #endregion
-
-                        #region object
-                        //Check if there is a "rdf:about" or a "rdf:resource" attribute
-                        XmlAttribute rdfObject = (GetRdfAboutAttribute(predNode) ?? GetRdfResourceAttribute(predNode));
-                        if (rdfObject != null)
-                        {
-                            //Attribute found, but we must check if it is "rdf:ID", "rdf:nodeID" or a relative Uri
-                            String rdfObjectValue = ResolveRelativeNode(rdfObject, xmlBase);
-                            RDFResource obj = new RDFResource(rdfObjectValue);
-                            result.AddTriple(new RDFTriple(subj, pred, obj));
-                            continue;
-                        }
-                        #endregion
-
-                        #region typed literal
-                        //Check if there is a "rdf:datatype" attribute
-                        XmlAttribute rdfDatatype = GetRdfDatatypeAttribute(predNode);
-                        if (rdfDatatype != null)
-                        {
-                            var dtype = RDFModelUtilities.GetDatatypeFromString(rdfDatatype.Value);
-                            RDFTypedLiteral tLit = new RDFTypedLiteral(RDFModelUtilities.ASCII_To_Unicode(HttpUtility.HtmlDecode(predNode.InnerText)), dtype);
-                            result.AddTriple(new RDFTriple(subj, pred, tLit));
-                            continue;
-                        }
-                        //Check if there is a "rdf:parseType=Literal" attribute
-                        XmlAttribute parseLiteral = GetParseTypeLiteralAttribute(predNode);
-                        if (parseLiteral != null)
-                        {
-                            RDFTypedLiteral tLit = new RDFTypedLiteral(RDFModelUtilities.ASCII_To_Unicode(HttpUtility.HtmlDecode(predNode.InnerXml)), RDFModelEnums.RDFDatatypes.RDFS_LITERAL);
-                            result.AddTriple(new RDFTriple(subj, pred, tLit));
-                            continue;
-                        }
-                        #endregion
-
-                        #region plain literal
-                        //Check if there is a "xml:lang" attribute (inherits from subject), or if a unique textual child
-                        if (xmlLangPred != null || (predNode.HasChildNodes && predNode.ChildNodes.Count == 1 && predNode.ChildNodes[0].NodeType == XmlNodeType.Text))
-                        {
-                            RDFPlainLiteral pLit = new RDFPlainLiteral(RDFModelUtilities.ASCII_To_Unicode(HttpUtility.HtmlDecode(predNode.InnerText)), (xmlLangPred != null ? xmlLangPred.Value : String.Empty));
-                            result.AddTriple(new RDFTriple(subj, pred, pLit));
-                            continue;
-                        }
-                        #endregion
-
                         #region nested description
-                        //At last, check for nested resource descriptions
-                        if (predNode.HasChildNodes)
+                        //Check for nested resource descriptions (DFS)
+                        if (predNode.HasChildNodes)
                         {
                             var nestedSubjects = ParseNodeList(predNode.ChildNodes, result, xmlBase, xmlLangPred);
                             foreach (var nestedSubject in nestedSubjects)
                                 result.AddTriple(new RDFTriple(subj, pred, nestedSubject));
+
+                            #region collection
+                            //Check if there is a "rdf:parseType=Collection" attribute
+                            XmlAttribute rdfCollect = GetParseTypeCollectionAttribute(predNode);
+                            if (rdfCollect != null)
+                            {
+                                ParseCollectionElements(xmlBase, predNode, subj, pred, result, xmlLangPred);
+                                continue;
+                            }
+                            #endregion
+
+                            #region container
+                            //Check if there is a "rdf:[Bag|Seq|Alt]" child node
+                            XmlNode container = GetContainerNode(predNode);
+                            if (container != null)
+                            {
+                                //Distinguish the right type of RDF container to build
+                                if (container.LocalName.Equals(RDFVocabulary.RDF.PREFIX + ":Bag", StringComparison.Ordinal) || container.LocalName.Equals("Bag", StringComparison.Ordinal))
+                                    ParseContainerElements(RDFModelEnums.RDFContainerTypes.Bag, container, subj, pred, result);
+                                else if (container.LocalName.Equals(RDFVocabulary.RDF.PREFIX + ":Seq", StringComparison.Ordinal) || container.LocalName.Equals("Seq", StringComparison.Ordinal))
+                                    ParseContainerElements(RDFModelEnums.RDFContainerTypes.Seq, container, subj, pred, result);
+                                else if (container.LocalName.Equals(RDFVocabulary.RDF.PREFIX + ":Alt", StringComparison.Ordinal) || container.LocalName.Equals("Alt", StringComparison.Ordinal))
+                                    ParseContainerElements(RDFModelEnums.RDFContainerTypes.Alt, container, subj, pred, result);
+                            }
+                            #endregion
+
+                            #region object
+                            //Check if there is a "rdf:about" or a "rdf:resource" attribute
+                            XmlAttribute rdfObject = (GetRdfAboutAttribute(predNode) ?? GetRdfResourceAttribute(predNode));
+                            if (rdfObject != null)
+                            {
+                                //Attribute found, but we must check if it is "rdf:ID", "rdf:nodeID" or a relative Uri
+                                String rdfObjectValue = ResolveRelativeNode(rdfObject, xmlBase);
+                                RDFResource obj = new RDFResource(rdfObjectValue);
+                                result.AddTriple(new RDFTriple(subj, pred, obj));
+                                continue;
+                            }
+                            #endregion
+
+                            #region typed literal
+                            //Check if there is a "rdf:datatype" attribute
+                            XmlAttribute rdfDatatype = GetRdfDatatypeAttribute(predNode);
+                            if (rdfDatatype != null)
+                            {
+                                var dtype = RDFModelUtilities.GetDatatypeFromString(rdfDatatype.Value);
+                                RDFTypedLiteral tLit = new RDFTypedLiteral(RDFModelUtilities.ASCII_To_Unicode(HttpUtility.HtmlDecode(predNode.InnerText)), dtype);
+                                result.AddTriple(new RDFTriple(subj, pred, tLit));
+                                continue;
+                            }
+                            //Check if there is a "rdf:parseType=Literal" attribute
+                            XmlAttribute parseLiteral = GetParseTypeLiteralAttribute(predNode);
+                            if (parseLiteral != null)
+                            {
+                                RDFTypedLiteral tLit = new RDFTypedLiteral(RDFModelUtilities.ASCII_To_Unicode(HttpUtility.HtmlDecode(predNode.InnerXml)), RDFModelEnums.RDFDatatypes.RDFS_LITERAL);
+                                result.AddTriple(new RDFTriple(subj, pred, tLit));
+                                continue;
+                            }
+                            #endregion
+
+                            #region plain literal
+                            //Check if there is a unique textual child
+                            if (predNode.ChildNodes.Count == 1 && predNode.ChildNodes[0].NodeType == XmlNodeType.Text)
+                            {
+                                RDFPlainLiteral pLit = new RDFPlainLiteral(RDFModelUtilities.ASCII_To_Unicode(HttpUtility.HtmlDecode(predNode.InnerText)), (xmlLangPred != null ? xmlLangPred.Value : String.Empty));
+                                result.AddTriple(new RDFTriple(subj, pred, pLit));
+                                continue;
+                            }
+                            #endregion
                         }
                         #endregion


rabbitConnectorPlus: refactor handler wrapping and listening

--- RabbitHarness/RabbitConnectorPlus.cs
+++ RabbitHarness/RabbitConnectorPlus.cs
@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using System.Text;
 using Newtonsoft.Json;
 using RabbitMQ.Client;
@@ -22,20 +21,13 @@
 			var connection = _factory.CreateConnection();
 			var channel = connection.CreateModel();

-			var wrapper = WrapHandler(channel, handler);
-			var listener = new EventingBasicConsumer(channel);
-			listener.Received += wrapper;
-
 			queueDefinition.Declare(channel);

-			channel.BasicConsume(
-				queueDefinition.Name,
-				noAck:
-				true, consumer: listener);
-
-			return () =>
-			{
-				listener.Received -= wrapper;
+			var unsubscribe = Listen(channel, queueDefinition.Name, handler);
+
+			return () =>
+			{
+				unsubscribe();
 				channel.Dispose();
 				connection.Dispose();
 			};
@@ -46,24 +38,17 @@
 			var connection = _factory.CreateConnection();
 			var channel = connection.CreateModel();

-			var wrapper = WrapHandler(channel, handler);
-			var listener = new EventingBasicConsumer(channel);
-			listener.Received += wrapper;
-
 			exchangeDefinition.Declare(channel);
 			queueDefinition.Declare(channel);

 			foreach (var key in queueDefinition.RoutingKeys)
 				channel.QueueBind(queueDefinition.Name, exchangeDefinition.Name, key);

-			channel.BasicConsume(
-				queueDefinition.Name,
-				noAck:
-				true, consumer: listener);
-
-			return () =>
-			{
-				listener.Received -= wrapper;
+			var unsubscribe = Listen(channel, queueDefinition.Name, handler);
+
+			return () =>
+			{
+				unsubscribe();
 				channel.Dispose();
 				connection.Dispose();
 			};
@@ -74,30 +59,61 @@
 			var connection = _factory.CreateConnection();
 			var channel = connection.CreateModel();

-			var wrapper = WrapHandler(channel, handler);
-			var listener = new EventingBasicConsumer(channel);
-			listener.Received += wrapper;
-
+			var queueName = channel.QueueDeclare();
 			exchangeDefinition.Declare(channel);

-			var queue = channel.QueueDeclare();
-
-			channel.QueueBind(queue, exchangeDefinition.Name, "");
-
-			channel.BasicConsume(
-				queue,
-				noAck:
-				true, consumer: listener);
-
-			return () =>
-			{
-				listener.Received -= wrapper;
+			channel.QueueBind(queueName, exchangeDefinition.Name, "");
+
+			var unsubscribe = Listen(channel, queueName, handler);
+
+			return () =>
+			{
+				unsubscribe();
 				channel.Dispose();
 				connection.Dispose();
 			};
 		}

-		private static EventHandler<BasicDeliverEventArgs> WrapHandler<TMessage>(IModel channel, Func<IBasicProperties, TMessage, bool> handler)
+		public void SendTo(QueueDefinition queueDefinition, Action<IBasicProperties> customiseProps, object message)
+		{
+			using (var connection = _factory.CreateConnection())
+			using (var channel = connection.CreateModel())
+			{
+				queueDefinition.Declare(channel);
+
+				var json = JsonConvert.SerializeObject(message);
+				var bytes = Encoding.UTF8.GetBytes(json);
+
+				var props = channel.CreateBasicProperties();
+				customiseProps(props);
+
+				channel.BasicPublish("", queueDefinition.Name, props, bytes);
+			}
+		}
+
+		public void SendTo(ExchangeDefinition exchangeDefinition, Action<IBasicProperties> customiseProps, object message)
+		{
+			SendTo(exchangeDefinition, "", customiseProps, message);
+		}
+
+		public void SendTo(ExchangeDefinition exchangeDefinition, string routingKey, Action<IBasicProperties> customiseProps, object message)
+		{
+			using (var connection = _factory.CreateConnection())
+			using (var channel = connection.CreateModel())
+			{
+				exchangeDefinition.Declare(channel);
+
+				var json = JsonConvert.SerializeObject(message);
+				var bytes = Encoding.UTF8.GetBytes(json);
+
+				var props = channel.CreateBasicProperties();
+				customiseProps(props);
+
+				channel.BasicPublish(exchangeDefinition.Name, routingKey, props, bytes);
+			}
+		}
+
+		private static Action Listen<TMessage>(IModel channel, string queueName, Func<IBasicProperties, TMessage, bool> handler)
 		{
 			var wrapper = new EventHandler<BasicDeliverEventArgs>((s, e) =>
 			{
@@ -119,46 +135,19 @@
 					throw;
 				}
 			});
-			return wrapper;
-		}
-
-		public void SendTo(QueueDefinition queueDefinition, Action<IBasicProperties> customiseProps, object message)
-		{
-			using (var connection = _factory.CreateConnection())
-			using (var channel = connection.CreateModel())
-			{
-				queueDefinition.Declare(channel);
-
-				var json = JsonConvert.SerializeObject(message);
-				var bytes = Encoding.UTF8.GetBytes(json);
-
-				var props = channel.CreateBasicProperties();
-				customiseProps(props);
-
-				channel.BasicPublish("", queueDefinition.Name, props, bytes);
-			}
-		}
-
-		public void SendTo(ExchangeDefinition exchangeDefinition, Action<IBasicProperties> customiseProps, object message)
-		{
-			SendTo(exchangeDefinition, "", customiseProps, message);
-		}
-
-		public void SendTo(ExchangeDefinition exchangeDefinition, string routingKey, Action<IBasicProperties> customiseProps, object message)
-		{
-			using (var connection = _factory.CreateConnection())
-			using (var channel = connection.CreateModel())
-			{
-				exchangeDefinition.Declare(channel);
-
-				var json = JsonConvert.SerializeObject(message);
-				var bytes = Encoding.UTF8.GetBytes(json);
-
-				var props = channel.CreateBasicProperties();
-				customiseProps(props);
-
-				channel.BasicPublish(exchangeDefinition.Name, routingKey, props, bytes);
-			}
+
+			var listener = new EventingBasicConsumer(channel);
+			listener.Received += wrapper;
+
+			channel.BasicConsume(
+				queueName,
+				noAck: true,
+				consumer: listener);
+
+			return () =>
+			{
+				listener.Received -= wrapper;
+			};
 		}
 	}


Developer tests

Developer tests

--- examples/WithDefaultManager/ConsoleApp/ConsoleApp/Program.cs
+++ examples/WithDefaultManager/ConsoleApp/ConsoleApp/Program.cs
@@ -1,5 +1,6 @@
 using CommandManagementSystem;
 using CommandManagementSystem.Attributes;
+using ConsoleApp.Commands;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -27,6 +28,6 @@
         {
             Console.WriteLine("Hello");
             return null;
-        }
+        }
     }
 }


Implement Shark behavior

Implement Shark behavior

--- Roton/Emulation/CoreBase.Behavior.cs
+++ Roton/Emulation/CoreBase.Behavior.cs
@@ -528,6 +528,29 @@

         virtual public void Act_Shark(int index)
         {
+            var actor = Actors[index];
+            var vector = new Vector();
+
+            if (actor.P1 > RandomNumberDeterministic(10))
+            {
+                Seek(actor.Location, vector);
+            }
+            else
+            {
+                Rnd(vector);
+            }
+
+            var target = actor.Location.Sum(vector);
+            var targetElement = ElementAt(target);
+
+            if (targetElement.Index == Elements.WaterId)
+            {
+                MoveActor(index, target);
+            }
+            else if (targetElement.Index == Elements.PlayerId)
+            {
+                Attack(index, target);
+            }
         }

         virtual public void Act_Slime(int index)


add missing hashcode override

add missing hashcode override

--- SQLitePCL.pretty.Orm/TableMapping.cs
+++ SQLitePCL.pretty.Orm/TableMapping.cs
@@ -69,6 +69,12 @@
             this.metadata = metadata;
         }

+        public Type ClrType { get { return clrType; } }
+
+        public PropertyInfo Property { get { return property; } }
+
+        public TableColumnMetadata Metadata { get { return metadata; } }
+
         /// <inheritdoc/>
         public bool Equals(ColumnMapping other)
         {
@@ -93,11 +99,15 @@
             return other is ColumnMapping && this == (ColumnMapping)other;
         }

-        public Type ClrType { get { return clrType; } }
-
-        public PropertyInfo Property { get { return property; } }
-
-        public TableColumnMetadata Metadata { get { return metadata; } }
+        /// <inheritdoc/>
+        public override int GetHashCode()
+        {
+            int hash = 17;
+            hash = hash * 31 + this.ClrType.GetHashCode();
+            hash = hash * 31 + this.Property.GetHashCode();
+            hash = hash * 31 + this.Metadata.GetHashCode();
+            return hash;
+        }
     }

     public interface ITableMapping : IReadOnlyDictionary<string, ColumnMapping>


fix Monitors on fast loading entities

fix Monitors on fast loading entities

--- Signum.Windows/Utilities/Monitors.cs
+++ Signum.Windows/Utilities/Monitors.cs
@@ -169,12 +169,15 @@

             var info = Monitors.GetMonitorFromWindow(win, NotFoundOptions.DefaultToNearest);

-            if (win.MaxWidth != info.WorkingArea.Width || win.MaxHeight != info.WorkingArea.Height)
-            {
+            if (win.MaxWidth != info.WorkingArea.Width || win.MaxHeight != info.WorkingArea.Height )
+            {
+                if(win.MaxWidth != double.PositiveInfinity && win.MaxHeight != double.PositiveInfinity)
+                     SetJustChangedMonitor(win, DateTime.Now);
+
                 win.MaxWidth = info.WorkingArea.Width;
                 win.MaxHeight = info.WorkingArea.Height;

-                SetJustChangedMonitor(win, DateTime.Now);
+
             }
         }