Caching configured source member child members

--- AgileMapper/Members/ConfiguredSourceMember.cs
+++ AgileMapper/Members/ConfiguredSourceMember.cs
@@ -4,6 +4,7 @@
     using System.Collections.Generic;
     using System.Linq;
     using System.Linq.Expressions;
+    using Caching;
     using Extensions;
     using ReadableExpressions;

@@ -11,8 +12,9 @@
     {
         private readonly string[] _matchedTargetMemberNames;
         private readonly IEnumerable<string> _matchedTargetMemberJoinedNames;
-        private readonly NamingSettings _namingSettings;
+        private readonly MapperContext _mapperContext;
         private readonly Member[] _childMembers;
+        private readonly ICache<string, ConfiguredSourceMember> _childMemberCache;

         public ConfiguredSourceMember(Expression value, MemberMapperData data)
             : this(
@@ -20,7 +22,7 @@
                   value.Type.IsEnumerable(),
                   value.ToReadableString(),
                   data.TargetMember.MemberChain.Select(data.MapperContext.NamingSettings.GetMatchingNameFor).ToArray(),
-                  data.MapperContext.NamingSettings)
+                  data.MapperContext)
         {
         }

@@ -29,8 +31,9 @@
                   childMember.Type,
                   isEnumerable,
                   parent.Name + childMember.JoiningName,
-                  parent._matchedTargetMemberNames.Append(parent._namingSettings.GetMatchingNameFor(childMember)),
-                  parent._namingSettings,
+                  parent._matchedTargetMemberNames.Append(
+                      parent._mapperContext.NamingSettings.GetMatchingNameFor(childMember)),
+                  parent._mapperContext,
                   parent._childMembers.Append(childMember))
         {
         }
@@ -40,15 +43,15 @@
             bool isEnumerable,
             string name,
             string[] matchedTargetMemberNames,
-            NamingSettings namingSettings,
+            MapperContext mapperContext,
             Member[] childMembers = null)
             : this(
-                  type,
-                  isEnumerable,
-                  name,
-                  matchedTargetMemberNames,
-                  namingSettings.GetJoinedNamesFor(matchedTargetMemberNames),
-                  namingSettings,
+                  type,
+                  isEnumerable,
+                  name,
+                  matchedTargetMemberNames,
+                  mapperContext.NamingSettings.GetJoinedNamesFor(matchedTargetMemberNames),
+                  mapperContext,
                   childMembers)
         {
         }
@@ -59,7 +62,7 @@
             string name,
             string[] matchedTargetMemberNames,
             IEnumerable<string> matchedTargetMemberJoinedNames,
-            NamingSettings namingSettings,
+            MapperContext mapperContext,
             Member[] childMembers = null)
         {
             Type = type;
@@ -67,9 +70,10 @@
             Name = name;
             _matchedTargetMemberNames = matchedTargetMemberNames;
             _matchedTargetMemberJoinedNames = matchedTargetMemberJoinedNames;
-            _namingSettings = namingSettings;
+            _mapperContext = mapperContext;
             _childMembers = childMembers ?? new[] { Member.RootSource(name, type) };
             Signature = _childMembers.GetSignature();
+            _childMemberCache = mapperContext.Cache.CreateNew<string, ConfiguredSourceMember>();
         }

         public Type Type { get; }
@@ -82,7 +86,12 @@

         public string GetPath() => _childMembers.GetFullName();

-        public IQualifiedMember Append(Member childMember) => new ConfiguredSourceMember(this, childMember, IsEnumerable);
+        public IQualifiedMember Append(Member childMember)
+        {
+            var key = childMember.IsSimple ? childMember.Name : childMember.Signature;
+
+            return _childMemberCache.GetOrAdd(key, n => new ConfiguredSourceMember(this, childMember, IsEnumerable));
+        }

         public IQualifiedMember RelativeTo(IQualifiedMember otherMember)
         {
@@ -95,7 +104,7 @@
                 Name,
                 _matchedTargetMemberNames,
                 _matchedTargetMemberJoinedNames,
-                _namingSettings,
+                _mapperContext,
                 relativeMemberChain);
         }


fix new ImportAbc visiblity, invalid return value and typo

--- AlembicImporter/Assets/AlembicImporter/Scripts/AbcAPI.cs
+++ AlembicImporter/Assets/AlembicImporter/Scripts/AbcAPI.cs
@@ -286,18 +286,18 @@
         ImportImpl(path, p);
     }

-    static GameObject ImportAbc(string path)
+    public static GameObject ImportAbc(string path)
     {
         var relPath = MakeRelativePath(path);
         ImportParams p = new ImportParams();
-        return ImportImpl(path, p);
+        return ImportImpl(relPath, p);
     }

     static GameObject ImportImpl(string path, ImportParams p)
     {
         if (path == null || path == "")
         {
-            return;
+            return null;
         }

         string baseName = System.IO.Path.GetFileNameWithoutExtension(path);


SavedQueriesCount is just the amount of Metadatas we own now

--- App/StackExchange.DataExplorer/Models/User.cs
+++ App/StackExchange.DataExplorer/Models/User.cs
@@ -310,7 +310,7 @@

         public int SavedQueriesCount
         {
-            get { return Current.DB.Query<int>("select count(*) from SavedQueries where UserId = @userId", new { userId = Id }).FirstOrDefault(); }
+            get { return Current.DB.Query<int>("SELECT COUNT(*) FROM Metadata WHERE OwnerId = @userId", new { userId = Id }).FirstOrDefault(); }
         }

         public int QueryExecutionsCount


Changed to new overload of ReadPropertyBag

--- Src/HttpDisassembler/HttpDisassembler.cs
+++ Src/HttpDisassembler/HttpDisassembler.cs
@@ -128,7 +128,8 @@

         public void Load(IPropertyBag propertyBag, int errorLog)
         {
-            DocumentSpecName = PropertyBagHelper.ToStringOrDefault(PropertyBagHelper.ReadPropertyBag(propertyBag, DocumentSpecNamePropertyName), string.Empty);
+
+            DocumentSpecName = PropertyBagHelper.ReadPropertyBag(propertyBag, DocumentSpecNamePropertyName, DocumentSpecName);
         }

         public void Save(IPropertyBag propertyBag, bool clearDirty, bool saveAllProperties)


check for false rather than null

check for false rather than null

--- ApplicationView/MenuRow/ApplicationMenuRow.cs
+++ ApplicationView/MenuRow/ApplicationMenuRow.cs
@@ -68,9 +68,8 @@

 			this.AddChild(new MenuOptionSettings());

-			// put in the help menu
-			if (ActiveSliceSettings.Instance != null
-				&& ActiveSliceSettings.Instance.ActionMacros().Any())
+			// put in the action menu
+			if (ActiveSliceSettings.Instance?.ActionMacros().Any() != false)
 			{
 				this.AddChild(new MenuOptionAction());
 			}


Added documentation to the PlayerDetails class

--- Starcraft2.ReplayParser/PlayerDetails.cs
+++ Starcraft2.ReplayParser/PlayerDetails.cs
@@ -2,12 +2,34 @@

 namespace Starcraft2.ReplayParser
 {
+    /// <summary>
+    /// Class describing an individual player in a match.
+    /// </summary>
     public class PlayerDetails
     {
+        /// <summary>
+        /// Gets or sets the player's name.
+        /// </summary>
         public string Name { get; set; }
+
+        /// <summary>
+        /// Gets or sets the player's race.
+        /// </summary>
         public string Race { get; set; }
+
+        /// <summary>
+        /// Gets or sets the type of player, whether he is human or computer.
+        /// </summary>
         public PlayerType PlayerType { get; set; }
+
+        /// <summary>
+        /// Gets or sets the player's color.
+        /// </summary>
         public Color Color { get; set; }
+
+        /// <summary>
+        /// Gets or sets the player's team number.
+        /// </summary>
         public int Team { get; set; }
     }
 }


- インポート時にアニメーションの最終フレームを超えるキーフレームが見つかった場合に対象のパーツ名・時間・アトリビュート値の型を出力するようにした。#30 関連

--- Assets/Editor/SpriteStudio/LibraryEditor_SpriteStudio.cs
+++ Assets/Editor/SpriteStudio/LibraryEditor_SpriteStudio.cs
@@ -177,6 +177,11 @@
 			}
 		}
 	}
+
+	/// <summary>
+	/// The parts currently processed while importing.
+	/// </summary>
+	static	internal string	CurrentProcessingPartsName;

 	/* Functions for Parsing OPSS(SS5) Datas */
 	internal static class ParseOPSS
