Removed the Topic reference and replaced Color reference with IColor

git-svn-id: 16f658619b342a39b0afd2472f072a689916e5a2@387 6f2d7086-9719-0410-ba06-0b8292a297aa

--- Psycho/src/Core/Psycho.Core/Psycho.Style/Style.cs
+++ Psycho/src/Core/Psycho.Core/Psycho.Style/Style.cs
@@ -19,6 +19,8 @@
 //

 using System;
+using System.Xml;
+using System.Xml.Serialization;

 namespace Psycho.Core
 {
@@ -28,7 +30,7 @@
 		FrameShape frameShape;
 		ConnectionPoint connectionPoint;
 		ConnectionShape connectionShape;
-		Color fillColor, strokeColor;
+		IColor fillColor, strokeColor;
 		bool equalMargins;
 		int leftMargin, rightMargin, topMargin, bottomMargin;
 		int minMargin, maxMargin;
@@ -40,11 +42,6 @@
 		SubtopicLayout subtopicLayout;
 		TextAlignment textAlignment;

-		public Style (Topic topic)
-		{
-			this.Topic = topic;
-		}
-
 		public string Font
 		{
 			get { return font; }
@@ -69,13 +66,13 @@
 			set { connectionShape = value; }
 		}

-		public Color FillColor
+		public IColor FillColor
 		{
 			get { return fillColor; }
 			set { fillColor = value; }
 		}

-		public Color StrokeColor
+		public IColor StrokeColor
 		{
 			get { return strokeColor; }
 			set { strokeColor = value; }


WIP more tests on RDFStore

WIP more tests on RDFStore

--- RDFSharp.Test/Store/Engines/RDFMemoryStoreTest.cs
+++ RDFSharp.Test/Store/Engines/RDFMemoryStoreTest.cs
@@ -512,7 +512,18 @@
         }

         [TestMethod]
-        public void ShouldContainNotQuadruples()
+        public void ShouldContainQuadruplesAsSQLStore()
+        {
+            RDFMemoryStore store = new RDFMemoryStore();
+            store.AddQuadruple(new RDFQuadruple(new RDFContext("ex:ctx1"), new RDFResource("ex:subj"), new RDFResource("ex:pred"), new RDFPlainLiteral("ex:obj")));
+            store.AddQuadruple(new RDFQuadruple(new RDFContext("ex:ctx2"), new RDFResource("ex:subj"), new RDFResource("ex:pred"), new RDFResource("ex:obj")));
+
+            Assert.IsTrue(((RDFStore)store).ContainsQuadruple(new RDFQuadruple(new RDFContext("ex:ctx1"), new RDFResource("ex:subj"), new RDFResource("ex:pred"), new RDFPlainLiteral("ex:obj"))));
+            Assert.IsTrue(((RDFStore)store).ContainsQuadruple(new RDFQuadruple(new RDFContext("ex:ctx2"), new RDFResource("ex:subj"), new RDFResource("ex:pred"), new RDFResource("ex:obj"))));
+        }
+
+        [TestMethod]
+        public void ShouldNotContainQuadruples()
         {
             RDFMemoryStore store = new RDFMemoryStore();
             store.AddQuadruple(new RDFQuadruple(new RDFContext("ex:ctx1"), new RDFResource("ex:subj"), new RDFResource("ex:pred"), new RDFPlainLiteral("ex:obj")));
@@ -520,6 +531,17 @@

             Assert.IsFalse(store.ContainsQuadruple(new RDFQuadruple(new RDFContext("ex:ctx3"), new RDFResource("ex:subj"), new RDFResource("ex:pred"), new RDFPlainLiteral("ex:obj"))));
             Assert.IsFalse(store.ContainsQuadruple(null));
+        }
+
+        [TestMethod]
+        public void ShouldNotContainQuadruplesAsSQLStore()
+        {
+            RDFMemoryStore store = new RDFMemoryStore();
+            store.AddQuadruple(new RDFQuadruple(new RDFContext("ex:ctx1"), new RDFResource("ex:subj"), new RDFResource("ex:pred"), new RDFPlainLiteral("ex:obj")));
+            store.AddQuadruple(new RDFQuadruple(new RDFContext("ex:ctx2"), new RDFResource("ex:subj"), new RDFResource("ex:pred"), new RDFResource("ex:obj")));
+
+            Assert.IsFalse(((RDFStore)store).ContainsQuadruple(new RDFQuadruple(new RDFContext("ex:ctx3"), new RDFResource("ex:subj"), new RDFResource("ex:pred"), new RDFPlainLiteral("ex:obj"))));
+            Assert.IsFalse(((RDFStore)store).ContainsQuadruple(null));
         }

         [TestMethod]


- moved start worker to after bus started

--- Shuttle.Esb/Pipeline/Pipelines/StartupPipeline.cs
+++ Shuttle.Esb/Pipeline/Pipelines/StartupPipeline.cs
@@ -34,12 +34,12 @@
 				.WithEvent<OnStartOutboxProcessing>()
 				.WithEvent<OnAfterStartOutboxProcessing>()
 				.WithEvent<OnStartDeferredMessageProcessing>()
-				.WithEvent<OnAfterStartDeferredMessageProcessing>()
-				.WithEvent<OnStartWorker>()
-				.WithEvent<OnAfterStartWorker>();
+				.WithEvent<OnAfterStartDeferredMessageProcessing>();

 			RegisterStage("Final")
-				.WithEvent<OnStarted>();
+				.WithEvent<OnStarted>()
+			    .WithEvent<OnStartWorker>()
+			    .WithEvent<OnAfterStartWorker>();
 		}
     }
 }


add FluentInclude WithExpressionTo

add FluentInclude WithExpressionTo

--- Signum.Engine/DynamicQuery/DynamicQueryManager.cs
+++ Signum.Engine/DynamicQuery/DynamicQueryManager.cs
@@ -434,17 +434,57 @@
         }

         /// <summary>
-        /// Uses NicePluralName as niceName
+        /// Uses NiceName as niceName
         /// </summary>
         public static FluentInclude<T> WithExpressionFrom<T, F>(this FluentInclude<T> fi, DynamicQueryManager dqm, Expression<Func<F, T>> lambdaToMethodOrProperty)
             where T : Entity
         {
-            dqm.RegisterExpression(lambdaToMethodOrProperty, () => typeof(T).NicePluralName());
+            dqm.RegisterExpression(lambdaToMethodOrProperty, () => typeof(T).NiceName());
             return fi;
         }

         public static FluentInclude<T> WithExpressionFrom<T, F>(this FluentInclude<T> fi, DynamicQueryManager dqm, Expression<Func<F, T>> lambdaToMethodOrProperty, Func<string> niceName)
             where T : Entity
