Added Color and Color32 support

Added Color and Color32 support

--- SimpleJSONUnity.cs
+++ SimpleJSONUnity.cs
@@ -49,6 +49,7 @@
         public static JSONContainerType VectorContainerType = JSONContainerType.Array;
         public static JSONContainerType QuaternionContainerType = JSONContainerType.Array;
         public static JSONContainerType RectContainerType = JSONContainerType.Array;
+        public static JSONContainerType ColorContainerType = JSONContainerType.Array;
         private static JSONNode GetContainer(JSONContainerType aType)
         {
             if (aType == JSONContainerType.Array)
@@ -75,6 +76,18 @@
             n.WriteVector4(aVec);
             return n;
         }
+        public static implicit operator JSONNode(Color aCol)
+        {
+            JSONNode n = GetContainer(ColorContainerType);
+            n.WriteColor(aCol);
+            return n;
+        }
+        public static implicit operator JSONNode(Color32 aCol)
+        {
+            JSONNode n = GetContainer(ColorContainerType);
+            n.WriteColor32(aCol);
+            return n;
+        }
         public static implicit operator JSONNode(Quaternion aRot)
 		{
             JSONNode n = GetContainer(QuaternionContainerType);
@@ -105,6 +118,14 @@
         public static implicit operator Vector4(JSONNode aNode)
         {
             return aNode.ReadVector4();
+        }
+        public static implicit operator Color(JSONNode aNode)
+        {
+            return aNode.ReadColor();
+        }
+        public static implicit operator Color32(JSONNode aNode)
+        {
+            return aNode.ReadColor32();
         }
         public static implicit operator Quaternion(JSONNode aNode)
         {
@@ -234,6 +255,75 @@
         }
         #endregion Vector4

+        #region Color / Color32
+        public Color ReadColor(Color aDefault)
+        {
+            if (IsObject)
+                return new Color(this["a"].AsFloat, this["r"].AsFloat, this["g"].AsFloat, this["b"].AsFloat);
+            if (IsArray)
+                return new Color(this[0].AsFloat, this[1].AsFloat, this[2].AsFloat, this[3].AsFloat);
+            return aDefault;
+        }
+        public Color ReadColor()
+        {
+            return ReadColor(Color.clear);
+        }
+        public JSONNode WriteColor(Color aCol)
+        {
+            if (IsObject)
+            {
+                Inline = true;
+                this["r"].AsFloat = aCol.r;
+                this["g"].AsFloat = aCol.g;
+                this["b"].AsFloat = aCol.b;
+                this["a"].AsFloat = aCol.a;
+            }
+            else if (IsArray)
+            {
+                Inline = true;
+                this[0].AsFloat = aCol.r;
+                this[1].AsFloat = aCol.g;
+                this[2].AsFloat = aCol.b;
+                this[3].AsFloat = aCol.a;
+            }
+            return this;
+        }
+
+        public Color32 ReadColor32(Color32 aDefault)
+        {
+            if (IsObject)
+                return new Color32((byte)this["r"].AsInt, (byte)this["g"].AsInt, (byte)this["b"].AsInt, (byte)this["a"].AsInt);
+            if (IsArray)
+                return new Color32((byte)this[0].AsInt, (byte)this[1].AsInt, (byte)this[2].AsInt, (byte)this[3].AsInt);
+            return aDefault;
+        }
+        public Color32 ReadColor32()
+        {
+            return ReadColor32(new Color32());
+        }
+        public JSONNode WriteColor32(Color32 aCol)
+        {
+            if (IsObject)
+            {
+                Inline = true;
+                this["r"].AsInt = aCol.r;
+                this["g"].AsInt = aCol.g;
+                this["b"].AsInt = aCol.b;
+                this["a"].AsInt = aCol.a;
+            }
+            else if (IsArray)
+            {
+                Inline = true;
+                this[0].AsInt = aCol.r;
+                this[1].AsInt = aCol.g;
+                this[2].AsInt = aCol.b;
+                this[3].AsInt = aCol.a;
+            }
+            return this;
+        }
+
+        #endregion Color / Color32
+
         #region Quaternion
         public Quaternion ReadQuaternion(Quaternion aDefault)
         {


Optimized loops with regards to instruction latency

--- SipHash/SipHash.cs
+++ SipHash/SipHash.cs
@@ -81,11 +81,11 @@

                 unsafe
                 {
-                    fixed (byte* p = key)
+                    fixed (byte* pKey = key)
                     {
-                        var p64 = (ulong*)p;
-                        p64[0] = this.initialState0 ^ 0x736f6d6570736575UL;
-                        p64[1] = this.initialState1 ^ 0x646f72616e646f6dUL;
+                        var pKey64 = (ulong*)pKey;
+                        pKey64[0] = this.initialState0 ^ 0x736f6d6570736575UL;
+                        pKey64[1] = this.initialState1 ^ 0x646f72616e646f6dUL;
                     }
                 }

@@ -139,6 +139,7 @@
             // SipHash internal state
             var v0 = this.initialState0;
             var v1 = this.initialState1;
+            // It is faster to load the initialStateX fields from memory again than to reference v0 and v1:
             var v2 = 0x1F160A001E161714UL ^ this.initialState0;
             var v3 = 0x100A160317100A1EUL ^ this.initialState1;

@@ -154,9 +155,9 @@
                     var finalBlock = dataStart + (count & ~7);

                     // Process the input data in blocks of 64 bits
-                    for (var blockPointer = (ulong*)dataStart; blockPointer < finalBlock; blockPointer++)
+                    for (var blockPointer = (ulong*)dataStart; blockPointer < finalBlock;)
                     {
-                        block = *blockPointer;
+                        block = *blockPointer++;

                         v3 ^= block;


Added a comment about lazy creation

Added a comment about lazy creation

--- SmallDictionary.cs
+++ SmallDictionary.cs
@@ -14,6 +14,10 @@
     /// <typeparam name="TValue"></typeparam>
     public class SmallDictionary<TKey,TValue>: IDictionary<TKey,TValue>
     {
+        // Note - it may be faster to not use lazy creation in our context. The users of this dictionary should
+        // already use lazy creation for the object itself, so this would just be another redundant check.
+        // TODO set up some good test/comparison cases
+
         //private List<KeyValuePair<TKey,TValue>> InnerList {
         //    get {
         //        if (_InnerList==null) {


Fixed bug with wrong data type on user stat model.

--- src/Steam.Models/SteamPlayer/UserStatModel.cs
+++ src/Steam.Models/SteamPlayer/UserStatModel.cs
@@ -4,6 +4,6 @@
     {
         public string Name { get; set; }

-        public uint Value { get; set; }
+        public double Value { get; set; }
     }
 }


Change trim prompt to indicate that you can use SPACE to view full text.

--- src/StructuredLogger/ObjectModel/Utilities.cs
+++ src/StructuredLogger/ObjectModel/Utilities.cs
@@ -5,7 +5,7 @@
     public class Utilities
     {
         public const int MaxDisplayedValueLength = 260;
-        private const string TrimPrompt = "... (Ctrl+C to copy full text)";
+        private const string TrimPrompt = "... (Space: view, Ctrl+C: copy)";

         public static string ShortenValue(string text, string trimPrompt = TrimPrompt)
         {


Respond to PR feedback.

Respond to PR feedback.

--- src/System.Linq/src/System/Linq/SelectMany.cs
+++ src/System.Linq/src/System/Linq/SelectMany.cs
@@ -203,6 +203,7 @@
                         if (!_subEnumerator.MoveNext())
                         {
                             _subEnumerator.Dispose();
+                            _subEnumerator = null;
                             _state = 2;
                             goto case 2;
                         }


minor version bump

minor version bump

--- src/UIA.Extensions/Properties/AssemblyInfo.cs
+++ src/UIA.Extensions/Properties/AssemblyInfo.cs
@@ -32,8 +32,8 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.7.0")]
-[assembly: AssemblyFileVersion("1.0.7.0")]
+[assembly: AssemblyVersion("1.0.7.1")]
+[assembly: AssemblyFileVersion("1.0.7.1")]
 [assembly: InternalsVisibleTo("UIA.Extensions.Units,PublicKey=002400000480000094000000060200000024000052534131000400000100010083671eb3742e62" +
 "427388c9e512020d945fa7ba10b5a1605d534ec7504c89ec99571c3ab023c04733fb0b15eedd1c" +
 "270f62b8519ddf44b5ba2f8045dca32ab054946aafe2734637409d0723aa186376f7b8b3a603c5" +


update index links (#710)

update index links (#710)

--- input/index.cshtml
+++ input/index.cshtml
@@ -34,11 +34,11 @@

 this.WhenAnyValue(x => x.SearchQuery)
-    .Throttle(TimeSpan.FromSeconds(0.8), RxApp.TaskpoolScheduler)
-    .Select(query => query?.Trim())
-    .DistinctUntilChanged()
-    .Where(query => !string.IsNullOrWhiteSpace(query))
-    .ObserveOn(RxApp.MainThreadScheduler)
+    .Throttle(TimeSpan.FromSeconds(0.8), RxApp.TaskpoolScheduler)
+    .Select(query => query?.Trim())
+    .DistinctUntilChanged()
+    .Where(query => !string.IsNullOrWhiteSpace(query))
+    .ObserveOn(RxApp.MainThreadScheduler)
     .InvokeCommand(ExecuteSearch);

@@ -65,14 +65,14 @@

Scalable & Testable

-
ReactiveUI copes gracefully as your application gets more complicated because of the  reactive foundation on which ReactiveUI is built upon. These building blocks are particularly adept at expressing the relationship between a group of things that are changing. ReactiveUI is essentially a collection of extension methods that make expressing intention more convenient when implementing user interfaces.
+
ReactiveUI copes gracefully as your application gets more complicated because of the  reactive foundation on which ReactiveUI is built upon. These building blocks are particularly adept at expressing the relationship between a group of things that are changing. ReactiveUI is essentially a collection of extension methods that make expressing intention more convenient when implementing user interfaces.

Waiting 3 seconds after receiving user input before instigating a request? Don't write a test that waits for 3 seconds - control time! Fast-forward 2.9 seconds, assert the request hasn't been sent, fast-forward another 0.1 seconds, and assert that it has. The functional idioms inherent in reactive programming lead to many other benefits including greater ease in testing your code & you will be able to assert the correctness of features and aspects of your application that you thought were impossible to test.

Open-source

ReactiveUI is developed under an OSI-approved open source license, making it freely usable and distributable, even for commercial use. We ❤ the people who are involved in this project, and we’d love to have you on board, especially if you are just getting started or have never contributed to open-source before.

-
ReactiveUI is a .NET Foundation project. Other projects that are associated with the foundation include the .NET Compiler Platform ("Roslyn") as well as the ASP.NET family of projects, .NET Core & Xamarin Forms.

+
ReactiveUI is a .NET Foundation project. Other projects that are associated with the foundation include the .NET Compiler Platform ("Roslyn") as well as the ASP.NET family of projects, .NET Core & Xamarin Forms.


Fixes #321

Fixes #321

--- src/Myra/Graphics2D/UI/Slider.cs
+++ src/Myra/Graphics2D/UI/Slider.cs
@@ -175,7 +175,7 @@

 		private void SyncHintWithValue()
 		{
-			Hint = (int)(MaxHint * (_value / Maximum));
+			Hint = (int)(MaxHint * ((_value - Minimum) / (Maximum - Minimum)));
 		}

 		public override void Arrange()


Paren was in wrong direction in tofragmentstring.

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@373

--- src/NHibernate/Sql/InFragment.cs
+++ src/NHibernate/Sql/InFragment.cs
@@ -45,7 +45,7 @@
 					buf.Insert(0, " is null or ")
 						.Insert(0, columnName)
 						.Insert(0, StringHelper.OpenParen)
-						.Append(StringHelper.OpenParen);
+						.Append(StringHelper.ClosedParen);
 			} else {
 				string value = values[0] as string;
 				if ( "null".Equals(value) ) {


Next release is Fourier.

Next release is Fourier.

--- ksp_plugin_adapter/main_window.cs
+++ ksp_plugin_adapter/main_window.cs
@@ -5,10 +5,10 @@

 internal class MainWindow : SupervisedWindowRenderer {
   // Update this section before each release.
-  private const string next_release_name_ = "Fibonacci";
-  private const int next_release_lunation_number_ = 244;
+  private const string next_release_name_ = "Fourier";
+  private const int next_release_lunation_number_ = 245;
   private readonly DateTimeOffset next_release_date_ =
-      new DateTimeOffset(2019, 09, 28, 18, 27, 00, TimeSpan.Zero);
+      new DateTimeOffset(2019, 10, 28, 03, 39, 00, TimeSpan.Zero);

   public delegate Vessel PredictedVessel();


Implemented

Implemented

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@59

--- src/NHibernate/Type/ClassType.cs
+++ src/NHibernate/Type/ClassType.cs
@@ -4,8 +4,45 @@

 namespace NHibernate.Type {

-	public class ClassType { //: ImmutableType {
-
+	public class ClassType : ImmutableType {

+		public override object Get(IDataReader rs, string name) {
+			string str = (string) NHibernate.String.Get(rs, name);
+			if (str == null) {
+				return null;
+			}
+			else {
+				try {
+					return ReflectHelper.ClassForName(str);
+				}
+				catch (TypeLoadException tle) {
+					throw new HibernateException("Class not found: " + str);
+				}
+			}
+		}
+
+		public override void Set(IDbCommand cmd, object value, int index) {
+			NHibernate.String.Set(cmd, ( (System.Type) value ).Name, index);
+		}
+
+		public override DbType SqlType {
+			get { return NHibernate.String.SqlType; }
+		}
+
+		public override string ToXML(object value) {
+			return ( (System.Type) value ).Name;
+		}
+
+		public override System.Type ReturnedClass {
+			get { return typeof(System.Type); }
+		}
+
+		public override bool Equals(object x, object y) {
+			return (x==y); //???
+		}
+
+		public override string Name {
+			get { return "class"; }
+		}
 	}
-}
+}


Fixed indentation in JsonSerializer. sublime FTW :metal:

--- src/Nancy/Json/JsonSerializer.cs
+++ src/Nancy/Json/JsonSerializer.cs
@@ -50,8 +50,8 @@
 		int recursionLimit;
 		int maxJsonLength;
 		int recursionDepth;
-        bool retainCasing;
-        bool iso8601DateFormat;
+		bool retainCasing;
+		bool iso8601DateFormat;

 		Dictionary <Type, MethodInfo> serializeGenericDictionaryMethods;
@@ -64,8 +64,8 @@
 			typeResolver = serializer.TypeResolver;
 			recursionLimit = serializer.RecursionLimit;
 			maxJsonLength = serializer.MaxJsonLength;
-            retainCasing = serializer.RetainCasing;
-		    iso8601DateFormat = serializer.ISO8601DateFormat;
+			retainCasing = serializer.RetainCasing;
+			iso8601DateFormat = serializer.ISO8601DateFormat;
 		}

 		public void Serialize (object obj, StringBuilder output)


MONO compatibility

MONO compatibility

Added compatibility with MONO to run on Linux.

--- src/NiceHashBotLib/LibConsole.cs
+++ src/NiceHashBotLib/LibConsole.cs
@@ -20,7 +20,9 @@

         public static void OpenConsole()
         {
+#if !MONO
             AllocConsole();
+#endif
         }

         public static void WriteLine(TEXT_TYPE Type, string Text)


fixed naming

fixed naming

--- Samples/Mapsui.Samples.Common.Desktop/GeoGifSample.cs
+++ Samples/Mapsui.Samples.Common.Desktop/GeoGifSample.cs
@@ -6,9 +6,9 @@

 namespace Mapsui.Samples.Common.Desktop
 {
-    public class GeoGifSample : ISample
+    public class GeoTiffSample : ISample
     {
-        public string Name => "6 Geo Gif";
+        public string Name => "6 Geo Tiff";
         public string Category => "Desktop";

         public void Setup(IMapControl mapControl)


Null checks

Null checks

--- Samples/MvvmMobile.Sample.Core/IoC/AutofacResolver.cs
+++ Samples/MvvmMobile.Sample.Core/IoC/AutofacResolver.cs
@@ -13,7 +13,7 @@

         public bool IsRegistered<T>() where T : class
         {
-            return _container.IsRegistered<T>();
+            return _container?.IsRegistered<T>() ?? false;
         }

         public T Resolve<T>() where T : class
@@ -23,7 +23,7 @@
                 return default(T);
             }

-            return _container.Resolve<T>();
+            return _container?.Resolve<T>();
         }
     }
 }


add missing EM.TrainEM method.

add missing EM.TrainEM method.

--- src/OpenCvSharp/Modules/ml/EM.cs
+++ src/OpenCvSharp/Modules/ml/EM.cs
@@ -198,6 +198,39 @@
                 return vec.ToArray();
             }

+        }
+
+        public virtual bool TrainEM(
+            InputArray samples,
+            OutputArray logLikelihoods = null,
+            OutputArray labels = null,
+            OutputArray probs = null)
+        {
+            ThrowIfDisposed();
+            if (samples == null)
+                throw new ArgumentNullException(nameof(samples));
+            samples.ThrowIfDisposed();
+
+            logLikelihoods?.ThrowIfNotReady();
+            labels?.ThrowIfNotReady();
+            probs?.ThrowIfNotReady();
+
+            int ret = NativeMethods.ml_EM_trainEM(
+                ptr,
+                samples.CvPtr,
+                Cv2.ToPtr(logLikelihoods),
+                Cv2.ToPtr(labels),
+                Cv2.ToPtr(probs));
+
+            logLikelihoods?.Fix();
+            labels?.Fix();
+            probs?.Fix();
+            GC.KeepAlive(this);
+            GC.KeepAlive(samples);
+            GC.KeepAlive(logLikelihoods);
+            GC.KeepAlive(labels);
+            GC.KeepAlive(probs);
+            return ret != 0;
         }

 #if LANG_JP


(TFS CS 6815)

(TFS CS 6815)

--- Signum.Engine.Extensions/Operations/OperationLogic.cs
+++ Signum.Engine.Extensions/Operations/OperationLogic.cs
@@ -111,7 +111,7 @@
         public static void AssertOperationAllowed(Enum operationKey)
         {
             if (!OperationAllowed(operationKey))
-                throw new UnauthorizedAccessException(Resources.Operation0IsNotAuthorized.Formato(operationKey));
+                throw new UnauthorizedAccessException(Resources.Operation0IsNotAuthorized.Formato(operationKey.NiceToString()));
         }
         #endregion


fix ValueProviders with error variable

fix ValueProviders with error variable

--- Signum.Engine.Extensions/Templating/ValueProviders.cs
+++ Signum.Engine.Extensions/Templating/ValueProviders.cs
@@ -397,15 +397,23 @@
                     return result;
                 }

-                if(!(vp is TokenValueProvider))
+                var tvp = vp as TokenValueProvider;
+
+                if(tvp == null)
                 {
                     addError(false, "Variable '{0}' is not a token".FormatWith(v));
                     return result;
                 }

+                if (tvp.ParsedToken.QueryToken == null)
+                {
+                    addError(false, "Variable '{0}' is not a correctly parsed".FormatWith(v));
+                    return result;
+                }
+
                 var after = tokenString.TryAfter('.');

-                tokenString = ((TokenValueProvider)vp).ParsedToken.QueryToken.FullKey() + (after == null ? null : ("." + after));
+                tokenString = tvp.ParsedToken.QueryToken.FullKey() + (after == null ? null : ("." + after));
             }

             try


a little bit more of doc

a little bit more of doc

git-svn-id: d6bffa57a36fe0f3c7d18ef52cc0c4d4ff653ca6@248 66c3f25c-543c-0410-ae2e-6f2ca0bd8c61

--- SolrNet/Commands/Parameters/HighlightingParameters.cs
+++ SolrNet/Commands/Parameters/HighlightingParameters.cs
@@ -15,9 +15,11 @@
 #endregion

 using System.Collections.Generic;
-using SolrNet.Utils;

 namespace SolrNet.Commands.Parameters {
+    /// <summary>
+    /// Highlighting parameters
+    /// </summary>
 	public class HighlightingParameters {
 		/// <summary>
 		/// List of fields to generate highlighted snippets for.


Remove useless comments and commented code

--- SolrNet/Impl/ResponseParsers/ResultsResponseParser.cs
+++ SolrNet/Impl/ResponseParsers/ResultsResponseParser.cs
@@ -34,19 +34,8 @@
         }

         public void Parse(XDocument xml, AbstractSolrQueryResults<T> results) {
-            // IsNullOrEmpty part is needed to pass tests -- ptasz3k
             var resultNode = xml.Element("response").Elements("result").FirstOrDefault(e => String.IsNullOrEmpty((string) e.Attribute("name")) || (string) e.Attribute("name") == "response");

-            //FIX BY klaas
-            //If resultNode == null exit func
-            //		This can occur when grouped results are returned
-            //if (resultNode == null)
-            //{
-            //    return;
-            //}
-
-            //FIX by kanda
-            // result (if present) to be parsed even if grouped results are present
             if (resultNode == null) {
                 var groupElement = xml.Element("response").Elements("lst").FirstOrDefault(e => (string) e.Attribute("name") == "grouped");
                 if (groupElement != null) {


add cancel moveto after move emote failprogresscount threshold (#3516)

--- Source/ACE.Server/WorldObjects/Creature_Navigation.cs
+++ Source/ACE.Server/WorldObjects/Creature_Navigation.cs
@@ -366,8 +366,19 @@
                     UpdatePosition_SyncLocation();
                     SendUpdatePosition();

-                    if (PhysicsObj?.MovementManager?.MoveToManager?.FailProgressCount < 10)
+                    if (PhysicsObj?.MovementManager?.MoveToManager?.FailProgressCount < 5)
+                    {
                         AddMoveToTick();
+                    }
+                    else
+                    {
+                        if (PhysicsObj?.MovementManager?.MoveToManager != null)
+                        {
+                            PhysicsObj.MovementManager.MoveToManager.CancelMoveTo(WeenieError.ActionCancelled);
+                            PhysicsObj.MovementManager.MoveToManager.FailProgressCount = 0;
+                        }
+                        EnqueueBroadcastMotion(new Motion(CurrentMotionState.Stance, MotionCommand.Ready));
+                    }

                     //Console.WriteLine($"{Name}.Position: {Location}");
                 }


#1994 Get methods from base classes

#1994 Get methods from base classes

--- Source/Csla/Reflection/ServiceProviderMethodCaller.cs
+++ Source/Csla/Reflection/ServiceProviderMethodCaller.cs
@@ -22,8 +22,8 @@
   /// </summary>
   public static class ServiceProviderMethodCaller
   {
-    private static readonly BindingFlags _bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.DeclaredOnly;
-    private static readonly BindingFlags _factoryBindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly;
+    private static readonly BindingFlags _bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic;
+    private static readonly BindingFlags _factoryBindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
     private static readonly ConcurrentDictionary<string, ServiceProviderMethodInfo> _methodCache =
       new ConcurrentDictionary<string, ServiceProviderMethodInfo>();


Change include no profile to always include, profile name ! is defaultl only

--- Source/Dna.HtmlEngine.Core/Engines/Base/BaseEngine.cs
+++ Source/Dna.HtmlEngine.Core/Engines/Base/BaseEngine.cs
@@ -746,26 +746,31 @@
                 includePath = includePath.Split(':')[0];
             }

-            // If this include is not for this output profile, ignore it
-            if (!string.Equals(output.ProfileName, profileName, StringComparison.CurrentCultureIgnoreCase))
-            {
-                // Remove include tag and finish
+            // If the profile is blank, always include it
+            if (string.IsNullOrEmpty(profileName) ||
+                // Or if we specify ! only include it if the specified profile is  blank
+                (profileName == "!" && string.IsNullOrEmpty(output.ProfileName)) ||
+                // Or if the profile name matches include it
+                string.Equals(output.ProfileName, profileName, StringComparison.CurrentCultureIgnoreCase))
+            {
+                // Try and find the include file
+                var includedContents = FindIncludeFile(data.FullPath, includePath, out string resolvedPath);
+
+                // If we didn't find it, error out
+                if (includedContents == null)
+                {
+                    data.Error = $"Include file not found {includePath}";
+                    return;
+                }
+
+                // Otherwise we got it, so replace the tag with the contents
+                ReplaceTag(output, match, includedContents, removeNewline: false);
+            }
+            // Remove include tag and finish
+            else
+            {
                 ReplaceTag(output, match, string.Empty);
-                return;
-            }
-
-            // Try and find the include file
-            var includedContents = FindIncludeFile(data.FullPath, includePath, out string resolvedPath);
-
-            // If we didn't find it, error out
-            if (includedContents == null)
-            {
-                data.Error = $"Include file not found {includePath}";
-                return;
-            }
-
-            // Otherwise we got it, so replace the tag with the contents
-            ReplaceTag(output, match, includedContents, removeNewline: false);
+            }
         }

         /// <summary>


GSF.TimeSeries: Removed superfluous catch from ArchiveReader.

--- Source/Libraries/GSF.Historian/Files/ArchiveReader.cs
+++ Source/Libraries/GSF.Historian/Files/ArchiveReader.cs
@@ -573,10 +573,6 @@
                         }
                     }
                 }
-                catch (ThreadAbortException)
-                {
-                    throw;
-                }
                 catch (Exception ex)
                 {
                     OnDataReadException(new InvalidOperationException("Exception encountered during roll-over processing: " + ex.Message, ex));


Small error fix

Small error fix

--- Source/StaffStuff/Assets/Scripts/VisitorController.cs
+++ Source/StaffStuff/Assets/Scripts/VisitorController.cs
@@ -6,8 +6,9 @@
 	public float movmentSpeed = 5.0f;
 	public Vector3 moveTo = new Vector3(0.0f, 0.0f, 0.0f);
 	public VisitorMovementMode movementMode = VisitorMovementMode.Target;
+	public float fadeOutTime = 3.0f;
+
 	private bool isDestroyed = false;
-	public float fadeOutTime = 3.0f;
 	private float gonesFadeoutTime = 0.0f;
 	private float alpha = 1.0f;

@@ -20,27 +21,27 @@

 	private void Update()
 	{
-		if (!isDestroyed) {
+		if (!isDestroyed)
+		{
 			var velocity = (moveTo - transform.position).normalized * movmentSpeed;
 			spriteRigidbody.velocity = velocity;
 		}
-		else {
-
+		else
+		{
 			alpha = 1.0f - gonesFadeoutTime / fadeOutTime;
 			gonesFadeoutTime += Time.deltaTime;

-			if (alpha < 0.2f) {
-				Destroy (gameObject);
+			if (alpha < 0.2f)
+			{
+				Destroy(gameObject);
 			}
-
-			if (alpha < 0.5f) {
-				GetComponent<Rigidbody> ().detectCollisions = false;
+			if (alpha < 0.5f)
+			{
+				GetComponent<Rigidbody2D>().Sleep();
 			}
-			var oldColor = GetComponent<Renderer> ().material.color;
+			var oldColor = GetComponent<Renderer>().material.color;
 			oldColor.a = alpha;
-			GetComponent<Renderer> ().material.color = oldColor;
-
-
+			GetComponent<Renderer>().material.color = oldColor;
 		}
 	}

@@ -49,7 +50,6 @@
 		if (!isDestroyed && collision.gameObject.tag == "Stage")
 		{
 			GameSession.Instance.DecreasePopularity(visitorType);
-			//Destroy(gameObject);
 			isDestroyed = true;
 		}
 	}


[Toolkit.Graphics] Fix issue with wrong slots being assigned in EffectPass

--- Source/Toolkit/SharpDX.Toolkit.Graphics/EffectPass.cs
+++ Source/Toolkit/SharpDX.Toolkit.Graphics/EffectPass.cs
@@ -87,7 +87,7 @@
         internal EffectTechnique Technique;

         private const bool EnableDebug = false;
-        internal static TextWriter DebugLog = new StringWriter();
+        internal TextWriter DebugLog = new StringWriter();

         /// <summary>
         ///   Initializes a new instance of the <see cref="EffectPass" /> class.
@@ -695,10 +695,10 @@

                 if (stageBlock.Parameters == null)
                 {
-                     stageBlock.Parameters = new List<EffectParameter>();
-                }
-
-                stageBlock.Parameters.Add(parameter);
+                    stageBlock.Parameters = new List<ParameterBinding>(shaderRaw.ResourceParameters.Count);
+                }
+
+                stageBlock.Parameters.Add(new ParameterBinding(parameter, parameterRaw.Slot));
             }

             stageBlock.ConstantBufferLinks = constantBufferLinks.ToArray();
@@ -720,8 +720,9 @@
             }

             // Compute default slot links link
-            foreach (var parameter in stageBlock.Parameters)
-            {
+            foreach (var parameterBinding in stageBlock.Parameters)
+            {
+                var parameter = parameterBinding.Parameter;

                 var slots = stageBlock.Slots[(int)parameter.ResourceType];
                 if (slots == null)
@@ -732,7 +733,7 @@

                 var parameterRaw = (EffectData.ResourceParameter)parameter.ParameterDescription;

-                var range = new SlotLinkSet() { SlotCount = parameterRaw.Count, SlotIndex = parameterRaw.Slot };
+                var range = new SlotLinkSet() { SlotCount = parameterRaw.Count, SlotIndex = parameterBinding.Slot };
                 slots.Add(range);
                 range.Links.Add(new SlotLink(parameter.Offset, 0, parameterRaw.Count));
             }
@@ -1099,6 +1100,19 @@
             public StageBlock[] Stages;
         }

+        private struct ParameterBinding
+        {
+            public ParameterBinding(EffectParameter parameter, int slot)
+            {
+                Parameter = parameter;
+                Slot = slot;
+            }
+
+            public readonly EffectParameter Parameter;
+
+            public readonly int Slot;
+        }
+
         #endregion

         #region Nested type: RawSlotLinkSet
@@ -1177,7 +1191,7 @@

         private class StageBlock
         {
-            public List<EffectParameter> Parameters;
+            public List<ParameterBinding> Parameters;

             public RawSlotLinkSet ConstantBufferSlotLinks;
             public ConstantBufferLink[] ConstantBufferLinks;


_hotBuf and _coldBuf is unnecessary because flush is sync

--- src/Prometheus.Client/Summary.cs
+++ src/Prometheus.Client/Summary.cs
@@ -33,13 +33,12 @@
             // Lock bufMtx before mtx if both are needed.
             private readonly object _lock = new object();

-            private SampleBuffer _coldBuf;
+            private SampleBuffer _buffer;
+            private DateTime _bufferExpTime;
             private uint _count;
             private QuantileStream _headStream;
             private DateTime _headStreamExpTime;
             private int _headStreamIdx;
-            private SampleBuffer _hotBuf;
-            private DateTime _hotBufExpTime;

             private double[] _sortedObjectives;
             private TimeSpan _streamDuration;
@@ -61,11 +60,10 @@
                 base.Init(labelValues, configuration);

                 _sortedObjectives = new double[Configuration.Objectives.Count];
-                _hotBuf = new SampleBuffer(Configuration.BufCap);
-                _coldBuf = new SampleBuffer(Configuration.BufCap);
+                _buffer = new SampleBuffer(Configuration.BufCap);
                 _streamDuration = new TimeSpan(Configuration.MaxAge.Ticks / Configuration.AgeBuckets);
                 _headStreamExpTime = now.Add(_streamDuration);
-                _hotBufExpTime = _headStreamExpTime;
+                _bufferExpTime = _headStreamExpTime;

                 _streams = new QuantileStream[Configuration.AgeBuckets];
                 for (int i = 0; i < Configuration.AgeBuckets; i++)
@@ -87,9 +85,8 @@
                 {
                     lock (_lock)
                     {
-                        // Swap bufs even if hotBuf is empty to set new hotBufExpTime.
-                        SwapBufs(now);
-                        FlushColdBuf();
+                        // FlushBuffer even if buffer is empty to set new bufferExpTime.
+                        FlushBuffer(now);

                         for (int i = 0; i < _sortedObjectives.Length; i++)
                         {
@@ -137,12 +134,12 @@
             {
                 lock (_bufLock)
                 {
-                    if (now > _hotBufExpTime)
+                    if (now > _bufferExpTime)
                         Flush(now);

-                    _hotBuf.Append(val);
-
-                    if (_hotBuf.IsFull)
+                    _buffer.Append(val);
+
+                    if (_buffer.IsFull)
                         Flush(now);

                     TimestampIfRequired();
@@ -154,35 +151,16 @@
             {
                 lock (_lock)
                 {
-                    SwapBufs(now);
-
-                    // Go version flushes on a separate goroutine, but doing this on another
-                    // thread actually makes the benchmark tests slower in .net
-                    FlushColdBuf();
-                }
-            }
-
-            // SwapBufs needs mtx AND bufMtx locked, coldBuf must be empty.
-            private void SwapBufs(DateTime now)
-            {
-                if (!_coldBuf.IsEmpty)
-                    throw new ArgumentException("coldBuf is not empty");
-
-                var temp = _hotBuf;
-                _hotBuf = _coldBuf;
-                _coldBuf = temp;
-
-                // hotBuf is now empty and gets new expiration set.
-                while (now > _hotBufExpTime)
-                    _hotBufExpTime = _hotBufExpTime.Add(_streamDuration);
-            }
-
-            // FlushColdBuf needs mtx locked.
-            private void FlushColdBuf()
-            {
-                for (int bufIdx = 0; bufIdx < _coldBuf.Position; bufIdx++)
-                {
-                    double value = _coldBuf[bufIdx];
+                    FlushBuffer(now);
+                }
+            }
+
+            // FlushBuffer needs mtx AND bufMtx locked.
+            private void FlushBuffer(DateTime now)
+            {
+                for (int bufIdx = 0; bufIdx < _buffer.Position; bufIdx++)
+                {
+                    double value = _buffer[bufIdx];

                     foreach (var quantileStream in _streams)
                         quantileStream.Insert(value);
@@ -191,14 +169,19 @@
                     _sum += value;
                 }

-                _coldBuf.Reset();
+                _buffer.Reset();
+
+                // buffer is now empty and gets new expiration set.
+                while (now > _bufferExpTime)
+                    _bufferExpTime = _bufferExpTime.Add(_streamDuration);
+
                 MaybeRotateStreams();
             }

             // MaybeRotateStreams needs mtx AND bufMtx locked.
             private void MaybeRotateStreams()
             {
-                while (!_hotBufExpTime.Equals(_headStreamExpTime))
+                while (!_bufferExpTime.Equals(_headStreamExpTime))
                 {
                     _headStream.Reset();
                     _headStreamIdx++;


[Toolkit.Graphics] Fix issue #276. Revert to Round only for final offset

--- Source/Toolkit/SharpDX.Toolkit.Graphics/SpriteFont.cs
+++ Source/Toolkit/SharpDX.Toolkit.Graphics/SpriteFont.cs
@@ -271,8 +271,8 @@
             var offset = new Vector2(x, y + glyph.Offset.Y);
             Vector2.Multiply(ref offset, ref axisDirectionTable[(int)spriteEffects & 3], out offset);
             Vector2.Add(ref offset, ref parameters.origin, out offset);
-            offset.X = (float)Math.Ceiling(offset.X);
-            offset.Y = (float)Math.Ceiling(offset.Y);
+            offset.X = (float)Math.Round(offset.X);
+            offset.Y = (float)Math.Round(offset.Y);

             if (spriteEffects != SpriteEffects.None)
             {


References for bundes changed

References for bundes changed

--- Source/Web/SportsBook.Web/Views/Shared/_Layout.cshtml
+++ Source/Web/SportsBook.Web/Views/Shared/_Layout.cshtml
@@ -5,17 +5,17 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>@ViewBag.Title - My ASP.NET Application</title>
-    @* @Styles.Render("~/Content/css", "~/Content/kendo")
+    @Styles.Render("~/Content/css", "~/Content/kendo")
     @Scripts.Render("~/bundles/jquery")
-    @Scripts.Render("~/bundles/kendo")*@
-
-
-    <link href="~/Content/Site.css" rel="stylesheet" />
+    @Scripts.Render("~/bundles/kendo")
+
+
+    @*<link href="~/Content/Site.css" rel="stylesheet" />
     <link href="~/Content/KendoUI/kendo.common.min.css" rel="stylesheet" />
     <link href="~/Content/KendoUI/kendo.default.min.css" rel="stylesheet" />
     <script src="~/Scripts/jquery-2.2.0.min.js"></script>
     <script src="~/Scripts/KendoUI/kendo.all.min.js"></script>
-    <script src="~/Scripts/KendoUI/kendo.aspnetmvc.min.js"></script>
+    <script src="~/Scripts/KendoUI/kendo.aspnetmvc.min.js"></script>*@

     <link href="~/Content/Theme/bootstrap.css" rel="stylesheet" />
     <link href="~/Content/Theme/font-awesome.css" rel="stylesheet" />


Bug fixed when link for facility details click - area added to pop up action links

--- Source/Web/SportsBook.Web/Views/Shared/_Layout.cshtml
+++ Source/Web/SportsBook.Web/Views/Shared/_Layout.cshtml
@@ -143,8 +143,8 @@

         @RenderBody()

-
@Html.Action("GetPopupLogin", "Account")

-
@Html.Action("GetPopupRegister", "Account")

+
@Html.Action("GetPopupLogin", "Account", new {area="" })

+
@Html.Action("GetPopupRegister", "Account", new {area="" })

© @DateTime.Now.Year - My ASP.NET Application


Reset retry to sensible levels

Reset retry to sensible levels

--- src/Proto.Remote/RemoteConfig.cs
+++ src/Proto.Remote/RemoteConfig.cs
@@ -67,12 +67,12 @@
         /// <summary>
         /// the number of times to retry the connection within the RetryTimeSpan
         /// </summary>
-        public int MaxRetries {get; set; } = 10;
-        public TimeSpan RetryTimeSpan { get; set; } = TimeSpan.FromMinutes(10);
+        public int MaxRetries {get; set; } = 8;
+        public TimeSpan RetryTimeSpan { get; set; } = TimeSpan.FromMinutes(3);

         /// <summary>
         /// each retry backs off by an exponential ratio of this amount
         /// </summary>
-        public int RetryBackOffms { get; set; } = 250;
+        public int RetryBackOffms { get; set; } = 10;
     }
 }


fix line endings

fix line endings

--- StackExchange.Precompilation/PrecompiledViewEngine.cs
+++ StackExchange.Precompilation/PrecompiledViewEngine.cs
@@ -1,492 +1,517 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Web;
-using System.Web.Mvc;
-using System.Web.Routing;
-using System.Web.WebPages;
-
-namespace StackExchange.Precompilation
-{
-    /// <summary>
-    /// Supports loading of precompiled views.
-    /// </summary>
-    public class PrecompiledViewEngine : VirtualPathProviderViewEngine
-    {
-        private class PrecompiledVirtualPathFactory : IVirtualPathFactory
-        {
-            private Func<string, Type> PathLookup;
-            private IVirtualPathFactory Backup;
-
-            public PrecompiledVirtualPathFactory(Func<string, Type> pathLookup, IVirtualPathFactory backup)
-            {
-                PathLookup = pathLookup;
-                Backup = backup;
-            }
-
-            public object CreateInstance(string virtualPath)
-            {
-                var compiledType = PathLookup(virtualPath);
-                if (compiledType != null)
-                {
-                    return Activator.CreateInstance(compiledType);
-                }
-
-                return Backup.CreateInstance(virtualPath);
-            }
-
-            public bool Exists(string virtualPath)
-            {
-                if (PathLookup(virtualPath) != null) return true;
-
-                return Backup.Exists(virtualPath);
-            }
-        }
-
-        private class PrecompiledView : IView
-        {
-            private static readonly Action<WebViewPage, string> LayoutSetter;
-
-            static PrecompiledView()
-            {
-                var property = typeof(WebViewPage).GetProperty("OverridenLayoutPath", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
-                if (property == null)
-                {
-                    throw new Exception("Couldn't generate LayoutSetter, no OverridenLayoutPath property");
-                }
-
-                var setter = property.GetSetMethod(nonPublic: true);
-                if (setter == null)
-                {
-                    throw new Exception("Couldn't generate LayoutSetter, no OverridenLayoutPath setter");
-                }
-
-                LayoutSetter = (Action<WebViewPage, string>)Delegate.CreateDelegate(typeof(Action<WebViewPage, string>), setter, throwOnBindFailure: true);
-            }
-
-            private readonly string Path;
-            private readonly string MasterPath;
-            private readonly Type Compiled;
-            private readonly Func<WebViewPage, string, WebPageRenderingBase> StartPageGetter;
-            private readonly Func<string, Type> CompiledTypeLookup;
-            private readonly PrecompiledViewEngine ViewEngine;
-
-            public PrecompiledView(string path, string masterPath, Type compiled, Func<string, Type> compiledTypeLookup, Func<WebViewPage, string, WebPageRenderingBase> startPageGetter, PrecompiledViewEngine viewEngine)
-            {
-                Path = path;
-                MasterPath = masterPath;
-                Compiled = compiled;
-                CompiledTypeLookup = compiledTypeLookup;
-                StartPageGetter = startPageGetter;
-                ViewEngine = viewEngine;
-            }
-
-            private WebViewPage CreatePage(ViewContext viewContext, System.IO.TextWriter writer, out WebPageContext pageContext, out WebPageRenderingBase startPage)
-            {
-                var webViewPage = (WebViewPage)Activator.CreateInstance(Compiled);
-
-                if (!string.IsNullOrEmpty(MasterPath))
-                {
-                    LayoutSetter(webViewPage, MasterPath);
-                }
-
-                webViewPage.VirtualPath = Path;
-                webViewPage.ViewContext = viewContext;
-                webViewPage.ViewData = viewContext.ViewData;
-                webViewPage.InitHelpers();
-
-                pageContext = new WebPageContext(viewContext.HttpContext, webViewPage, null);
-
-                startPage = null;
-                if (StartPageGetter != null)
-                {
-                    startPage = StartPageGetter(webViewPage, "_ViewStart");
-                }
-
-                var asExecuting = webViewPage as WebPageExecutingBase;
-
-                if (asExecuting != null)
-                {
-                    asExecuting.VirtualPathFactory = new PrecompiledVirtualPathFactory(CompiledTypeLookup, asExecuting.VirtualPathFactory);
-                }
-
-                return webViewPage;
-            }
-
-            public void Render(ViewContext viewContext, System.IO.TextWriter writer)
-            {
-                using (ViewEngine.DoProfileStep("Render"))
-                {
-                    WebPageContext pageContext;
-                    WebPageRenderingBase startPage;
-                    var webViewPage = CreatePage(viewContext, writer, out pageContext, out startPage);
-
-                    var asExecuting = webViewPage as WebPageExecutingBase;
-
-                    if (asExecuting != null)
-                    {
-                        asExecuting.VirtualPathFactory = new PrecompiledVirtualPathFactory(CompiledTypeLookup, asExecuting.VirtualPathFactory);
-                    }
-
-                    using (ViewEngine.DoProfileStep("ExecutePageHierarchy"))
-                    {
-                        webViewPage.ExecutePageHierarchy(pageContext, writer, startPage);
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        /// Gets the view paths
-        /// </summary>
-        public IEnumerable<string> ViewPaths { get; private set; }
-
-        private readonly Dictionary<string, Type> _views;
-
-        /// <summary>
-        /// Triggers when the engine performs a step that can be profiled.
-        /// </summary>
-        public Func<string, IDisposable> ProfileStep { get; set; }
-
-        /// <summary>
-        /// Creates a new PrecompiledViewEngine instance, scanning all assemblies in <paramref name="findAssembliesInPath"/> for precompiled views.
-        /// Precompiled views are types deriving from <see cref="WebPageRenderingBase"/> decorated with a <see cref="CompiledFromFileAttribute" />
-        /// </summary>
-        /// <param name="findAssembliesInPath">The path to scan for assemblies with precompiled views.</param>
-        /// <remarks>
-        /// Use this constructor if you use aspnet_compiler.exe with it's targetDir parameter instead of StackExchange.Precompilation.Build.
-        /// </remarks>
-        public PrecompiledViewEngine(string findAssembliesInPath)
-            : this(FindViewAssemblies(findAssembliesInPath).ToArray())
-        {
-        }
-
-        /// <summary>
-        /// Creates a new PrecompiledViewEngine instance, scanning the provided <paramref name="assemblies"/> for precompiled views.
-        /// Precompiled views are types deriving from <see cref="WebPageRenderingBase"/> decorated with a <see cref="CompiledFromFileAttribute" />
-        /// </summary>
-        /// <param name="assemblies">The assemblies to scan for precompiled views.</param>
-        public PrecompiledViewEngine(params Assembly[] assemblies)
-        {
-            AreaViewLocationFormats = new[]
-            {
-                "~/Areas/{2}/Views/{1}/{0}.cshtml",
-                "~/Areas/{2}/Views/Shared/{0}.cshtml",
-            };
-            AreaMasterLocationFormats = new[]
-            {
-                "~/Areas/{2}/Views/{1}/{0}.cshtml",
-                "~/Areas/{2}/Views/Shared/{0}.cshtml",
-            };
-            AreaPartialViewLocationFormats = new[]
-            {
-                "~/Areas/{2}/Views/{1}/{0}.cshtml",
-                "~/Areas/{2}/Views/Shared/{0}.cshtml",
-            };
-            FileExtensions = new[]
-            {
-                "cshtml",
-            };
-            MasterLocationFormats = new[]
-            {
-                "~/Views/{1}/{0}.cshtml",
-                "~/Views/Shared/{0}.cshtml",
-            };
-            PartialViewLocationFormats = new[]
-            {
-                "~/Views/{1}/{0}.cshtml",
-                "~/Views/Shared/{0}.cshtml",
-            };
-            ViewLocationFormats = new[]
-            {
-                "~/Views/{1}/{0}.cshtml",
-                "~/Views/Shared/{0}.cshtml",
-            };
-
-            _views = new Dictionary<string, Type>(StringComparer.InvariantCultureIgnoreCase);
-
-            foreach (var asm in assemblies)
-            {
-                List<Type> viewTypes;
-                try
-                {
-                    viewTypes = asm.GetTypes().Where(t => typeof(WebPageRenderingBase).IsAssignableFrom(t)).ToList();
-                }
-                catch (Exception e)
-                {
-                    throw e;
-                }
-
-                foreach (var view in viewTypes)
-                {
-                    var attr = view.GetCustomAttribute<CompiledFromFileAttribute>();
-                    if (attr != null)
-                    {
-                        _views[MakeVirtualPath(attr.SourceFile)] = view;
-                    }
-                }
-            }
-
-            ViewPaths = _views.Keys.OrderBy(_ => _).ToList();
-        }
-
-        private IDisposable DoProfileStep(string name)
-        {
-            return ProfileStep?.Invoke(name);
-        }
-
-        private static string MakeVirtualPath(string absolutePath)
-        {
-            var firstArea = absolutePath.IndexOf(@"\Areas\");
-
-            if (firstArea != -1)
-            {
-                var tail = absolutePath.Substring(firstArea);
-                var vp = "~" + tail.Replace(@"\", "/");
-
-                return vp;
-            }
-            else
-            {
-                var firstView = absolutePath.IndexOf(@"\Views\");
-                if (firstView == -1) throw new Exception("Couldn't convert: " + absolutePath);
-
-                var tail = absolutePath.Substring(firstView);
-                var vp = "~" + tail.Replace(@"\", "/");
-
-                return vp;
-            }
-        }
-
-        private static List<Assembly> FindViewAssemblies(string dirPath)
-        {
-            var pendingDirs = new List<string>();
-            pendingDirs.Add(dirPath);
-
-            var ret = new List<Assembly>();
-
-            while (pendingDirs.Count > 0)
-            {
-                var dir = pendingDirs[0];
-                pendingDirs.RemoveAt(0);
-
-                pendingDirs.AddRange(Directory.EnumerateDirectories(dir));
-
-                var dlls = Directory.EnumerateFiles(dir, "*.dll").Where(w => Path.GetFileNameWithoutExtension(w).Contains("_Web_"));
-
-                foreach (var dll in dlls)
-                {
-                    try
-                    {
-                        var pdb = Path.Combine(Path.GetDirectoryName(dll), Path.GetFileNameWithoutExtension(dll) + ".pdb");
-
-                        var asmBytes = File.ReadAllBytes(dll);
-                        var pdbBytes = File.Exists(pdb) ? File.ReadAllBytes(pdb) : null;
-
-                        Assembly asm;
-
-                        if (pdbBytes == null)
-                        {
-                            asm = Assembly.Load(asmBytes);
-                        }
-                        else
-                        {
-                            asm = Assembly.Load(asmBytes, pdbBytes);
-                        }
-
-                        ret.Add(asm);
-
-                        Debug.WriteLine("Loading view assembly: " + dll);
-                    }
-                    catch (Exception) { }
-                }
-            }
-
-            return ret;
-        }
-
-        /// <inheritdoc />
-        protected override IView CreatePartialView(ControllerContext controllerContext, string partialPath) =>
-            CreateViewImpl(partialPath, masterPath: null, runViewStart: false);
-
-        /// <inheritdoc />
-        protected override IView CreateView(ControllerContext controllerContext, string viewPath, string masterPath) =>
-            CreateViewImpl(viewPath, masterPath, runViewStart: true);
-
-
-        private Type TryLookupCompiledType(string viewPath)
-        {
-            Type compiledView;
-            if (!_views.TryGetValue(viewPath, out compiledView))
-            {
-                return null;
-            }
-
-            return compiledView;
-        }
-
-        private PrecompiledView CreateViewImpl(string viewPath, string masterPath, bool runViewStart)
-        {
-            Type compiledView;
-            if (!_views.TryGetValue(viewPath, out compiledView))
-            {
-                return null;
-            }
-
-            return runViewStart
-                ? new PrecompiledView(viewPath, masterPath, compiledView, TryLookupCompiledType, GetStartPage, this)
-                : new PrecompiledView(viewPath, masterPath, compiledView, TryLookupCompiledType, null, this);
-        }
-
-        private WebPageRenderingBase GetStartPage(WebPageRenderingBase page, string fileName)
-        {
-            WebPageRenderingBase currentPage = page;
-            var pageDirectory = VirtualPathUtility.GetDirectory(page.VirtualPath);
-
-            while (!string.IsNullOrEmpty(pageDirectory) && pageDirectory != "/")
-            {
-                var virtualPath = VirtualPathUtility.Combine(pageDirectory, fileName + ".cshtml");
-
-                Type compiledType;
-                if (_views.TryGetValue(virtualPath, out compiledType))
-                {
-                    var parentStartPage = (StartPage)Activator.CreateInstance(compiledType);
-                    parentStartPage.VirtualPath = virtualPath;
-                    parentStartPage.ChildPage = currentPage;
-                    parentStartPage.VirtualPathFactory = page.VirtualPathFactory;
-                    currentPage = parentStartPage;
-
-                    break;
-                }
-
-                pageDirectory = VirtualPathUtility.GetDirectory(pageDirectory);
-            }
-
-            return currentPage;
-        }
-
-        /// <inheritdoc />
-        public override ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName, bool useCache)
-        {
-            if (controllerContext == null) throw new ArgumentNullException(nameof(controllerContext));
-            if (string.IsNullOrEmpty(partialViewName)) throw new ArgumentException("\"viewName\" argument cannot be null or empty.");
-
-            var controllerName = controllerContext.RouteData.GetRequiredString("controller");
-            var areaName = AreaHelpers.GetAreaName(controllerContext.RouteData);
-
-            var locationsSearched = new List<string>(
-                ((PartialViewLocationFormats?.Length ?? 0) +
-                (areaName != null ? AreaPartialViewLocationFormats?.Length ?? 0 : 0))
-            );
-
-            var viewPath = ResolveViewPath(partialViewName, controllerName, areaName, PartialViewLocationFormats, AreaPartialViewLocationFormats, locationsSearched);
-
-            return string.IsNullOrEmpty(viewPath)
-                ? new ViewEngineResult(locationsSearched)
-                : new ViewEngineResult(CreatePartialView(controllerContext, viewPath), this);
-        }
-
-        /// <inheritdoc />
-        public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache)
-        {
-            // All this madness is essentially re-written from the VirtualPathProviderViewEngine class, but that class
-            // checks on things like cache and whether the file exists and a whole bunch of stuff that's unnecessary.
-            // Plus: unecessary allocations :(
-
-            if (controllerContext == null) throw new ArgumentNullException(nameof(controllerContext));
-            if (string.IsNullOrEmpty(viewName)) throw new ArgumentException("\"viewName\" argument cannot be null or empty.");
-
-            var controllerName = controllerContext.RouteData.GetRequiredString("controller");
-            var areaName = AreaHelpers.GetAreaName(controllerContext.RouteData);
-
-            // minimize re-allocations of List
-            var locationsSearched = new List<string>(
-                ((ViewLocationFormats?.Length ?? 0) +
-                (areaName != null ? AreaViewLocationFormats?.Length ?? 0 : 0)) +
-                (MasterLocationFormats?.Length ?? 0) +
-                (areaName != null ? AreaMasterLocationFormats?.Length ?? 0 : 0)
-            );
-
-            var viewPath = ResolveViewPath(viewName, controllerName, areaName, ViewLocationFormats, AreaViewLocationFormats, locationsSearched);
-            var masterPath = ResolveViewPath(masterName, controllerName, areaName, MasterLocationFormats, AreaMasterLocationFormats, locationsSearched);
-
-            if (string.IsNullOrEmpty(viewPath) ||
-                (string.IsNullOrEmpty(masterPath) && !string.IsNullOrEmpty(masterName)))
-            {
-                return new ViewEngineResult(locationsSearched);
-            }
-
-            return new ViewEngineResult(CreateView(controllerContext, viewPath, masterPath), this);
-        }
-
-        private string ResolveViewPath(string viewName, string controllerName, string areaName, string[] viewLocationFormats, string[] areaViewLocationFormats, List<string> viewLocationsSearched)
-        {
-            if (IsSpecificPath(viewName))
-            {
-                var normalized = NormalizeViewName(viewName);
-                viewLocationsSearched.Add(viewName);
-                return _views.ContainsKey(normalized) ? normalized : null;
-            }
-
-            if (!string.IsNullOrEmpty(areaName) && areaViewLocationFormats != null)
-            {
-                foreach (var format in areaViewLocationFormats)
-                {
-                    var path = string.Format(format, viewName, controllerName, areaName);
-                    viewLocationsSearched.Add(path);
-                    if (_views.ContainsKey(path))
-                        return path;
-                }
-            }
-
-            if (viewLocationFormats == null)
-                return null;
-
-            foreach (var format in viewLocationFormats)
-            {
-                var path = string.Format(format, viewName, controllerName);
-                viewLocationsSearched.Add(path);
-                if (_views.ContainsKey(path))
-                    return path;
-            }
-
-            return null;
-        }
-
-        private static string NormalizeViewName(string viewName)
-        {
-            return viewName[0] == '/' ? ("~" + viewName) : viewName;
-        }
-
-        private static bool IsSpecificPath(string path) => path.Length > 0 && (path[0] == '~' || path[0] == '/');
-    }
-
-    // Hooray, another MVC5 class that should be public but ISN'T
-    internal static class AreaHelpers
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Web;
+using System.Web.Mvc;
+using System.Web.Routing;
+using System.Web.WebPages;
+
+namespace StackExchange.Precompilation
+{
+    /// <summary>
+    /// Supports loading of precompiled views.
+    /// </summary>
+    public class PrecompiledViewEngine : VirtualPathProviderViewEngine
     {
-        public static string GetAreaName(RouteBase route)
-        {
-            var routeWithArea = route as IRouteWithArea;
-            if (routeWithArea != null)
-                return routeWithArea.Area;
-
-            var castRoute = route as Route;
-            return castRoute?.DataTokens?["area"] as string;
-        }
-
-        public static string GetAreaName(RouteData routeData)
-        {
-            object area;
-            if (routeData.DataTokens.TryGetValue("area", out area))
-            {
-                return area as string;
-            }
-
-            return GetAreaName(routeData.Route);
-        }
-    }
-}
+        private class PrecompiledVirtualPathFactory : IVirtualPathFactory
+        {
+            private Func<string, Type> PathLookup;
+            private IVirtualPathFactory Backup;
+
+            public PrecompiledVirtualPathFactory(Func<string, Type> pathLookup, IVirtualPathFactory backup)
+            {
+                PathLookup = pathLookup;
+                Backup = backup;
+            }
+
+            public object CreateInstance(string virtualPath)
+            {
+                var compiledType = PathLookup(virtualPath);
+                if (compiledType != null)
+                {
+                    return Activator.CreateInstance(compiledType);
+                }
+
+                return Backup.CreateInstance(virtualPath);
+            }
+
+            public bool Exists(string virtualPath)
+            {
+                if (PathLookup(virtualPath) != null) return true;
+
+                return Backup.Exists(virtualPath);
+            }
+        }
+
+        private class PrecompiledView : IView
+        {
+            private static readonly Action<WebViewPage, string> LayoutSetter;
+
+            static PrecompiledView()
+            {
+                var property = typeof(WebViewPage).GetProperty("OverridenLayoutPath", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
+                if (property == null)
+                {
+                    throw new Exception("Couldn't generate LayoutSetter, no OverridenLayoutPath property");
+                }
+
+                var setter = property.GetSetMethod(nonPublic: true);
+                if (setter == null)
+                {
+                    throw new Exception("Couldn't generate LayoutSetter, no OverridenLayoutPath setter");
+                }
+
+                LayoutSetter = (Action<WebViewPage, string>)Delegate.CreateDelegate(typeof(Action<WebViewPage, string>), setter, throwOnBindFailure: true);
+            }
+
+            private readonly string Path;
+            private readonly string MasterPath;
+            private readonly Type Compiled;
+            private readonly Func<WebViewPage, string, WebPageRenderingBase> StartPageGetter;
+            private readonly Func<string, Type> CompiledTypeLookup;
+            private readonly PrecompiledViewEngine ViewEngine;
+
+            public PrecompiledView(string path, string masterPath, Type compiled, Func<string, Type> compiledTypeLookup, Func<WebViewPage, string, WebPageRenderingBase> startPageGetter, PrecompiledViewEngine viewEngine)
+            {
+                Path = path;
+                MasterPath = masterPath;
+                Compiled = compiled;
+                CompiledTypeLookup = compiledTypeLookup;
+                StartPageGetter = startPageGetter;
+                ViewEngine = viewEngine;
+            }
+
+            private WebViewPage CreatePage(ViewContext viewContext, System.IO.TextWriter writer, out WebPageContext pageContext, out WebPageRenderingBase startPage)
+            {
+                var webViewPage = (WebViewPage)Activator.CreateInstance(Compiled);
+
+                if (!string.IsNullOrEmpty(MasterPath))
+                {
+                    LayoutSetter(webViewPage, MasterPath);
+                }
+
+                webViewPage.VirtualPath = Path;
+                webViewPage.ViewContext = viewContext;
+                webViewPage.ViewData = viewContext.ViewData;
+                webViewPage.InitHelpers();
+
+                pageContext = new WebPageContext(viewContext.HttpContext, webViewPage, null);
+
+                startPage = null;
+                if (StartPageGetter != null)
+                {
+                    startPage = StartPageGetter(webViewPage, "_ViewStart");
+                }
+
+                var asExecuting = webViewPage as WebPageExecutingBase;
+
+                if (asExecuting != null)
+                {
+                    asExecuting.VirtualPathFactory = new PrecompiledVirtualPathFactory(CompiledTypeLookup, asExecuting.VirtualPathFactory);
+                }
+
+                return webViewPage;
+            }
+
+            public void Render(ViewContext viewContext, System.IO.TextWriter writer)
+            {
+                using (ViewEngine.DoProfileStep("Render"))
+                {
+                    WebPageContext pageContext;
+                    WebPageRenderingBase startPage;
+                    var webViewPage = CreatePage(viewContext, writer, out pageContext, out startPage);
+
+                    var asExecuting = webViewPage as WebPageExecutingBase;
+
+                    if (asExecuting != null)
+                    {
+                        asExecuting.VirtualPathFactory = new PrecompiledVirtualPathFactory(CompiledTypeLookup, asExecuting.VirtualPathFactory);
+                    }
+
+                    using (ViewEngine.DoProfileStep("ExecutePageHierarchy"))
+                    {
+                        webViewPage.ExecutePageHierarchy(pageContext, writer, startPage);
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// Gets the view paths
+        /// </summary>
+        public IEnumerable<string> ViewPaths { get; private set; }
+
+        private readonly Dictionary<string, Type> _views;
+
+        /// <summary>
+        /// Triggers when the engine performs a step that can be profiled.
+        /// </summary>
+        public Func<string, IDisposable> ProfileStep { get; set; }
+
+        /// <summary>
+        /// Creates a new PrecompiledViewEngine instance, scanning all assemblies in <paramref name="findAssembliesInPath"/> for precompiled views.
+        /// Precompiled views are types deriving from <see cref="WebPageRenderingBase"/> decorated with a <see cref="CompiledFromFileAttribute" />
+        /// </summary>
+        /// <param name="findAssembliesInPath">The path to scan for assemblies with precompiled views.</param>
+        /// <remarks>
+        /// Use this constructor if you use aspnet_compiler.exe with it's targetDir parameter instead of StackExchange.Precompilation.Build.
+        /// </remarks>
+        public PrecompiledViewEngine(string findAssembliesInPath)
+            : this(FindViewAssemblies(findAssembliesInPath).ToArray())
+        {
+        }
+
+        /// <summary>
+        /// Creates a new PrecompiledViewEngine instance, scanning the provided <paramref name="assemblies"/> for precompiled views.
+        /// Precompiled views are types deriving from <see cref="WebPageRenderingBase"/> decorated with a <see cref="CompiledFromFileAttribute" />
+        /// </summary>
+        /// <param name="assemblies">The assemblies to scan for precompiled views.</param>
+        public PrecompiledViewEngine(params Assembly[] assemblies)
+        {
+            AreaViewLocationFormats = new[]
+            {
+                "~/Areas/{2}/Views/{1}/{0}.cshtml",
+                "~/Areas/{2}/Views/Shared/{0}.cshtml",
+            };
+            AreaMasterLocationFormats = new[]
+            {
+                "~/Areas/{2}/Views/{1}/{0}.cshtml",
+                "~/Areas/{2}/Views/Shared/{0}.cshtml",
+            };
+            AreaPartialViewLocationFormats = new[]
+            {
+                "~/Areas/{2}/Views/{1}/{0}.cshtml",
+                "~/Areas/{2}/Views/Shared/{0}.cshtml",
+            };
+            FileExtensions = new[]
+            {
+                "cshtml",
+            };
+            MasterLocationFormats = new[]
+            {
+                "~/Views/{1}/{0}.cshtml",
+                "~/Views/Shared/{0}.cshtml",
+            };
+            PartialViewLocationFormats = new[]
+            {
+                "~/Views/{1}/{0}.cshtml",
+                "~/Views/Shared/{0}.cshtml",
+            };
+            ViewLocationFormats = new[]
+            {
+                "~/Views/{1}/{0}.cshtml",
+                "~/Views/Shared/{0}.cshtml",
+            };
+
+            _views = new Dictionary<string, Type>(StringComparer.InvariantCultureIgnoreCase);
+
+            foreach (var asm in assemblies)
+            {
+                List<Type> viewTypes;
+                try
+                {
+                    viewTypes = asm.GetTypes().Where(t => typeof(WebPageRenderingBase).IsAssignableFrom(t)).ToList();
+                }
+                catch (Exception e)
+                {
+                    throw e;
+                }
+
+                foreach (var view in viewTypes)
+                {
+                    var attr = view.GetCustomAttribute<CompiledFromFileAttribute>();
+                    if (attr != null)
+                    {
+                        _views[MakeVirtualPath(attr.SourceFile)] = view;
+                    }
+                }
+            }
+
+            ViewPaths = _views.Keys.OrderBy(_ => _).ToList();
+        }
+
+        private IDisposable DoProfileStep(string name)
+        {
+            return ProfileStep?.Invoke(name);
+        }
+
+        private static string MakeVirtualPath(string absolutePath)
+        {
+            var firstArea = absolutePath.IndexOf(@"\Areas\");
+
+            if (firstArea != -1)
+            {
+                var tail = absolutePath.Substring(firstArea);
+                var vp = "~" + tail.Replace(@"\", "/");
+
+                return vp;
+            }
+            else
+            {
+                var firstView = absolutePath.IndexOf(@"\Views\");
+                if (firstView == -1) throw new Exception("Couldn't convert: " + absolutePath);
+
+                var tail = absolutePath.Substring(firstView);
+                var vp = "~" + tail.Replace(@"\", "/");
+
+                return vp;
+            }
+        }
+
+        private static List<Assembly> FindViewAssemblies(string dirPath)
+        {
+            var pendingDirs = new List<string>();
+            pendingDirs.Add(dirPath);
+
+            var ret = new List<Assembly>();
+
+            while (pendingDirs.Count > 0)
+            {
+                var dir = pendingDirs[0];
+                pendingDirs.RemoveAt(0);
+
+                pendingDirs.AddRange(Directory.EnumerateDirectories(dir));
+
+                var dlls = Directory.EnumerateFiles(dir, "*.dll").Where(w => Path.GetFileNameWithoutExtension(w).Contains("_Web_"));
+
+                foreach (var dll in dlls)
+                {
+                    try
+                    {
+                        var pdb = Path.Combine(Path.GetDirectoryName(dll), Path.GetFileNameWithoutExtension(dll) + ".pdb");
+
+                        var asmBytes = File.ReadAllBytes(dll);
+                        var pdbBytes = File.Exists(pdb) ? File.ReadAllBytes(pdb) : null;
+
+                        Assembly asm;
+
+                        if (pdbBytes == null)
+                        {
+                            asm = Assembly.Load(asmBytes);
+                        }
+                        else
+                        {
+                            asm = Assembly.Load(asmBytes, pdbBytes);
+                        }
+
+                        ret.Add(asm);
+
+                        Debug.WriteLine("Loading view assembly: " + dll);
+                    }
+                    catch (Exception) { }
+                }
+            }
+
+            return ret;
+        }
+
+        /// <inheritdoc />
+        protected override IView CreatePartialView(ControllerContext controllerContext, string partialPath) =>
+            CreateViewImpl(partialPath, masterPath: null, runViewStart: false);
+
+        /// <inheritdoc />
+        protected override IView CreateView(ControllerContext controllerContext, string viewPath, string masterPath) =>
+            CreateViewImpl(viewPath, masterPath, runViewStart: true);
+
+
+        private Type TryLookupCompiledType(string viewPath)
+        {
+            Type compiledView;
+            if (!_views.TryGetValue(viewPath, out compiledView))
+            {
+                return null;
+            }
+
+            return compiledView;
+        }
+
+        private PrecompiledView CreateViewImpl(string viewPath, string masterPath, bool runViewStart)
+        {
+            Type compiledView;
+            if (!_views.TryGetValue(viewPath, out compiledView))
+            {
+                return null;
+            }
+
+            return runViewStart
+                ? new PrecompiledView(viewPath, masterPath, compiledView, TryLookupCompiledType, GetStartPage, this)
+                : new PrecompiledView(viewPath, masterPath, compiledView, TryLookupCompiledType, null, this);
+        }
+
+        private WebPageRenderingBase GetStartPage(WebPageRenderingBase page, string fileName)
+        {
+            WebPageRenderingBase currentPage = page;
+            var pageDirectory = VirtualPathUtility.GetDirectory(page.VirtualPath);
+
+            while (!string.IsNullOrEmpty(pageDirectory) && pageDirectory != "/")
+            {
+                var virtualPath = VirtualPathUtility.Combine(pageDirectory, fileName + ".cshtml");
+
+                Type compiledType;
+                if (_views.TryGetValue(virtualPath, out compiledType))
+                {
+                    var parentStartPage = (StartPage)Activator.CreateInstance(compiledType);
+                    parentStartPage.VirtualPath = virtualPath;
+                    parentStartPage.ChildPage = currentPage;
+                    parentStartPage.VirtualPathFactory = page.VirtualPathFactory;
+                    currentPage = parentStartPage;
+
+                    break;
+                }
+
+                pageDirectory = VirtualPathUtility.GetDirectory(pageDirectory);
+            }
+
+            return currentPage;
+        }
+
+        /// <inheritdoc />
+        public override ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName, bool useCache)
+        {
+            if (controllerContext == null) throw new ArgumentNullException(nameof(controllerContext));
+            if (string.IsNullOrEmpty(partialViewName)) throw new ArgumentException("\"viewName\" argument cannot be null or empty.");
+
+            var controllerName = controllerContext.RouteData.GetRequiredString("controller");
+            var areaName = AreaHelpers.GetAreaName(controllerContext.RouteData);
+
+            var locationsSearched = new List<string>(
+
+                ((PartialViewLocationFormats?.Length ?? 0) +
+
+                (areaName != null ? AreaPartialViewLocationFormats?.Length ?? 0 : 0))
+
+            );
+
+            var viewPath = ResolveViewPath(partialViewName, controllerName, areaName, PartialViewLocationFormats, AreaPartialViewLocationFormats, locationsSearched);
+
+            return string.IsNullOrEmpty(viewPath)
+                ? new ViewEngineResult(locationsSearched)
+                : new ViewEngineResult(CreatePartialView(controllerContext, viewPath), this);
+        }
+
+        /// <inheritdoc />
+        public override ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache)
+        {
+            // All this madness is essentially re-written from the VirtualPathProviderViewEngine class, but that class
+            // checks on things like cache and whether the file exists and a whole bunch of stuff that's unnecessary.
+            // Plus: unecessary allocations :(
+
+            if (controllerContext == null) throw new ArgumentNullException(nameof(controllerContext));
+            if (string.IsNullOrEmpty(viewName)) throw new ArgumentException("\"viewName\" argument cannot be null or empty.");
+
+            var controllerName = controllerContext.RouteData.GetRequiredString("controller");
+            var areaName = AreaHelpers.GetAreaName(controllerContext.RouteData);
+
+            // minimize re-allocations of List
+            var locationsSearched = new List<string>(
+
+                ((ViewLocationFormats?.Length ?? 0) +
+
+                (areaName != null ? AreaViewLocationFormats?.Length ?? 0 : 0)) +
+
+                (MasterLocationFormats?.Length ?? 0) +
+
+                (areaName != null ? AreaMasterLocationFormats?.Length ?? 0 : 0)
+
+            );
+
+            var viewPath = ResolveViewPath(viewName, controllerName, areaName, ViewLocationFormats, AreaViewLocationFormats, locationsSearched);
+            var masterPath = ResolveViewPath(masterName, controllerName, areaName, MasterLocationFormats, AreaMasterLocationFormats, locationsSearched);
+
+            if (string.IsNullOrEmpty(viewPath) ||
+                (string.IsNullOrEmpty(masterPath) && !string.IsNullOrEmpty(masterName)))
+            {
+                return new ViewEngineResult(locationsSearched);
+            }
+
+            return new ViewEngineResult(CreateView(controllerContext, viewPath, masterPath), this);
+        }
+
+        private string ResolveViewPath(string viewName, string controllerName, string areaName, string[] viewLocationFormats, string[] areaViewLocationFormats, List<string> viewLocationsSearched)
+        {
+            if (IsSpecificPath(viewName))
+            {
+                var normalized = NormalizeViewName(viewName);
+                viewLocationsSearched.Add(viewName);
+                return _views.ContainsKey(normalized) ? normalized : null;
+            }
+
+            if (!string.IsNullOrEmpty(areaName) && areaViewLocationFormats != null)
+            {
+                foreach (var format in areaViewLocationFormats)
+                {
+                    var path = string.Format(format, viewName, controllerName, areaName);
+                    viewLocationsSearched.Add(path);
+                    if (_views.ContainsKey(path))
+                        return path;
+                }
+            }
+
+            if (viewLocationFormats == null)
+
+                return null;
+
+            foreach (var format in viewLocationFormats)
+            {
+                var path = string.Format(format, viewName, controllerName);
+                viewLocationsSearched.Add(path);
+                if (_views.ContainsKey(path))
+                    return path;
+            }
+
+            return null;
+        }
+
+        private static string NormalizeViewName(string viewName)
+        {
+            return viewName[0] == '/' ? ("~" + viewName) : viewName;
+        }
+
+        private static bool IsSpecificPath(string path) => path.Length > 0 && (path[0] == '~' || path[0] == '/');
+    }
+
+    // Hooray, another MVC5 class that should be public but ISN'T
+    internal static class AreaHelpers
+
+    {
+
+        public static string GetAreaName(RouteBase route)
+
+        {
+
+            var routeWithArea = route as IRouteWithArea;
+            if (routeWithArea != null)
+                return routeWithArea.Area;
+
+            var castRoute = route as Route;
+            return castRoute?.DataTokens?["area"] as string;
+        }
+
+
+
+        public static string GetAreaName(RouteData routeData)
+
+        {
+
+            object area;
+
+            if (routeData.DataTokens.TryGetValue("area", out area))
+
+            {
+
+                return area as string;
+
+            }
+
+
+
+            return GetAreaName(routeData.Route);
+
+        }
+
+    }
+}


Creating Reaction Test exposition, more methods implemented.

--- StroopTest/Views/ReactionPages/FormReactExposition.cs
+++ StroopTest/Views/ReactionPages/FormReactExposition.cs
@@ -96,12 +96,38 @@
         {

             cancellationTokenSource = new CancellationTokenSource();
-            await showInstructions(programInUse, cancellationTokenSource.Token);
-
-            var interval = Task.Run(async delegate {await Task.Delay(programInUse.IntervalTime,
-                                                                      cancellationTokenSource.Token);});
-            var exposition = Task.Run(async delegate { await Task.Delay(programInUse.ExpositionTime,
-                                                                        cancellationTokenSource.Token); });
+            var interval = Task.Run(async delegate {
+                await Task.Delay(programInUse.IntervalTime,
+                                  cancellationTokenSource.Token);
+            });
+            var exposition = Task.Run(async delegate {
+                await Task.Delay(programInUse.ExpositionTime,
+                                 cancellationTokenSource.Token);
+            });
+            try
+            {
+                await showInstructions(programInUse, cancellationTokenSource.Token);
+                string printCount = "";
+                while (true)
+                {
+                    elapsedTime = 0; // elapsed time to zero
+                    //changeBackgroundColor(programInUse, true);
+                    await Task.Delay(programInUse.IntervalTime, cancellationTokenSource.Token);
+                    for (int counter = 0; counter < programInUse.NumExpositions; counter++)
+                    {
+                        await intervalTime();
+
+                        //preparing execution
+                        await drawSquareShape();
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message);
+            }
+
+
         }

         private async Task showInstructions(ReactionProgram program, CancellationToken token) // apresenta instruções
@@ -118,36 +144,81 @@
             }
         }

-
-        private void makingFixPoint()
-        {
+        private async Task intervalTime()
+        {
+            int intervalTime = 200; // minimal rnd interval time
+
+            // if random interval active, it will be a value between 200 and the defined interval time
+            if (programInUse.IntervalTimeRandom && programInUse.IntervalTime > 200)
+            {
+                Random random = new Random();
+                intervalTime = random.Next(200, programInUse.IntervalTime);
+            }
+            else
+            {
+                intervalTime = programInUse.IntervalTime;
+            }
+
+            // if there is no fixPoint determination, just wait intervalTime
+            if (programInUse.FixPoint != "+" && programInUse.FixPoint != "o")
+            {
+                await Task.Delay(intervalTime);
+            }
+            else // if it uses fixPoint
+            {
+                await makingFixPoint(intervalTime);
+            }
+
+        }
+
+        private async Task drawSquareShape()
+        {
+            int brush25 = 25;
             SolidBrush myBrush = new SolidBrush(ColorTranslator.FromHtml(programInUse.FixPointColor));
+            float[] clientMiddle = { (ClientSize.Width / 2), (ClientSize.Height / 2) };
+            Graphics formGraphicsEllipse = this.CreateGraphics();
+            float xEllipse = clientMiddle[0] - brush25 * programInUse.StimulusDistance / 10;
+            float yEllipse = clientMiddle[1] - brush25 * programInUse.StimulusDistance / 10;
+            float widthEllipse = 2 * brush25;
+            float heightEllipse = 2 * brush25;
+            formGraphicsEllipse.FillEllipse(myBrush, xEllipse, yEllipse, widthEllipse, heightEllipse);
+            await Task.Delay(programInUse.ExpositionTime, cancellationTokenSource.Token);
+            formGraphicsEllipse.Dispose();
+        }
+
+
+        private async Task makingFixPoint(int intervalTime)
+        {
+            SolidBrush myBrush = new SolidBrush(ColorTranslator.FromHtml(programInUse.FixPointColor));
+            float[] clientMiddle = { (ClientSize.Width / 2), (ClientSize.Height / 2) };
+            int brush25 = 25;
+            int brush4 = 4;

             switch (programInUse.FixPoint)
             {
                 case "+": // cross fixPoint
                     Graphics formGraphicsCross1 = this.CreateGraphics();
                     Graphics formGraphicsCross2 = this.CreateGraphics();
-                    float xCross1 = ClientSize.Width / 2 - 25;
-                    float yCross1 = ClientSize.Height / 2 - 4;
-                    float xCross2 = ClientSize.Width / 2 - 4;
-                    float yCross2 = ClientSize.Height / 2 - 25;
-                    float widthCross = 2 * 25;
-                    float heightCross = 2 * 4;
+                    float xCross1 = clientMiddle[0] - brush25;
+                    float yCross1 = clientMiddle[1] - brush4;
+                    float xCross2 = clientMiddle[0] - brush4;
+                    float yCross2 = clientMiddle[1] - brush25;
+                    float widthCross = 2 * brush25;
+                    float heightCross = 2 * brush4;
                     formGraphicsCross1.FillRectangle(myBrush, xCross1, yCross1, widthCross, heightCross);
                     formGraphicsCross2.FillRectangle(myBrush, xCross2, yCross2, heightCross, widthCross);
-   /////////////////////////// await Task.Delay(intervalTime);
+                    await Task.Delay(intervalTime);
                     formGraphicsCross1.Dispose();
                     formGraphicsCross2.Dispose();
                     break;
                 case "o": // circle fixPoint
                     Graphics formGraphicsEllipse = this.CreateGraphics();
-                    float xEllipse = ClientSize.Width / 2 - 25;
-                    float yEllipse = ClientSize.Height / 2 - 25;
-                    float widthEllipse = 2 * 25;
-                    float heightEllipse = 2 * 25;
+                    float xEllipse = clientMiddle[0] - brush25;
+                    float yEllipse = clientMiddle[1] - brush25;
+                    float widthEllipse = 2 * brush25;
+                    float heightEllipse = 2 * brush25;
                     formGraphicsEllipse.FillEllipse(myBrush, xEllipse, yEllipse, widthEllipse, heightEllipse);
-   //////////////////////  await Task.Delay(intervalTime);
+                    await Task.Delay(intervalTime);
                     formGraphicsEllipse.Dispose();
                     break;
             }


Avoiding to call Event and event

Avoiding to call Event and event

Because reasons

--- Tests/System/Linq/Expressions/ExpressionTest_Utils.cs
+++ Tests/System/Linq/Expressions/ExpressionTest_Utils.cs
@@ -208,14 +208,14 @@
             return arg;
         }

-        public delegate int TestDelegate(int i);
-
-        public event TestDelegate TestEvent;
+        public delegate int Delegate(int i);
+
+        public event Delegate OnTest;

         public void DoNothing()
         {
             // Just to avoid a compiler warning
-            if (TestEvent != null)
+            if (OnTest != null)
             {
                 return;
             }
@@ -266,7 +266,7 @@

         public static EventInfo GetEventInfo()
         {
-            return typeof(MemberClass).GetEvent("TestEvent");
+            return typeof(MemberClass).GetEvent("OnTest");
         }

         public static FieldInfo GetStaticFieldInfo()


Set client on token validation result for reference tokens

--- source/Core/Validation/TokenValidator.cs
+++ source/Core/Validation/TokenValidator.cs
@@ -242,6 +242,7 @@
             {
                 IsError = false,

+                Client = token.Client,
                 Claims = ReferenceTokenToClaims(token),
                 ReferenceToken = token,
                 ReferenceTokenId = tokenHandle


Update Canvas.cs

Update Canvas.cs

--- source/Cosmos.System2/Graphics/Canvas.cs
+++ source/Cosmos.System2/Graphics/Canvas.cs
@@ -939,12 +939,15 @@
         /// <exception cref="ArgumentOutOfRangeException">Thrown on fatal error.</exception>
         public void DrawImageAlpha(Image image, int x, int y)
         {
+            var _pen = new Pen(Color.White);
+
             for (int _x = 0; _x < image.Width; _x++)
             {
                 for (int _y = 0; _y < image.Height; _y++)
                 {
                     Global.mDebugger.SendInternal(image.rawData[_x + _y * image.Width]);
-                    DrawPoint(new Pen(Color.FromArgb(image.rawData[_x + _y * image.Width])), x + _x, y + _y);
+                    _pen.Color = (Color.FromArgb(image.rawData[_x + _y * image.Width]));
+                    DrawPoint(_pen, x + _x, y + _y);
                 }
             }
         }


Changes the value of the enumeration to the test

--- src/SerializerTest/TestHelper.cs
+++ src/SerializerTest/TestHelper.cs
@@ -18,7 +18,7 @@
                 Date = DateTime.UtcNow,
                 Sex = true,
                 Xuid = Guid.NewGuid(),
-                UserStatus = UserStatus.Pending,
+                UserStatus = UserStatus.Approved,
                 Lastip = new byte[] { 192, 168, 0, 254 },
                 Inner = new InnerFoo { InnerNumeric = 999.99912m }
             };


テストケース一時除外

テストケース一時除外

--- source/WinCap.Test/SettingsWindowTest.cs
+++ source/WinCap.Test/SettingsWindowTest.cs
@@ -66,7 +66,6 @@
         /// <summary>
         /// キャプチャ遅延時間のテスト。
         /// </summary>
-        [TestMethod]
         public void TestCaptureDelayTime()
         {
             var settingsWindow = App.ShowSettingsWindow();
@@ -95,7 +94,6 @@
         /// <summary>
         /// 全般タブの入力エラーテスト。
         /// </summary>
-        [TestMethod]
         [DataSource("System.Data.OleDB",
             @"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=Params.xlsx; Extended Properties='Excel 12.0;HDR=yes';",
             "TestGeneralError$",
@@ -130,7 +128,6 @@
         /// <summary>
         /// 出力タブの入力エラーテスト。
         /// </summary>
-        [TestMethod]
         [DataSource("System.Data.OleDB",
             @"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=Params.xlsx; Extended Properties='Excel 12.0;HDR=yes';",
             "TestOutputError$",
@@ -167,7 +164,6 @@
         /// <summary>
         /// ショートカットキータブの入力エラーテスト。
         /// </summary>
-        [TestMethod]
         [DataSource("System.Data.OleDB",
             @"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=Params.xlsx; Extended Properties='Excel 12.0;HDR=yes';",
             "TestShortcutKeyError$",


Update SessionEventArgs.cs

Update SessionEventArgs.cs

--- Titanium.Web.Proxy/EventArguments/SessionEventArgs.cs
+++ Titanium.Web.Proxy/EventArguments/SessionEventArgs.cs
@@ -405,7 +405,8 @@
         /// <param name="headers"></param>
         public async Task Ok(byte[] result, Dictionary<string, HttpHeader> headers)
         {
-            var response = new OkResponse();
+            var response = new OkResponse();
+
             if (headers != null && headers.Count > 0)
             {
                 response.ResponseHeaders = headers;
@@ -420,7 +421,7 @@

         public async Task GenericResponse(string html, HttpStatusCode status)
         {
-            await GenericResponse(html, null, status);
+            await GenericResponse(html, null, status);
         }

         public async Task GenericResponse(string html, Dictionary<string, HttpHeader> headers, HttpStatusCode status)
@@ -430,7 +431,7 @@
                 throw new Exception("You cannot call this function after request is made to server.");
             }

-            if (html == null)
+            if (html == null)
             {
                 html = string.Empty;
             }