@@ -1911,6 +1916,8 @@
 												ref LibraryEditor_SpriteStudio.SettingImport DataSettingImport
 											)
 			{
+				CurrentProcessingPartsName = "";
+
 				/* "Root" Node(GameObject)s Create (on Scene) */
 				GameObject GameObjectRoot = AssetUtility.Create.GameObjectNode(this, ListParts[0], null);
 				Script_SpriteStudio_PartsRoot ScriptRoot = GameObjectRoot.GetComponent<Script_SpriteStudio_PartsRoot>();
@@ -1945,6 +1952,7 @@
 					for(int i=0; i<ListParts.Length; i++)
 					{
 						/* Create Animation-Data for Runtime */
+						CurrentProcessingPartsName = ListParts[i].Name;
 						DataSpriteStudio = NodeSetAnimation(GameObjectParts[i], ListParts[i], ScriptRoot);
 						if(null == DataSpriteStudio)
 						{
@@ -1955,6 +1963,7 @@
 						/* Attach Collider (to GameObject) */
 						NodeSetCollider(GameObjectParts[i], ListParts[i], DataSpriteStudio, ref DataSettingImport);
 					}
+					CurrentProcessingPartsName = "";

 					/* Solving Inherit-Attributes */
 					/* MEMO: Child-nodes only (Parent-node need not solve) */
@@ -2287,6 +2296,11 @@
 						}
 						else
 						{	/* Same Animation */
+							if (IndexAnimationStart < 0 || IndexAnimationStart >= ListInformationPlay.Length)
+							{
+								Debug.LogError("Vector3.X keyframe is out of range!! Parts:" + CurrentProcessingPartsName + " frame:" + DataStart.Time);
+								return(null);
+							}
 							if((true == FirstKeyFrameAnimation) && (ListInformationPlay[IndexAnimationStart].FrameStart < DataStart.Time))
 							{	/* Padding to Start-Frames  */
 								for(int j=ListInformationPlay[IndexAnimationStart].FrameStart; j<=DataStart.Time; j++)
@@ -2350,6 +2364,11 @@
 						}
 						else
 						{	/* Same Animation */
+							if (IndexAnimationStart < 0 || IndexAnimationStart >= ListInformationPlay.Length)
+							{
+								Debug.LogError("Vector3.Y keyframe is out of range!! Parts:" + CurrentProcessingPartsName + " frame:" + DataStart.Time);
+								return(null);
+							}
 							if((true == FirstKeyFrameAnimation) && (ListInformationPlay[IndexAnimationStart].FrameStart < DataStart.Time))
 							{	/* Padding to Start-Frames  */
 								for(int j=ListInformationPlay[IndexAnimationStart].FrameStart; j<=DataStart.Time; j++)
@@ -2413,6 +2432,11 @@
 						}
 						else
 						{	/* Same Animation */
+							if (IndexAnimationStart < 0 || IndexAnimationStart >= ListInformationPlay.Length)
+							{
+								Debug.LogError("Vector3.Z keyframe is out of range!! Parts:" + CurrentProcessingPartsName + " frame:" + DataStart.Time);
+								return(null);
+							}
 							if((true == FirstKeyFrameAnimation) && (ListInformationPlay[IndexAnimationStart].FrameStart < DataStart.Time))
 							{	/* Padding to Start-Frames  */
 								for(int j=ListInformationPlay[IndexAnimationStart].FrameStart; j<=DataStart.Time; j++)
@@ -2500,6 +2524,11 @@
 						}
 						else
 						{	/* Same Animation */
+							if (IndexAnimationStart < 0 || IndexAnimationStart >= ListInformationPlay.Length)
+							{
+								Debug.LogError("Vector2.X keyframe is out of range!! Parts:" + CurrentProcessingPartsName + " frame:" + DataStart.Time);
+								return(null);
+							}
 							if((true == FirstKeyFrameAnimation) && (ListInformationPlay[IndexAnimationStart].FrameStart < DataStart.Time))
 							{	/* Padding to Start-Frames  */
 								for(int j=ListInformationPlay[IndexAnimationStart].FrameStart; j<=DataStart.Time; j++)
@@ -2563,6 +2592,11 @@
 						}
 						else
 						{	/* Same Animation */
+							if (IndexAnimationStart < 0 || IndexAnimationStart >= ListInformationPlay.Length)
+							{
+								Debug.LogError("Vector3.Y keyframe is out of range!! Parts:" + CurrentProcessingPartsName + " frame:" + DataStart.Time);
+								return(null);
+							}
 							if((true == FirstKeyFrameAnimation) && (ListInformationPlay[IndexAnimationStart].FrameStart < DataStart.Time))
 							{	/* Padding to Start-Frames  */
 								for(int j=ListInformationPlay[IndexAnimationStart].FrameStart; j<=DataStart.Time; j++)
@@ -2650,6 +2684,11 @@
 						}
 						else
 						{	/* Same Animation */
+							if (IndexAnimationStart < 0 || IndexAnimationStart >= ListInformationPlay.Length)
+							{
+								Debug.LogError("Float keyframe is out of range!! Parts:" + CurrentProcessingPartsName + " frame:" + DataStart.Time);
+								return(null);
+							}
 							if((true == FirstKeyFrameAnimation) && (ListInformationPlay[IndexAnimationStart].FrameStart < DataStart.Time))
 							{	/* Padding to Start-Frames  */
 								for(int j=ListInformationPlay[IndexAnimationStart].FrameStart; j<=DataStart.Time; j++)
@@ -2738,6 +2777,11 @@
 						}
 						else
 						{	/* Same Animation */
+							if (IndexAnimationStart < 0 || IndexAnimationStart >= ListInformationPlay.Length)
+							{
+								Debug.LogError("Color keyframe is out of range!! Parts:" + CurrentProcessingPartsName + " frame:" + DataStart.Time);
+								return(null);
+							}
 							if((true == FirstKeyFrameAnimation) && (ListInformationPlay[IndexAnimationStart].FrameStart < DataStart.Time))
 							{	/* Padding to Start-Frames  */
 								for(int j=ListInformationPlay[IndexAnimationStart].FrameStart; j<=DataStart.Time; j++)
@@ -2844,6 +2888,11 @@
 						}
 						else
 						{	/* Same Animation */
+							if (IndexAnimationStart < 0 || IndexAnimationStart >= ListInformationPlay.Length)
+							{
+								Debug.LogError("Quadrilateral keyframe is out of range!! Parts:" + CurrentProcessingPartsName + " frame:" + DataStart.Time);
+								return(null);
+							}
 							if((true == FirstKeyFrameAnimation) && (ListInformationPlay[IndexAnimationStart].FrameStart < DataStart.Time))
 							{	/* Padding to Start-Frames  */
 								for(int j=ListInformationPlay[IndexAnimationStart].FrameStart; j<=DataStart.Time; j++)
@@ -2939,6 +2988,11 @@
 						}
 						else
 						{	/* Same Animation */
+							if (IndexAnimationStart < 0 || IndexAnimationStart >= ListInformationPlay.Length)
+							{
+								Debug.LogError("Cell keyframe is out of range!! Parts:" + CurrentProcessingPartsName + " frame:" + DataStart.Time);
+								return(null);
+							}
 							if((true == FirstKeyFrameAnimation) && (ListInformationPlay[IndexAnimationStart].FrameStart < DataStart.Time))
 							{	/* Padding to Start-Frames  */
 								for(int j=ListInformationPlay[IndexAnimationStart].FrameStart; j<=DataStart.Time; j++)


Missed one last place in the client where null needs replacing with DBNull.Value

--- DataProviderClient/RemoteSqlDataReaderClient.cs
+++ DataProviderClient/RemoteSqlDataReaderClient.cs
@@ -71,7 +71,10 @@
 					var fieldNames = _reader.GetFieldNames(_readerId);
 					_currentColumnNamesLookupIfKnown = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
 					for (var i = 0; i < fieldNames.Length; i++)
-						_currentColumnNamesLookupIfKnown[fieldNames[i]] = i;
+					{
+						if (!_currentColumnNamesLookupIfKnown.ContainsKey(fieldNames[i]))
+							_currentColumnNamesLookupIfKnown.Add(fieldNames[i], i);
+					}
 				}
 				_valuesInCurrentRowIfKnown = _reader.GetValues(_readerId, _currentColumnNamesLookupIfKnown.Count);
 			}
@@ -104,7 +107,7 @@
 				{
 					int fieldIndex;
 					if (_currentColumnNamesLookupIfKnown.TryGetValue(name, out fieldIndex))
-						return _valuesInCurrentRowIfKnown[fieldIndex];
+						return _valuesInCurrentRowIfKnown[fieldIndex] ?? DBNull.Value; // Replace null with DBNull.Value for the same reason as in GetValue
 				}
 				return GetValue(GetOrdinal(name));
 			}


log-levels: add task attributes

log-levels: add task attributes

--- exercises/concept/log-levels/LogLevelsTests.cs
+++ exercises/concept/log-levels/LogLevelsTests.cs
@@ -4,66 +4,77 @@
 public class LogLineTests
 {
     [Fact]
+    [Task(1)]
     public void Error_message()
     {
         Assert.Equal("Stack overflow", LogLine.Message("[ERROR]: Stack overflow"));
     }

     [Fact(Skip = "Remove this Skip property to run this test")]
+    [Task(1)]
     public void Warning_message()
     {
         Assert.Equal("Disk almost full", LogLine.Message("[WARNING]: Disk almost full"));
     }

     [Fact(Skip = "Remove this Skip property to run this test")]
+    [Task(1)]
     public void Info_message()
     {
         Assert.Equal("File moved", LogLine.Message("[INFO]: File moved"));
     }

     [Fact(Skip = "Remove this Skip property to run this test")]
+    [Task(1)]
     public void Message_with_leading_and_trailing_white_space()
     {
         Assert.Equal("Timezone not set", LogLine.Message("[WARNING]:   \tTimezone not set  \r\n"));
     }

     [Fact(Skip = "Remove this Skip property to run this test")]
+    [Task(2)]
     public void Error_log_level()
     {
         Assert.Equal("error", LogLine.LogLevel("[ERROR]: Disk full"));
     }

     [Fact(Skip = "Remove this Skip property to run this test")]
+    [Task(2)]
     public void Warning_log_level()
     {
         Assert.Equal("warning", LogLine.LogLevel("[WARNING]: Unsafe password"));
     }

     [Fact(Skip = "Remove this Skip property to run this test")]
+    [Task(2)]
     public void Info_log_level()
     {
         Assert.Equal("info", LogLine.LogLevel("[INFO]: Timezone changed"));
     }

     [Fact(Skip = "Remove this Skip property to run this test")]
+    [Task(3)]
     public void Error_reformat()
     {
         Assert.Equal("Segmentation fault (error)", LogLine.Reformat("[ERROR]: Segmentation fault"));
     }

     [Fact(Skip = "Remove this Skip property to run this test")]
+    [Task(3)]
     public void Warning_reformat()
     {
         Assert.Equal("Decreased performance (warning)", LogLine.Reformat("[WARNING]: Decreased performance"));
     }

     [Fact(Skip = "Remove this Skip property to run this test")]
+    [Task(3)]
     public void Info_reformat()
     {
         Assert.Equal("Disk defragmented (info)", LogLine.Reformat("[INFO]: Disk defragmented"));
     }

     [Fact(Skip = "Remove this Skip property to run this test")]
+    [Task(3)]
     public void Reformat_with_leading_and_trailing_white_space()
     {
         Assert.Equal("Corrupt disk (error)", LogLine.Reformat("[ERROR]: \t Corrupt disk\t \t \r\n"));


Fix some bugs with how gravity affects avatar movement, walking down hills is still a bit weird though.

--- Aurora/Physics/AuroraOpenDynamicsEngine/AODECharacter.cs
+++ Aurora/Physics/AuroraOpenDynamicsEngine/AODECharacter.cs
@@ -55,6 +55,7 @@
         //private Vector3 m_lastRotationalVelocity;

         private bool _zeroFlag = false;
+        private bool _wasZeroFlagFlying = false;
         private bool m_ZeroUpdateSent = false;

         float m_UpdateTimecntr = 0;
@@ -841,6 +842,7 @@

             #region Check for underground

+            bool groundCollision = false;
             if (!(Position.X < 0.25f || Position.Y < 0.25f ||
                 Position.X > _parent_scene.Region.RegionSizeX - .25f ||
                 Position.Y > _parent_scene.Region.RegionSizeY - .25f))
@@ -855,7 +857,7 @@
                     {
                         //if (_target_velocity.Z < 0)
                         _target_velocity.Z = 0;
-                        vec.Z = -vel.Z * PID_D * 2f + ((groundHeight - (tempPos.Z - AvatarHalfsize)) * PID_P * 100.0f);
+                        vec.Z = -vel.Z * PID_D * 1.5f + ((groundHeight - (tempPos.Z - AvatarHalfsize)) * PID_P * 100.0f);
                     }
                     else
                         vec.Z = ((groundHeight - (tempPos.Z - AvatarHalfsize)) * PID_P);
@@ -863,6 +865,7 @@
                 if (tempPos.Z - AvatarHalfsize - groundHeight < 0.12f)
                 {
                     m_iscolliding = true;
+                    groundCollision = true;
                     flying = false; // ground the avatar
                     ContactPoint point = new ContactPoint ();
                     point.PenetrationDepth = vel.Z;
@@ -937,7 +940,7 @@

             //  if velocity is zero, use position control; otherwise, velocity control
             if (_target_velocity == Vector3.Zero &&
-                Math.Abs (vel.X) < 0.05 && Math.Abs (vel.Y) < 0.05 && Math.Abs (vel.Z) < 0.05 && (this.m_iscolliding || this.flying))
+                Math.Abs (vel.X) < 0.05 && Math.Abs (vel.Y) < 0.05 && Math.Abs (vel.Z) < 0.05 && (this.m_iscolliding || this.flying || (this._zeroFlag && _wasZeroFlagFlying == flying)))
             //This is so that if we get moved by something else, it will update us in the client
             {
                 m_isJumping = false;
@@ -945,6 +948,7 @@
                 if (!_zeroFlag)
                 {
                     _zeroFlag = true;
+                    _wasZeroFlagFlying = flying;
                     _zeroPosition = tempPos;
                 }

@@ -1002,9 +1006,11 @@

                 #region Gravity

-                if (!flying && !m_iscolliding)//No ground collisions! Otherwise, we bounce on terrain
-                    _parent_scene.CalculateGravity (m_mass, tempPos, true, 1.025f, ref gravForce);
-                else if(!m_iscolliding)
+                if (!flying && groundCollision)//No ground collisions! Otherwise, we bounce on terrain
+                    _parent_scene.CalculateGravity (m_mass, tempPos, true, 0.45f, ref gravForce);
+                else if (!flying)
+                    _parent_scene.CalculateGravity (m_mass, tempPos, true, 1, ref gravForce);
+                else
                     _parent_scene.CalculateGravity (m_mass, tempPos, false, 0.75f, ref gravForce);//Allow point gravity and repulsors affect us a bit

                 vec += gravForce;


GitHubSync update

GitHubSync update

--- deployment/cake/docker-tasks.cake
+++ deployment/cake/docker-tasks.cake
@@ -178,7 +178,7 @@

             CakeContext.CreateDirectory(confTargetDirectory);

-            var confSourceDirectory = string.Format("{0}*", dockerImageSpecificationDirectory);
+            var confSourceDirectory = string.Format("{0}/*", dockerImageSpecificationDirectory);
             CakeContext.Information("Copying files from '{0}' => '{1}'", confSourceDirectory, confTargetDirectory);

             CakeContext.CopyFiles(confSourceDirectory, confTargetDirectory, true);


JimEvans: Removing unused source file for unit tests.

git-svn-id: aa1aa1384423cb28c2b1e29129bb3a91de1d9196@8277 07704840-8298-11de-bf8c-fd130f914ac9

--- common/test/csharp/webdriver-common-test/Environment.cs
+++ common/test/csharp/webdriver-common-test/Environment.cs
@@ -1,70 +0,0 @@
-using OpenQa.Selenium;
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Reflection;
-using System.Text;
-
-namespace OpenQa.Selenium
-{
-    public class Environment
-    {
-
-        Type driverType;
-        static readonly Environment instance = new Environment();
-        private Browser browser;
-        IWebDriver driver = null;
-
-
-        private Environment()
-        {
-            String driverClassName = System.Configuration.ConfigurationManager.AppSettings.GetValues("Driver")[0];
-            String assemblyName = System.Configuration.ConfigurationManager.AppSettings.GetValues("Assembly")[0];
-            Assembly assembly = Assembly.Load(assemblyName);
-            driverType = assembly.GetType(driverClassName);
-            browser = (Browser) Enum.Parse(
-                typeof(Browser),
-                System.Configuration.ConfigurationManager.AppSettings.GetValues("DriverName")[0]);
-        }
-
-        ~Environment()
-        {
-            if (driver != null)
-            {
-                driver.Quit();
-            }
-        }
-
-        public Browser Browser
-        {
-            get { return browser; }
-        }
-
-        public IWebDriver GetDriver()
-        {
-            if (driver != null) { return driver; }
-            else { return CreateFreshDriver(); }
-        }
-
-        public IWebDriver CreateSecondDriver()
-        {
-            return (IWebDriver)Activator.CreateInstance(driverType);
-        }
-
-        public IWebDriver CreateFreshDriver()
-        {
-            if (driver != null) { driver.Quit(); }
-            driver = (IWebDriver)Activator.CreateInstance(driverType);
-            return driver;
-        }
-
-        public static Environment Instance
-        {
-            get
-            {
-                return instance;
-            }
-        }
-
-    }
-}


Fix a bug where overwriting f-curve lacks a last point

--- Dev/Editor/EffekseerCoreGUI/GUI/Dock/FCurves.cs
+++ Dev/Editor/EffekseerCoreGUI/GUI/Dock/FCurves.cs
@@ -1425,15 +1425,15 @@

 						if(replace)
 						{
-							prop.KVSelected = new byte[copiedCurve.Points.Count];
-
-							prop.Keys = copiedCurve.Points.Select(_ => _.Key + offsetTime).ToArray();
-							prop.Values = copiedCurve.Points.Select(_ => _.Value).ToArray();
-							prop.LeftKeys = copiedCurve.Points.Select(_ => _.LeftKey + offsetTime).ToArray();
-							prop.LeftValues = copiedCurve.Points.Select(_ => _.LeftValue).ToArray();
-							prop.RightKeys = copiedCurve.Points.Select(_ => _.RightKey + offsetTime).ToArray();
-							prop.RightValues = copiedCurve.Points.Select(_ => _.RightValue).ToArray();
-							prop.Interpolations = copiedCurve.Points.Select(_ => _.Interpolation).ToArray();
+							prop.KVSelected = new byte[copiedCurve.Points.Count + 1];
+
+							prop.Keys = copiedCurve.Points.Select(_ => _.Key + offsetTime).Concat(new[] { 0.0f }).ToArray();
+							prop.Values = copiedCurve.Points.Select(_ => _.Value).Concat(new[] { 0.0f }).ToArray();
+							prop.LeftKeys = copiedCurve.Points.Select(_ => _.LeftKey + offsetTime).Concat(new[] { 0.0f }).ToArray();
+							prop.LeftValues = copiedCurve.Points.Select(_ => _.LeftValue).Concat(new[] { 0.0f }).ToArray();
+							prop.RightKeys = copiedCurve.Points.Select(_ => _.RightKey + offsetTime).Concat(new[] { 0.0f }).ToArray();
+							prop.RightValues = copiedCurve.Points.Select(_ => _.RightValue).Concat(new[] { 0.0f }).ToArray();
+							prop.Interpolations = copiedCurve.Points.Select(_ => _.Interpolation).Concat(new[] { 0 }).ToArray();

 							prop.SolveContradiction();
 							prop.IsDirtied = true;


Add virtual methods to basicPage.cs for overriding.

--- wallabag/wallabag.Shared/Common/basicPage.cs
+++ wallabag/wallabag.Shared/Common/basicPage.cs
@@ -18,6 +18,7 @@
         void navigationHelper_SaveState(object sender, SaveStateEventArgs e)
         {
             e.PageState.Add(ViewModelPageKey, this.DataContext);
+            SaveState(e);
         }
         void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
         {
@@ -25,7 +26,11 @@
             {
                 this.DataContext = e.PageState[ViewModelPageKey];
             }
+            LoadState(e);
         }
+
+        protected virtual void LoadState(LoadStateEventArgs e) { }
+        protected virtual void SaveState(SaveStateEventArgs e) { }

         protected override void OnNavigatedTo(NavigationEventArgs e)
         {


Improve handling of updating assets

Improve handling of updating assets

--- AssetsUpdater.cs
+++ AssetsUpdater.cs
@@ -19,8 +19,22 @@
             {
                 return;
             }
-            UpdateTrainTracks();
-            UpdateMetroStationsMeta();
+            try
+            {
+                UpdateTrainTracks();
+            }
+            catch (Exception e)
+            {
+                UnityEngine.Debug.LogException(e);
+            }
+            try
+            {
+                UpdateMetroStationsMeta();
+            }
+            catch (Exception e)
+            {
+                UnityEngine.Debug.LogException(e);
+            }
         }

         private static void UpdateTrainTracks()
@@ -147,20 +161,35 @@
         {
             var vanillaMetroStation = PrefabCollection<BuildingInfo>.FindLoaded("Metro Entrance");

-            foreach (var info in Resources.FindObjectsOfTypeAll<BuildingInfo>())
-            {
-                if (!info.IsMetroDepot() || info.m_buildingAI == null)
-                {
-                    continue;
-                }
-
-                if (info.m_buildingAI.GetType() != typeof(DepotAI))
-                {
-                    var transportStationAi = (TransportStationAI)info.m_buildingAI;
-                    transportStationAi.m_maxVehicleCount = 0;
-                }
-                info.m_UnlockMilestone = vanillaMetroStation.m_UnlockMilestone;
-                ((DepotAI)info.m_buildingAI).m_createPassMilestone = ((DepotAI)vanillaMetroStation.m_buildingAI).m_createPassMilestone;
+            var infos = Resources.FindObjectsOfTypeAll<BuildingInfo>();
+            if (infos == null)
+            {
+                return;
+            }
+            foreach (var info in infos)
+            {
+                try
+                {
+                    if (info == null || info.m_buildingAI == null || !info.IsMetroDepot())
+                    {
+                        continue;
+                    }
+
+                    var ai = info.m_buildingAI as TransportStationAI;
+                    if (ai != null)
+                    {
+                        var transportStationAi = ai;
+                        transportStationAi.m_maxVehicleCount = 0;
+                    }
+                    info.m_UnlockMilestone = vanillaMetroStation.m_UnlockMilestone;
+                    ((DepotAI) info.m_buildingAI).m_createPassMilestone = ((DepotAI) vanillaMetroStation.m_buildingAI)
+                        .m_createPassMilestone;
+                }
+                catch (Exception e)
+                {
+                    UnityEngine.Debug.LogError($"MOM: Failed to update meta of {info?.name}:");
+                    UnityEngine.Debug.LogException(e);
+                }
             }
         }


If a package is not found from the source feed, then check nuget.org.

--- DotSpatial.Plugins.ExtensionManager/Packages.cs
+++ DotSpatial.Plugins.ExtensionManager/Packages.cs
@@ -91,9 +91,7 @@
                 {
                     //Check Core repository for Dlls we might not have. TODO
                     IPackageRepository coreRepo = new PackageRepositoryFactory().CreateRepository(coreRepoUrl);
-                    String coreLocation = "C:\\Users\\shieldst\\Documents\\Visual Studio 2010\\Projects\\DotSpatial2\\Debug\\bin\\";
-                    if(File.Exists(coreLocation + name +".dll")) { return null; }
-                    PackageManager corePackageManager = new PackageManager(coreRepo, new DefaultPackagePathResolver(coreRepoUrl), new PhysicalFileSystem(coreLocation));
+                    PackageManager corePackageManager = new PackageManager(coreRepo, new DefaultPackagePathResolver(coreRepoUrl), new PhysicalFileSystem(repositoryLocation));
                     package = coreRepo.FindPackage(name);
                     corePackageManager.InstallPackage(package, true, false);
                     return package;


#100 New components add at current location, not 0,0

--- Assets/Scripts/QuestEditor/QuestEditorData.cs
+++ Assets/Scripts/QuestEditor/QuestEditorData.cs
@@ -573,7 +573,13 @@
         {
             index++;
         }
-        game.quest.qd.components.Add("Tile" + index, new QuestData.Tile("Tile" + index));
+        QuestData.Tile tile = new QuestData.Tile("Tile" + index);
+        game.quest.qd.components.Add("Tile" + index, tile);
+
+        CameraController cc = GameObject.FindObjectOfType<CameraController>();
+        tile.location.x = game.gameType.TileRound() * Mathf.Round(cc.gameObject.transform.position.x / game.gameType.TileRound());
+        tile.location.y = game.gameType.TileRound() * Mathf.Round(cc.gameObject.transform.position.y / game.gameType.TileRound());
+
         game.quest.Add("Tile" + index);
         SelectComponent("Tile" + index);
     }
@@ -587,7 +593,13 @@
         {
             index++;
         }
-        game.quest.qd.components.Add("Door" + index, new QuestData.Door("Door" + index));
+        QuestData.Door door = new QuestData.Door("Door" + index);
+        game.quest.qd.components.Add("Door" + index, door);
+
+        CameraController cc = GameObject.FindObjectOfType<CameraController>();
+        door.location.x = game.gameType.SelectionRound() * Mathf.Round(cc.gameObject.transform.position.x / game.gameType.SelectionRound());
+        door.location.y = game.gameType.SelectionRound() * Mathf.Round(cc.gameObject.transform.position.y / game.gameType.SelectionRound());
+
         game.quest.Add("Door" + index);
         SelectComponent("Door" + index);
     }
@@ -601,7 +613,13 @@
         {
             index++;
         }
-        game.quest.qd.components.Add("Token" + index, new QuestData.Token("Token" + index));
+        QuestData.Token token = new QuestData.Token("Token" + index);
+        game.quest.qd.components.Add("Token" + index, token);
+
+        CameraController cc = GameObject.FindObjectOfType<CameraController>();
+        token.location.x = game.gameType.SelectionRound() * Mathf.Round(cc.gameObject.transform.position.x / game.gameType.SelectionRound());
+        token.location.y = game.gameType.SelectionRound() * Mathf.Round(cc.gameObject.transform.position.y / game.gameType.SelectionRound());
+
         game.quest.Add("Token" + index);
         SelectComponent("Token" + index);
     }


[add] refs #5 ユーザの取得から非同期処理をなくす

[add] refs #5 ユーザの取得から非同期処理をなくす

--- Attereco-Front/Model/Common/AtterecoClient.cs
+++ Attereco-Front/Model/Common/AtterecoClient.cs
@@ -4,8 +4,10 @@
 using System.Text;
 using System.Threading.Tasks;
 using System.Net.Http;
+using Attereco_Front;
 using Attereco_Front.Model;
 using Attereco_Front.Model.Common;
+using Codeplex.Data;

 namespace Attereco_Front.Model.Common
 {
@@ -39,23 +41,21 @@
                 {"token",  settings.Token}
             };
             string url = settings.Url + "/attereco/api/v1/users/" + user.Sid + "/attend_sid";
-            Task task = Task.Factory.StartNew(
-                async () =>
-                {
-                    var content = new FormUrlEncodedContent(form);
-                    var response = await httpClient.PostAsync(url, content);
-                    Console.WriteLine(response.ToString());
-                }
-            );
+            var content = new FormUrlEncodedContent(form);
             try
             {
-                task.Start();
+                var response = httpClient.PostAsync(url, content);
+                var contents = response.Result.Content.ReadAsStringAsync();
+                dynamic obj = DynamicJson.Parse(contents.Result);
+                user.Sid = obj["sid"];
+                user.Name = obj["name"];
+                return user;
             }
             catch (Exception e)
             {
                 Console.WriteLine(e.Source);
+                throw new NullReferenceException();
             }
-            return user;
         }
     }
 }


Fix inventory handling in PoS (#1922)

Fix inventory handling in PoS (#1922)

--- BTCPayServer/Views/Apps/TemplateEditor.cshtml
+++ BTCPayServer/Views/Apps/TemplateEditor.cshtml
@@ -260,6 +260,9 @@
                         if (image) {
                             template += '  image: ' + image + '\n';
                         }
+                        if (inventory) {
+                            template += '  inventory: ' + inventory + '\n';
+                        }
                         if (custom) {
                             template += '  custom: true\n';
                         }


Use the text "Default (English)" instead of none for language selection

--- EDDiscovery/UserControls/UserControlSettings.cs
+++ EDDiscovery/UserControls/UserControlSettings.cs
@@ -52,7 +52,7 @@
             comboBoxCustomLanguage.Items.AddRange(BaseUtils.Translator.EnumerateLanguageNames( EDDOptions.Instance.TranslatorFolders() ));

             comboBoxCustomLanguage.Items.Add("Auto");
-            comboBoxCustomLanguage.Items.Add("None");
+            comboBoxCustomLanguage.Items.Add("Default (English)");
             if (comboBoxCustomLanguage.Items.Contains(EDDConfig.Instance.Language))
                 comboBoxCustomLanguage.SelectedItem = EDDConfig.Instance.Language;
             else


Updated version code to 1.1.1

Updated version code to 1.1.1

--- SteamShutdown/Properties/AssemblyInfo.cs
+++ SteamShutdown/Properties/AssemblyInfo.cs
@@ -9,7 +9,7 @@
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("SteamShutdown")]
-[assembly: AssemblyCopyright("Copyright ©  2015")]
+[assembly: AssemblyCopyright("Copyright ©  2016")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

@@ -31,5 +31,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.1.0.0")]
-[assembly: AssemblyFileVersion("1.1.0.0")]
+[assembly: AssemblyVersion("1.1.1.0")]
+[assembly: AssemblyFileVersion("1.1.1.0")]


Clean up JSBrowserWindowInstance constructor

--- Electrino/win10/Electrino/JS/JSBrowserWindow.cs
+++ Electrino/win10/Electrino/JS/JSBrowserWindow.cs
@@ -44,27 +44,19 @@

         public JSBrowserWindowInstance(JToken options) : base("BrowserWindowInstance")
         {
+            int width = 0, height = 0;
             this.options = options;

             AttachMethod(LoadURL, "loadURL");
             AttachMethod(On, "on");

-            if (this.options != null)
-            {
-                int width = 0, height = 0;
+            Int32.TryParse(options["width"].ToString(), out width);
+            Int32.TryParse(options["height"].ToString(), out height);

-                Int32.TryParse(options["width"].ToString(), out width);
-                Int32.TryParse(options["height"].ToString(), out height);
+            if (width <= 0) width = defaultWindowWidth;
+            if (height <= 0) height = defaultWindowHeight;

-                if (width <= 0) width = defaultWindowWidth;
-                if (height <= 0) height = defaultWindowHeight;
-
-                App.NewWindow(width, height);
-            }
-            else
-            {
-                App.NewWindow(defaultWindowWidth, defaultWindowHeight);
-            }
+            App.NewWindow(width, height);
         }
         protected JavaScriptValue LoadURL(JavaScriptValue callee, bool isConstructCall, JavaScriptValue[] arguments, ushort argumentCount, IntPtr callbackData)
         {


Fix an incorrect replacement of Credits

Fix an incorrect replacement of Credits

--- EliteDangerous/JournalEvents/JournalLoadGame.cs
+++ EliteDangerous/JournalEvents/JournalLoadGame.cs
@@ -35,7 +35,7 @@
             StartDead = evt["StartDead"].Bool();
             GameMode = evt["GameMode"].Str();
             Group = evt["Group"].Str();
-            Credits = evt["cr;N0"].Long();
+            Credits = evt["Credits"].Long();
             Loan = evt["Loan"].Long();

             ShipName = evt["ShipName"].Str();


[keyboarding] Improve output of test app

--- TestApps/TestAppKeyboard/KeyboardForm.cs
+++ TestApps/TestAppKeyboard/KeyboardForm.cs
@@ -22,9 +22,17 @@
 			KeyboardController.RegisterControl(testAreaB, eventHandler);
 			KeyboardController.RegisterControl(testAreaC, eventHandler);

+			Console.WriteLine();
+			Console.WriteLine("Adding keyboards for Test Area A");
 			LoadKeyboards(keyboardsA);
+			Console.WriteLine();
+			Console.WriteLine("Adding keyboards for Test Area B");
 			LoadKeyboards(keyboardsB);
+			Console.WriteLine();
+			Console.WriteLine("Adding keyboards for Test Area C");
 			LoadKeyboards(keyboardsC);
+			Console.WriteLine();
+			Console.WriteLine("Adding keyboards for Current Keyboard dropdown");
 			LoadKeyboards(currentKeyboard);
 		}


Use remote domain Load instead of CreateInstanceAndUnwrap

--- Sharpmake/ExtensionLoader.cs
+++ Sharpmake/ExtensionLoader.cs
@@ -15,7 +15,6 @@
 using System.Collections.Generic;
 using System.IO;
 using System.Reflection;
-using System.Security.Policy;

 namespace Sharpmake
 {
@@ -205,8 +204,8 @@
             {
                 if (_validator == null)
                 {
-                    _remoteDomain = AppDomain.CreateDomain("ExtensionHelperDomain", new Evidence(AppDomain.CurrentDomain.Evidence));
-                    _validator = _remoteDomain.CreateInstanceAndUnwrap(typeof(ExtensionChecker).Assembly.FullName, typeof(ExtensionChecker).FullName) as ExtensionChecker;
+                    _remoteDomain = AppDomain.CreateDomain("ExtensionHelperDomain");
+                    _validator = _remoteDomain.Load(typeof(ExtensionChecker).Assembly.FullName).CreateInstance(typeof(ExtensionChecker).FullName) as ExtensionChecker;
                 }
             }
         }


added overloads of PrintReport and ExportReportAsPdf without margin parameter

--- SimpleWPFReporting/Report.cs
+++ SimpleWPFReporting/Report.cs
@@ -19,6 +19,8 @@
     public static class Report
     {
         const int DIUPerInch = 96;
+        private static readonly Thickness defaultMargin = new Thickness(25);
+
         public static void ExportVisualAsXps(Visual visual)
         {
             SaveFileDialog saveFileDialog = new SaveFileDialog
@@ -196,6 +198,37 @@
         }

         /// <summary>
+        /// Divides elements of reportContainer into pages and prints them
+        /// NOTE: this overload uses default margin of 25
+        /// </summary>
+        /// <param name="reportContainer">StackPanel containing report elements</param>
+        /// <param name="dataContext">Data Context used in the report</param>
+        /// <param name="orientation">Landscape or Portrait orientation</param>
+        /// <param name="reportHeaderDataTemplate">Optional header for each page</param>
+        /// <param name="headerOnlyOnTheFirstPage">Use header only on the first page (default is false)</param>
+        /// <param name="reportFooterDataTemplate">Optional footer for each page</param>
+        /// <param name="footerStartsFromTheSecondPage">Do not use footer on the first page (default is false)</param>
+        public static void PrintReport(
+            StackPanel reportContainer,
+            object dataContext,
+            ReportOrientation orientation,
+            DataTemplate reportHeaderDataTemplate = null,
+            bool headerOnlyOnTheFirstPage = false,
+            DataTemplate reportFooterDataTemplate = null,
+            bool footerStartsFromTheSecondPage = false)
+        {
+            PrintReport(
+                reportContainer: reportContainer,
+                dataContext: dataContext,
+                margin: defaultMargin,
+                orientation: orientation,
+                reportHeaderDataTemplate: reportHeaderDataTemplate,
+                headerOnlyOnTheFirstPage: headerOnlyOnTheFirstPage,
+                reportFooterDataTemplate: reportFooterDataTemplate,
+                footerStartsFromTheSecondPage: footerStartsFromTheSecondPage);
+        }
+
+        /// <summary>
         /// Divides elements of reportContainer into pages and exports them as PDF
         /// </summary>
         /// <param name="reportContainer">StackPanel containing report elements</param>
@@ -288,6 +321,37 @@
             }
         }

+        /// <summary>
+        /// Divides elements of reportContainer into pages and exports them as PDF
+        /// NOTE: this overload uses default margin of 25
+        /// </summary>
+        /// <param name="reportContainer">StackPanel containing report elements</param>
+        /// <param name="dataContext">Data Context used in the report</param>
+        /// <param name="orientation">Landscape or Portrait orientation</param>
+        /// <param name="reportHeaderDataTemplate">Optional header for each page</param>
+        /// <param name="headerOnlyOnTheFirstPage">Use header only on the first page (default is false)</param>
+        /// <param name="reportFooterDataTemplate">Optional footer for each page</param>
+        /// <param name="footerStartsFromTheSecondPage">Do not use footer on the first page (default is false)</param>
+        public static void ExportReportAsPdf(
+            StackPanel reportContainer,
+            object dataContext,
+            ReportOrientation orientation,
+            DataTemplate reportHeaderDataTemplate = null,
+            bool headerOnlyOnTheFirstPage = false,
+            DataTemplate reportFooterDataTemplate = null,
+            bool footerStartsFromTheSecondPage = false)
+        {
+            ExportReportAsPdf(
+                reportContainer,
+                dataContext,
+                defaultMargin,
+                orientation,
+                reportHeaderDataTemplate,
+                headerOnlyOnTheFirstPage,
+                reportFooterDataTemplate,
+                footerStartsFromTheSecondPage);
+        }
+
         private static List<ReportPage> GetReportPages(
             StackPanel reportContainer,
             List<FrameworkElement> ReportElements,


Some tweaks to the terraria relay

Some tweaks to the terraria relay

--- Bot.Core/Modules/Relay/TerrariaRelayModule.cs
+++ Bot.Core/Modules/Relay/TerrariaRelayModule.cs
@@ -35,6 +35,7 @@
             public EventHandler<MessageReceivedEventArgs> TerrariaMessageReceivedEvent;
             public EventHandler<DisconnectEventArgs> TerrariaDisconnectedEvent;
             public EventHandler<MessageEventArgs> DiscordMessageReceivedEvent;
+            public EventHandler<LoggedInEventArgs> TerrariaOnLoginEvent;

             [JsonConstructor]
             private TerrChannelRelay(ulong channelId, string host, int port, string password)
@@ -143,6 +144,10 @@
                     if (string.IsNullOrEmpty(relay.Password))
                         cfg.Password(relay.Password);

+                    cfg.TrackItems(false);
+                    cfg.TrackNpcs(false);
+                    cfg.TrackProjectiles(false);
+
                     cfg.Player(player =>
                     {
                         player.Appearance(appear => appear.Name(relay.Channel.Name));
@@ -176,10 +181,13 @@
                     relay.Client.CurrentPlayer.SendMessage($"<{e.User.Name}> {e.Message.Text}");
                 };

+                relay.TerrariaOnLoginEvent = (s, e) => relay.Client.CurrentPlayer.Killme(" says hi.");
+
                 //set handlers
                 relay.Client.MessageReceived += relay.TerrariaMessageReceivedEvent;
                 relay.Client.Disconnected += relay.TerrariaDisconnectedEvent;
                 _client.MessageReceived += relay.DiscordMessageReceivedEvent;
+                relay.Client.LoggedIn += relay.TerrariaOnLoginEvent;

                 relay.Client.Log.MessageReceived +=
                     (s, e) => StrmyCore.Logger.FormattedWrite(e.Severity.ToString(), e.Message, ConsoleColor.White);
@@ -207,6 +215,7 @@
             relay.Client.MessageReceived -= relay.TerrariaMessageReceivedEvent;
             relay.Client.Disconnected -= relay.TerrariaDisconnectedEvent;
             _client.MessageReceived -= relay.DiscordMessageReceivedEvent;
+            relay.Client.LoggedIn -= relay.TerrariaOnLoginEvent;

             _relays.Remove(relay);
             relay.Client.SocketDispose();


.Editor: Fix crashing when changing savestates

--- FEZ.Editor.mm/FezGame/Components/LevelEditor.cs
+++ FEZ.Editor.mm/FezGame/Components/LevelEditor.cs
@@ -574,13 +574,6 @@
                                 LabelCentered = false,
                                 Position = new Vector2(0f, 0f)
                             },
-                            new ButtonWidget(Game, "C") {
-                                Background = new Color(0f, 0f, 0.125f, 1f),
-                                Size = new Vector2(24f, 24f),
-                                UpdateBounds = false,
-                                LabelCentered = true,
-                                Position = new Vector2(window.Size.X - 48f, 0f)
-                            },
                             new ButtonWidget(Game, "X", delegate() {
                                 LevelManager.Volumes.Remove(volume.Id);
                                 window.Refresh();
@@ -1329,7 +1322,7 @@
                 return;
             }

-            if (GameState.Loading || GameState.InMap || GameState.InMenuCube || GameState.Paused) {
+            if (GameState.Loading || GameState.InMap || GameState.InMenuCube || GameState.Paused || string.IsNullOrEmpty(LevelManager.Name)) {
                 return;
             }

@@ -1412,7 +1405,7 @@
         }

         public override void Draw(GameTime gameTime) {
-            if (GameState.Loading || GameState.InMap || GameState.InMenuCube || GameState.Paused || !FEZMod.Preloaded) {
+            if (GameState.Loading || GameState.InMap || GameState.InMenuCube || GameState.Paused || !FEZMod.Preloaded || string.IsNullOrEmpty(LevelManager.Name)) {
                 return;
             }


Ajuste no Provider Ginfes para cidade de Capivari/SP

--- src/ACBr.Net.NFSe/Providers/Ginfes/ProviderGinfes.cs
+++ src/ACBr.Net.NFSe/Providers/Ginfes/ProviderGinfes.cs
@@ -1162,7 +1162,8 @@
             //Algumas prefeituras não permitem estas TAGs
             if (
                 Municipio.Codigo != 2704302 && //Maceió/AL
-                Municipio.Codigo != 3503208 // Araraquara/SP
+                Municipio.Codigo != 3503208 && // Araraquara/SP
+                Municipio.Codigo != 3510401    // Capivari/SP
                 )
             {
                 valores.AddChild(AdicionarTag(TipoCampo.De2, "", "DescontoIncondicionado", ns, 1, 15, Ocorrencia.Obrigatoria, nota.Servico.Valores.DescontoIncondicionado));


.Editor: Add function to remove trile groups

--- FEZ.Editor.mm/FezGame/Components/LevelEditor.cs
+++ FEZ.Editor.mm/FezGame/Components/LevelEditor.cs
@@ -926,55 +926,62 @@
             button.Widgets.Add(new ButtonWidget(Game, "Groups", delegate() {
                 ContainerWidget window;
                 Widgets.Add(window = new ContainerWidget(Game) {
-                    UpdateBounds = true
-                });
-                window.Size.X = 256f;
-                window.Size.Y = 24f;
-                window.Label = "Groups";
-                window.Widgets.Add(new WindowHeaderWidget(Game));
-
-                int i = 0;
-                foreach (TrileGroup group_ in LevelManager.Groups.Values) {
-                    window.Widgets.Add(new ContainerWidget(Game, new EditorWidget[] {
-                        new ButtonWidget(Game, "["+group_.Id+"] "+group_.Name) {
-                            Size = new Vector2(window.Size.X - 48f, 24f),
-                            UpdateBounds = false,
-                            LabelCentered = false,
-                            Position = new Vector2(0f, 0f)
-                        },
-                        new ButtonWidget(Game, "C") {
-                            Background = new Color(0f, 0f, 0.125f, 1f),
-                            Size = new Vector2(24f, 24f),
-                            UpdateBounds = false,
-                            LabelCentered = true,
-                            Position = new Vector2(window.Size.X - 48f, 0f)
-                        },
-                        new ButtonWidget(Game, "X") {
-                            Background = new Color(0.5f, 0f, 0f, 1f),
-                            Size = new Vector2(24f, 24f),
-                            UpdateBounds = false,
-                            LabelCentered = true,
-                            Position = new Vector2(window.Size.X - 24f, 0f)
-                        }
+                    UpdateBounds = true,
+                    Size = new Vector2(256f, 24f),
+                    Label = "Groups"
+                });
+
+                window.RefreshValue = delegate() {
+                    window.Widgets.Clear();
+
+                    window.Widgets.Add(new WindowHeaderWidget(Game));
+
+                    int i = 0;
+                    foreach (TrileGroup group_ in LevelManager.Groups.Values) {
+                        window.Widgets.Add(new ContainerWidget(Game, new EditorWidget[] {
+                            new ButtonWidget(Game, "["+group_.Id+"] "+group_.Name) {
+                                Size = new Vector2(window.Size.X - 24f, 24f),
+                                UpdateBounds = false,
+                                LabelCentered = false,
+                                Position = new Vector2(0f, 0f)
+                            },
+                            new ButtonWidget(Game, "X", delegate() {
+                                while (group_.Triles.Count > 0) {
+                                    LevelManager.ClearTrile(group_.Triles[0]);
+                                }
+                                LevelManager.Groups.Remove(group_.Id);
+                                window.Refresh();
+                            }) {
+                                Background = new Color(0.5f, 0f, 0f, 1f),
+                                Size = new Vector2(24f, 24f),
+                                UpdateBounds = false,
+                                LabelCentered = true,
+                                Position = new Vector2(window.Size.X - 24f, 0f)
+                            }
+                        }) {
+                            Size = new Vector2(window.Size.X, 24f),
+                            Background = new Color(EditorWidget.DefaultBackground, 0f)
+                        });
+
+                        i++;
+                    }
+
+                    window.Size.Y = (i+1) * 24f;
+                    window.Size.Y = Math.Min(512f, window.Size.Y);
+
+                    window.Widgets.Add(new ButtonWidget(Game, "+", delegate() {
                     }) {
+                        Background = new Color(0f, 0.125f, 0f, 1f),
                         Size = new Vector2(window.Size.X, 24f),
-                        Background = new Color(EditorWidget.DefaultBackground, 0f)
+                        UpdateBounds = false,
+                        LabelCentered = true,
+                        Position = new Vector2(0f, window.Size.Y - 24f)
                     });

-                    i++;
-                }
-
-                window.Size.Y += i * 24f;
-                window.Size.Y = Math.Min(512f, window.Size.Y);
-
-                window.Widgets.Add(new ButtonWidget(Game, "+", delegate() {
-                }) {
-                    Background = new Color(0f, 0.125f, 0f, 1f),
-                    Size = new Vector2(window.Size.X, 24f),
-                    UpdateBounds = false,
-                    LabelCentered = true,
-                    Position = new Vector2(0f, window.Size.Y - 24f)
-                });
+                    return null;
+                };
+
+                window.Refresh();

                 window.Position.X = GraphicsDevice.Viewport.Width / 2 - (int) (window.Size.X / 2);
                 window.Position.Y = GraphicsDevice.Viewport.Height / 2 - (int) (window.Size.Y / 2);


Fixed reordering with alt+arrow now that we have layers and collision relationship sub-items.

--- FRBDK/Glue/Glue/FormHelpers/RightClickHelper.cs
+++ FRBDK/Glue/Glue/FormHelpers/RightClickHelper.cs
@@ -2094,7 +2094,8 @@
         {
             object objectToRemove;
             IList listToRemoveFrom;
-            GetObjectAndListForMoving(out objectToRemove, out listToRemoveFrom);
+            IList listForIndexing;
+            GetObjectAndListForMoving(out objectToRemove, out listToRemoveFrom, out listForIndexing);
             if (listToRemoveFrom != null)
             {
                 int index = listToRemoveFrom.IndexOf(objectToRemove);
@@ -2135,11 +2136,24 @@
         {
             object objectToRemove;
             IList listToRemoveFrom;
-            GetObjectAndListForMoving(out objectToRemove, out listToRemoveFrom);
+            IList listForIndexing;
+            GetObjectAndListForMoving(out objectToRemove, out listToRemoveFrom, out listForIndexing);
             if (listToRemoveFrom != null)
             {
                 int index = listToRemoveFrom.IndexOf(objectToRemove);
-                int newIndex = index + direction;
+
+                var oldIndexInListForIndexing = listForIndexing.IndexOf(objectToRemove);
+                var newIndexInListForIndexing = oldIndexInListForIndexing + direction;
+
+                object objectToMoveBeforeOrAfter = objectToRemove;
+                if(newIndexInListForIndexing >= 0 && newIndexInListForIndexing < listForIndexing.Count)
+                {
+                    objectToMoveBeforeOrAfter = listForIndexing[newIndexInListForIndexing];
+                }
+
+                //int newIndex = index + direction;
+                int newIndex = listToRemoveFrom .IndexOf(objectToMoveBeforeOrAfter);
+
                 if (newIndex >= 0 && newIndex < listToRemoveFrom.Count)
                 {
                     listToRemoveFrom.Remove(objectToRemove);
@@ -2165,7 +2179,8 @@
         {
             object objectToRemove;
             IList listToRemoveFrom;
-            GetObjectAndListForMoving(out objectToRemove, out listToRemoveFrom);
+            IList throwaway;
+            GetObjectAndListForMoving(out objectToRemove, out listToRemoveFrom, out throwaway);
             if (listToRemoveFrom != null)
             {

@@ -2182,20 +2197,24 @@
             return false;
         }

-        private static void GetObjectAndListForMoving(out object objectToRemove, out IList listToRemoveFrom)
-        {
-            objectToRemove = null;
+        private static void GetObjectAndListForMoving(out object objectToMove,
+            out IList listToRemoveFrom, out IList listForIndexing)
+        {
+            objectToMove = null;
             listToRemoveFrom = null;
-
+            listForIndexing = null;
             if (EditorLogic.CurrentCustomVariable != null)
             {
-                objectToRemove = EditorLogic.CurrentCustomVariable;
+                objectToMove = EditorLogic.CurrentCustomVariable;
                 listToRemoveFrom = GlueState.Self.CurrentElement.CustomVariables;
+                listForIndexing = listToRemoveFrom;
             }

             else if (GlueState.Self.CurrentNamedObjectSave != null)
             {
-                objectToRemove = GlueState.Self.CurrentNamedObjectSave;
+                var currentNamedObject = GlueState.Self.CurrentNamedObjectSave;
+
+                objectToMove = currentNamedObject;

                 NamedObjectSave container = NamedObjectContainerHelper.GetNamedObjectThatIsContainerFor(
                     GlueState.Self.CurrentElement, GlueState.Self.CurrentNamedObjectSave);
@@ -2203,10 +2222,24 @@
                 if (container != null)
                 {
                     listToRemoveFrom = container.ContainedObjects;
+                    listForIndexing = listToRemoveFrom;
+                }
+                else if(currentNamedObject.IsLayer)
+                {
+                    listToRemoveFrom = GlueState.Self.CurrentElement.NamedObjects;
+                    listForIndexing = GlueState.Self.CurrentElement.NamedObjects.Where(item => item.IsLayer).ToList();
+                }
+                else if(currentNamedObject.IsCollisionRelationship())
+                {
+                    listToRemoveFrom = GlueState.Self.CurrentElement.NamedObjects;
+                    listForIndexing = GlueState.Self.CurrentElement.NamedObjects.Where(item => item.IsCollisionRelationship()).ToList();
                 }
                 else
                 {
                     listToRemoveFrom = GlueState.Self.CurrentElement.NamedObjects;
+                    listForIndexing = GlueState.Self.CurrentElement.NamedObjects
+                        .Where(item => item.IsLayer == false && item.IsCollisionRelationship() == false)
+                        .ToList();
                 }
             }
         }


Comparison with field rather than parameter causes crash (#85)

* Bugfix: Must take polymorphic controls into consideration.

* Bugfix: Must save original position of all tagged controls, regardless of the primary drag vertex status.

Before the fix, it was possible to get out of sync with the "IsTagged" status of the primary drag vertex (it was set after the drag start). When that happened, the secondary vertices being dragged, did not have its OriginalX/Y properties updated, resulting in a "jump" from its visual origin to X=0, Y=0.

* Bugfix: compare with argument, not default initialized field.

--- GraphX.PCL.Logic/Algorithms/LayoutAlgorithms/Tree/SimpleTreeLayoutAlgorithm.cs
+++ GraphX.PCL.Logic/Algorithms/LayoutAlgorithms/Tree/SimpleTreeLayoutAlgorithm.cs
@@ -24,7 +24,7 @@
         public SimpleTreeLayoutAlgorithm( TGraph visitedGraph, IDictionary<TVertex, Point> vertexPositions, IDictionary<TVertex, Size> vertexSizes, SimpleTreeLayoutParameters parameters )
             : base( visitedGraph, vertexPositions, parameters )
         {
-            VertexSizes = VertexSizes == null ? new Dictionary<TVertex, Size>() : new Dictionary<TVertex, Size>(vertexSizes);
+            VertexSizes = vertexSizes == null ? new Dictionary<TVertex, Size>() : new Dictionary<TVertex, Size>(vertexSizes);
         }

         public override void Compute(CancellationToken cancellationToken)


ExtensionsSpecs extended for different cultures

GetContainerFor tested for different Cultures like "en-US", "tr-TR"

--- FluentSecurity.Specification/ExtensionsSpecs.cs
+++ FluentSecurity.Specification/ExtensionsSpecs.cs
@@ -1,7 +1,9 @@
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
+using System.Globalization;
 using System.Linq.Expressions;
+using System.Threading;
 using System.Web.Mvc;
 using System.Web.Routing;
 using FluentSecurity.Policy;
@@ -75,6 +77,22 @@
 			// Assert
 			Assert.That(policyContainer, Is.Not.Null);
 		}
+
+        [Test]
+        public void Should_return_a_container_for_Controller_ActIonThatDoesExist_EN()
+        {
+            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
+            var policyContainer = _containers.GetContainerFor("Controller", "ActIonThatDoesExist");
+            Assert.That(policyContainer, Is.Not.Null);
+        }
+
+        [Test]
+        public void Should_return_a_container_for_Controller_ActIonThatDoesExist_TR()
+        {
+            Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR");
+            var policyContainer = _containers.GetContainerFor("Controller", "ActIonThatDoesExist");
+            Assert.That(policyContainer, Is.Not.Null);
+        }
 	}

 	[TestFixture]


Refactor: some extra keyboard state extension methods.

--- Framework/Extensions/KeyboardStateExtensions.cs
+++ Framework/Extensions/KeyboardStateExtensions.cs
@@ -8,7 +8,7 @@
     /// </summary>
     public static class KeyboardStateExtensions {

-        private static Keys[] _modifierKeys = new Keys[] {
+        private static readonly Keys[] _modifierKeys = new Keys[] {
             Keys.LeftControl,
             Keys.RightControl,
             Keys.LeftAlt,
@@ -18,12 +18,32 @@
         };

         /// <summary>
+        /// Determines whether all of the specified keys are currently down.
+        /// </summary>
+        /// <param name="keyboardState">State of the keyboard.</param>
+        /// <param name="keys">The keys.</param>
+        /// <returns><c>true</c> if all of the keys are down; otherwise, <c>false</c>.</returns>
+        public static bool AreAllKeysDown(this KeyboardState keyboardState, params Keys[] keys) {
+            return keys.All(x => keyboardState.IsKeyDown(x));
+        }
+
+        /// <summary>
+        /// Determines whether any of the specified keys are currently down.
+        /// </summary>
+        /// <param name="keyboardState">State of the keyboard.</param>
+        /// <param name="keys">The keys.</param>
+        /// <returns><c>true</c> if any of the keys are down; otherwise, <c>false</c>.</returns>
+        public static bool IsAnyKeyDown(this KeyboardState keyboardState, params Keys[] keys) {
+            return keys.Any(x => keyboardState.IsKeyDown(x));
+        }
+
+        /// <summary>
         /// Determines whether or not a modifier key is currently down.
         /// </summary>
         /// <param name="keyboardState">State of the keyboard.</param>
         /// <returns><c>true</c> if a modifier key is down; otherwise, <c>false</c>.</returns>
         public static bool IsModifierKeyDown(this KeyboardState keyboardState) {
-            return KeyboardStateExtensions._modifierKeys.Any(x => keyboardState.IsKeyDown(x));
+            return keyboardState.IsAnyKeyDown(KeyboardStateExtensions._modifierKeys);
         }
     }
 }


Calculate days, weeks and years correct on time diff.

--- Chalmers.ILL/Extensions/DateTimeExtensions.cs
+++ Chalmers.ILL/Extensions/DateTimeExtensions.cs
@@ -26,17 +26,17 @@
             {
                 ret = "i går";
             }
-            else if ((DateTime.Now - date).TotalDays < 30) // Inom de senaste trettio dagarna
+            else if ((DateTime.Now.Date - date.Date).TotalDays < 30) // Inom de senaste trettio dagarna
             {
-                ret = Math.Floor((DateTime.Now - date).TotalDays) + " dagar";
+                ret = Math.Floor((DateTime.Now.Date - date.Date).TotalDays) + " dagar";
             }
-            else if ((DateTime.Now - date).TotalDays < 365) // Inom det senaste året
+            else if ((DateTime.Now.Date - date.Date).TotalDays < 365) // Inom det senaste året
             {
-                ret = Math.Floor((DateTime.Now - date).TotalDays / 7) + " veckor";
+                ret = Math.Floor((DateTime.Now.Date - date.Date).TotalDays / 7) + " veckor";
             }
             else // Gammal
             {
-                ret = Math.Floor((DateTime.Now - date).TotalDays / 365) + " år";
+                ret = Math.Floor((DateTime.Now.Date - date.Date).TotalDays / 365) + " år";
             }

             return ret;


- Adding password protected tests.

- Adding password protected tests.

--- PDFsharp/testing/PdfSharp.UnitTests/PDFsharpTests-GDI/Reader/PdfReaderTests.cs
+++ PDFsharp/testing/PdfSharp.UnitTests/PDFsharpTests-GDI/Reader/PdfReaderTests.cs
@@ -9,19 +9,66 @@

 namespace PdfSharp.UnitTests.Reader
 {
-  [GotoWorkDirectory]
   public class PdfReaderTests
   {
     [Test]
     [TestCaseSource(nameof(GetPDFs))]
     public void OpenTest(string pdfFile)
     {
+      DoOpen(pdfFile);
+    }
+
+    [Test]
+    public void OpenPasswordProtectedTest()
+    {
+      Assert.Throws<PdfReaderException>(
+        () => DoOpen(DirectoryPointHelper.Resolve("@PDFsharp/samples/PDFs/HelloWorld (protected).pdf"))
+      );
+
+      DoOpen2(DirectoryPointHelper.Resolve("@PDFsharp/samples/PDFs/HelloWorld (protected).pdf"), "user", PdfDocumentOpenMode.Import);
+
+      Assert.Throws<PdfReaderException>(
+        () => DoOpen2(DirectoryPointHelper.Resolve("@PDFsharp/samples/PDFs/HelloWorld (protected).pdf"), "user", PdfDocumentOpenMode.Modify)
+      );
+
+      DoOpen2(DirectoryPointHelper.Resolve("@PDFsharp/samples/PDFs/HelloWorld (protected).pdf"), "user", PdfDocumentOpenMode.ReadOnly);
+
+      DoOpen2(DirectoryPointHelper.Resolve("@PDFsharp/samples/PDFs/HelloWorld (protected).pdf"), "owner", PdfDocumentOpenMode.Import);
+
+      DoOpen2(DirectoryPointHelper.Resolve("@PDFsharp/samples/PDFs/HelloWorld (protected).pdf"), "owner", PdfDocumentOpenMode.Modify);
+
+      DoOpen2(DirectoryPointHelper.Resolve("@PDFsharp/samples/PDFs/HelloWorld (protected).pdf"), "owner", PdfDocumentOpenMode.ReadOnly);
+    }
+
+    private void DoOpen(string pdfFile)
+    {
+      using (var reader = PdfReader.Open(new MemoryStream(File.ReadAllBytes(pdfFile))))
+      {
+        // nop
+      }
+
       using (var reader = PdfReader.Open(pdfFile))
       {
         // nop
       }
     }

-    public static IEnumerable<string> GetPDFs() => Directory.GetFiles(DirectoryPointHelper.Resolve("@PDFsharp/samples/PDFs"), "*.pdf");
+    private void DoOpen2(string pdfFile, string password, PdfDocumentOpenMode mode)
+    {
+      using (var reader = PdfReader.Open(new MemoryStream(File.ReadAllBytes(pdfFile)), password, mode))
+      {
+        // nop
+      }
+
+      using (var reader = PdfReader.Open(pdfFile, password, mode))
+      {
+        // nop
+      }
+    }
+
+    public static IEnumerable<string> GetPDFs() => Directory.GetFiles(DirectoryPointHelper.Resolve("@PDFsharp/samples/PDFs"), "*.pdf")
+      .Where(it => true
+        && !it.Contains("HelloWorld (protected).pdf")
+      );
   }
 }


Fixed issue  that was happening when saving a page

--- CmsEngine.Application/Services/PageService.cs
+++ CmsEngine.Application/Services/PageService.cs
@@ -154,15 +154,15 @@
                     logger.LogInformation("New page");
                     var page = pageEditModel.MapToModel();
                     page.WebsiteId = Instance.Id;
-                    PrepareRelatedProperties(page);
+                    await PrepareRelatedProperties(page);
                     await unitOfWork.Pages.Insert(page);
                 }
                 else
                 {
                     logger.LogInformation("Update page");
-                    var page = pageEditModel.MapToModel(await unitOfWork.Pages.GetByIdAsync(pageEditModel.VanityId));
+                    var page = pageEditModel.MapToModel(await unitOfWork.Pages.GetForSavingById(pageEditModel.VanityId));
                     page.WebsiteId = Instance.Id;
-                    PrepareRelatedProperties(page);
+                    await PrepareRelatedProperties(page);
                     _unitOfWork.Pages.Update(page);
                 }


Fixed null exception

Fixed null exception

--- CmsEngine.Application/Services/PostService.cs
+++ CmsEngine.Application/Services/PostService.cs
@@ -240,27 +240,32 @@

         private async Task PrepareRelatedPropertiesAsync(PostEditModel postEditModel, Post post)
         {
-            var categoryIds = await _unitOfWork.Categories.GetIdsByMultipleGuidsAsync(postEditModel.SelectedCategories.ToList().ConvertAll(Guid.Parse));
-            var tagIds = await _unitOfWork.Tags.GetIdsByMultipleGuidsAsync(postEditModel.SelectedTags.ToList().ConvertAll(Guid.Parse));
-
             post.PostCategories.Clear();
-            foreach (int categoryId in categoryIds)
-            {
-                post.PostCategories.Add(new PostCategory
-                {
-                    PostId = post.Id,
-                    CategoryId = categoryId
-                });
+            if (postEditModel.SelectedCategories != null)
+            {
+                var categoryIds = await _unitOfWork.Categories.GetIdsByMultipleGuidsAsync(postEditModel.SelectedCategories.ToList().ConvertAll(Guid.Parse));
+                foreach (int categoryId in categoryIds)
+                {
+                    post.PostCategories.Add(new PostCategory
+                    {
+                        PostId = post.Id,
+                        CategoryId = categoryId
+                    });
+                }
             }

             post.PostTags.Clear();
-            foreach (int tagId in tagIds)
-            {
-                post.PostTags.Add(new PostTag
-                {
-                    PostId = post.Id,
-                    TagId = tagId
-                });
+            if (postEditModel.SelectedTags != null)
+            {
+                var tagIds = await _unitOfWork.Tags.GetIdsByMultipleGuidsAsync(postEditModel.SelectedTags.ToList().ConvertAll(Guid.Parse));
+                foreach (int tagId in tagIds)
+                {
+                    post.PostTags.Add(new PostTag
+                    {
+                        PostId = post.Id,
+                        TagId = tagId
+                    });
+                }
             }

             var user = await GetCurrentUserAsync();


Fix contract status reset

Fix contract status reset

--- Source/ContractController.cs
+++ Source/ContractController.cs
@@ -51,6 +51,7 @@

 			DontDestroyOnLoad(gameObject);

+			Debug.Log("[Contract Parser] Starting Contract Parsing Controller...");
 			initialized = true;

 			GameEvents.Contract.onParameterChange.Add(onParamChange);
@@ -59,10 +60,10 @@
 			GameEvents.Contract.onFinished.Add(onFinished);
 			GameEvents.Contract.onOffered.Add(onOffered);
 			GameEvents.Contract.onContractsLoaded.Add(onContractsLoaded);
-			GameEvents.onLevelWasLoaded.Add(onSceneChange);
+			GameEvents.onGameSceneSwitchRequested.Add(onSceneChange);
 		}

-		private void onSceneChange(GameScenes scene)
+		private void onSceneChange(GameEvents.FromToAction<GameScenes, GameScenes> g)
 		{
 			contractParser.Loaded = false;
 		}


do not kick mods with white name

do not kick mods with white name

--- CompatBot/Database/Providers/ContentFilter.cs
+++ CompatBot/Database/Providers/ContentFilter.cs
@@ -123,13 +123,13 @@

         var suppressActions = (FilterAction)0;
 #if !DEBUG
-            if (message.Author.IsWhitelisted(client, message.Channel.Guild))
-            {
-                if (message.Content.StartsWith('>'))
-                    suppressActions = FilterAction.IssueWarning | FilterAction.RemoveContent;
-                else
-                    return true;
-            }
+        if (message.Author.IsWhitelisted(client, message.Channel.Guild))
+        {
+            if (message.Content.StartsWith('>'))
+                suppressActions = FilterAction.IssueWarning | FilterAction.RemoveContent | FilterAction.Kick;
+            else
+                return true;
+        }
 #endif

         var content = new StringBuilder(message.Content);


Clean up SubFloorHideSystem

Clean up SubFloorHideSystem

--- Content.Shared/SubFloor/SubFloorHideSystem.cs
+++ Content.Shared/SubFloor/SubFloorHideSystem.cs
@@ -33,21 +33,9 @@
             }
         }

-        private void UpdateAll()
-        {
-            foreach (var comp in ComponentManager.EntityQuery<SubFloorHideComponent>(true))
-            {
-                var transform = comp.Owner.Transform;
-                if (!_mapManager.TryGetGrid(transform.GridID, out var grid)) return;
-                UpdateTile(grid, grid.TileIndicesFor(transform.Coordinates));
-            }
-        }
-
         public override void Initialize()
         {
             base.Initialize();
-
-            IoCManager.InjectDependencies(this);

             _mapManager.GridChanged += MapManagerOnGridChanged;
             _mapManager.TileChanged += MapManagerOnTileChanged;
@@ -72,7 +60,8 @@

         private void OnSubFloorTerminating(EntityUid uid, SubFloorHideComponent component, ComponentShutdown _)
         {
-            UpdateEntity(uid);
+            // Regardless of whether we're on a subfloor or not, unhide.
+            UpdateEntity(uid, true);
         }

         private void HandleAnchorChanged(EntityUid uid, SubFloorHideComponent component, AnchorStateChangedEvent args)
@@ -97,37 +86,76 @@
             }
         }

-        private void UpdateEntity(EntityUid uid)
+        private bool IsSubFloor(IMapGrid grid, Vector2i position)
         {
-            if (!ComponentManager.TryGetComponent(uid, out ITransformComponent? transform) ||
-                !_mapManager.TryGetGrid(transform.GridID, out var grid)) return;
+            var tileDef = (ContentTileDefinition) _tileDefinitionManager[grid.GetTileRef(position).Tile.TypeId];
+            return tileDef.IsSubFloor;
+        }

-            UpdateTile(grid, grid.WorldToTile(transform.WorldPosition));
+        private void UpdateAll()
+        {
+            foreach (var comp in ComponentManager.EntityQuery<SubFloorHideComponent>(true))
+            {
+                UpdateEntity(comp.Owner.Uid);
+            }
         }

         private void UpdateTile(IMapGrid grid, Vector2i position)
         {
-            var tile = grid.GetTileRef(position);
-            var tileDef = (ContentTileDefinition) _tileDefinitionManager[tile.Tile.TypeId];
-            foreach (var anchored in grid.GetAnchoredEntities(position))
+            var isSubFloor = IsSubFloor(grid, position);
+
+            foreach (var uid in grid.GetAnchoredEntities(position))
             {
-                if (!ComponentManager.TryGetComponent(anchored, out SubFloorHideComponent? subFloorComponent))
-                {
-                    continue;
-                }
+                if(ComponentManager.HasComponent<SubFloorHideComponent>(uid))
+                    UpdateEntity(uid, isSubFloor);
+            }
+        }

-                // Show sprite
-                if (ComponentManager.TryGetComponent(anchored, out SharedSpriteComponent ? spriteComponent))
-                {
-                    spriteComponent.Visible = ShowAll || !subFloorComponent.Running || tileDef.IsSubFloor;
-                }
+        private void UpdateEntity(EntityUid uid)
+        {
+            var transform = ComponentManager.GetComponent<ITransformComponent>(uid);
+            if (!_mapManager.TryGetGrid(transform.GridID, out var grid))
+            {
+                // Not being on a grid counts as no subfloor, unhide this.
+                UpdateEntity(uid, true);
+                return;
+            }

-                // So for collision all we care about is that the component is running.
-                if (ComponentManager.TryGetComponent(anchored, out PhysicsComponent ? physicsComponent))
-                {
-                    physicsComponent.CanCollide = !subFloorComponent.Running;
-                }
+            // Update normally.
+            UpdateEntity(uid, IsSubFloor(grid, grid.TileIndicesFor(transform.Coordinates)));
+        }
+
+        private void UpdateEntity(EntityUid uid, bool subFloor)
+        {
+            // We raise an event to allow other entity systems to handle this.
+            var subFloorHideEvent = new SubFloorHideEvent(subFloor);
+            RaiseLocalEvent(uid, subFloorHideEvent, false);
+
+            // Check if it has been handled by someone else.
+            if (subFloorHideEvent.Handled)
+                return;
+
+            // Show sprite
+            if (ComponentManager.TryGetComponent(uid, out SharedSpriteComponent? spriteComponent))
+            {
+                spriteComponent.Visible = ShowAll || subFloor;
+            }
+
+            // So for collision all we care about is that the component is running.
+            if (ComponentManager.TryGetComponent(uid, out PhysicsComponent? physicsComponent))
+            {
+                physicsComponent.CanCollide = subFloor;
             }
         }
     }
+
+    public class SubFloorHideEvent : HandledEntityEventArgs
+    {
+        public bool SubFloor { get; }
+
+        public SubFloorHideEvent(bool subFloor)
+        {
+            SubFloor = subFloor;
+        }
+    }
 }


Fixed Bug in alarmValue WebAPI

Fixed Bug in alarmValue WebAPI

--- Source/Applications/openXDA/openXDA/Controllers/WebAPI/AlarmValueController.cs
+++ Source/Applications/openXDA/openXDA/Controllers/WebAPI/AlarmValueController.cs
@@ -156,7 +156,8 @@
                     ORDER BY StartTime";

                 IEnumerable<AlarmRequestResponse> result = alarms.Select().Select(item => {
-                    DataTable values = connection.RetrieveData(sql);
+                    int alarmID = connection.ExecuteScalar<int>("SELECT MAX(ID) FROM ALARM WHERE ALARMGROUPID = {0} AND Manual = 0", int.Parse(item["ID"].ToString()));
+                    DataTable values = connection.RetrieveData(string.Format(string.Format(sql,alarmID,post.StartTime,post.EndTime));
                     AlarmRequestResponse parsed = new AlarmRequestResponse() {
                         ID = int.Parse(item["ID"].ToString()),
                         Color = item["Color"].ToString(),


Version bump to 3.2.2

Version bump to 3.2.2

--- src/ConDep.Dsl.Operations/Properties/AssemblyInfo.cs
+++ src/ConDep.Dsl.Operations/Properties/AssemblyInfo.cs
@@ -7,8 +7,8 @@
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("ConDep.Dsl.Operations.Core")]
 [assembly: AssemblyCopyright("Copyright © ConDep 2014")]
-[assembly: AssemblyVersion("3.2.1.0")]
-[assembly: AssemblyFileVersion("3.2.1.0")]
+[assembly: AssemblyVersion("3.2.2.0")]
+[assembly: AssemblyFileVersion("3.2.2.0")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]


TestingAdapters: Modified the random number generation technique in FrameBasedRandomValueInputAdapter in the interest of thread safety.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/gsf/Main;C90143

--- Source/Libraries/Adapters/TestingAdapters/FrameBasedRandomValueInputAdapter.cs
+++ Source/Libraries/Adapters/TestingAdapters/FrameBasedRandomValueInputAdapter.cs
@@ -222,7 +222,7 @@
             while (nextPublication < now)
             {
                 OnNewMeasurements(OutputMeasurements
-                    .Select((measurement, index) => Measurement.Clone(measurement, Generator.NextDouble(), nextPublication))
+                    .Select((measurement, index) => Measurement.Clone(measurement, ThreadLocalGenerator.Value.NextDouble(), nextPublication))
                     .ToList<IMeasurement>());

                 m_lastPublication = nextPublication;
@@ -254,6 +254,16 @@

         // Static Fields
         private static readonly Random Generator = new Random();
+        private static readonly ThreadLocal<Random> ThreadLocalGenerator = new ThreadLocal<Random>(CreateGenerator);
+
+        // Static Methods
+        private static Random CreateGenerator()
+        {
+            lock (Generator)
+            {
+                return new Random(Generator.Next());
+            }
+        }

         #endregion
     }


Added code to copy content headers when cloning requests in GrafanaAuthProxyController.

--- Source/Libraries/Adapters/openHistorian.Adapters/GrafanaAuthProxyController.cs
+++ Source/Libraries/Adapters/openHistorian.Adapters/GrafanaAuthProxyController.cs
@@ -249,6 +249,12 @@
                     content.Position = 0;
                     cloneContent.Position = 0;
                     clone.Content = new StreamContent(cloneContent);
+
+                    if ((object)Request.Content.Headers != null)
+                    {
+                        foreach (KeyValuePair<string, IEnumerable<string>> header in Request.Content.Headers)
+                            clone.Content.Headers.TryAddWithoutValidation(header.Key, header.Value);
+                    }
                 }

                 return clone;


build test

build test

--- src/Crane.Tests.Common/Context/NuGetServerContext.cs
+++ src/Crane.Tests.Common/Context/NuGetServerContext.cs
@@ -97,7 +97,8 @@

             if (!_waitForStarted.WaitOne(TimeSpan.FromSeconds(30)))
             {
-                throw new Exception("Could not start klondie");
+                throw new Exception(string.Format("Could not start klondie{0}Standard out:{0}{1}Error out:{0}{2}",
+                    System.Environment.NewLine, Output, Error));
             }
         }


Added nested if

Added nested if

--- CS/cslanguage.cs
+++ CS/cslanguage.cs
@@ -23,7 +23,7 @@

         class ManyDetails {
             public static void executeDriver() {
-                // Comment
+                // Single line comment

                 /*
                     Multi
@@ -190,6 +190,15 @@
                 if (false || true) {
                     // comes here
                 }
+
+                // Nested if
+                if (true) {
+                    if (true) {
+                        if (true) {
+                            // Wnat more?  This is completely valid code. :)
+                        }
+                    }
+                }

                 // Tertiary operator
@@ -445,5 +454,5 @@

-    } // End class CsLanguages
+    } // End class CsLanguage
 }


Some fixes to the buttons enabled/disabled and hotslogs dequeing

--- HeroesParserData/ViewModels/ReplaysViewModel.cs
+++ HeroesParserData/ViewModels/ReplaysViewModel.cs
@@ -308,15 +308,7 @@

         public bool IsHotsLogsUploaderEnabled
         {
-            get
-            {
-                bool enabled = UserSettings.Default.IsHotsLogsUploaderEnabled;
-                if (enabled)
-                    AreHotsLogsUploaderButtonsEnabled = true;
-                else
-                    AreHotsLogsUploaderButtonsEnabled = false;
-                return enabled;
-            }
+            get { return UserSettings.Default.IsHotsLogsUploaderEnabled; }
             set
             {
                 UserSettings.Default.IsHotsLogsUploaderEnabled = value;
@@ -479,9 +471,9 @@
         private void StartProcessing()
         {
             IsProcessSelected = true;
+            if (IsHotsLogsUploaderEnabled) IsHotsLogsStopButtonEnabled = true;
+            IsHotsLogsUploaderQueueOn = true;
             AreProcessButtonsEnabled = false;
-            IsHotsLogsStopButtonEnabled = true;
-            IsHotsLogsUploaderQueueOn = true;

             if (IsProcessWatchChecked)
                 InitReplayWatcher();
@@ -490,7 +482,6 @@
                 ReplayHotsLogsUploadQueue.Clear();

             InitProcessing(IsAutoScanChecked);
-
         }

         private void StopProcessing()
@@ -1028,12 +1019,18 @@
                         {
                             currentReplayFile.HotsLogsStatus = ReplayHotsLogStatus.FileNotFound;
                             HotsLogsLog.Log(LogLevel.Info, $"File does not exists: {currentReplayFile.FilePath}");
+
+                            // remove it before we continue
+                            ReplayHotsLogsUploadQueue.Dequeue();
                             continue;
                         }

                         if (currentReplayFile.ReplayId == 0)
                         {
                             WarningLog.Log(LogLevel.Info, "HOTS Logs Queue: A replayId of 0 was detected");
+
+                            // remove it before we continue
+                            ReplayHotsLogsUploadQueue.Dequeue();
                             continue;
                         }

@@ -1051,6 +1048,9 @@
                             {
                                 // already added, so its a duplicate
                                 currentReplayFile.HotsLogsStatus = ReplayHotsLogStatus.Duplicate;
+
+                                // remove it before we continue
+                                ReplayHotsLogsUploadQueue.Dequeue();
                                 continue;
                             }
                         }
@@ -1093,12 +1093,12 @@
                         currentReplayFile.HotsLogsStatus = ReplayHotsLogStatus.Maintenance;
                         HotsLogsMaintenance = true;
                     }
-                    catch (AmazonS3Exception ex)
+                    catch (AmazonS3Exception ex) // note: the replay is still in front of the queue
                     {
                         currentReplayFile.HotsLogsStatus = ReplayHotsLogStatus.UploadError;
                         HotsLogsLog.Log(LogLevel.Error, ex);
                     }
-                    catch (Exception ex)
+                    catch (Exception ex) // note: the replay is still in front of the queue
                     {
                         currentReplayFile.HotsLogsStatus = ReplayHotsLogStatus.UploadError;
                         ExceptionLog.Log(LogLevel.Error, ex);


Minor optimization in the mapped file system

--- src/Framework/N2/Edit/FileSystem/MappedFileSystem.cs
+++ src/Framework/N2/Edit/FileSystem/MappedFileSystem.cs
@@ -21,12 +21,17 @@
 				yield break;
 			foreach (var file in new DirectoryInfo(path).GetFiles())
 				if(!file.Name.StartsWith("."))
-					yield return GetFile(N2.Web.Url.Combine(parentVirtualPath, file.Name));
+					yield return GetFile(N2.Web.Url.Combine(parentVirtualPath, file.Name), file);
 		}

 		public FileData GetFile(string virtualPath)
 		{
 			FileInfo info = new FileInfo(MapPath(virtualPath));
+			return GetFile(virtualPath, info);
+		}
+
+		private static FileData GetFile(string virtualPath, FileInfo info)
+		{
 			return new FileData
 			{
 				Name = info.Name,
@@ -44,18 +49,23 @@
 				yield break;
 			foreach (var dir in new DirectoryInfo(path).GetDirectories())
 				if (!dir.Name.StartsWith("."))
-					yield return GetDirectory(N2.Web.Url.Combine(parentVirtualPath, dir.Name));
+					yield return GetDirectory(N2.Web.Url.Combine(parentVirtualPath, dir.Name), dir);
 		}

 		public DirectoryData GetDirectory(string virtualPath)
 		{
 			DirectoryInfo info = new DirectoryInfo(MapPath(virtualPath));
-			return new DirectoryData
-			{
+			return GetDirectory(virtualPath, info);
+		}
+
+		private static DirectoryData GetDirectory(string virtualPath, DirectoryInfo info)
+		{
+			return new DirectoryData
+			{
 				Name = info.Name,
 				Created = GetSafely(info, i => i.CreationTime),
-				Updated = GetSafely(info, i => i.LastWriteTime),
-				VirtualPath = virtualPath
+				Updated = GetSafely(info, i => i.LastWriteTime),
+				VirtualPath = virtualPath
 			};
 		}


Fix for network.

Fix for network.

--- Holojam/Assets/Holojam/Server/HolojamNetwork.cs
+++ Holojam/Assets/Holojam/Server/HolojamNetwork.cs
@@ -30,6 +30,7 @@

 		void Start() {
 			sendThread = new HolojamSendThread(BLACK_BOX_SERVER_PORT);
+			receiveThreads = new List<HolojamThread> ();
 			receiveThreads.Add(new HolojamRecieveThread(HOLOJAM_MOTIVE_PORT));
 			receiveThreads.Add(new HolojamRecieveThread(HOLOJAM_NONMOTIVE_PORT));


Avoid leaking resources at design time

Avoid leaking resources at design time

--- src/GitHub.UI/Helpers/SharedDictionaryManagerBase.cs
+++ src/GitHub.UI/Helpers/SharedDictionaryManagerBase.cs
@@ -7,10 +7,13 @@
     public class SharedDictionaryManagerBase : ResourceDictionary
     {
         static IDictionary<Uri, ResourceDictionary> sharedDictionaries;
+        static IList<IDisposable> disposables;

         static SharedDictionaryManagerBase()
         {
-            sharedDictionaries = new Dictionary<Uri, ResourceDictionary>();
+            // Avoid leaking resources at design time.
+            sharedDictionaries = GetAppDomainSharedDictionaries();
+            disposables = GetAppDomainDisposables();
         }

         public virtual new Uri Source
@@ -22,6 +25,13 @@
                 var rd = GetResourceDictionary(value);
                 MergedDictionaries.Clear();
                 MergedDictionaries.Add(rd);
+
+                // Remember dictionaries that need disposing of.
+                var disposable = this as IDisposable;
+                if (disposable != null && !disposables.Contains(disposable))
+                {
+                    disposables.Add(disposable);
+                }
             }
         }

@@ -47,14 +57,14 @@
             var url = inUri.ToString();
             var assemblyPrefix = "/src/";
             var assemblyIndex = url.LastIndexOf(assemblyPrefix);
-            if(assemblyIndex == -1)
+            if (assemblyIndex == -1)
             {
                 return inUri;
             }

             assemblyIndex += assemblyPrefix.Length;
             var pathIndex = url.IndexOf('/', assemblyIndex);
-            if(pathIndex == -1)
+            if (pathIndex == -1)
             {
                 return inUri;
             }
@@ -64,5 +74,39 @@

             return new Uri($"pack://application:,,,/{assemblyName};component/{path}");
         }
+
+        static IDictionary<Uri, ResourceDictionary> GetAppDomainSharedDictionaries()
+        {
+            var name = typeof(SharedDictionaryManagerBase).FullName + ".SharedDictionaries";
+            var sharedDictionaries = GetAppDomainData<Dictionary<Uri, ResourceDictionary>>(name);
+
+            sharedDictionaries.Clear();
+            return sharedDictionaries;
+        }
+
+        static IList<IDisposable> GetAppDomainDisposables()
+        {
+            var name = typeof(SharedDictionaryManagerBase).FullName + ".Disposables";
+            var disposables = GetAppDomainData<List<IDisposable>>(name);
+            foreach (var disposable in disposables)
+            {
+                disposable.Dispose();
+            }
+
+            disposables.Clear();
+            return disposables;
+        }
+
+        static T GetAppDomainData<T>(string name) where T : new()
+        {
+            var data = (T)AppDomain.CurrentDomain.GetData(name);
+            if (data == null)
+            {
+                data = new T();
+                AppDomain.CurrentDomain.SetData(name, data);
+            }
+
+            return data;
+        }
     }
 }


Fixed a potential regex-related bug in old functionality

--- Joinrpg/Models/TargetedSearchResultViewModel.cs
+++ Joinrpg/Models/TargetedSearchResultViewModel.cs
@@ -23,7 +23,7 @@

       descriptionToShow = Regex.Replace(
           descriptionToShow,
-          SearchTarget,
+          Regex.Escape(SearchTarget),
           match => "" + match.Value + "", RegexOptions.IgnoreCase);

       return new HtmlString(descriptionToShow);


Fixed streamingasset for Android

Fixed streamingasset for Android

--- Sources/Silphid.Loadzup/Sources/Loaders/StreamingAsset/StreamingAssetLoader.cs
+++ Sources/Silphid.Loadzup/Sources/Loaders/StreamingAsset/StreamingAssetLoader.cs
@@ -17,7 +17,7 @@
             _converter = converter;
         }

-        public bool Supports<T>(Uri uri) =>
+        public bool Supports<T>(Uri uri) =>
             uri.Scheme == Scheme.StreamingAsset;

         public IObservable<T> Load<T>(Uri uri, Options options = null)
@@ -26,7 +26,9 @@
             var path = uri.GetPathAndContentType(ref contentType, _pathSeparator, true);

             return LoadFile(uri, options, path, contentType)
-                .ContinueWith(x => _converter.Convert<T>(x.Bytes, options?.ContentType ?? x.ContentType ?? contentType, x.Encoding));
+                .ContinueWith(
+                    x =>
+                        _converter.Convert<T>(x.Bytes, options?.ContentType ?? x.ContentType ?? contentType, x.Encoding));
         }

         private IObservable<Response> LoadFile(Uri uri, Options options, string path, ContentType contentType)
@@ -35,8 +37,11 @@

             if (filePath.Contains("://"))
             {
+                if (options == null)
+                    options = new Options();
+
                 options.ContentType = contentType;
-                return _requester.Request(uri, options);
+                return _requester.Request(new Uri(filePath), options);
             }

             return Observable.Return(System.IO.File.ReadAllBytes(filePath))