+        {
+            dqm.RegisterExpression(lambdaToMethodOrProperty, niceName);
+            return fi;
+        }
+
+        /// <summary>
+        /// Prefer WithExpressionFrom to keep dependencies between modules clean!. Uses NicePluralName as niceName.
+        /// </summary>
+        public static FluentInclude<F> WithExpressionTo<F, T>(this FluentInclude<F> fi, DynamicQueryManager dqm, Expression<Func<F, IQueryable<T>>> lambdaToMethodOrProperty)
+            where F : Entity
+        {
+            dqm.RegisterExpression(lambdaToMethodOrProperty, () => typeof(T).NicePluralName());
+            return fi;
+        }
+
+        /// <summary>
+        /// Prefer WithExpressionFrom to keep dependencies between modules clean!.
+        /// </summary>
+        public static FluentInclude<F> WithExpressionTo<F, T>(this FluentInclude<F> fi, DynamicQueryManager dqm, Expression<Func<F, IQueryable<T>>> lambdaToMethodOrProperty, Func<string> niceName)
+            where F : Entity
+        {
+            dqm.RegisterExpression(lambdaToMethodOrProperty, niceName);
+            return fi;
+        }
+
+        /// <summary>
+        /// Prefer WithExpressionFrom to keep dependencies between modules clean!. Uses NiceName as niceName.
+        /// </summary>
+        public static FluentInclude<F> WithExpressionTo<F, T>(this FluentInclude<F> fi, DynamicQueryManager dqm, Expression<Func<F, T>> lambdaToMethodOrProperty)
+             where F : Entity
+        {
+            dqm.RegisterExpression(lambdaToMethodOrProperty, () => typeof(T).NiceName());
+            return fi;
+        }
+
+        /// <summary>
+        /// Prefer WithExpressionFrom to keep dependencies between modules clean!.
+        /// </summary>
+        public static FluentInclude<F> WithExpressionTo<F, T>(this FluentInclude<F> fi, DynamicQueryManager dqm, Expression<Func<F, T>> lambdaToMethodOrProperty, Func<string> niceName)
+            where F : Entity
         {
             dqm.RegisterExpression(lambdaToMethodOrProperty, niceName);
             return fi;


Switch PK[L] Arenas location to database (#3798)

--- Source/ACE.Server/WorldObjects/Player_Location.cs
+++ Source/ACE.Server/WorldObjects/Player_Location.cs
@@ -452,11 +452,11 @@

         private static List<Position> pkArenaLocs = new List<Position>()
         {
-            new Position(0x00660117, new Vector3(30, -50, 0.005f), new Quaternion(0, 0, 0, 1)),
-            new Position(0x00660106, new Vector3(10, 0, 0.005f), new Quaternion(0, 0, -0.947071f, 0.321023f)),
-            new Position(0x00660103, new Vector3(0, -30, 0.005f), new Quaternion(0, 0, -0.699713f, 0.714424f)),
-            new Position(0x0066011E, new Vector3(50, 0, 0.005f), new Quaternion(0, 0, -0.961021f, -0.276474f)),
-            new Position(0x00660127, new Vector3(60, -30, 0.005f), new Quaternion(0, 0, 0.681639f, 0.731689f)),
+            new Position(DatabaseManager.World.GetCachedWeenie("portalpkarenanew1").GetPosition(PositionType.Destination)),
+            new Position(DatabaseManager.World.GetCachedWeenie("portalpkarenanew2").GetPosition(PositionType.Destination)),
+            new Position(DatabaseManager.World.GetCachedWeenie("portalpkarenanew3").GetPosition(PositionType.Destination)),
+            new Position(DatabaseManager.World.GetCachedWeenie("portalpkarenanew4").GetPosition(PositionType.Destination)),
+            new Position(DatabaseManager.World.GetCachedWeenie("portalpkarenanew5").GetPosition(PositionType.Destination)),
         };

         public void HandleActionTeleToPkArena()
@@ -530,11 +530,11 @@

         private static List<Position> pklArenaLocs = new List<Position>()
         {
-            new Position(0x00670117, new Vector3(30, -50, 0.005f), new Quaternion(0, 0, 0, 1)),
-            new Position(0x00670106, new Vector3(10, 0, 0.005f), new Quaternion(0, 0, -0.947071f, 0.321023f)),
-            new Position(0x00670103, new Vector3(0, -30, 0.005f), new Quaternion(0, 0, -0.699713f, 0.714424f)),
-            new Position(0x0067011E, new Vector3(50, 0, 0.005f), new Quaternion(0, 0, -0.961021f, -0.276474f)),
-            new Position(0x00670127, new Vector3(60, -30, 0.005f), new Quaternion(0, 0, 0.681639f, 0.731689f)),
+            new Position(DatabaseManager.World.GetCachedWeenie("portalpklarenanew1").GetPosition(PositionType.Destination)),
+            new Position(DatabaseManager.World.GetCachedWeenie("portalpklarenanew2").GetPosition(PositionType.Destination)),
+            new Position(DatabaseManager.World.GetCachedWeenie("portalpklarenanew3").GetPosition(PositionType.Destination)),
+            new Position(DatabaseManager.World.GetCachedWeenie("portalpklarenanew4").GetPosition(PositionType.Destination)),
+            new Position(DatabaseManager.World.GetCachedWeenie("portalpklarenanew5").GetPosition(PositionType.Destination)),
         };

         public void HandleActionTeleToPklArena()


[Taxonomy] Made the GetTermSetFromGroup method public and non-static.  Ran stylecop.

--- Source/GSoft.Dynamite/Taxonomy/TaxonomyService.cs
+++ Source/GSoft.Dynamite/Taxonomy/TaxonomyService.cs
@@ -20,14 +20,14 @@
     {
         private ILogger log;
         private ISiteTaxonomyCacheManager taxManager;
-
         private int taxCreationCount = 0;
         private Guid requestIdentifier = Guid.NewGuid();

         /// <summary>
-        /// Initializes a new instance of the <see cref="TaxonomyService"/> class.
+        /// Initializes a new instance of the <see cref="TaxonomyService" /> class.
         /// </summary>
         /// <param name="logger">The logger.</param>
+        /// <param name="taxManager">The taxonomy manager.</param>
         public TaxonomyService(ILogger logger, ISiteTaxonomyCacheManager taxManager)
         {
             this.log = logger;
@@ -87,7 +87,7 @@
             SiteTaxonomyCache taxCache = this.taxManager.GetSiteTaxonomyCache(site, null);
             TermStore termStore = taxCache.TaxonomySession.DefaultSiteCollectionTermStore;
             Group siteCollectionGroup = taxCache.SiteCollectionGroup;
-            TermSet termSet = GetTermSetFromGroup(termStore, siteCollectionGroup, termSetName);
+            TermSet termSet = this.GetTermSetFromGroup(termStore, siteCollectionGroup, termSetName);

             return GetTaxonomyValueForLabelInternal(termStore, siteCollectionGroup, termSet, termLabel);
         }
@@ -145,7 +145,7 @@
             SiteTaxonomyCache taxCache = this.taxManager.GetSiteTaxonomyCache(site, null);
             TermStore termStore = taxCache.TaxonomySession.DefaultSiteCollectionTermStore;
             Group siteCollectionGroup = taxCache.SiteCollectionGroup;
-            TermSet termSet = GetTermSetFromGroup(termStore, siteCollectionGroup, termSetName);
+            TermSet termSet = this.GetTermSetFromGroup(termStore, siteCollectionGroup, termSetName);

             return GetTermForLabelInternal(termStore, siteCollectionGroup, termSet, termLabel);
         }
@@ -158,7 +158,7 @@
         /// <returns>The term</returns>
         public Term GetTermForId(SPSite site, Guid id)
         {
-            return GetTermForId(site, null, id);
+            return this.GetTermForId(site, null, id);
         }

         /// <summary>
@@ -227,7 +227,7 @@
             SiteTaxonomyCache taxCache = this.taxManager.GetSiteTaxonomyCache(site, null);
             TermStore termStore = taxCache.TaxonomySession.DefaultSiteCollectionTermStore;
             Group siteCollectionGroup = taxCache.SiteCollectionGroup;
-            TermSet termSet = GetTermSetFromGroup(termStore, siteCollectionGroup, termSetName);
+            TermSet termSet = this.GetTermSetFromGroup(termStore, siteCollectionGroup, termSetName);

             return GetTaxonomyValuesForLabelInternal(termStore, siteCollectionGroup, termSet, termLabel);
         }
@@ -282,7 +282,7 @@
             SiteTaxonomyCache taxCache = this.taxManager.GetSiteTaxonomyCache(site, null);
             TermStore termStore = taxCache.TaxonomySession.DefaultSiteCollectionTermStore;
             Group siteCollectionGroup = taxCache.SiteCollectionGroup;
-            TermSet termSet = GetTermSetFromGroup(termStore, siteCollectionGroup, termSetName);
+            TermSet termSet = this.GetTermSetFromGroup(termStore, siteCollectionGroup, termSetName);

             return GetTaxonomyValuesForTermSetInternal(termStore, siteCollectionGroup, termSet);
         }
@@ -341,7 +341,7 @@
             SiteTaxonomyCache taxCache = this.taxManager.GetSiteTaxonomyCache(site, null);
             TermStore termStore = taxCache.TaxonomySession.DefaultSiteCollectionTermStore;
             Group siteCollectionGroup = taxCache.SiteCollectionGroup;
-            TermSet termSet = GetTermSetFromGroup(termStore, siteCollectionGroup, termSetName);
+            TermSet termSet = this.GetTermSetFromGroup(termStore, siteCollectionGroup, termSetName);

             return GetTermsForLabelInternal(termStore, siteCollectionGroup, termSet, termLabel);
         }
@@ -396,22 +396,40 @@
             SiteTaxonomyCache taxCache = this.taxManager.GetSiteTaxonomyCache(site, null);
             TermStore termStore = taxCache.TaxonomySession.DefaultSiteCollectionTermStore;
             Group siteCollectionGroup = taxCache.SiteCollectionGroup;
-            TermSet termSet = GetTermSetFromGroup(termStore, siteCollectionGroup, termSetName);
+            TermSet termSet = this.GetTermSetFromGroup(termStore, siteCollectionGroup, termSetName);

             return GetTermsForTermSetInternal(termStore, siteCollectionGroup, termSet);
         }

+        /// <summary>
+        /// Gets the term set from group.
+        /// </summary>
+        /// <param name="termStore">The term store.</param>
+        /// <param name="group">The group.</param>
+        /// <param name="termSetName">Name of the term set.</param>
+        /// <returns>The term set for the specified store, group and term set name.</returns>
+        /// <exception cref="System.ArgumentException">Could not find term set with name  + termSetName +  in group  + group.Name</exception>
+        public TermSet GetTermSetFromGroup(TermStore termStore, Group group, string termSetName)
+        {
+            // Always interact with the term sets in the term store's default language
+            int originalWorkingLanguage = termStore.WorkingLanguage;
+            termStore.WorkingLanguage = termStore.DefaultLanguage;
+
+            TermSet termSet = group.TermSets[termSetName];
+
+            if (termSet == null)
+            {
+                throw new ArgumentException("Could not find term set with name " + termSetName + " in group " + group.Name);
+            }
+
+            termStore.WorkingLanguage = originalWorkingLanguage;
+
+            return termSet;
+        }
+
         #endregion

         #region Private utility methods
-
-        private static TaxonomyValue GetTaxonomyValueForLabelInternal(TermStore termStore, string termStoreGroupName, string termSetName, string termLabel)
-        {
-            Group termStoreGroup = GetGroupFromTermStore(termStore, termStoreGroupName);
-            TermSet termSet = GetTermSetFromGroup(termStore, termStoreGroup, termSetName);
-
-            return GetTaxonomyValueForLabelInternal(termStore, termStoreGroup, termSet, termLabel);
-        }

         private static TaxonomyValue GetTaxonomyValueForLabelInternal(TermStore termStore, Group termStoreGroup, TermSet termSet, string termLabel)
         {
@@ -426,14 +444,6 @@
             return value;
         }

-        private static Term GetTermForLabelInternal(TermStore termStore, string termStoreGroupName, string termSetName, string termLabel)
-        {
-            Group termStoreGroup = GetGroupFromTermStore(termStore, termStoreGroupName);
-            TermSet termSet = GetTermSetFromGroup(termStore, termStoreGroup, termSetName);
-
-            return GetTermForLabelInternal(termStore, termStoreGroup, termSet, termLabel);
-        }
-
         private static Term GetTermForLabelInternal(TermStore termStore, Group termStoreGroup, TermSet termSet, string termLabel)
         {
             Term term = null;
@@ -454,28 +464,12 @@
             return term;
         }

-        private static IList<TaxonomyValue> GetTaxonomyValuesForLabelInternal(TermStore termStore, string termStoreGroupName, string termSetName, string termLabel)
-        {
-            Group termStoreGroup = GetGroupFromTermStore(termStore, termStoreGroupName);
-            TermSet termSet = GetTermSetFromGroup(termStore, termStoreGroup, termSetName);
-
-            return GetTaxonomyValuesForLabelInternal(termStore, termStoreGroup, termSet, termLabel);
-        }
-
         private static IList<TaxonomyValue> GetTaxonomyValuesForLabelInternal(TermStore termStore, Group termStoreGroup, TermSet termSet, string termLabel)
         {
             IList<Term> terms = GetTermsForLabelInternal(termStore, termStoreGroup, termSet, termLabel);
             return terms.Select(term => new TaxonomyValue(term)).ToList();
         }

-        private static IList<TaxonomyValue> GetTaxonomyValuesForTermSetInternal(TermStore termStore, string termStoreGroupName, string termSetName)
-        {
-            Group termStoreGroup = GetGroupFromTermStore(termStore, termStoreGroupName);
-            TermSet termSet = GetTermSetFromGroup(termStore, termStoreGroup, termSetName);
-
-            return GetTaxonomyValuesForTermSetInternal(termStore, termStoreGroup, termSet);
-        }
-
         private static IList<TaxonomyValue> GetTaxonomyValuesForTermSetInternal(TermStore termStore, Group termStoreGroup, TermSet termSet)
         {
             IList<TaxonomyValue> termsList = new List<TaxonomyValue>();
@@ -489,34 +483,6 @@
             return termsList;
         }

-        private static IList<Term> GetTermsForLabelInternal(TermStore termStore, string termStoreGroupName, string termSetName, string termLabel)
-        {
-            if (termStore == null)
-            {
-                throw new ArgumentNullException("termStore");
-            }
-
-            if (string.IsNullOrEmpty(termStoreGroupName))
-            {
-                throw new ArgumentNullException("termStoreGroupName");
-            }
-
-            if (string.IsNullOrEmpty(termSetName))
-            {
-                throw new ArgumentNullException("termSetName");
-            }
-
-            if (string.IsNullOrEmpty(termLabel))
-            {
-                throw new ArgumentNullException("termLabel");
-            }
-
-            Group group = GetGroupFromTermStore(termStore, termStoreGroupName);
-            TermSet termSet = GetTermSetFromGroup(termStore, group, termSetName);
-
-            return GetTermsForLabelInternal(termStore, group, termSet, termLabel);
-        }
-
         private static IList<Term> GetTermsForLabelInternal(TermStore termStore, Group termStoreGroup, TermSet termSet, string termLabel)
         {
             if (termStore == null)
@@ -544,31 +510,6 @@
             {
                 return term.Labels.Any(label => label.Value == termLabel);
             }).ToList();
-        }
-
-        private static IList<Term> GetTermsForTermSetInternal(TermStore termStore, string termStoreGroupName, string termSetName)
-        {
-            if (termStore == null)
-            {
-                throw new ArgumentNullException("termStore");
-            }
-
-            if (string.IsNullOrEmpty(termStoreGroupName))
-            {
-                throw new ArgumentNullException("termStoreGroupName");
-            }
-
-            if (string.IsNullOrEmpty(termSetName))
-            {
-                throw new ArgumentNullException("termSetName");
-            }
-
-            IList<Term> termsList = new List<Term>();
-
-            Group group = GetGroupFromTermStore(termStore, termStoreGroupName);
-            TermSet termSet = GetTermSetFromGroup(termStore, group, termSetName);
-
-            return GetTermsForTermSetInternal(termStore, group, termSet);
         }

         private static IList<Term> GetTermsForTermSetInternal(TermStore termStore, Group termStoreGroup, TermSet termSet)
@@ -634,22 +575,89 @@
             return group;
         }

-        private static TermSet GetTermSetFromGroup(TermStore termStore, Group group, string termSetName)
-        {
-            // Always interact with the term sets in the term store's default language
-            int originalWorkingLanguage = termStore.WorkingLanguage;
-            termStore.WorkingLanguage = termStore.DefaultLanguage;
-
-            TermSet termSet = group.TermSets[termSetName];
-
-            if (termSet == null)
-            {
-                throw new ArgumentException("Could not find term set with name " + termSetName + " in group " + group.Name);
-            }
-
-            termStore.WorkingLanguage = originalWorkingLanguage;
-
-            return termSet;
+        private TaxonomyValue GetTaxonomyValueForLabelInternal(TermStore termStore, string termStoreGroupName, string termSetName, string termLabel)
+        {
+            Group termStoreGroup = GetGroupFromTermStore(termStore, termStoreGroupName);
+            TermSet termSet = this.GetTermSetFromGroup(termStore, termStoreGroup, termSetName);
+
+            return GetTaxonomyValueForLabelInternal(termStore, termStoreGroup, termSet, termLabel);
+        }
+
+        private Term GetTermForLabelInternal(TermStore termStore, string termStoreGroupName, string termSetName, string termLabel)
+        {
+            Group termStoreGroup = GetGroupFromTermStore(termStore, termStoreGroupName);
+            TermSet termSet = this.GetTermSetFromGroup(termStore, termStoreGroup, termSetName);
+
+            return GetTermForLabelInternal(termStore, termStoreGroup, termSet, termLabel);
+        }
+
+        private IList<TaxonomyValue> GetTaxonomyValuesForLabelInternal(TermStore termStore, string termStoreGroupName, string termSetName, string termLabel)
+        {
+            Group termStoreGroup = GetGroupFromTermStore(termStore, termStoreGroupName);
+            TermSet termSet = this.GetTermSetFromGroup(termStore, termStoreGroup, termSetName);
+
+            return GetTaxonomyValuesForLabelInternal(termStore, termStoreGroup, termSet, termLabel);
+        }
+
+        private IList<TaxonomyValue> GetTaxonomyValuesForTermSetInternal(TermStore termStore, string termStoreGroupName, string termSetName)
+        {
+            Group termStoreGroup = GetGroupFromTermStore(termStore, termStoreGroupName);
+            TermSet termSet = this.GetTermSetFromGroup(termStore, termStoreGroup, termSetName);
+
+            return GetTaxonomyValuesForTermSetInternal(termStore, termStoreGroup, termSet);
+        }
+
+        private IList<Term> GetTermsForLabelInternal(TermStore termStore, string termStoreGroupName, string termSetName, string termLabel)
+        {
+            if (termStore == null)
+            {
+                throw new ArgumentNullException("termStore");
+            }
+
+            if (string.IsNullOrEmpty(termStoreGroupName))
+            {
+                throw new ArgumentNullException("termStoreGroupName");
+            }
+
+            if (string.IsNullOrEmpty(termSetName))
+            {
+                throw new ArgumentNullException("termSetName");
+            }
+
+            if (string.IsNullOrEmpty(termLabel))
+            {
+                throw new ArgumentNullException("termLabel");
+            }
+
+            Group group = GetGroupFromTermStore(termStore, termStoreGroupName);
+            TermSet termSet = this.GetTermSetFromGroup(termStore, group, termSetName);
+
+            return GetTermsForLabelInternal(termStore, group, termSet, termLabel);
+        }
+
+        private IList<Term> GetTermsForTermSetInternal(TermStore termStore, string termStoreGroupName, string termSetName)
+        {
+            if (termStore == null)
+            {
+                throw new ArgumentNullException("termStore");
+            }
+
+            if (string.IsNullOrEmpty(termStoreGroupName))
+            {
+                throw new ArgumentNullException("termStoreGroupName");
+            }
+
+            if (string.IsNullOrEmpty(termSetName))
+            {
+                throw new ArgumentNullException("termSetName");
+            }
+
+            IList<Term> termsList = new List<Term>();
+
+            Group group = GetGroupFromTermStore(termStore, termStoreGroupName);
+            TermSet termSet = this.GetTermSetFromGroup(termStore, group, termSetName);
+
+            return GetTermsForTermSetInternal(termStore, group, termSet);
         }

         #endregion


Added comments and moved search logic into separate Function for use in overrides

--- Source/Libraries/GSF.Web/Model/ModelController.cs
+++ Source/Libraries/GSF.Web/Model/ModelController.cs
@@ -494,44 +494,236 @@

             try
             {
-
-                string whereClause = BuildWhereClause(postData.Searches);
-
-                using (AdoDataConnection connection = new AdoDataConnection(Connection))
-                {
-                    string tableName = TableOperations<T>.GetTableName();
-
-                    string sql = "";
-
-                    if (SearchSettings == null && CustomView == String.Empty)
-                        sql = $@" SELECT * FROM {tableName} {whereClause}
+                DataTable table = GetSearchResults(postData);
+                return Ok(JsonConvert.SerializeObject(table));
+            }
+            catch (Exception ex)
+            {
+                return InternalServerError(ex);
+            }
+        }
+        #endregion
+
+        #region [Helper Methods]
+
+        protected string BuildWhereClause(IEnumerable<Search> searches)
+        {
+
+            string whereClause = string.Join(" AND ", searches.Select(search => {
+                if (search.SearchText == string.Empty) search.SearchText = "%";
+                else search.SearchText = search.SearchText.Replace("*", "%");
+
+                if (search.Type == "string" || search.Type == "datetime")
+                    search.SearchText = $"'{search.SearchText}'";
+                else if (Array.IndexOf(new[] { "integer", "number", "boolean" }, search.Type) < 0)
+                {
+                    string text = search.SearchText.Replace("(", "").Replace(")", "");
+                    List<string> things = text.Split(',').ToList();
+                    things = things.Select(t => $"'{t}'").ToList();
+                    search.SearchText = $"({string.Join(",", things)})";
+                }
+
+                return $"[{(search.isPivotColumn ? "AFV_" : "") + search.FieldName}] {search.Operator} {search.SearchText}";
+            }));
+
+            if (searches.Any())
+                whereClause = "WHERE \n" + whereClause;
+
+            return whereClause;
+        }
+
+        private IEnumerable<T> QueryRecordsWhere(string filterExpression, params object[] parameters)
+        {
+            using (AdoDataConnection connection = new AdoDataConnection(Connection))
+            {
+                if (CustomView == String.Empty)
+                {
+                    if(Take == null)
+                        return new TableOperations<T>(connection).QueryRecords(DefaultSort, new RecordRestriction(filterExpression, parameters));
+                    else
+                        return new TableOperations<T>(connection).QueryRecords(DefaultSort, new RecordRestriction(filterExpression, parameters)).Take((int)Take);
+
+                }
+                string sql = $@"
+                    SELECT * FROM
+                    ({CustomView}) T1
+                    WHERE {filterExpression}
+                    {(DefaultSort != null ? " ORDER BY " +DefaultSort : "")}";
+                DataTable dataTbl = connection.RetrieveData(sql, parameters);
+
+                List<T> result = new List<T>();
+                TableOperations<T> tblOperations = new TableOperations<T>(connection);
+                foreach (DataRow row in dataTbl.Rows)
+                {
+                    result.Add(tblOperations.LoadRecord(row));
+                }
+                if (Take == null)
+                    return result;
+                else
+                    return result.Take((int)Take);
+            }
+        }
+
+        private T QueryRecordWhere(string filterExpression, params object[] parameters)
+        {
+            using (AdoDataConnection connection = new AdoDataConnection(Connection))
+            {
+                if (CustomView == String.Empty)
+                    return new TableOperations<T>(connection).QueryRecordWhere(filterExpression, parameters);
+
+                string whereClause = " WHERE " + filterExpression;
+                string sql = "SELECT * FROM (" + CustomView + ") T1";
+                DataTable dataTbl = connection.RetrieveData(sql + whereClause, parameters);
+
+                TableOperations<T> tblOperations = new TableOperations<T>(connection);
+                if (dataTbl.Rows.Count > 0)
+                    return tblOperations.LoadRecord(dataTbl.Rows[0]);
+                return null;
+
+            }
+        }
+
+        private IEnumerable<T> QueryRecords()
+        {
+            using (AdoDataConnection connection = new AdoDataConnection(Connection))
+            {
+                if (CustomView == String.Empty)
+                {
+                    if (Take == null)
+                        return new TableOperations<T>(connection).QueryRecords(DefaultSort);
+                    else
+                        return new TableOperations<T>(connection).QueryRecords(DefaultSort).Take((int)Take);
+
+
+                }
+
+                string sql = $@"
+                    SELECT * FROM
+                    ({CustomView}) T1
+                    {(DefaultSort != null ? " ORDER BY " + DefaultSort : "")}";
+
+                DataTable dataTbl = connection.RetrieveData(sql);
+
+                List<T> result = new List<T>();
+                TableOperations<T> tblOperations = new TableOperations<T>(connection);
+                foreach (DataRow row in dataTbl.Rows)
+                {
+                    result.Add(tblOperations.LoadRecord(row));
+                }
+                if (Take == null)
+                    return result;
+                else
+                    return result.Take((int)Take);
+            }
+        }
+
+        /// <summary>
+        /// Check if current User is authorized for GET Requests
+        /// </summary>
+        /// <returns>True if User is authorized for GET requests</returns>
+        protected bool GetAuthCheck()
+        {
+            if (SecurityType == "Claims")
+            {
+                List<Claim> claims = Claims["GET"];
+                ClaimsPrincipal claimsPrincipal = (ClaimsPrincipal)User;
+                return claims.Count() == 0 || claimsPrincipal.HasClaim(claim => claims.Any(c => c.Type == claim.Type && c.Value == claim.Value));
+            }
+            else
+                return GetRoles == string.Empty || User.IsInRole(GetRoles);
+        }
+
+        /// <summary>
+        /// Check if current User is authorized for POST Requests
+        /// </summary>
+        /// <returns>True if User is authorized for POST requests</returns>
+        protected bool PostAuthCheck()
+        {
+            if (SecurityType == "Claims")
+            {
+                List<Claim> claims = Claims["POST"];
+                ClaimsPrincipal claimsPrincipal = (ClaimsPrincipal)User;
+                return claims.Count() == 0 || claimsPrincipal.HasClaim(claim => claims.Any(c => c.Type == claim.Type && c.Value == claim.Value));
+            }
+            else
+                return PostRoles == string.Empty || User.IsInRole(PostRoles);
+        }
+
+        /// <summary>
+        /// Check if current User is authorized for PATCH Requests
+        /// </summary>
+        /// <returns>True if User is authorized for PATCH requests</returns>
+        protected bool PatchAuthCheck()
+        {
+            if (SecurityType == "Claims")
+            {
+                List<Claim> claims = Claims["PATCH"];
+                ClaimsPrincipal claimsPrincipal = (ClaimsPrincipal)User;
+                return claims.Count() == 0 || claimsPrincipal.HasClaim(claim => claims.Any(c => c.Type == claim.Type && c.Value == claim.Value));
+            }
+            else
+                return PatchRoles == string.Empty || User.IsInRole(PatchRoles);
+        }
+
+        /// <summary>
+        /// Check if current User is authorized for DELETE Requests
+        /// </summary>
+        /// <returns>True if User is authorized for DELETE requests</returns>
+        protected bool DeleteAuthCheck()
+        {
+            if (SecurityType == "Claims")
+            {
+                List<Claim> claims = Claims["DELETE"];
+                ClaimsPrincipal claimsPrincipal = (ClaimsPrincipal)User;
+                return claims.Count() == 0 || claimsPrincipal.HasClaim(claim => claims.Any(c => c.Type == claim.Type && c.Value == claim.Value));
+            }
+            else
+                return DeleteRoles == string.Empty || User.IsInRole(DeleteRoles);
+        }
+
+        /// <summary>
+        /// Gets the <see cref="DataTable"/> with the SearchResults as specified in <see cref="PostData"/>.
+        /// </summary>
+        /// <returns>A <see cref="DataTable"/>.</returns>
+        protected DataTable GetSearchResults(PostData postData)
+        {
+            string whereClause = BuildWhereClause(postData.Searches);
+
+            using (AdoDataConnection connection = new AdoDataConnection(Connection))
+            {
+                string tableName = TableOperations<T>.GetTableName();
+
+                string sql = "";
+
+                if (SearchSettings == null && CustomView == String.Empty)
+                    sql = $@" SELECT * FROM {tableName} {whereClause}
                             ORDER BY { postData.OrderBy} {(postData.Ascending ? "ASC" : "DESC")} ";

-                    else if (SearchSettings == null)
-                        sql = $@" SELECT* FROM({CustomView}) T1
+                else if (SearchSettings == null)
+                    sql = $@" SELECT* FROM({CustomView}) T1
                          {whereClause}
                         ORDER BY {postData.OrderBy} {(postData.Ascending ? "ASC" : "DESC")}";

-                    else
-                    {
-                        string pivotCollums = "(" + String.Join(",", postData.Searches.Where(item => item.isPivotColumn).Select(search => "'" + search.FieldName + "'")) + ")";
-
-                        if (pivotCollums == "()")
-                            pivotCollums = "('')";
-
-                        string collumnCondition = SearchSettings.Condition;
-                        if (collumnCondition != String.Empty)
-                            collumnCondition = $"AF.{collumnCondition} AND ";
-                        collumnCondition = collumnCondition + $"{SearchSettings.FieldKeyField} IN {pivotCollums}";
-
-                        string joinCondition = $"af.FieldName IN {pivotCollums.Replace("'", "''")} AND ";
-                        joinCondition = joinCondition + SearchSettings.Condition.Replace("'", "''");
-                        if (SearchSettings.Condition != String.Empty)
-                            joinCondition = $"{joinCondition} AND ";
-                        joinCondition = joinCondition + $"SRC.{PrimaryKeyField} = AF.{SearchSettings.PrimaryKeyField}";
-
-                        if (CustomView == String.Empty)
-                            sql = $@"
+                else
+                {
+                    string pivotCollums = "(" + String.Join(",", postData.Searches.Where(item => item.isPivotColumn).Select(search => "'" + search.FieldName + "'")) + ")";
+
+                    if (pivotCollums == "()")
+                        pivotCollums = "('')";
+
+                    string collumnCondition = SearchSettings.Condition;
+                    if (collumnCondition != String.Empty)
+                        collumnCondition = $"AF.{collumnCondition} AND ";
+                    collumnCondition = collumnCondition + $"{SearchSettings.FieldKeyField} IN {pivotCollums}";
+
+                    string joinCondition = $"af.FieldName IN {pivotCollums.Replace("'", "''")} AND ";
+                    joinCondition = joinCondition + SearchSettings.Condition.Replace("'", "''");
+                    if (SearchSettings.Condition != String.Empty)
+                        joinCondition = $"{joinCondition} AND ";
+                    joinCondition = joinCondition + $"SRC.{PrimaryKeyField} = AF.{SearchSettings.PrimaryKeyField}";
+
+                    if (CustomView == String.Empty)
+                        sql = $@"
                             DECLARE @PivotColumns NVARCHAR(MAX) = N''
                             SELECT @PivotColumns = @PivotColumns + '[AFV_' + [Key] + '],'
                                 FROM (Select DISTINCT {SearchSettings.FieldKeyField} AS [Key] FROM {SearchSettings.AdditionalFieldTable} AS AF WHERE {collumnCondition}  ) AS [Fields]
@@ -556,8 +748,8 @@
 		                        exec sp_executesql @CleanSQL
                             '
                             exec sp_executesql @SQLStatement";
-                        else
-                            sql = $@"
+                    else
+                        sql = $@"
                             DECLARE @PivotColumns NVARCHAR(MAX) = N''
                             SELECT @PivotColumns = @PivotColumns + '[AFV_' + [Key] + '],'
                                 FROM (Select DISTINCT {SearchSettings.FieldKeyField} AS [Key] FROM {SearchSettings.AdditionalFieldTable} AS AF WHERE {collumnCondition}  ) AS [Fields]
@@ -582,182 +774,11 @@
 		                        exec sp_executesql @CleanSQL
                             '
                             exec sp_executesql @SQLStatement";
-                    }
-                    DataTable table = connection.RetrieveData(sql, "");
-
-                    return Ok(JsonConvert.SerializeObject(table));
-                }
-            }
-            catch (Exception ex)
-            {
-                return InternalServerError(ex);
-            }
-        }
-        #endregion
-
-        #region [Helper Methods]
-
-        protected string BuildWhereClause(IEnumerable<Search> searches)
-        {
-
-            string whereClause = string.Join(" AND ", searches.Select(search => {
-                if (search.SearchText == string.Empty) search.SearchText = "%";
-                else search.SearchText = search.SearchText.Replace("*", "%");
-
-                if (search.Type == "string" || search.Type == "datetime")
-                    search.SearchText = $"'{search.SearchText}'";
-                else if (Array.IndexOf(new[] { "integer", "number", "boolean" }, search.Type) < 0)
-                {
-                    string text = search.SearchText.Replace("(", "").Replace(")", "");
-                    List<string> things = text.Split(',').ToList();
-                    things = things.Select(t => $"'{t}'").ToList();
-                    search.SearchText = $"({string.Join(",", things)})";
-                }
-
-                return $"[{(search.isPivotColumn ? "AFV_" : "") + search.FieldName}] {search.Operator} {search.SearchText}";
-            }));
-
-            if (searches.Any())
-                whereClause = "WHERE \n" + whereClause;
-
-            return whereClause;
-        }
-
-        private IEnumerable<T> QueryRecordsWhere(string filterExpression, params object[] parameters)
-        {
-            using (AdoDataConnection connection = new AdoDataConnection(Connection))
-            {
-                if (CustomView == String.Empty)
-                {
-                    if(Take == null)
-                        return new TableOperations<T>(connection).QueryRecords(DefaultSort, new RecordRestriction(filterExpression, parameters));
-                    else
-                        return new TableOperations<T>(connection).QueryRecords(DefaultSort, new RecordRestriction(filterExpression, parameters)).Take((int)Take);
-
-                }
-                string sql = $@"
-                    SELECT * FROM
-                    ({CustomView}) T1
-                    WHERE {filterExpression}
-                    {(DefaultSort != null ? " ORDER BY " +DefaultSort : "")}";
-                DataTable dataTbl = connection.RetrieveData(sql, parameters);
-
-                List<T> result = new List<T>();
-                TableOperations<T> tblOperations = new TableOperations<T>(connection);
-                foreach (DataRow row in dataTbl.Rows)
-                {
-                    result.Add(tblOperations.LoadRecord(row));
-                }
-                if (Take == null)
-                    return result;
-                else
-                    return result.Take((int)Take);
-            }
-        }
-
-
-        private T QueryRecordWhere(string filterExpression, params object[] parameters)
-        {
-            using (AdoDataConnection connection = new AdoDataConnection(Connection))
-            {
-                if (CustomView == String.Empty)
-                    return new TableOperations<T>(connection).QueryRecordWhere(filterExpression, parameters);
-
-                string whereClause = " WHERE " + filterExpression;
-                string sql = "SELECT * FROM (" + CustomView + ") T1";
-                DataTable dataTbl = connection.RetrieveData(sql + whereClause, parameters);
-
-                TableOperations<T> tblOperations = new TableOperations<T>(connection);
-                if (dataTbl.Rows.Count > 0)
-                    return tblOperations.LoadRecord(dataTbl.Rows[0]);
-                return null;
-
-            }
-        }
-
-        private IEnumerable<T> QueryRecords()
-        {
-            using (AdoDataConnection connection = new AdoDataConnection(Connection))
-            {
-                if (CustomView == String.Empty)
-                {
-                    if (Take == null)
-                        return new TableOperations<T>(connection).QueryRecords(DefaultSort);
-                    else
-                        return new TableOperations<T>(connection).QueryRecords(DefaultSort).Take((int)Take);
-
-
-                }
-
-                string sql = $@"
-                    SELECT * FROM
-                    ({CustomView}) T1
-                    {(DefaultSort != null ? " ORDER BY " + DefaultSort : "")}";
-
-                DataTable dataTbl = connection.RetrieveData(sql);
-
-                List<T> result = new List<T>();
-                TableOperations<T> tblOperations = new TableOperations<T>(connection);
-                foreach (DataRow row in dataTbl.Rows)
-                {
-                    result.Add(tblOperations.LoadRecord(row));
-                }
-                if (Take == null)
-                    return result;
-                else
-                    return result.Take((int)Take);
-            }
-        }
-
-        protected bool GetAuthCheck()
-        {
-            if (SecurityType == "Claims")
-            {
-                List<Claim> claims = Claims["GET"];
-                ClaimsPrincipal claimsPrincipal = (ClaimsPrincipal)User;
-                return claims.Count() == 0 || claimsPrincipal.HasClaim(claim => claims.Any(c => c.Type == claim.Type && c.Value == claim.Value));
-            }
-            else
-                return GetRoles == string.Empty || User.IsInRole(GetRoles);
-        }
-
-        protected bool PostAuthCheck()
-        {
-            if (SecurityType == "Claims")
-            {
-                List<Claim> claims = Claims["POST"];
-                ClaimsPrincipal claimsPrincipal = (ClaimsPrincipal)User;
-                return claims.Count() == 0 || claimsPrincipal.HasClaim(claim => claims.Any(c => c.Type == claim.Type && c.Value == claim.Value));
-            }
-            else
-                return PostRoles == string.Empty || User.IsInRole(PostRoles);
-        }
-
-        protected bool PatchAuthCheck()
-        {
-            if (SecurityType == "Claims")
-            {
-                List<Claim> claims = Claims["PATCH"];
-                ClaimsPrincipal claimsPrincipal = (ClaimsPrincipal)User;
-                return claims.Count() == 0 || claimsPrincipal.HasClaim(claim => claims.Any(c => c.Type == claim.Type && c.Value == claim.Value));
-            }
-            else
-                return PatchRoles == string.Empty || User.IsInRole(PatchRoles);
-        }
-
-        protected bool DeleteAuthCheck()
-        {
-            if (SecurityType == "Claims")
-            {
-                List<Claim> claims = Claims["DELETE"];
-                ClaimsPrincipal claimsPrincipal = (ClaimsPrincipal)User;
-                return claims.Count() == 0 || claimsPrincipal.HasClaim(claim => claims.Any(c => c.Type == claim.Type && c.Value == claim.Value));
-            }
-            else
-                return DeleteRoles == string.Empty || User.IsInRole(DeleteRoles);
-        }
-
-
+                }
+                return connection.RetrieveData(sql, "");
+            }
+
+        }
         #endregion
     }
 }


Support reading the HTTP request body from a file

--- Source/MSBuild.Community.Tasks/Net/HttpRequest.cs
+++ Source/MSBuild.Community.Tasks/Net/HttpRequest.cs
@@ -62,6 +62,11 @@
         public string Password{ get; set; }

         /// <summary>
+        /// Optional; the name of the file to reqd the request from.
+        /// </summary>
+        public string ReadRequestFrom { get; set; }
+
+        /// <summary>
         /// Optional; the name of the file to write the response to.
         /// </summary>
         public string WriteResponseTo { get; set; }
@@ -81,6 +86,15 @@
             get
             {
                 return !string.IsNullOrEmpty(EnsureResponseContains);
+            }
+        }
+
+
+        private bool ReadRequestFromFile
+        {
+            get
+            {
+                return !string.IsNullOrEmpty(ReadRequestFrom);
             }
         }

@@ -114,6 +128,23 @@
 	    {
 		request.Credentials = new NetworkCredential(Username, Password);
 	    }
+
+	    if (ReadRequestFromFile) {
+		request.SendChunked = true;
+		using (FileStream source = File.Open(ReadRequestFrom, FileMode.Open))
+		{
+			using (Stream requestStream = request.GetRequestStream())
+			{
+				byte[] buffer = new byte[16 * 1024];
+				int bytesRead;
+				while ((bytesRead = source.Read(buffer, 0, buffer.Length)) > 0)
+				{
+					requestStream.Write(buffer, 0, bytesRead);
+				}
+			}
+		}
+	    }
+

             using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
             {


Unit tests for Regex groups (inner, non-capturing, ordering)

--- Tests/Batch1/Text/RegularExpressions/RegexEntityTests.cs
+++ Tests/Batch1/Text/RegularExpressions/RegexEntityTests.cs
@@ -265,5 +265,221 @@
                 }
             }
         }
+
+        [Test]
+        public void MatchNamedGroupTest()
+        {
+            const string pattern = @"(?<test>A)(B)";
+            const string text = @"AB";
+            var rgx = new Regex(pattern);
+            var m = rgx.Match(text);
+
+            ValidateMatch(m, 0, 2, "AB", 3, true);
+
+            ValidateGroup(m, 0, 0, 2, true, "AB", 1);
+            ValidateCapture(m, 0, 0, 0, 2, "AB");
+
+            ValidateGroup(m, 1, 1, 1, true, "B", 1);
+            ValidateCapture(m, 1, 0, 1, 1, "B");
+
+            ValidateGroup(m, 2, 0, 1, true, "A", 1);
+            ValidateCapture(m, 2, 0, 0, 1, "A");
+
+            GroupsAreEqual(m.Groups[2], m.Groups["test"], "Named Group is correct");
+        }
+
+        [Test]
+        public void MatchInnerNamedGroupTest1()
+        {
+            const string pattern = @"((?<test>A)(B))";
+            const string text = @"AB";
+            var rgx = new Regex(pattern);
+            var m = rgx.Match(text);
+
+            ValidateMatch(m, 0, 2, "AB", 4, true);
+
+            ValidateGroup(m, 0, 0, 2, true, "AB", 1);
+            ValidateCapture(m, 0, 0, 0, 2, "AB");
+
+            ValidateGroup(m, 1, 0, 2, true, "AB", 1);
+            ValidateCapture(m, 1, 0, 0, 2, "AB");
+
+            ValidateGroup(m, 2, 1, 1, true, "B", 1);
+            ValidateCapture(m, 2, 0, 1, 1, "B");
+
+            ValidateGroup(m, 3, 0, 1, true, "A", 1);
+            ValidateCapture(m, 3, 0, 0, 1, "A");
+
+            GroupsAreEqual(m.Groups[3], m.Groups["test"], "Named Group is correct");
+        }
+
+        [Test]
+        public void MatchInnerNamedGroupTest2()
+        {
+            const string pattern = @"(?<outer>(C)(?<inner1>(?<inner2>A)+)(B))";
+            const string text = @"CAAAB";
+            var rgx = new Regex(pattern);
+            var m = rgx.Match(text);
+
+            ValidateMatch(m, 0, 5, "CAAAB", 6, true);
+
+            ValidateGroup(m, 0, 0, 5, true, "CAAAB", 1);
+            ValidateCapture(m, 0, 0, 0, 5, "CAAAB");
+
+            ValidateGroup(m, 1, 0, 1, true, "C", 1);
+            ValidateCapture(m, 1, 0, 0, 1, "C");
+
+            ValidateGroup(m, 2, 4, 1, true, "B", 1);
+            ValidateCapture(m, 2, 0, 4, 1, "B");
+
+            ValidateGroup(m, 3, 0, 5, true, "CAAAB", 1);
+            ValidateCapture(m, 3, 0, 0, 5, "CAAAB");
+
+            ValidateGroup(m, 4, 1, 3, true, "AAA", 1);
+            ValidateCapture(m, 4, 0, 1, 3, "AAA");
+
+            ValidateGroup(m, 5, 3, 1, true, "A", 3);
+            ValidateCapture(m, 5, 0, 1, 1, "A");
+            ValidateCapture(m, 5, 1, 2, 1, "A");
+            ValidateCapture(m, 5, 2, 3, 1, "A");
+
+            GroupsAreEqual(m.Groups[4], m.Groups["inner1"], "Named Group is correct");
+        }
+
+        [Test]
+        public void GroupOrderingTest()
+        {
+            const string pattern = @"(C)(?<group1>A)+(B)";
+            const string text = @"CAAAB";
+            var rgx = new Regex(pattern);
+            var m = rgx.Match(text);
+
+            ValidateMatch(m, 0, 5, "CAAAB", 4, true);
+
+            var expected = new List<string>();
+
+            ValidateGroup(m, 0, 0, 5, true, "CAAAB", 1);
+            ValidateCapture(m, 0, 0, 0, 5, "CAAAB");
+            expected.Add("CAAAB");
+
+            ValidateGroup(m, 1, 0, 1, true, "C", 1);
+            ValidateCapture(m, 1, 0, 0, 1, "C");
+            expected.Add("C");
+
+            ValidateGroup(m, 2, 4, 1, true, "B", 1);
+            ValidateCapture(m, 2, 0, 4, 1, "B");
+            expected.Add("B");
+
+            ValidateGroup(m, 3, 3, 1, true, "A", 3);
+            ValidateCapture(m, 3, 0, 1, 1, "A");
+            ValidateCapture(m, 3, 1, 2, 1, "A");
+            ValidateCapture(m, 3, 2, 3, 1, "A");
+            expected.Add("A");
+
+            var i = 0;
+            foreach (Group group in m.Groups)
+            {
+                Assert.AreEqual(expected[i], group.Value, "Group[" + i + "].Value is correct");
+                ++i;
+            }
+        }
+
+        [Test]
+        public void RepeatingGroupTest()
+        {
+            const string pattern = @"((A(\d)*A)x(B(\d)*B)+)";
+            const string text = @"A123AxBBB";
+            var rgx = new Regex(pattern);
+            var m = rgx.Match(text);
+
+            ValidateMatch(m, 0, 8, "A123AxBB", 6, true);
+
+            ValidateGroup(m, 0, 0, 8, true, "A123AxBB", 1);
+            ValidateCapture(m, 0, 0, 0, 8, "A123AxBB");
+
+            ValidateGroup(m, 1, 0, 8, true, "A123AxBB", 1);
+            ValidateCapture(m, 1, 0, 0, 8, "A123AxBB");
+
+            ValidateGroup(m, 2, 0, 5, true, "A123A", 1);
+            ValidateCapture(m, 2, 0, 0, 5, "A123A");
+
+            ValidateGroup(m, 3, 3, 1, true, "3", 3);
+            ValidateCapture(m, 3, 0, 1, 1, "1");
+            ValidateCapture(m, 3, 1, 2, 1, "2");
+            ValidateCapture(m, 3, 2, 3, 1, "3");
+
+            ValidateGroup(m, 4, 6, 2, true, "BB", 1);
+            ValidateCapture(m, 4, 0, 6, 2, "BB");
+
+            ValidateGroup(m, 5, 0, 0, false, "", 0);
+        }
+
+        [Test]
+        public void ZeroResultTest()
+        {
+            // Case 1:
+            var pattern = @"()";
+            var text = @"ABC";
+            var rgx = new Regex(pattern);
+            var m = rgx.Match(text);
+
+            ValidateMatch(m, 0, 0, "", 2, true);
+
+            ValidateGroup(m, 0, 0, 0, true, "", 1);
+            ValidateCapture(m, 0, 0, 0, 0, "");
+
+            ValidateGroup(m, 1, 0, 0, true, "", 1);
+            ValidateCapture(m, 1, 0, 0, 0, "");
+
+
+            // Case 2:
+            pattern = @"(B?)";
+            text = @"ABC";
+            rgx = new Regex(pattern);
+            m = rgx.Match(text);
+
+            ValidateMatch(m, 0, 0, "", 2, true);
+
+            ValidateGroup(m, 0, 0, 0, true, "", 1);
+            ValidateCapture(m, 0, 0, 0, 0, "");
+
+            ValidateGroup(m, 1, 0, 0, true, "", 1);
+            ValidateCapture(m, 1, 0, 0, 0, "");
+
+
+            // Case 3:
+            pattern = @"(B)?";
+            text = @"ABC";
+            rgx = new Regex(pattern);
+            m = rgx.Match(text);
+
+            ValidateMatch(m, 0, 0, "", 2, true);
+
+            ValidateGroup(m, 0, 0, 0, true, "", 1);
+            ValidateCapture(m, 0, 0, 0, 0, "");
+
+            ValidateGroup(m, 1, 0, 0, false, "", 0);
+        }
+
+        [Test]
+        public void NonCapturingGroupsTest()
+        {
+            const string pattern = @"(?:Q(?<noncapInner>A)Z)(B)(?:C)";
+            const string text = @"QAZBC";
+            var rgx = new Regex(pattern);
+            var m = rgx.Match(text);
+
+            ValidateMatch(m, 0, 5, "QAZBC", 3, true);
+
+            ValidateGroup(m, 0, 0, 5, true, "QAZBC", 1);
+            ValidateCapture(m, 0, 0, 0, 5, "QAZBC");
+
+            ValidateGroup(m, 1, 3, 1, true, "B", 1);
+            ValidateCapture(m, 1, 0, 3, 1, "B");
+
+            ValidateGroup(m, 2, 1, 1, true, "A", 1);
+            ValidateCapture(m, 2, 0, 1, 1, "A");
+
+        }
     }
 }


Add test

Add test

--- Tests/Kernels/Cosmos.Compiler.Tests.TypeSystem/Kernel.cs
+++ Tests/Kernels/Cosmos.Compiler.Tests.TypeSystem/Kernel.cs
@@ -33,6 +33,13 @@
         protected override void BeforeRun()
         {
             Console.WriteLine("Cosmos booted successfully. Starting Type tests now please wait...");
+        }
+
+        private void TestGarbageCollector()
+        {
+            object a = new object();
+
+            GCImplementation.Free(a);
         }

         protected override void Run()
@@ -85,6 +92,8 @@
                 Assert.IsTrue(c != null, "Anonymous types are created correctly");
                 Assert.IsTrue(c.i == 1 && c.n == "Test", "Anonymous types have correct values");

+                TestGarbageCollector();
+
                 TestController.Completed();
             }
             catch (Exception e)


1413:MemBitmapExtensions.CopyImgBuffer()

--- src/PixelFarm/PixelFarm.Painter/3_Cpu_Blit/MemBitmap.cs
+++ src/PixelFarm/PixelFarm.Painter/3_Cpu_Blit/MemBitmap.cs
@@ -207,7 +207,7 @@
                 _registerMemBmpList.Add(new TempMemBitmapMonitor(detail) { _memBmp = memBmp }); //_memBmp = new WeakReference(memBmp) });
             }
         }
-    }
+    }
 #endif

@@ -517,15 +517,13 @@

     public static class MemBitmapExtensions
     {
-        public static int[] CopyImgBuffer(MemBitmap memBmp, int width)
+        public static int[] CopyImgBuffer(MemBitmap memBmp, int width, int height)
         {
             //calculate stride for the width

             int destStride = MemBitmap.CalculateStride(width, CpuBlit.Imaging.PixelFormat.ARGB32);
-            int h = memBmp.Height;
             int newBmpW = destStride / 4;
-
-            int[] buff2 = new int[newBmpW * memBmp.Height];
+            int[] buff2 = new int[newBmpW * height];
             unsafe
             {

@@ -537,7 +535,7 @@
                     fixed (int* destHead = &buff2[0])
                     {
                         byte* destHead2 = (byte*)destHead;
-                        for (int line = 0; line < h; ++line)
+                        for (int line = 0; line < height; ++line)
                         {
                             //System.Runtime.InteropServices.Marshal.Copy(srcBuffer, srcIndex, (IntPtr)destHead2, destStride);
                             NativeMemMx.memcpy((byte*)destHead2, srcBuffer + srcIndex, destStride);


Stop adding the @using statement to views

--- Umbraco.ModelsBuilder.AspNet/ModelsBuilderApplication.cs
+++ Umbraco.ModelsBuilder.AspNet/ModelsBuilderApplication.cs
@@ -37,6 +37,11 @@
             var factory = new PureLiveModelFactory(renderViewEngine, pluginViewEngine);
             PublishedContentModelFactoryResolver.Current.SetFactory(factory);

+            // the following would add @using statement in every view so user's don't
+            // have to do it - however, then noone understands where the @using statement
+            // comes from, and it cannot be avoided / removed --- DISABLED
+            //
+            /*
             // no need for @using in views
             // note:
             //  we are NOT using the in-code attribute here, config is required
@@ -46,6 +51,7 @@
             if (string.IsNullOrWhiteSpace(modelsNamespace))
                 modelsNamespace = Configuration.Config.DefaultModelsNamespace;
             System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(modelsNamespace);
+            */
         }
     }
 }


PersistableFactory tests now check that the sender is forwarded to the instance.

--- UnboundedNondeterminism.Tests/PersistableFactoryTests.cs
+++ UnboundedNondeterminism.Tests/PersistableFactoryTests.cs
@@ -26,6 +26,7 @@
             public Guid Reference;
             public Guid PersistenceGuid;
             public IActorRef CorrectSender;
+            public IActorRef RespondingTo;
         }

         public sealed class TestType : PersistableBase
@@ -43,7 +44,8 @@
                 {
                     Reference = cnt.Reference,
                     PersistenceGuid = persistenceGuid,
-                    CorrectSender = Self
+                    CorrectSender = Self,
+                    RespondingTo = Sender
                 }));
                 Command(m => Assert.True(false));
             }
@@ -123,7 +125,7 @@
             var referenceA = Guid.NewGuid();
             factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceA }, PersistenceGuid = createdA.PersistenceGuid });

-            ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == createdA.PersistenceGuid && sender == response.CorrectSender);
+            ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == createdA.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);
             Assert.Equal(new[] { createdA.PersistenceGuid }, Created);
             Assert.Empty(Deleted);
         }
@@ -141,7 +143,7 @@
             var referenceB = Guid.NewGuid();
             factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceB }, PersistenceGuid = createdA.PersistenceGuid });

-            var responseB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceB && response.PersistenceGuid == createdA.PersistenceGuid && sender == response.CorrectSender);
+            var responseB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceB && response.PersistenceGuid == createdA.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);
             Assert.Equal(responseA.CorrectSender, responseB.CorrectSender);
             Assert.Equal(new[] { createdA.PersistenceGuid }, Created);
             Assert.Empty(Deleted);
@@ -180,7 +182,7 @@
             var referenceA = Guid.NewGuid();
             factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceA }, PersistenceGuid = createdB.PersistenceGuid });

-            var responseB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender);
+            var responseB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);
             Assert.Equal(new[] { createdB.PersistenceGuid }, Created);
             Assert.Empty(Deleted);
         }
@@ -244,7 +246,7 @@
             var referenceA = Guid.NewGuid();
             factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceA }, PersistenceGuid = createdB.PersistenceGuid });

-            ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender);
+            ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);
             Assert.Equal(new[] { createdB.PersistenceGuid }, Created);
             Assert.Empty(Deleted);
         }
@@ -310,11 +312,11 @@
             ExpectMsgFrom<PersistableFactory<TestType>.Deleted>(factory);
             var preReferenceA = Guid.NewGuid();
             factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = preReferenceA }, PersistenceGuid = createdForwardedRecovered.PersistenceGuid });
-            ExpectMsg<TestResponse>((response, sender) => response.Reference == preReferenceA && response.PersistenceGuid == createdForwardedRecovered.PersistenceGuid && sender == response.CorrectSender);
+            ExpectMsg<TestResponse>((response, sender) => response.Reference == preReferenceA && response.PersistenceGuid == createdForwardedRecovered.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

             var preReferenceB = Guid.NewGuid();
             factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = preReferenceB }, PersistenceGuid = createdForwardedDeletedRecovered.PersistenceGuid });
-            ExpectMsg<TestResponse>((response, sender) => response.Reference == preReferenceB && response.PersistenceGuid == createdForwardedDeletedRecovered.PersistenceGuid && sender == response.CorrectSender);
+            ExpectMsg<TestResponse>((response, sender) => response.Reference == preReferenceB && response.PersistenceGuid == createdForwardedDeletedRecovered.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

             factory.Tell(new PersistableFactory<TestType>.Delete { PersistenceGuid = createdForwardedDeletedRecovered.PersistenceGuid });
             ExpectMsgFrom<PersistableFactory<TestType>.Deleted>(factory);
@@ -331,15 +333,15 @@

             var referenceA = Guid.NewGuid();
             factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceA }, PersistenceGuid = createdB.PersistenceGuid });
-            var responseBA = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender);
+            var responseBA = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

             var referenceB = Guid.NewGuid();
             factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceB }, PersistenceGuid = createdA.PersistenceGuid });
-            var responseA = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceB && response.PersistenceGuid == createdA.PersistenceGuid && sender == response.CorrectSender);
+            var responseA = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceB && response.PersistenceGuid == createdA.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

             var referenceC = Guid.NewGuid();
             factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceC }, PersistenceGuid = createdB.PersistenceGuid });
-            var responseBB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceC && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender);
+            var responseBB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceC && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

             Assert.Equal(responseBA.CorrectSender, responseBB.CorrectSender);

@@ -381,21 +383,21 @@

             var referenceA = Guid.NewGuid();
             factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceA }, PersistenceGuid = recoveredCreatedA.PersistenceGuid });
-            var responseAA = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == recoveredCreatedA.PersistenceGuid && sender == response.CorrectSender);
+            var responseAA = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == recoveredCreatedA.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

             var referenceB = Guid.NewGuid();
             factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceB }, PersistenceGuid = recoveredCreatedB.PersistenceGuid });
-            var responseB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceB && response.PersistenceGuid == recoveredCreatedB.PersistenceGuid && sender == response.CorrectSender);
+            var responseB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceB && response.PersistenceGuid == recoveredCreatedB.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

             var referenceC = Guid.NewGuid();
             factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceC }, PersistenceGuid = recoveredCreatedA.PersistenceGuid });
-            var responseAB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceC && response.PersistenceGuid == recoveredCreatedA.PersistenceGuid && sender == response.CorrectSender);
+            var responseAB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceC && response.PersistenceGuid == recoveredCreatedA.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

             Assert.Equal(responseAA.CorrectSender, responseAB.CorrectSender);

             var referenceD = Guid.NewGuid();
             factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceD }, PersistenceGuid = recoveredCreatedForwardedDeleted.PersistenceGuid });
-            var responseC = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceD && response.PersistenceGuid == recoveredCreatedForwardedDeleted.PersistenceGuid && sender == response.CorrectSender);
+            var responseC = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceD && response.PersistenceGuid == recoveredCreatedForwardedDeleted.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

             factory.Tell(new PersistableFactory<TestType>.Delete { PersistenceGuid = recoveredCreatedDeleted.PersistenceGuid });
             ExpectMsgFrom<PersistableFactory<TestType>.Deleted>(factory);
@@ -437,11 +439,11 @@

             var preReferenceA = Guid.NewGuid();
             factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = preReferenceA }, PersistenceGuid = createdForwardedRecovered.PersistenceGuid });
-            ExpectMsg<TestResponse>((response, sender) => response.Reference == preReferenceA && response.PersistenceGuid == createdForwardedRecovered.PersistenceGuid && sender == response.CorrectSender);
+            ExpectMsg<TestResponse>((response, sender) => response.Reference == preReferenceA && response.PersistenceGuid == createdForwardedRecovered.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

             var preReferenceB = Guid.NewGuid();
             factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = preReferenceB }, PersistenceGuid = createdForwardedDeletedRecovered.PersistenceGuid });
-            ExpectMsg<TestResponse>((response, sender) => response.Reference == preReferenceB && response.PersistenceGuid == createdForwardedDeletedRecovered.PersistenceGuid && sender == response.CorrectSender);
+            ExpectMsg<TestResponse>((response, sender) => response.Reference == preReferenceB && response.PersistenceGuid == createdForwardedDeletedRecovered.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

             factory.Tell(new PersistableFactory<TestType>.Delete { PersistenceGuid = createdForwardedDeletedRecovered.PersistenceGuid });
             ExpectMsgFrom<PersistableFactory<TestType>.Deleted>(factory);
@@ -468,7 +470,7 @@
                 var referenceA = Guid.NewGuid();
                 factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceA }, PersistenceGuid = createdRecoveredForwardedDeleted.PersistenceGuid });
                 expectedCreated.Add(createdRecoveredForwardedDeleted.PersistenceGuid);
-                var responseA = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == createdRecoveredForwardedDeleted.PersistenceGuid && sender == response.CorrectSender);
+                var responseA = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == createdRecoveredForwardedDeleted.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

                 factory.Tell(new PersistableFactory<TestType>.Delete { PersistenceGuid = createdRecoveredForwardedDeleted.PersistenceGuid });
                 ExpectMsgFrom<PersistableFactory<TestType>.Deleted>(factory);
@@ -484,16 +486,16 @@
                 var referenceA = Guid.NewGuid();
                 factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceA }, PersistenceGuid = createdB.PersistenceGuid });
                 expectedCreated.Add(createdB.PersistenceGuid);
-                var responseBA = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender);
+                var responseBA = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

                 var referenceB = Guid.NewGuid();
                 factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceB }, PersistenceGuid = createdA.PersistenceGuid });
                 expectedCreated.Add(createdA.PersistenceGuid);
-                var responseA = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceB && response.PersistenceGuid == createdA.PersistenceGuid && sender == response.CorrectSender);
+                var responseA = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceB && response.PersistenceGuid == createdA.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

                 var referenceC = Guid.NewGuid();
                 factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceC }, PersistenceGuid = createdB.PersistenceGuid });
-                var responseBB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceC && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender);
+                var responseBB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceC && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

                 Assert.Equal(responseBA.CorrectSender, responseBB.CorrectSender);

@@ -505,7 +507,7 @@

                 var referenceD = Guid.NewGuid();
                 factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceD }, PersistenceGuid = createdB.PersistenceGuid });
-                var responseCA = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceD && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender);
+                var responseCA = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceD && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

                 factory.Tell(new PersistableFactory<TestType>.Delete { PersistenceGuid = createdForwardedRecovered.PersistenceGuid });
                 ExpectMsgFrom<PersistableFactory<TestType>.Deleted>(factory);
@@ -534,23 +536,23 @@
                 var referenceA = Guid.NewGuid();
                 factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceA }, PersistenceGuid = recoveredCreatedA.PersistenceGuid });
                 expectedCreated.Add(recoveredCreatedA.PersistenceGuid);
-                var responseAA = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == recoveredCreatedA.PersistenceGuid && sender == response.CorrectSender);
+                var responseAA = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == recoveredCreatedA.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

                 var referenceB = Guid.NewGuid();
                 factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceB }, PersistenceGuid = recoveredCreatedB.PersistenceGuid });
                 expectedCreated.Add(recoveredCreatedB.PersistenceGuid);
-                var responseB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceB && response.PersistenceGuid == recoveredCreatedB.PersistenceGuid && sender == response.CorrectSender);
+                var responseB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceB && response.PersistenceGuid == recoveredCreatedB.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

                 var referenceC = Guid.NewGuid();
                 factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceC }, PersistenceGuid = recoveredCreatedA.PersistenceGuid });
-                var responseAB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceC && response.PersistenceGuid == recoveredCreatedA.PersistenceGuid && sender == response.CorrectSender);
+                var responseAB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceC && response.PersistenceGuid == recoveredCreatedA.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

                 Assert.Equal(responseAA.CorrectSender, responseAB.CorrectSender);

                 var referenceD = Guid.NewGuid();
                 factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceD }, PersistenceGuid = recoveredCreatedForwardedDeleted.PersistenceGuid });
                 expectedCreated.Add(recoveredCreatedForwardedDeleted.PersistenceGuid);
-                var responseC = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceD && response.PersistenceGuid == recoveredCreatedForwardedDeleted.PersistenceGuid && sender == response.CorrectSender);
+                var responseC = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceD && response.PersistenceGuid == recoveredCreatedForwardedDeleted.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

                 factory.Tell(new PersistableFactory<TestType>.Delete { PersistenceGuid = recoveredCreatedDeleted.PersistenceGuid });
                 ExpectMsgFrom<PersistableFactory<TestType>.Deleted>(factory);
@@ -586,11 +588,11 @@

             var referenceA = Guid.NewGuid();
             factoryA.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceA }, PersistenceGuid = createdA.PersistenceGuid });
-            var responseA = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == createdA.PersistenceGuid && sender == response.CorrectSender);
+            var responseA = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == createdA.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

             var referenceB = Guid.NewGuid();
             factoryB.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceB }, PersistenceGuid = createdB.PersistenceGuid });
-            var responseB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceB && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender);
+            var responseB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceB && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

             Assert.NotEqual(responseA.CorrectSender, responseB.CorrectSender);

@@ -606,11 +608,11 @@

             var referenceC = Guid.NewGuid();
             factoryA.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceC }, PersistenceGuid = createdA.PersistenceGuid });
-            var responseC = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceC && response.PersistenceGuid == createdA.PersistenceGuid && sender == response.CorrectSender);
+            var responseC = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceC && response.PersistenceGuid == createdA.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

             var referenceD = Guid.NewGuid();
             factoryB.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceD }, PersistenceGuid = createdB.PersistenceGuid });
-            var responseD = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceD && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender);
+            var responseD = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceD && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

             Assert.NotEqual(responseA.CorrectSender, responseB.CorrectSender);

@@ -631,7 +633,7 @@
             var createdC = ExpectMsgFrom<PersistableFactory<TestType>.Created>(factory);
             var referenceA = Guid.NewGuid();
             factory.Tell(new PersistableFactory<TestType>.Forward { Message = new TestRequest { Reference = referenceA }, PersistenceGuid = createdB.PersistenceGuid });
-            var responseB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender);
+            var responseB = ExpectMsg<TestResponse>((response, sender) => response.Reference == referenceA && response.PersistenceGuid == createdB.PersistenceGuid && sender == response.CorrectSender && response.RespondingTo == TestActor);

             factory.Tell(new PersistableBase.Stop());
             ExpectNoMsg();


Неиспользуемые методы

Неиспользуемые методы

--- src/ScriptEngine/Machine/Contexts/ScriptDrivenObject.cs
+++ src/ScriptEngine/Machine/Contexts/ScriptDrivenObject.cs
@@ -407,16 +407,5 @@
         {
             return _module.ExportedMethods.Select(x => x.SymbolicName).ToArray();
         }
-
-        public Type ReflectAsCLRType()
-        {
-            throw new NotImplementedException();
-            //return ReflectedClassType.ReflectModule(_module, GetReflectedTypeName());
-        }
-
-        protected virtual string GetReflectedTypeName()
-        {
-            return SystemType.Name;
-        }
     }
 }


fix an but of not local version as it is larger than version table.

--- Unity/ABFetcher/AssetBundleManager/AssetBundleManager.cs
+++ Unity/ABFetcher/AssetBundleManager/AssetBundleManager.cs
@@ -406,12 +406,18 @@
 			// assetBundleName is with variant extension.

 #if ENABLE_NDINFRA_DEBUG_INFO
-			Debug.LogWarning ("LoadAssetBundleInternal url=" + url ) ;
+			Debug.LogWarning ("LoadAssetBundleInternal input and assemble url=" + url ) ;
 #endif // ENABLE_NDINFRA_DEBUG_INFO

 			string keyWoVariant = RemovePostVariant(assetBundleName) ;

 			bool isVersionExist = m_VersionTable.ContainsKey( keyWoVariant ) ;
+			int targetVersion = 0 ;
+			if(isVersionExist)
+			{
+				targetVersion = m_VersionTable[ keyWoVariant ];
+			}
+

 			// check if we need to use local asset bundle
 			bool isLocalExist = m_LocalBundleTable.ContainsKey( keyWoVariant ) ;
@@ -421,6 +427,7 @@

 			if( true == isUseLocalBundle )
 			{
+				targetVersion = m_LocalBundleTable[keyWoVariant] ;
 				// change path to streaming assets path
 				url = GetStreamingAssetsPath() + "/AssetBundles/" + Utility.GetPlatformName() + "/"+ assetBundleName ;
 #if ENABLE_NDINFRA_DEBUG_INFO
@@ -432,7 +439,7 @@
 			if( m_EnableVersionCheck && isVersionExist )
 			{
 				// url was used here
-				download = WWW.LoadFromCacheOrDownload( url , m_VersionTable[ keyWoVariant ] ) ;
+				download = WWW.LoadFromCacheOrDownload( url , targetVersion ) ;
 			}
 			else
 			{


Properly advance the bookmark when rolling over days.

--- src/Seq.Client.Serilog/Client/Serilog/HttpLogShipper.cs
+++ src/Seq.Client.Serilog/Client/Serilog/HttpLogShipper.cs
@@ -114,10 +114,17 @@
                                     SelfLog.WriteLine("Received failed HTTP shipping result {0}: {1}", result.StatusCode, result.Content.ReadAsStringAsync().Result);
                                 }
                             }
-                            else if (fileSet.Length > 2)
+                            else
                             {
-                                var del = new[] { currentFile, fileSet.First() }.OrderBy(v => v).First();
-                                File.Delete(del);
+                                if (fileSet.Length == 2 && fileSet.First() == currentFile)
+                                {
+                                    WriteBookmark(bookmark, 0, fileSet[1]);
+                                }
+
+                                if (fileSet.Length > 2)
+                                {
+                                    File.Delete(fileSet[0]);
+                                }
                             }
                         }
                     }


Set subtitle

Set subtitle

--- WalletWasabi.Fluent/ViewModels/AddWalletPageViewModel.cs
+++ WalletWasabi.Fluent/ViewModels/AddWalletPageViewModel.cs
@@ -41,7 +41,10 @@
 			CreateWalletCommand = ReactiveCommand.CreateFromTask(
 				async () =>
 				{
-					var enterPassword = new EnterPasswordViewModel(navigationState, NavigationTarget.Dialog);
+					var enterPassword = new EnterPasswordViewModel(
+						navigationState,
+						NavigationTarget.Dialog,
+						"Type the password of the wallet and click Continue.");

 					navigationState.DialogScreen?.Invoke().Router.Navigate.Execute(enterPassword);


Used SourceComparer to avoid lookup.

Used SourceComparer to avoid lookup.

--- WmcSoft.Core/Collections/Generic/CollectionExtensions.cs
+++ WmcSoft.Core/Collections/Generic/CollectionExtensions.cs
@@ -444,21 +444,31 @@

         #region ElementsAt

+        static int[] Iota(int n) {
+            var array = new int[n];
+            for (int i = 0; i < n; i++) {
+                array[i] = i;
+            }
+            return array;
+        }
+
         static IEnumerable<TSource> DoElementsAt<TSource>(IEnumerable<TSource> source, params int[] indices) {
             if (indices.Length == 0)
                 return Enumerable.Empty<TSource>();

             var length = indices.Length;
-            var sorted = ((int[])indices.Clone()).Sort();
+            var sorted = Iota(length).Sort(new SourceComparer<int>(indices));
             var buffer = new TSource[length];
             var i = 0;
             var count = 0;
+            var m = indices[sorted[i]];
             using (var enumerator = source.GetEnumerator()) {
                 while (enumerator.MoveNext()) {
-                    if (count++ == sorted[i]) {
-                        buffer[Array.IndexOf(indices, sorted[i])] = enumerator.Current;
+                    if (count++ == m) {
+                        buffer[i] = enumerator.Current;
                         if (++i == length)
                             return buffer;
+                        m = indices[sorted[i]];
                     }
                 }
             }
@@ -487,17 +497,18 @@
                 return Enumerable.Empty<TSource>();

             var length = indices.Length;
-            var sorted = ((int[])indices.Clone()).Sort();
+            var sorted = Iota(length).Sort(new SourceComparer<int>(indices));
             var buffer = new TSource[length];
             var i = 0;
             var count = 0;
+            var m = indices[sorted[i]];
             using (var enumerator = source.GetEnumerator()) {
                 while (enumerator.MoveNext()) {
-                    if (count++ == sorted[i]) {
-                        var index = Array.IndexOf(indices, sorted[i]);
-                        buffer[index] = enumerator.Current;
+                    if (count++ == m) {
+                        buffer[i] = enumerator.Current;
                         if (++i == length)
                             break;
+                        m = indices[sorted[i]];
                     }
                 }
             }
@@ -537,16 +548,18 @@
                 return Enumerable.Empty<TResult>();

             var length = indices.Length;
-            var sorted = ((int[])indices.Clone()).Sort();
+            var sorted = Iota(length).Sort(new SourceComparer<int>(indices));
             var buffer = new TResult[length];
             var i = 0;
             var count = 0;
+            var m = indices[sorted[i]];
             using (var enumerator = source.GetEnumerator()) {
                 while (enumerator.MoveNext()) {
-                    if (count++ == sorted[i]) {
-                        buffer[Array.IndexOf(indices, sorted[i])] = selector(enumerator.Current);
+                    if (count++ == m) {
+                        buffer[i] = selector(enumerator.Current);
                         if (++i == length)
                             return buffer;
+                        m = indices[sorted[i]];
                     }
                 }
             }
@@ -575,17 +588,18 @@
                 return Enumerable.Empty<TResult>();

             var length = indices.Length;
-            var sorted = ((int[])indices.Clone()).Sort();
+            var sorted = Iota(length).Sort(new SourceComparer<int>(indices));
             var buffer = new TResult[length];
             var i = 0;
             var count = 0;
+            var m = indices[sorted[i]];
             using (var enumerator = source.GetEnumerator()) {
                 while (enumerator.MoveNext()) {
-                    if (count++ == sorted[i]) {
-                        var index = Array.IndexOf(indices, sorted[i]);
-                        buffer[index] = selector(enumerator.Current);
+                    if (count++ == m) {
+                        buffer[i] = selector(enumerator.Current);
                         if (++i == length)
                             break;
+                        m = indices[sorted[i]];
                     }
                 }
             }


Simplify ToDictionary.

Simplify ToDictionary.

--- WmcSoft.Core/Collections/Generic/EnumerableExtensions.cs
+++ WmcSoft.Core/Collections/Generic/EnumerableExtensions.cs
@@ -1358,25 +1358,14 @@

         #region ToDictionary

-        public static Dictionary<TKey, TSource> ToDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, DuplicatePolicy policy) {
-            return ToDictionary(source, keySelector, SpecialFunctions<TSource>.Identity, null, policy);
-        }
-
-        public static Dictionary<TKey, TSource> ToDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer, DuplicatePolicy policy) {
-            return ToDictionary(source, keySelector, SpecialFunctions<TSource>.Identity, comparer, policy);
-        }
-
-        public static Dictionary<TKey, TElement> ToDictionary<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, DuplicatePolicy policy) {
-            return ToDictionary(source, keySelector, elementSelector, null, policy);
-        }
-
-        public static Dictionary<TKey, TElement> ToDictionary<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer, DuplicatePolicy policy) {
-            if (source == null)
-                throw new ArgumentNullException("source");
-            if (keySelector == null)
-                throw new ArgumentNullException("keySelector");
-            if (elementSelector == null)
-                throw new ArgumentNullException("elementSelector");
+        public static Dictionary<TKey, TSource> ToDictionary<TSource, TKey>(this IEnumerable<TSource> source, DuplicatePolicy policy, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer = null) {
+            return ToDictionary(source, policy, keySelector, SpecialFunctions<TSource>.Identity, comparer);
+        }
+
+        public static Dictionary<TKey, TElement> ToDictionary<TSource, TKey, TElement>(this IEnumerable<TSource> source, DuplicatePolicy policy, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer = null) {
+            if (source == null) throw new ArgumentNullException("source");
+            if (keySelector == null) throw new ArgumentNullException("keySelector");
+            if (elementSelector == null) throw new ArgumentNullException("elementSelector");

             var d = new Dictionary<TKey, TElement>(comparer);
             switch (policy) {
@@ -1401,15 +1390,20 @@
             return d;
         }

-        public static Dictionary<TKey, TElement> ToDictionary<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer, Func<TElement, TSource, TElement> merger) {
-            if (source == null)
-                throw new ArgumentNullException("source");
-            if (keySelector == null)
-                throw new ArgumentNullException("keySelector");
-            if (elementSelector == null)
-                throw new ArgumentNullException("elementSelector");
-            if (merger == null)
-                throw new ArgumentNullException("merger");
+        public static Dictionary<TKey, TElement> ToDictionary<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<TElement, TElement, TElement> merger, IEqualityComparer<TKey> comparer=null) {
+            if (source == null) throw new ArgumentNullException("source");
+            if (keySelector == null) throw new ArgumentNullException("keySelector");
+            if (elementSelector == null) throw new ArgumentNullException("elementSelector");
+            if (merger == null) throw new ArgumentNullException("merger");
+
+            return ToDictionary(source, keySelector, elementSelector, (x, y) => merger(x, elementSelector(y)), comparer);
+        }
+
+        public static Dictionary<TKey, TElement> ToDictionary<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<TElement, TSource, TElement> merger, IEqualityComparer<TKey> comparer=null) {
+            if (source == null) throw new ArgumentNullException("source");
+            if (keySelector == null) throw new ArgumentNullException("keySelector");
+            if (elementSelector == null) throw new ArgumentNullException("elementSelector");
+            if (merger == null) throw new ArgumentNullException("merger");

             var d = new Dictionary<TKey, TElement>(comparer);
             foreach (TSource item in source) {
@@ -1419,29 +1413,6 @@
                     d.Add(selector, elementSelector(item));
                 } else {
                     d[selector] = merger(element, item);
-                }
-            }
-            return d;
-        }
-
-        public static Dictionary<TKey, TElement> ToDictionary<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer, Func<TElement, TElement, TElement> merger) {
-            if (source == null)
-                throw new ArgumentNullException("source");
-            if (keySelector == null)
-                throw new ArgumentNullException("keySelector");
-            if (elementSelector == null)
-                throw new ArgumentNullException("elementSelector");
-            if (merger == null)
-                throw new ArgumentNullException("merger");
-
-            var d = new Dictionary<TKey, TElement>(comparer);
-            foreach (TSource item in source) {
-                var selector = keySelector(item);
-                TElement element;
-                if (!d.TryGetValue(selector, out element)) {
-                    d.Add(selector, elementSelector(item));
-                } else {
-                    d[selector] = merger(element, elementSelector(item));
                 }
             }
             return d;


-Fixed Windows Phone build

-Fixed Windows Phone build

--- Src/Newtonsoft.Json/Schema/JsonSchemaGenerator.cs
+++ Src/Newtonsoft.Json/Schema/JsonSchemaGenerator.cs
@@ -330,7 +330,9 @@
             GenerateISerializableContract(type, (JsonISerializableContract) contract);
             break;
 #endif
+#if !(NET35 || NET20 || WINDOWS_PHONE)
           case JsonContractType.Dynamic:
+#endif
           case JsonContractType.Linq:
             CurrentSchema.Type = JsonSchemaType.Any;
             break;


Update ReflectionObject.cs#Create (#2007)

--- Src/Newtonsoft.Json/Utilities/ReflectionObject.cs
+++ Src/Newtonsoft.Json/Utilities/ReflectionObject.cs
@@ -145,16 +145,6 @@
                         throw new ArgumentException("Unexpected member type '{0}' for member '{1}'.".FormatWith(CultureInfo.InvariantCulture, member.MemberType(), member.Name));
                 }

-                if (ReflectionUtils.CanReadMemberValue(member, false))
-                {
-                    reflectionMember.Getter = delegateFactory.CreateGet<object>(member);
-                }
-
-                if (ReflectionUtils.CanSetMemberValue(member, false, false))
-                {
-                    reflectionMember.Setter = delegateFactory.CreateSet<object>(member);
-                }
-
                 reflectionMember.MemberType = ReflectionUtils.GetMemberUnderlyingType(member);

                 d.Members[memberName] = reflectionMember;
@@ -163,4 +153,4 @@
             return d;
         }
     }
-}+}