Revert "Optimization by returning the same instance"

This reverts commit 990fc118cbd6df423be2107a75970a834ade1f76.

When using the _reusableEditor field to create a BlockEditorPropertyEditor
it doesn't matter that content type cache has been invalidated (memory cache)
as the content types are also cached in a private field in the BlockEditorValues class.

Closes #10910

(cherry picked from commit 94b0b252ece607c9ea6fff4e417635623ee1803e)

--- src/Umbraco.Core/PropertyEditors/DataEditor.cs
+++ src/Umbraco.Core/PropertyEditors/DataEditor.cs
@@ -19,7 +19,6 @@
     public class DataEditor : IDataEditor
     {
         private IDictionary<string, object> _defaultConfiguration;
-        private IDataValueEditor _reusableEditor;

         /// <summary>
         /// Initializes a new instance of the <see cref="DataEditor"/> class.
@@ -91,8 +90,7 @@
         /// simple enough for now.</para>
         /// </remarks>
         // TODO: point of that one? shouldn't we always configure?
-        public IDataValueEditor GetValueEditor() => ExplicitValueEditor ?? (_reusableEditor ?? (_reusableEditor = CreateValueEditor()));
-
+        public IDataValueEditor GetValueEditor() => ExplicitValueEditor ?? CreateValueEditor();

         /// <inheritdoc />
         /// <remarks>


Had sinned against the coding standards.

git-svn-id: bab0c2de90ee11a20376049c2cdee62584491f34@1483 73e77b4c-caa6-f847-a29a-24ab75ae54b6

--- MonoRail/Castle.MonoRail.Framework/Helpers/IPager.cs
+++ MonoRail/Castle.MonoRail.Framework/Helpers/IPager.cs
@@ -1,8 +1,22 @@
-using System;
-using System.Collections;
+// Copyright 2004-2005 Castle Project - http://www.castleproject.org/
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.

 namespace Castle.MonoRail.Framework.Helpers
 {
+	using System;
+	using System.Collections;
+
 	public interface IPager : IEnumerable
 	{
 		int CurrentIndex { get; }


Added RedirectToPreviousStep and RedirectToFirstStep

git-svn-id: bab0c2de90ee11a20376049c2cdee62584491f34@1347 73e77b4c-caa6-f847-a29a-24ab75ae54b6

--- MonoRail/Castle.MonoRail.Framework/WizardStepPage.cs
+++ MonoRail/Castle.MonoRail.Framework/WizardStepPage.cs
@@ -16,8 +16,8 @@
 {
 	using System;
 	using System.Collections;
-	using System.Collections.Specialized;
 	using System.Reflection;
+
 	using Castle.MonoRail.Framework.Internal;

@@ -113,6 +113,10 @@

 		#endregion

+		/// <summary>
+		/// Sends a redirect to the next wizard step (if it exists)
+		/// </summary>
+		/// <exception cref="RailsException">if no further step exists</exception>
 		protected void RedirectToNextStep()
 		{
 			String wizardName = WizardUtils.ConstructWizardNamespace(_wizardcontroller);
@@ -129,20 +133,70 @@

 				WizardUtils.RegisterCurrentStepInfo(_wizardcontroller, nextStepIndex, nextStep);

-				// We need to preserve any attribute from the QueryString
-				// for example in case the url has an Id
-				if( Context.Request.QueryString.HasKeys() )
-				{
-					string url = UrlInfo.CreateAbsoluteRailsUrl( Context.ApplicationPath,
-						_wizardcontroller.Name, nextStep, Context.UrlInfo.Extension )
-								+ Context.Request.Uri.Query;
+				RedirectToStep(nextStepIndex, nextStep);
+			}
+			else
+			{
+				throw new RailsException("No next step available");
+			}
+		}
+
+		/// <summary>
+		/// Sends a redirect to the previous wizard step
+		/// </summary>
+		/// <exception cref="RailsException">
+		/// if no previous step exists (ie. already in the first one)</exception>
+		protected void RedirectToPreviousStep()
+		{
+			String wizardName = WizardUtils.ConstructWizardNamespace(_wizardcontroller);
+
+			int currentIndex = (int) Context.Session[wizardName + "currentstepindex"];
+
+			IList stepList = (IList) Context.UnderlyingContext.Items["wizard.step.list"];
+
+			if ((currentIndex - 1) >= 0)
+			{
+				int prevStepIndex = currentIndex - 1;
+
+				String prevStep = (String) stepList[prevStepIndex];
+
+				RedirectToStep(prevStepIndex, prevStep);
+			}
+			else
+			{
+				throw new RailsException("No previous step available");
+			}
+		}
+
+		/// <summary>
+		/// Sends a redirect to the first wizard step
+		/// </summary>
+		protected void RedirectToFirstStep()
+		{
+			IList stepList = (IList) Context.UnderlyingContext.Items["wizard.step.list"];
+
+			String firstStep = (String) stepList[0];
+
+			RedirectToStep(0, firstStep);
+		}
+
+		private void RedirectToStep(int prevStepIndex, string prevStep)
+		{
+			WizardUtils.RegisterCurrentStepInfo(_wizardcontroller, prevStepIndex, prevStep);
+
+			// We need to preserve any attribute from the QueryString
+			// for example in case the url has an Id
+			if( Context.Request.QueryString.HasKeys() )
+			{
+				string url = UrlInfo.CreateAbsoluteRailsUrl( Context.ApplicationPath,
+				                                             _wizardcontroller.Name, prevStep, Context.UrlInfo.Extension )
+					+ Context.Request.Uri.Query;

-					Context.Response.Redirect( url );
-				}
-				else
-				{
-					Context.Response.Redirect(_wizardcontroller.Name, nextStep);
-				}
+				Context.Response.Redirect( url );
+			}
+			else
+			{
+				Context.Response.Redirect(_wizardcontroller.Name, prevStep);
 			}
 		}
 	}


Changed exception on error in sendrecieve due to connection shutdown

--- NetworkCommsDotNet/Connection/ConnectionSendClose.cs
+++ NetworkCommsDotNet/Connection/ConnectionSendClose.cs
@@ -285,7 +285,7 @@
             RemoveShutdownHandler(SendReceiveShutDownDelegate);

             if (remotePeerDisconnectedDuringWait)
-                throw new ExpectedReturnTimeoutException("Remote end closed connection before data was successfully returned.");
+                throw new ConnectionShutdownException("Remote end closed connection before data was successfully returned.");
             else
                 return returnObject;
         }


fix for visual mode sticking when using extract method

--- OmniSharp/Refactoring/OmniSharpRefactoringContext.cs
+++ OmniSharp/Refactoring/OmniSharpRefactoringContext.cs
@@ -47,13 +47,19 @@
             if(request is CodeActionRequest)
             {
                 var car = request as CodeActionRequest;
-                var startLocation
-                    = new TextLocation(car.SelectionStartLine.Value, car.SelectionStartColumn.Value);
-                System.Console.WriteLine(startLocation);
-                var endLocation
-                    = new TextLocation(car.SelectionEndLine.Value, car.SelectionEndColumn.Value);
+                if(car.SelectionStartColumn.HasValue)
+                {
+                    var startLocation
+                        = new TextLocation(car.SelectionStartLine.Value, car.SelectionStartColumn.Value);
+                    var endLocation
+                        = new TextLocation(car.SelectionEndLine.Value, car.SelectionEndColumn.Value);

-                refactoringContext = new OmniSharpRefactoringContext(doc, resolver, location, startLocation, endLocation);
+                    refactoringContext = new OmniSharpRefactoringContext(doc, resolver, location, startLocation, endLocation);
+                }
+                else
+                {
+                    refactoringContext = new OmniSharpRefactoringContext(doc, resolver, location);
+                }
             }
             else
             {


Changed interface - instead of using  atreeview with fields for all language/type combos, we now use a CheckedListBox with a specific language/type's fields.  Multiple entries can be selected.

--- PlayOnline.Utils.FFXIDataBrowser/ItemFieldChooser.cs
+++ PlayOnline.Utils.FFXIDataBrowser/ItemFieldChooser.cs
@@ -13,77 +13,66 @@

     #region Controls

-    private System.Windows.Forms.TreeView tvItemFields;
     private System.Windows.Forms.Button btnOK;
+    private System.Windows.Forms.CheckedListBox clstFields;

     private System.ComponentModel.Container components = null;

     #endregion

-    public ItemDataType     T;
-    public ItemDataLanguage L;
-    public ItemField        F;
-
-    public ItemFieldChooser() {
-      InitializeComponent();
-      foreach (NamedEnum NE in NamedEnum.GetAll(typeof(ItemDataLanguage))) {
-      TreeNode TN = this.tvItemFields.Nodes.Add(NE.Name);
-	TN.Tag = NE.Value;
-	this.AddTypeTrees((ItemDataLanguage) NE.Value, TN);
+    public ItemFieldChooser(ItemDataLanguage L, ItemDataType T, bool IncludeAny, params ItemField[] FieldParams) {
+      this.InitializeComponent();
+      // Set up fields - this should really be done via an IItemInfo, but that requires an item instance.
+    ArrayList FieldsToCheck = new ArrayList(FieldParams);
+      if (IncludeAny)
+	this.AddField(ItemField.Any, FieldsToCheck);
+      this.AddField(ItemField.ID, FieldsToCheck);
+      this.AddField(ItemField.Flags, FieldsToCheck);
+      this.AddField(ItemField.StackSize, FieldsToCheck);
+      this.AddField(ItemField.Type, FieldsToCheck);
+      this.AddField(ItemField.EnglishName, FieldsToCheck);
+      this.AddField(ItemField.JapaneseName, FieldsToCheck);
+      if (L == ItemDataLanguage.English) {
+	this.AddField(ItemField.LogNameSingular, FieldsToCheck);
+	this.AddField(ItemField.LogNamePlural, FieldsToCheck);
+      }
+      this.AddField(ItemField.Description, FieldsToCheck);
+      if (T != ItemDataType.Object) {
+	this.AddField(ItemField.ResourceID, FieldsToCheck);
+	this.AddField(ItemField.Level, FieldsToCheck);
+	this.AddField(ItemField.Slots, FieldsToCheck);
+	this.AddField(ItemField.Jobs, FieldsToCheck);
+	this.AddField(ItemField.Races, FieldsToCheck);
+	if (T == ItemDataType.Weapon) {
+	  this.AddField(ItemField.Damage, FieldsToCheck);
+	  this.AddField(ItemField.Delay, FieldsToCheck);
+	  this.AddField(ItemField.Skill, FieldsToCheck);
+	}
+	else
+	  this.AddField(ItemField.ShieldSize, FieldsToCheck);
+	this.AddField(ItemField.MaxCharges, FieldsToCheck);
+	this.AddField(ItemField.EquipDelay, FieldsToCheck);
+	this.AddField(ItemField.ReuseTimer, FieldsToCheck);
       }
     }

-    private void AddTypeTrees(ItemDataLanguage L, TreeNode Parent) {
-      foreach (NamedEnum NE in NamedEnum.GetAll(typeof(ItemDataType))) {
-      TreeNode TN = Parent.Nodes.Add(NE.Name);
-	TN.Tag = NE.Value;
-	this.AddFields(L, (ItemDataType) NE.Value, TN);
-      }
+    private void AddField(ItemField Field, ArrayList FieldsToCheck) {
+      this.clstFields.Items.Add(new NamedEnum(Field), FieldsToCheck.Contains(Field));
     }

-    private void AddFields(ItemDataLanguage L, ItemDataType T, TreeNode Parent) {
-      this.AddField(ItemField.ID, Parent);
-      this.AddField(ItemField.Flags, Parent);
-      this.AddField(ItemField.StackSize, Parent);
-      this.AddField(ItemField.Type, Parent);
-      this.AddField(ItemField.EnglishName, Parent);
-      this.AddField(ItemField.JapaneseName, Parent);
-      if (L == ItemDataLanguage.English) {
-	this.AddField(ItemField.LogNameSingular, Parent);
-	this.AddField(ItemField.LogNamePlural, Parent);
-      }
-      this.AddField(ItemField.Description, Parent);
-      if (T != ItemDataType.Object) {
-	this.AddField(ItemField.ResourceID, Parent);
-	this.AddField(ItemField.Level, Parent);
-	this.AddField(ItemField.Slots, Parent);
-	this.AddField(ItemField.Jobs, Parent);
-	this.AddField(ItemField.Races, Parent);
-	if (T == ItemDataType.Weapon) {
-	  this.AddField(ItemField.Damage, Parent);
-	  this.AddField(ItemField.Delay, Parent);
-	  this.AddField(ItemField.Skill, Parent);
+    public ArrayList Fields {
+      get {
+      ArrayList Fields = new ArrayList();
+	foreach (NamedEnum NE in this.clstFields.CheckedItems) {
+	  if ((ItemField) NE.Value == ItemField.Any) {
+	    Fields.Clear();
+	    Fields.Add(ItemField.Any);
+	    break;
+	  }
+	  else
+	    Fields.Add(NE.Value);
 	}
-	else
-	  this.AddField(ItemField.ShieldSize, Parent);
-	this.AddField(ItemField.MaxCharges, Parent);
-	this.AddField(ItemField.EquipDelay, Parent);
-	this.AddField(ItemField.ReuseTimer, Parent);
-      }
-    }
-
-    private void AddField(ItemField F, TreeNode Parent) {
-    NamedEnum NE = new NamedEnum(F);
-    TreeNode TN = Parent.Nodes.Add(NE.Name);
-      TN.Tag = NE.Value;
-    }
-
-    private void tvItemFields_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e) {
-      this.btnOK.Enabled = (e.Node.Nodes.Count == 0);
-      if (e.Node.Nodes.Count == 0) { // Leaf Node
-	this.F = (ItemField) e.Node.Tag;
-	this.T = (ItemDataType) e.Node.Parent.Tag;
-	this.L = (ItemDataLanguage) e.Node.Parent.Parent.Tag;
+	return Fields;
       }
     }

@@ -97,33 +86,9 @@

     private void InitializeComponent() {
       System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ItemFieldChooser));
-      this.tvItemFields = new System.Windows.Forms.TreeView();
       this.btnOK = new System.Windows.Forms.Button();
+      this.clstFields = new System.Windows.Forms.CheckedListBox();
       this.SuspendLayout();
-      //
-      // tvItemFields
-      //
-      this.tvItemFields.AccessibleDescription = resources.GetString("tvItemFields.AccessibleDescription");
-      this.tvItemFields.AccessibleName = resources.GetString("tvItemFields.AccessibleName");
-      this.tvItemFields.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("tvItemFields.Anchor")));
-      this.tvItemFields.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tvItemFields.BackgroundImage")));
-      this.tvItemFields.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("tvItemFields.Dock")));
-      this.tvItemFields.Enabled = ((bool)(resources.GetObject("tvItemFields.Enabled")));
-      this.tvItemFields.Font = ((System.Drawing.Font)(resources.GetObject("tvItemFields.Font")));
-      this.tvItemFields.ImageIndex = ((int)(resources.GetObject("tvItemFields.ImageIndex")));
-      this.tvItemFields.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("tvItemFields.ImeMode")));
-      this.tvItemFields.Indent = ((int)(resources.GetObject("tvItemFields.Indent")));
-      this.tvItemFields.ItemHeight = ((int)(resources.GetObject("tvItemFields.ItemHeight")));
-      this.tvItemFields.Location = ((System.Drawing.Point)(resources.GetObject("tvItemFields.Location")));
-      this.tvItemFields.Name = "tvItemFields";
-      this.tvItemFields.PathSeparator = ".";
-      this.tvItemFields.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("tvItemFields.RightToLeft")));
-      this.tvItemFields.SelectedImageIndex = ((int)(resources.GetObject("tvItemFields.SelectedImageIndex")));
-      this.tvItemFields.Size = ((System.Drawing.Size)(resources.GetObject("tvItemFields.Size")));
-      this.tvItemFields.TabIndex = ((int)(resources.GetObject("tvItemFields.TabIndex")));
-      this.tvItemFields.Text = resources.GetString("tvItemFields.Text");
-      this.tvItemFields.Visible = ((bool)(resources.GetObject("tvItemFields.Visible")));
-      this.tvItemFields.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvItemFields_AfterSelect);
       //
       // btnOK
       //
@@ -149,6 +114,30 @@
       this.btnOK.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnOK.TextAlign")));
       this.btnOK.Visible = ((bool)(resources.GetObject("btnOK.Visible")));
       //
+      // clstFields
+      //
+      this.clstFields.AccessibleDescription = resources.GetString("clstFields.AccessibleDescription");
+      this.clstFields.AccessibleName = resources.GetString("clstFields.AccessibleName");
+      this.clstFields.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("clstFields.Anchor")));
+      this.clstFields.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("clstFields.BackgroundImage")));
+      this.clstFields.CheckOnClick = true;
+      this.clstFields.ColumnWidth = ((int)(resources.GetObject("clstFields.ColumnWidth")));
+      this.clstFields.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("clstFields.Dock")));
+      this.clstFields.Enabled = ((bool)(resources.GetObject("clstFields.Enabled")));
+      this.clstFields.Font = ((System.Drawing.Font)(resources.GetObject("clstFields.Font")));
+      this.clstFields.HorizontalExtent = ((int)(resources.GetObject("clstFields.HorizontalExtent")));
+      this.clstFields.HorizontalScrollbar = ((bool)(resources.GetObject("clstFields.HorizontalScrollbar")));
+      this.clstFields.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("clstFields.ImeMode")));
+      this.clstFields.IntegralHeight = ((bool)(resources.GetObject("clstFields.IntegralHeight")));
+      this.clstFields.Location = ((System.Drawing.Point)(resources.GetObject("clstFields.Location")));
+      this.clstFields.Name = "clstFields";
+      this.clstFields.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("clstFields.RightToLeft")));
+      this.clstFields.ScrollAlwaysVisible = ((bool)(resources.GetObject("clstFields.ScrollAlwaysVisible")));
+      this.clstFields.Size = ((System.Drawing.Size)(resources.GetObject("clstFields.Size")));
+      this.clstFields.TabIndex = ((int)(resources.GetObject("clstFields.TabIndex")));
+      this.clstFields.Visible = ((bool)(resources.GetObject("clstFields.Visible")));
+      this.clstFields.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.clstFields_ItemCheck);
+      //
       // ItemFieldChooser
       //
       this.AcceptButton = this.btnOK;
@@ -160,11 +149,11 @@
       this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize")));
       this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
       this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize")));
+      this.Controls.Add(this.clstFields);
       this.Controls.Add(this.btnOK);
-      this.Controls.Add(this.tvItemFields);
       this.Enabled = ((bool)(resources.GetObject("$this.Enabled")));
       this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font")));
-      this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
+      this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
       this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
       this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode")));
       this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location")));
@@ -183,6 +172,13 @@

     #endregion

+    private void clstFields_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e) {
+      // Enable button if at least one entry selected
+      this.btnOK.Enabled = false;
+      if (this.clstFields.CheckedItems.Count > 1 || e.NewValue == CheckState.Checked)
+	this.btnOK.Enabled = true;
+    }
+
   }

 }


Refactoring.

Refactoring.

--- ProgramSynthesis/ProseSample.Substrings/Semantics.cs
+++ ProgramSynthesis/ProseSample.Substrings/Semantics.cs
@@ -145,35 +145,8 @@
                     var n = ReconstructTree(v.Value);
                     resultList.Add(new Node(ConverterHelper.ConvertCSharpToTreeNode(n)));
                 }
-
-                //resultList.AddRange(edited);
             }
             return resultList;
-        }
-
-        /// <summary>
-        /// Script semantic function
-        /// </summary>
-        /// <param name="target">Node</param>
-        /// <param name="edits">Edit operations</param>
-        /// <returns>Transformed node.</returns>
-        public static Node Script(Node target, IEnumerable<Node> edits)
-        {
-            TreeNode<SyntaxNodeOrToken> current = edits.Last().Value;
-            if (edits.Last().LeftNode != null)
-            {
-                var leftnode = ReconstructTree(edits.First().LeftNode.Value);
-            }
-
-            if (edits.Last().RightNode != null)
-            {
-                var rightnode = ReconstructTree(edits.First().RightNode.Value);
-            }
-
-            var node = ReconstructTree(current);
-            Console.WriteLine(node.ToString());
-            var itree = ConverterHelper.ConvertCSharpToTreeNode(node);
-            return itree != null ? new Node(itree) : new Node(new TreeNode<SyntaxNodeOrToken>(default(SyntaxNodeOrToken), new TLabel(SyntaxKind.None)));
         }

         /// <summary>
@@ -447,12 +420,10 @@
                     iTree.AddChild(newchild, i);
                 }

-                var beforeFlorest = iTree.Children.Select(o => o.Value).ToList();
                 var emptyStatement = SyntaxFactory.EmptyStatement();
                 var newtree = new TreeNode<SyntaxNodeOrToken>(emptyStatement, new TLabel(SyntaxKind.EmptyStatement));
                 newtree.AddChild(iTree.Children.First(), 0);
                 var newNode = new Node(newtree);
-                //BeforeAfterMapping[newNode] = beforeFlorest;

                 regions.Add(newNode);
             }


Further optimizations

Further optimizations

--- RDFSharp/Semantics/OWL/Ontology/RDFOntologyHelper.cs
+++ RDFSharp/Semantics/OWL/Ontology/RDFOntologyHelper.cs
@@ -1019,36 +1019,32 @@
             #endregion

             #region HasValue
-            else if (ontRestriction     is RDFOntologyHasValueRestriction hasValueRestriction) {
+            else if (ontRestriction is RDFOntologyHasValueRestriction hasValueRestriction) {
                 if (hasValueRestriction.RequiredValue.IsFact()) {

                     //Enlist the same facts of the restriction's "RequiredValue"
-                    var compFacts        = ontology.Data.GetSameFactsAs((RDFOntologyFact)hasValueRestriction.RequiredValue)
-                                                        .AddFact((RDFOntologyFact)hasValueRestriction.RequiredValue);
-
-                    //Iterate the compatible assertions
-                    foreach (var tEntry in restrictionAssertions) {
-                        if (tEntry.TaxonomyObject.IsFact()) {
-                            if (compFacts.SelectFact(tEntry.TaxonomyObject.ToString()) != null) {
-                                result.AddFact((RDFOntologyFact)tEntry.TaxonomySubject);
+                    var facts = ontology.Data.GetSameFactsAs((RDFOntologyFact)hasValueRestriction.RequiredValue)
+                                             .AddFact((RDFOntologyFact)hasValueRestriction.RequiredValue);
+
+                    //Iterate the compatible assertions and track the occurrence informations
+                    foreach (var assertion in restrictionAssertions.Where(x => x.TaxonomyObject.IsFact())) {
+                        if (facts.SelectFact(assertion.TaxonomyObject.ToString()) != null) {
+                            result.AddFact((RDFOntologyFact)assertion.TaxonomySubject);
+                        }
+                    }
+
+                }
+                else if (hasValueRestriction.RequiredValue.IsLiteral()) {
+
+                    //Iterate the compatible assertions and track the occurrence informations
+                    foreach (var assertion in restrictionAssertions.Where(x => x.TaxonomyObject.IsLiteral()) {
+                        try {
+                            var literalsCompare = RDFQueryUtilities.CompareRDFPatternMembers(hasValueRestriction.RequiredValue.Value, assertion.TaxonomyObject.Value);
+                            if (literalsCompare == 0) {
+                                result.AddFact((RDFOntologyFact)assertion.TaxonomySubject);
                             }
                         }
-                    }
-
-                }
-                else if (hasValueRestriction.RequiredValue.IsLiteral()) {
-
-                    //Iterate the compatible assertions and track the occurrence informations
-                    foreach (var tEntry in restrictionAssertions) {
-                        if (tEntry.TaxonomyObject.IsLiteral()) {
-                            try {
-                                var semanticLiteralsCompare  = RDFQueryUtilities.CompareRDFPatternMembers(hasValueRestriction.RequiredValue.Value, tEntry.TaxonomyObject.Value);
-                                if (semanticLiteralsCompare == 0) {
-                                    result.AddFact((RDFOntologyFact)tEntry.TaxonomySubject);
-                                }
-                            }
-                            finally { }
-                        }
+                        finally { }
                     }

                 }


Cleanup and document ClickWaitUntilPost

Cleanup and document ClickWaitUntilPost

--- SeleniumExtension/Extensions/IWebElementExtension.cs
+++ SeleniumExtension/Extensions/IWebElementExtension.cs
@@ -2,7 +2,6 @@
 using System.Collections.Generic;
 using System.Threading;
 using OpenQA.Selenium.Internal;
-using OpenQA.Selenium.Support.UI;
 using SeleniumExtension;

 namespace OpenQA.Selenium
@@ -103,6 +102,25 @@

         #endregion

+        #region Clicks
+
+        /// <summary>
+        /// Clicks the current <see cref="IWebElement"/> and waits for the Post to start
+        /// </summary>
+        /// <param name="iWebDriver">The <see cref="IWebDriver"/> to be used for waiting</param>
+        /// <param name="maxWaitTimeInSeconds">Maximum amount of seconds as <see cref="int"/> to wait for the <see cref="IWebElement"/> to exist</param>
+        /// <returns></returns>
+        /// <returns><see langword="true"/> if the DOM is cleared or empty; otherwise, <see langword="false"/></returns>
+        public static bool ClickWaitUntilPost(this IWebElement iWebElement, IWebDriver iWebDriver, int maxWaitTimeInSeconds = 10)
+        {
+            By wait = By.CssSelector(string.Format("[{0}=\"true\"]", HtmlTagAttribute.WaitForPost));
+            iWebElement.SetAttribute(HtmlTagAttribute.WaitForPost, "true");
+            iWebElement.Click();
+            return iWebDriver.WaitUntilNotExists(wait, maxWaitTimeInSeconds);
+        }
+
+        #endregion
+
         /// <summary>
         /// Gets the value of the <see cref="HtmlTagAttribute"/>
         /// </summary>
@@ -125,14 +143,6 @@
                 throw new ArgumentException("element", "Element must wrap a web driver that supports javascript execution");

             javascript.ExecuteScript("arguments[0].setAttribute(arguments[1], arguments[2])", element, attributeName, value);
-        }
-
-        public static bool ClickWaitUntilPost(this IWebElement iWebElement, IWebDriver driver, int timeOutInSeconds = 10)
-        {
-            By wait = By.CssSelector(string.Format("[{0}=\"true\"]", HtmlTagAttribute.WaitForPost));
-            iWebElement.SetAttribute(HtmlTagAttribute.WaitForPost, "true");
-            iWebElement.Click();
-            return driver.WaitUntilNotExists(wait, timeOutInSeconds);
         }

         /// <summary>
@@ -214,9 +224,7 @@
             }
             return true;
         }
-

-
         #endregion
     }
 }


fix removing ToQuoted

fix removing ToQuoted

--- Signum.Engine.Extensions/Workflow/WorkflowBuilder.cs
+++ Signum.Engine.Extensions/Workflow/WorkflowBuilder.cs
@@ -378,11 +378,11 @@
     {
         public XmlEntity(T entity)
         {
-            var finalXml = @"<bpmn:definitions xmlns:xsi = " + WorkflowBuilder.xsi.ToString().ToQuoted() + " " +
-                          @"xmlns:bpmn = " + WorkflowBuilder.bpmn.ToString().ToQuoted() + " " +
-                          @"xmlns:bpmndi = " + WorkflowBuilder.bpmndi.ToString() + " " +
-                          @"xmlns:dc = " + WorkflowBuilder.dc.ToString().ToQuoted() + " " +
-                          @"xmlns:di = " + WorkflowBuilder.di.ToString().ToQuoted() + @" id = ""Definitions_1"" targetNamespace = " + WorkflowBuilder.targetNamespace.ToQuoted() + " > " +
+            var finalXml = @"<bpmn:definitions xmlns:xsi = " + ToQuoted(WorkflowBuilder.xsi.ToString()) + " " +
+                          @"xmlns:bpmn = " + ToQuoted(WorkflowBuilder.bpmn.ToString()) + " " +
+                          @"xmlns:bpmndi = " + ToQuoted(WorkflowBuilder.bpmndi.ToString()) + " " +
+                          @"xmlns:dc = " + ToQuoted(WorkflowBuilder.dc.ToString()) + " " +
+                          @"xmlns:di = " + ToQuoted(WorkflowBuilder.di.ToString()) + @" id = ""Definitions_1"" targetNamespace = " + ToQuoted(WorkflowBuilder.targetNamespace) + " > " +
                           @"<bpmndi:BPMNDiagram id = ""BPMNDiagram_1"" >"
                            + entity.Xml.DiagramXml +
                           @"</bpmndi:BPMNDiagram>" +
@@ -406,6 +406,11 @@
         public KeyValuePair<string, ModelEntity> ToModelKVP() => new KeyValuePair<string, ModelEntity>(bpmnElementId, Entity.GetModel());

         public override string ToString() => $"{bpmnElementId} {Entity.GetType().Name} {Entity.Name}";
+
+        public string ToQuoted(string str)
+        {
+            return "\"" + str + "\"";
+        }
     }

     public enum WorkflowBuilderMessage


Fix table aliases returned from ExpressionConverter.

--- Silk.Data.SQL.ORM/Expressions/ExpressionConverter.cs
+++ Silk.Data.SQL.ORM/Expressions/ExpressionConverter.cs
@@ -132,7 +132,7 @@
 					{
 						if (entityField.Join != null)
 						{
-							sourceExpression = new AliasIdentifierExpression(entityField.Join.SourceName);
+							sourceExpression = new AliasIdentifierExpression(entityField.Join.TableAlias);
 							if (!RequiredJoins.Contains(entityField.Join))
 								RequiredJoins.Add(entityField.Join);
 						}


FIxed a recursion in the throwif pattern

--- SolutionsPG.QuickSilver.Core/Exceptions/Arguments.cs
+++ SolutionsPG.QuickSilver.Core/Exceptions/Arguments.cs
@@ -14,7 +14,7 @@

         public static string ThrowIfArgumentNullOrWhiteSpace(this string obj, string argumentName)
         {
-            argumentName.ThrowIfArgumentNullOrWhiteSpace(nameof(argumentName));
+            argumentName.ThrowIf_(string.IsNullOrWhiteSpace(argumentName), _ => new ArgumentNullException(nameof(argumentName)));
             return obj.ThrowIf_(string.IsNullOrWhiteSpace(obj), _ => new ArgumentNullException(argumentName));
         }


Added: Failing Tests

Added: Failing Tests

--- Source/ChangeTracking.Tests/IChangeTrackableTests.cs
+++ Source/ChangeTracking.Tests/IChangeTrackableTests.cs
@@ -651,6 +651,26 @@
             trackable.CustomerNumber = "Change";

             trackable.CastToIChangeTrackable().ChangedProperties.Should().BeEquivalentTo(nameof(Order.CustomerNumber));
+        }
+
+        [Fact]
+        public void When_Changed_ComplexProperty_ChangedProperties_Should_ReturnChangedProperties()
+        {
+            Order order = Helper.GetOrder();
+            var trackable = order.AsTrackable();
+            trackable.Address.City = "Hanoi";
+
+            trackable.CastToIChangeTrackable().ChangedProperties.Should().BeEquivalentTo(nameof(Order.Address));
+        }
+
+        [Fact]
+        public void When_Changed_CollectionProperty_ChangedProperties_Should_ReturnChangedProperties()
+        {
+            Order order = Helper.GetOrder();
+            var trackable = order.AsTrackable();
+            trackable.OrderDetails.Clear();
+
+            trackable.CastToIChangeTrackable().ChangedProperties.Should().BeEquivalentTo(nameof(Order.OrderDetails));
         }

         [Fact]


Don't list all MIME types, use ResponseCompressionDefaults.MimeTypes

--- Source/MVC6/Boilerplate.AspNetCore.Sample/Startup.cs
+++ Source/MVC6/Boilerplate.AspNetCore.Sample/Startup.cs
@@ -1,5 +1,6 @@
 namespace MvcBoilerplate
 {
+    using System.Linq;
     using Boilerplate.AspNetCore;
     // $Start-RedirectToCanonicalUrl$
     using Boilerplate.AspNetCore.Filters;
@@ -10,6 +11,7 @@
     using Microsoft.AspNetCore.Mvc;
     using Microsoft.AspNetCore.Mvc.Infrastructure;
     using Microsoft.AspNetCore.Mvc.Routing;
+    using Microsoft.AspNetCore.ResponseCompression;
     // $Start-HttpsEverywhere-On$
     using Microsoft.AspNetCore.Rewrite;
     // $End-HttpsEverywhere-On$
@@ -167,27 +169,19 @@
                         // $Start-HttpsEverywhere-On$
                         options.EnableForHttps = true;
                         // $End-HttpsEverywhere-On$
-                        options.MimeTypes = new string[]
-                        {
-                            // General
-                            "text/plain",
-                            "text/css",
-                            "application/javascript",
-                            "text/html",
-                            "application/xml",
-                            "text/xml",
-                            "application/rss+xml",
-                            "application/atom+xml",
-                            "application/json",
-                            "text/json",
-                            // Images
-                            "image/svg+xml",
-                            "image/x-icon",
-                            // Fonts
-                            "application/vnd.ms-fontobject",
-                            "application/x-font-ttf",
-                             "font/otf"
-                        };
+                        options.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(
+                            new string[]
+                            {
+                                // ATOM
+                                "application/atom+xml",
+                                // Images
+                                "image/svg+xml",
+                                "image/x-icon",
+                                // Fonts
+                                "application/vnd.ms-fontobject",
+                                "application/x-font-ttf",
+                                 "font/otf"
+                            });
                     })
                 // Add useful interface for accessing the ActionContext outside a controller.
                 .AddSingleton<IActionContextAccessor, ActionContextAccessor>()


adding version to item name of http lifecycle

--- Source/StructureMap/Pipeline/HttpContextLifecycle.cs
+++ Source/StructureMap/Pipeline/HttpContextLifecycle.cs
@@ -1,11 +1,12 @@
 using System.Collections;
+using System.Reflection;
 using System.Web;

 namespace StructureMap.Pipeline
 {
     public class HttpContextLifecycle : ILifecycle
     {
-        public static readonly string ITEM_NAME = "STRUCTUREMAP-INSTANCES";
+        public static readonly string ITEM_NAME = string.Format("STRUCTUREMAP-INSTANCES-{0}", Assembly.GetExecutingAssembly().GetName().Version);

         public void EjectAll()


Null check stripeCharge.Metadata when looking up the cartNumber

--- Source/TeaCommerce.PaymentProviders/Inline/Stripe.cs
+++ Source/TeaCommerce.PaymentProviders/Inline/Stripe.cs
@@ -58,7 +58,7 @@
                     var stripeCharge = Mapper<Charge>.MapFromJson(stripeEvent.Data.Object.ToString());

                     // Get cart number from meta data or description (legacy)
-                    cartNumber = stripeCharge.Metadata.ContainsKey("cartNumber")
+                    cartNumber = stripeCharge.Metadata != null && stripeCharge.Metadata.ContainsKey("cartNumber")
                         ? stripeCharge.Metadata["cartNumber"]
                         : stripeCharge.Description;
                 }


Fix using wrong buried deployement

Fix using wrong buried deployement

--- Stratis.Bitcoin.FullNode/Consensus/ConsensusFlags.cs
+++ Stratis.Bitcoin.FullNode/Consensus/ConsensusFlags.cs
@@ -56,7 +56,7 @@

 			// Start enforcing CHECKLOCKTIMEVERIFY, (BIP65) for block.nVersion=4
 			// blocks, when 75% of the network has upgraded:
-			if(pindex.Height >= chainparams.BuriedDeployments[BuriedDeployments.BIP66])
+			if(pindex.Height >= chainparams.BuriedDeployments[BuriedDeployments.BIP65])
 			{
 				ScriptFlags |= ScriptVerify.CheckLockTimeVerify;
 			}


Fix PrinterRecoveryTest test

Fix PrinterRecoveryTest test

- Issue MatterHackers/MCCentral#2415
Null reference in TumbleCubeControl from PrinterRecoveryTest

--- Tests/MatterControl.AutomationTests/PrintingTests.cs
+++ Tests/MatterControl.AutomationTests/PrintingTests.cs
@@ -262,22 +262,21 @@

 					Assert.IsTrue(ProfileManager.Instance.ActiveProfile != null);

-					testRunner.SwitchToSliceSettings();
-
-					testRunner.ClickByName("General Tab");
-					testRunner.ClickByName("Single Print Tab");
+					// TODO: Delay needed to work around timing issue in MatterHackers/MCCentral#2415
+					testRunner.Delay(1);
+
+					testRunner.OpenPrintPopupMenu();
 					testRunner.ClickByName("Layer(s) To Pause Field");
 					testRunner.Type("2;4;6");

-					testRunner.ClickByName("Pin Settings Button");
-
 					// print a part
 					testRunner.AddItemToBedplate();
-					testRunner.ClickByName("Start Print Button");
-
-					// the printer is now paused
+					testRunner.StartPrint();
+
+					// Dismiss pause dialog
 					testRunner.WaitForName("No Button", 90); // the no button is 'Resume'
-															 // validate the current layer
+
+					// validate the current layer
 					Assert.AreEqual(2, ApplicationController.Instance.ActivePrinter.Connection.CurrentlyPrintingLayer);
 					testRunner.ClickByName("No Button");

@@ -293,6 +292,7 @@
 					testRunner.ClickByName("Connect to printer button");

 					// Assert that recovery happens
+
 					// Recover the print
 					ClickDialogButton(testRunner, "Yes Button", -1);


Fix feature shader parsing

Fix feature shader parsing

--- ValveResourceFormat/CompiledShader/CompiledShader.cs
+++ ValveResourceFormat/CompiledShader/CompiledShader.cs
@@ -107,8 +107,9 @@
             var e = Reader.ReadInt32();
             var f = Reader.ReadInt32();
             var g = Reader.ReadInt32();
-
-            Console.WriteLine($"{a} {b} {c} {d} {e} {f} {g}");
+            var h = Reader.ReadInt32();
+
+            Console.WriteLine($"{a} {b} {c} {d} {e} {f} {g} {h}");

             var count = Reader.ReadUInt32();

@@ -142,15 +143,16 @@
             }

             // Appears to be always 112 bytes
-            for (var i = 0; i < 7; i++)
-            {
-                // 0 -
+            for (var i = 0; i < 8; i++)
+            {
+                // 0 - ?
                 // 1 - vertex shader
                 // 2 - pixel shader
                 // 3 - geometry shader
                 // 4 - hull shader
                 // 5 - domain shader
-                // 6 - CD B1 D4.... hardcoded, this one might be 20 bytes because (0E 00 00 00) appears in other files too
+                // 6 - ?
+                // 7 - ?
                 var identifier = Reader.ReadBytes(16);

                 Console.WriteLine("#{0} identifier: {1}", i, BitConverter.ToString(identifier));


Added redirection on entering own room

Added redirection on entering own room

--- VlogRoom/VlogRoom.Web/Controllers/UsersController.cs
+++ VlogRoom/VlogRoom.Web/Controllers/UsersController.cs
@@ -34,6 +34,11 @@
             var user = this.userDataService.GetUserById(id);
             Guard.WhenArgument(user, "user").IsNull().Throw();

+            if (this.User.Identity.IsAuthenticated && user.UserName == this.User.Identity.Name)
+            {
+                return this.RedirectToAction("Account");
+            }
+
             var userModel = MappingService.Provider.Map<UserDataViewModel>(user);
             return View(userModel);
         }
@@ -55,7 +60,7 @@
         public ActionResult DailyFeed()
         {
             var currentUser = this.userDataService.GetUserByUsername(this.User.Identity.Name);
-            var model = currentUser.Subscribers.SelectMany(x => x.Videos);
+            var model = currentUser.Subscribers.SelectMany(x => x.Videos).Where(x => x.CreatedOn.Value.Day == DateTime.Now.Day);

             throw new NotImplementedException();
         }


js controller and UI for shape file mapping

--- Web/Areas/Settings/Views/AdminUnit/GISMapping.cshtml
+++ Web/Areas/Settings/Views/AdminUnit/GISMapping.cshtml
@@ -9,4 +9,165 @@

-@Html.Partial("_dashboardmap")+@using Cats.Services.Security
+@using LanguageHelpers.Localization
+@{
+    var user = (UserIdentity)HttpContext.Current.User.Identity;
+
+    }
+
+<link rel="stylesheet" href="~/Content/MapResources/openlayers/theme/default/style.css" type="text/css">
+
+
+
+
+
+

+

+

+

+                 <input class="input-small" ng-model="adminRegion.code"  ng-change="onMappingChange();"/>
+                <button ng-click="loadChildren(adminRegion.AdminUnitID)">Down</button> {{adminRegion.AdminUnitName}}
+

+
+

+

+

+
Admin Unit

+

+

+
+
+

+

+

+
Total Commoditiy Required

+

+

+
+


Making packet ring buffer logger smaller - it was too huge and useless.


Wrote some tests around hashset. One fails.

This is making me realize that perhaps we can be more consistent by saying
that `.Equals()` has different behavior from `==`. More experimentation is in
order.


DomTree Demo

DomTree Demo

--- UnitTestProject1/Demos.cs
+++ UnitTestProject1/Demos.cs
@@ -96,6 +96,27 @@

         }

+        [TestMethod]
+        public void DominatorTreeDemo()
+        {
+            var root = Parser.ParseString(Samples.SampleProgramText.domSampleTrivial);
+            var code = ProgramTreeToLinear.Build(root);
+            var blocks = LYtest.BaseBlocks.LinearToBaseBlock.Build(code);
+            var cfg = ListBlocksToCFG.Build(blocks);
+
+            Console.WriteLine(string.Join("\n", code));

+            for (int i = 0; i < blocks.Count(); i++)
+            {
+                Console.WriteLine(String.Format("\nBlock #{0}:", i));
+                Console.WriteLine(string.Join("\n", blocks[i].Enumerate()));
+            }
+
+            var dt = new LYtest.DominatorTree.DominatorTree(cfg);
+            var node = dt.GetRoot();
+
+            Console.WriteLine("\nDominator tree:");
+            Console.WriteLine(dt.ToString());
+        }
     }
 }


Fixed code span printing. Omit "aborting due to previous error" error

--- VisualRust.Build/Rustc.cs
+++ VisualRust.Build/Rustc.cs
@@ -374,19 +374,23 @@
             var primarySpan = msg.GetPrimarySpan();
             var code = msg.GetErrorCodeAsString();

+            // supress messages like "aborting due to previous error"
+            if (String.IsNullOrEmpty(code) && primarySpan == null)
+                return;
+
             if (type == RustcMessageType.Error)
             {
                 if (primarySpan == null)
                     Log.LogError(msg.message);
                 else
-                    Log.LogError(null, code, null, primarySpan.file_name, primarySpan.line_start, primarySpan.byte_start, primarySpan.line_end, primarySpan.byte_end, msg.message);
+                    Log.LogError(null, code, null, primarySpan.file_name, primarySpan.line_start, primarySpan.column_start, primarySpan.line_end, primarySpan.column_end, msg.message);
             }
             else
             {
                 if (primarySpan == null)
                     Log.LogWarning(msg.message);
                 else
-                    Log.LogWarning(null, code, null, primarySpan.file_name, primarySpan.line_start, primarySpan.byte_start, primarySpan.line_end, primarySpan.byte_end, msg.message);
+                    Log.LogWarning(null, code, null, primarySpan.file_name, primarySpan.line_start, primarySpan.column_start, primarySpan.line_end, primarySpan.column_end, msg.message);
             }

         }


Remove unused chameleon code

Remove unused chameleon code

--- osu.Framework.Tests/Visual/Containers/TestSceneSizing.cs
+++ osu.Framework.Tests/Visual/Containers/TestSceneSizing.cs
@@ -1153,9 +1153,6 @@

     internal class InfofulBox : Container
     {
-#pragma warning disable CA1805
-        public bool Chameleon = false;
-#pragma warning restore CA1805
         public bool AllowDrag = true;

         protected override void OnDrag(DragEvent e)
@@ -1175,45 +1172,5 @@
                 Depth = float.MaxValue,
             });
         }
-
-        private int lastSwitch;
-
-        protected override void Update()
-        {
-            if (Chameleon && (int)Time.Current / 1000 != lastSwitch)
-            {
-                lastSwitch = (int)Time.Current / 1000;
-
-                switch (lastSwitch % 6)
-                {
-                    case 0:
-                        Anchor = (Anchor)((int)Anchor + 1);
-                        Origin = (Anchor)((int)Origin + 1);
-                        break;
-
-                    case 1:
-                        this.MoveTo(new Vector2(0, 0), 800, Easing.Out);
-                        break;
-
-                    case 2:
-                        this.MoveTo(new Vector2(200, 0), 800, Easing.Out);
-                        break;
-
-                    case 3:
-                        this.MoveTo(new Vector2(200, 200), 800, Easing.Out);
-                        break;
-
-                    case 4:
-                        this.MoveTo(new Vector2(0, 200), 800, Easing.Out);
-                        break;
-
-                    case 5:
-                        this.MoveTo(new Vector2(0, 0), 800, Easing.Out);
-                        break;
-                }
-            }
-
-            base.Update();
-        }
     }
 }


Only allow Transformations on loaded Drawables.

--- osu.Framework/Graphics/Drawable_TransformationHelpers.cs
+++ osu.Framework/Graphics/Drawable_TransformationHelpers.cs
@@ -119,6 +119,8 @@

         public TransformAlpha FadeInFromZero(double duration)
         {
+            Debug.Assert(IsLoaded);
+
             if (transformationDelay == 0)
             {
                 Alpha = 0;
@@ -145,6 +147,8 @@

         public TransformAlpha FadeOutFromOne(double duration)
         {
+            Debug.Assert(IsLoaded);
+
             if (transformationDelay == 0)
             {
                 Alpha = 1;
@@ -168,6 +172,8 @@

         private Drawable transformFloatTo(float startValue, float newValue, double duration, EasingTypes easing, TransformFloat transform)
         {
+            Debug.Assert(IsLoaded);
+
             Type type = transform.GetType();
             if (transformationDelay == 0)
             {
@@ -224,6 +230,8 @@

         private Drawable transformVectorTo(Vector2 startValue, Vector2 newValue, double duration, EasingTypes easing, TransformVector transform)
         {
+            Debug.Assert(IsLoaded);
+
             Type type = transform.GetType();
             if (transformationDelay == 0)
             {
@@ -281,6 +289,8 @@

         public Drawable FadeColour(Color4 newColour, int duration, EasingTypes easing = EasingTypes.None)
         {
+            Debug.Assert(IsLoaded);
+
             updateTransformsOfType(typeof(TransformColour));
             Color4 startValue = (Transforms.FindLast(t => t is TransformColour) as TransformColour)?.EndValue ?? Colour;
             if (transformationDelay == 0)
@@ -306,6 +316,7 @@

         public Drawable FlashColour(Color4 flashColour, int duration)
         {
+            Debug.Assert(IsLoaded);
             Debug.Assert(transformationDelay == 0, @"FlashColour doesn't support Delay() currently");

             Color4 startValue = (Transforms.FindLast(t => t is TransformColour) as TransformColour)?.EndValue ?? Colour;


Provide correct `HitResult` type for random judgements in `TestSceneHitErrorMeter`

--- osu.Game.Tests/Visual/Gameplay/TestSceneHitErrorMeter.cs
+++ osu.Game.Tests/Visual/Gameplay/TestSceneHitErrorMeter.cs
@@ -48,7 +48,11 @@
         {
             AddStep("create display", () => recreateDisplay(new OsuHitWindows(), 5));

-            AddRepeatStep("New random judgement", () => newJudgement(), 40);
+            AddRepeatStep("New random judgement", () =>
+            {
+                double offset = RNG.Next(-150, 150);
+                newJudgement(offset, drawableRuleset.HitWindows.ResultFor(offset));
+            }, 400);

             AddRepeatStep("New max negative", () => newJudgement(-drawableRuleset.HitWindows.WindowFor(HitResult.Meh)), 20);
             AddRepeatStep("New max positive", () => newJudgement(drawableRuleset.HitWindows.WindowFor(HitResult.Meh)), 20);


Revert unintentional change

Revert unintentional change

--- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs
+++ osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs
@@ -120,8 +120,6 @@
             }
         }

-        protected override void ClearInternal(bool disposeChildren = true) => throw new InvalidOperationException($"Should never clear a {nameof(DrawableHitObject)}");
-
         protected override void LoadComplete()
         {
             base.LoadComplete();


make DescribedSerializationBase an IHaveSerializerRepresentation

--- OBeautifulCode.Serialization/Models/DescribedSerialization/DescribedSerializationBase.cs
+++ OBeautifulCode.Serialization/Models/DescribedSerialization/DescribedSerializationBase.cs
@@ -23,7 +23,7 @@
     /// enabling a consumer having the object and the serializer loaded,
     /// to deserialize the object.
     /// </remarks>
-    public abstract partial class DescribedSerializationBase : IModelViaCodeGen
+    public abstract partial class DescribedSerializationBase : IHaveSerializerRepresentation, IModelViaCodeGen
     {
         /// <summary>
         /// Initializes a new instance of the <see cref="DescribedSerializationBase"/> class.


Fix ExternalCPlusPlusProjectReferencesAreCorrectInSolutionTest on non-Windows platforms

--- Protobuild.FunctionalTests/ExternalCPlusPlusProjectReferencesAreCorrectInSolutionTest.cs
+++ Protobuild.FunctionalTests/ExternalCPlusPlusProjectReferencesAreCorrectInSolutionTest.cs
@@ -16,7 +16,7 @@
         {
             this.SetupTest("ExternalCPlusPlusProjectReferencesAreCorrectInSolution");

-            this.Generate("Windows");
+            this.Generate("Windows", hostPlatform: "Windows");

             _assert.True(File.Exists(this.GetPath(@"Module.Windows.sln")));


Remove default ID property mapping exclusion

--- mab.lib.SimpleMapper/SimpleMapper.cs
+++ mab.lib.SimpleMapper/SimpleMapper.cs
@@ -108,18 +108,17 @@

         public static void CopyProperties<TSource, TDestination>(TSource source, TDestination destination)
         {
-            // By default we don't want to map any property ending with "ID" (leave this to EF)
-            CopyProperties<TSource, TDestination>(source, destination, new List<string> { "^.*ID$" }, null, new List<string> { });
+            CopyProperties<TSource, TDestination>(source, destination, new List<string>(), null, new List<string>());
         }

         public static void CopyProperties<TSource, TDestination>(TSource source, TDestination destination, List<string> excludes)
         {
-            CopyProperties<TSource, TDestination>(source, destination, excludes, null, new List<string> { });
+            CopyProperties<TSource, TDestination>(source, destination, excludes, null, new List<string>());
         }

         public static void CopyProperties<TSource, TDestination>(TSource source, TDestination destination, List<string> excludes, Func<object, object> processingFunction)
         {
-            CopyProperties<TSource, TDestination>(source, destination, excludes, processingFunction, new List<string> { });
+            CopyProperties<TSource, TDestination>(source, destination, excludes, processingFunction, new List<string>());
         }

         public static void CopyProperties<TSource, TDestination>(TSource source, TDestination destination, List<string> excludes, Func<object, object> processingFunction, List<string> processingExcludes)


Formatting

Formatting

--- 01-AustralianVoting/01-AustralianVoting/BallotSet.cs
+++ 01-AustralianVoting/01-AustralianVoting/BallotSet.cs
@@ -55,10 +55,10 @@
 			// Convert to percentages
 			for (int _candidateCount = 0; _candidateCount < _candidates.Count; _candidateCount++)
 			{
-				_tally[_candidateCount + 1] = (int)(((double)_tally[_candidateCount + 1] /(double) _totalVotes) * 100);
+				_tally[_candidateCount + 1] = (int)(((double)_tally[_candidateCount + 1] / (double) _totalVotes) * 100) ;
 			}

-				return _tally;
+			return _tally;
 		}

 		public void ProcessEliminatedCandidates()


[FIXED] saving topic tags

[FIXED] saving topic tags

--- yafsrc/YAF.Types/Models/TopicTag.cs
+++ yafsrc/YAF.Types/Models/TopicTag.cs
@@ -33,6 +33,7 @@
     /// A class which represents the TopicTag table.
     /// </summary>
     [Serializable]
+    [CompositePrimaryKey(nameof(TagID), nameof(TopicID))]
     public class TopicTag : IEntity
     {
         #region Properties


Tidy up WPF support (no real support yet)

--- APE.Communication/APE.Communication/Communication.cs
+++ APE.Communication/APE.Communication/Communication.cs
@@ -2039,6 +2039,7 @@
                                     {
                                         if (Identifier.TechnologyType == "Windows Presentation Foundation (WPF)" || Identifier.TechnologyType == null)
                                         {
+                                            Handle = hWnd;
                                             wpfFindSourceByIdentifier(Identifier, ref Handle, ref Name, ref theText, ref theType, ref CurrentIndex, ref FoundControl);
                                             if (FoundControl)
                                             {
@@ -2461,6 +2462,7 @@
                                 {
                                     if (Identifier.TechnologyType == "Windows Presentation Foundation (WPF)" || Identifier.TechnologyType == null)
                                     {
+                                        Handle = hWnd;
                                         wpfFindSourceByIdentifier(Identifier, ref Handle, ref Name, ref theText, ref theType, ref CurrentIndex, ref FoundControl);
                                         if (FoundControl)
                                         {


Generalized actor actions

Generalized actor actions

--- Assets/Plugins/UnityActions/Scripts/Actions/Actor.cs
+++ Assets/Plugins/UnityActions/Scripts/Actions/Actor.cs
@@ -70,18 +70,23 @@
 		}

+		public Coroutine PerformAction(FiniteTimeAction anAction)
+		{
+			Director runner =Director.Setup(this);
+			return runner.StartCoroutine(YieldAction(anAction));

-	public Coroutine MoveBy(float duraction,Vector3 diff)
-	{
-			Director runner =Director.Setup(this);
-			return runner.StartCoroutine(YieldAction(new CC.MoveBy(duraction,diff)));
-	}
+		}

-		public Coroutine MoveTo(float duraction,Vector3 destination)
-	{
-			Director runner =Director.Setup(this);
-			return runner.StartCoroutine(YieldAction(new CC.MoveTo(duraction,destination)));
-	}
+		public Coroutine MoveBy(float aduration,Vector3 diff)
+		{
+			return PerformAction(new CC.MoveBy(aduration,diff));
+
+		}
+
+		public Coroutine MoveTo(float duraction,Vector3 targetPos)
+		{
+			return PerformAction(new CC.MoveTo(duraction,targetPos));
+		}

 }


Fix double slash inside image url

Fix double slash inside image url

--- Assets/Scripts/ImageLoader/JPL/JplImageInfoLoader.cs
+++ Assets/Scripts/ImageLoader/JPL/JplImageInfoLoader.cs
@@ -17,7 +17,7 @@
 		}

 		private const string JSON_BASE_URL = "http://www.jpl.nasa.gov/assets/json/getMore.php?images=true&search=anaglyph&page=";
-		private const string IMAGE_BASE_URL = "http://www.jpl.nasa.gov/";
+		private const string IMAGE_BASE_URL = "http://www.jpl.nasa.gov";

 		private string error = null;
 		private List<ImageData> imageDataList;


Refactor: Reorder language service methods

Gather the parse handlers into a region

--- AutoScaleLanguageService/AutoScaleLanguageService.cs
+++ AutoScaleLanguageService/AutoScaleLanguageService.cs
@@ -146,19 +146,109 @@
                     OnDisplayMemberList(req, authoringScope);
                     break;

+                case ParseReason.HighlightBraces:
+                    OnHighlightBraces(req);
+                    break;
+
                 case ParseReason.MemberSelect:
                     OnMemberSelect(req, authoringScope);
                     break;
-
-                case ParseReason.HighlightBraces:
-                    OnHighlightBraces(req);
-                    break;
             }

             return authoringScope;
         }

         #endregion LanguageService Members
+
+        #region Parse Handlers
+
+        // The user placed the cursor on an identifier and selected Edit, Intellisense,
+        // List Members. Display the list of identifiers that are valid in this context.
+        private void OnDisplayMemberList(ParseRequest req, AutoScaleAuthoringScope authoringScope)
+        {
+            var tokens = TokenizeFile(req);
+            string identifier = FindPrecedingIdentifier(req, tokens);
+
+            IEnumerable<AutoScaleDeclaration> declarationsToDisplay = null;
+
+            if (IsSamplingSystemVariableMember(identifier))
+            {
+                declarationsToDisplay = SamplingSystemVariableMembers;
+            }
+            else
+            {
+                IEnumerable<AutoScaleDeclaration> identifierDeclarations =
+                    FindIdentifiers(tokens, req.Text)
+                        .Where(id => !AllBuiltInIdentifiers.Select(decl => decl.Name).Contains(id))
+                        .Where(id => !SamplingSystemVariableMembers.Select(decl => decl.Name).Contains(id))
+                        .Distinct()
+                        .Select(id => new AutoScaleDeclaration(id, Resources.UserDefinedVariableDescription, (int)IconImageIndex.Variable + (int)IconImageIndex.AccessPrivate));
+
+                declarationsToDisplay = AllBuiltInIdentifiers
+                    .Union(identifierDeclarations)
+                    .OrderBy(decl => decl.Name);
+
+            }
+
+            foreach (var declaration in declarationsToDisplay)
+            {
+                authoringScope.AddDeclaration(declaration);
+            }
+        }
+
+        // The user typed a closing brace. Highlight the matching opening brace.
+        private void OnHighlightBraces(ParseRequest req)
+        {
+            var tokens = TokenizeFile(req);
+            var braceMatches = FindBraceMatches(tokens, req.Text);
+
+            int indexOfCaret = GetPositionOfLineIndex(req.Line, req.Col);
+            int? matchIndex = FindMatchForBrace(indexOfCaret, braceMatches);
+
+            if (matchIndex.HasValue)
+            {
+                int matchLine, matchCol;
+                GetLineIndexOfPosition(matchIndex.Value, out matchLine, out matchCol);
+
+                var spanAtCaret = new TextSpan
+                {
+                    iStartLine = req.Line,
+                    iEndLine = req.Line,
+                    // The caret is after the closing brace, so back up one column.
+                    iStartIndex = req.Col - 1,
+                    iEndIndex = req.Col
+                };
+
+                var spanAtMatch = new TextSpan
+                {
+                    iStartLine = matchLine,
+                    iEndLine = matchLine,
+                    iStartIndex = matchCol,
+                    iEndIndex = matchCol + 1
+                };
+
+                req.Sink.FoundMatchingBrace = true;
+                req.Sink.MatchPair(spanAtCaret, spanAtMatch, priority: 0);
+            }
+        }
+
+        // The user typed a member select operator. Provide the list of members of the
+        // identifier preceding the member select operator.
+        private void OnMemberSelect(ParseRequest req, AutoScaleAuthoringScope authoringScope)
+        {
+            var tokens = TokenizeFile(req);
+            string identifier = FindPrecedingIdentifier(req, tokens);
+
+            if (IsSamplingSystemVariable(identifier))
+            {
+                foreach (var declaration in SamplingSystemVariableMembers)
+                {
+                    authoringScope.AddDeclaration(declaration);
+                }
+            }
+        }
+
+        #endregion Parse Handlers

         #region Test Helpers

@@ -182,124 +272,6 @@

         #endregion Test Helpers

-        // The user placed the cursor on an identifier and selected Edit, Intellisense,
-        // List Members. Display the list of identifiers that are valid in this context.
-        private void OnDisplayMemberList(ParseRequest req, AutoScaleAuthoringScope authoringScope)
-        {
-            var tokens = TokenizeFile(req);
-            string identifier = FindPrecedingIdentifier(req, tokens);
-
-            IEnumerable<AutoScaleDeclaration> declarationsToDisplay = null;
-
-            if (IsSamplingSystemVariableMember(identifier))
-            {
-                declarationsToDisplay = SamplingSystemVariableMembers;
-            }
-            else
-            {
-                IEnumerable<AutoScaleDeclaration> identifierDeclarations =
-                    FindIdentifiers(tokens, req.Text)
-                        .Where(id => !AllBuiltInIdentifiers.Select(decl => decl.Name).Contains(id))
-                        .Where(id => !SamplingSystemVariableMembers.Select(decl => decl.Name).Contains(id))
-                        .Distinct()
-                        .Select(id => new AutoScaleDeclaration(id, Resources.UserDefinedVariableDescription, (int)IconImageIndex.Variable + (int)IconImageIndex.AccessPrivate));
-
-                declarationsToDisplay = AllBuiltInIdentifiers
-                    .Union(identifierDeclarations)
-                    .OrderBy(decl => decl.Name);
-
-            }
-
-            foreach (var declaration in declarationsToDisplay)
-            {
-                authoringScope.AddDeclaration(declaration);
-            }
-        }
-
-        private IEnumerable<string> FindIdentifiers(IEnumerable<TokenInfo> tokens, string input)
-        {
-            return tokens
-                .Where(t => t.Type == TokenType.Identifier)
-                .Select(t => GetTokenText(t, input));
-        }
-
-        // The user typed a member select operator. Provide the list of members of the
-        // identifier preceding the member select operator.
-        private void OnMemberSelect(ParseRequest req, AutoScaleAuthoringScope authoringScope)
-        {
-            var tokens = TokenizeFile(req);
-            string identifier = FindPrecedingIdentifier(req, tokens);
-
-            if (IsSamplingSystemVariable(identifier))
-            {
-                foreach (var declaration in SamplingSystemVariableMembers)
-                {
-                    authoringScope.AddDeclaration(declaration);
-                }
-            }
-        }
-
-        private bool IsSamplingSystemVariable(string identifier)
-        {
-            return SamplingSystemVariables.Any(sv => sv.Name == identifier);
-        }
-
-        private bool IsSamplingSystemVariableMember(string identifier)
-        {
-            return SamplingSystemVariableMembers.Any(sv => sv.Name == identifier);
-        }
-
-        // The user typed a closing brace. Highlight the matching opening brace.
-        private void OnHighlightBraces(ParseRequest req)
-        {
-            var tokens = TokenizeFile(req);
-            var braceMatches = FindBraceMatches(tokens, req.Text);
-
-            int indexOfCaret = GetPositionOfLineIndex(req.Line, req.Col);
-            int? matchIndex = FindMatchForBrace(indexOfCaret, braceMatches);
-
-            if (matchIndex.HasValue)
-            {
-                int matchLine, matchCol;
-                GetLineIndexOfPosition(matchIndex.Value, out matchLine, out matchCol);
-
-                var spanAtCaret = new TextSpan
-                {
-                    iStartLine = req.Line,
-                    iEndLine = req.Line,
-                    // The caret is after the closing brace, so back up one column.
-                    iStartIndex = req.Col - 1,
-                    iEndIndex = req.Col
-                };
-
-                var spanAtMatch = new TextSpan
-                {
-                    iStartLine = matchLine,
-                    iEndLine = matchLine,
-                    iStartIndex = matchCol,
-                    iEndIndex = matchCol + 1
-                };
-
-                req.Sink.FoundMatchingBrace = true;
-                req.Sink.MatchPair(spanAtCaret, spanAtMatch, priority: 0);
-            }
-        }
-
-        private IEnumerable<TokenInfo> TokenizeFile(ParseRequest req)
-        {
-            var tokens = new List<TokenInfo>();
-            int state = 0;
-
-            for (var info = new TokenInfo();
-                _scanner.ScanTokenAndProvideInfoAboutIt(info, ref state);
-                info = new TokenInfo())
-            {
-                tokens.Add(info);
-            }
-
-            return tokens;
-        }
-
         private IEnumerable<BraceMatch> FindBraceMatches(IEnumerable<TokenInfo> tokens, string text)
         {
             var braceMatches = new List<BraceMatch>();
@@ -326,6 +298,13 @@
             return braceMatches;
         }

+        private IEnumerable<string> FindIdentifiers(IEnumerable<TokenInfo> tokens, string input)
+        {
+            return tokens
+                .Where(t => t.Type == TokenType.Identifier)
+                .Select(t => GetTokenText(t, input));
+        }
+
         private int? FindMatchForBrace(int indexOfCaret, IEnumerable<BraceMatch> braceMatches)
         {
             foreach (var braceMatch in braceMatches)
@@ -377,5 +356,30 @@
                 token.StartIndex,
                 token.EndIndex - token.StartIndex + 1);
         }
+
+        private bool IsSamplingSystemVariable(string identifier)
+        {
+            return SamplingSystemVariables.Any(sv => sv.Name == identifier);
+        }
+
+        private bool IsSamplingSystemVariableMember(string identifier)
+        {
+            return SamplingSystemVariableMembers.Any(sv => sv.Name == identifier);
+        }
+
+        private IEnumerable<TokenInfo> TokenizeFile(ParseRequest req)
+        {
+            var tokens = new List<TokenInfo>();
+            int state = 0;
+
+            for (var info = new TokenInfo();
+                _scanner.ScanTokenAndProvideInfoAboutIt(info, ref state);
+                info = new TokenInfo())
+            {
+                tokens.Add(info);
+            }
+
+            return tokens;
+        }
     }
 }


Log Exception in SynchronizerFactory if google task list can't be fetched.

--- CalDavSynchronizer/Scheduling/SynchronizerFactory.cs
+++ CalDavSynchronizer/Scheduling/SynchronizerFactory.cs
@@ -360,10 +360,16 @@

       var tasksService = System.Threading.Tasks.Task.Run (() => OAuth.Google.GoogleHttpClientFactory.LoginToGoogleTasksService (options.UserName).Result).Result;

-      var taskList = tasksService.Tasklists.Get (options.CalenderUrl).Execute();
-
-      if (taskList == null)
-        throw new System.Exception ($"Profile '{options.Name}' (Id: '{options.Id}'): task list '{options.CalenderUrl}' not found.");
+      TaskList taskList;
+      try
+      {
+        taskList = tasksService.Tasklists.Get (options.CalenderUrl).Execute();
+      }
+      catch (Google.GoogleApiException)
+      {
+        s_logger.ErrorFormat ($"Profile '{options.Name}' (Id: '{options.Id}'): task list '{options.CalenderUrl}' not found.");
+        throw;
+      }

       var btypeRepository = new GoogleTaskRepository (tasksService, taskList);


Trigger the vessel remove more often

Trigger the vessel remove more often

--- Client/Systems/VesselRemoveSys/VesselRemoveSystem.cs
+++ Client/Systems/VesselRemoveSys/VesselRemoveSystem.cs
@@ -36,7 +36,7 @@
             GameEvents.onVesselWillDestroy.Add(VesselRemoveEvents.OnVesselWillDestroy);
             GameEvents.onGameStatePostLoad.Add(VesselRemoveEvents.OnGameStatePostLoad);
             SetupRoutine(new RoutineDefinition(1000, RoutineExecution.Update, KillPastSubspaceVessels));
-            SetupRoutine(new RoutineDefinition(1000, RoutineExecution.Update, RemoveQueuedVessels));
+            SetupRoutine(new RoutineDefinition(500, RoutineExecution.Update, RemoveQueuedVessels));
             SetupRoutine(new RoutineDefinition(20000, RoutineExecution.Update, FlushRemovedVessels));
         }


Updating FindView_UsesViewLocationExpandersToLocateViews for IRazorViewFactory.

--- test/Microsoft.AspNet.Mvc.Razor.Test/RazorViewEngineTest.cs
+++ test/Microsoft.AspNet.Mvc.Razor.Test/RazorViewEngineTest.cs
@@ -302,7 +302,7 @@
                 };
             }
         }
-/*
+
         [Theory]
         [MemberData(nameof(FindView_UsesViewLocationExpandersToLocateViewsData))]
         public void FindView_UsesViewLocationExpandersToLocateViews(IDictionary<string, object> routeValues,
@@ -313,6 +313,10 @@
             pageFactory.Setup(p => p.CreateInstance("test-string/bar.cshtml"))
                        .Returns(Mock.Of<IRazorPage>())
                        .Verifiable();
+
+            var viewFactory = new Mock<IRazorViewFactory>();
+            viewFactory.Setup(p => p.GetView(It.IsAny<IRazorPage>(), It.IsAny<bool>()))
+                       .Returns(Mock.Of<IView>());

             var expander1Result = new[] { "some-seed" };
             var expander1 = new Mock<IViewLocationExpander>();
@@ -343,21 +347,21 @@
                      .Returns(new[] { "test-string/{1}.cshtml" })
                      .Verifiable();

-            var viewEngine = CreateViewEngine(pageFactory.Object,
+            var viewEngine = CreateViewEngine(pageFactory.Object, viewFactory.Object,
                                  new[] { expander1.Object, expander2.Object });
-            var context = GetActionContext(routeValues);
+            var context = GetActionContext(routeValues, viewFactory.Object);

             // Act
             var result = viewEngine.FindView(context, "test-view");

             // Assert
             Assert.True(result.Success);
-            Assert.IsAssignableFrom<IRazorView>(result.View);
+            Assert.IsAssignableFrom<RazorView>(result.View);
             pageFactory.Verify();
             expander1.Verify();
             expander2.Verify();
         }
-*/
+
         [Fact]
         public void FindView_CachesValuesIfViewWasFound()
         {


Correct ListAdapter tests Modifying a ReadOnlyCollection will always fail

--- test/Microsoft.AspNetCore.JsonPatch.Test/ListAdapterTest.cs
+++ test/Microsoft.AspNetCore.JsonPatch.Test/ListAdapterTest.cs
@@ -181,7 +181,7 @@
             var sDto = new SimpleDTO();
             var iDto = new InheritedDTO();
             var resolver = new Mock<IContractResolver>(MockBehavior.Strict);
-            var targetObject = (new List<SimpleDTO>() { sDto });
+            var targetObject = new List<SimpleDTO>() { sDto };
             var listAdapter = new ListAdapter();
             string message = null;

@@ -200,7 +200,7 @@
         {
             // Arrange
             var resolver = new Mock<IContractResolver>(MockBehavior.Strict);
-            var targetObject = (new List<int>() { 10, 20 }).AsReadOnly();
+            var targetObject = new List<int>() { 10, 20 };
             var listAdapter = new ListAdapter();
             string message = null;

@@ -411,7 +411,7 @@
         {
             // Arrange
             var resolver = new Mock<IContractResolver>(MockBehavior.Strict);
-            var targetObject = (new List<int>() { 10, 20 }).AsReadOnly();
+            var targetObject = new List<int>() { 10, 20 };
             var listAdapter = new ListAdapter();
             string message = null;


Added skeleton method for replacing constructor calls

--- Deflector/Deflector/MethodCallInterceptionEmitter.cs
+++ Deflector/Deflector/MethodCallInterceptionEmitter.cs
@@ -39,7 +39,7 @@
             _getMethodCall = module.ImportMethod<IDictionary<MethodBase, IMethodCall>>("get_Item");
             _invokeMethod = module.ImportMethod<IMethodCall>("Invoke");
             _stackCtor = module.ImportConstructor<Stack<object>>(new Type[0]);
-            _markerAttributeCtor = module.ImportConstructor<MethodCallsAlreadyInterceptedAttribute>(new Type[0]);
+            _markerAttributeCtor = module.ImportConstructor<MethodCallsAlreadyInterceptedAttribute>(new Type[0]);
             _markerAttributeType = module.ImportType<MethodCallsAlreadyInterceptedAttribute>();
             _addMethodCalls = module.ImportMethod<IMethodCallProvider>("AddMethodCalls");

@@ -88,18 +88,20 @@
             var callInstructions = oldInstructions.Where(instruction => instruction.OpCode == OpCodes.Call ||
                                                                         instruction.OpCode == OpCodes.Callvirt).ToArray();

+            var constructorCalls = oldInstructions.Where(instruction => instruction.OpCode == OpCodes.Newobj).ToArray();
+
             // Skip the method if there are no calls to intercept
-            if (callInstructions.Any())
+            if (callInstructions.Any() || constructorCalls.Any())
             {
                 var il = body.GetILProcessor();
                 var targetMethods = callInstructions.Select(instruction => instruction.Operand as MethodReference).ToArray();

                 // Precalculate all method call interceptors
-                var addMethod = module.ImportMethod<IDictionary<MethodBase, IMethodCall>>("Add", typeof (MethodBase),
-                    typeof (IMethodCall));
+                var addMethod = module.ImportMethod<IDictionary<MethodBase, IMethodCall>>("Add", typeof(MethodBase),
+                    typeof(IMethodCall));

                 var provider = method.AddLocal<IMethodCallProvider>();
-                var getProvider = module.ImportMethod("GetProvider", typeof (MethodCallProviderRegistry));
+                var getProvider = module.ImportMethod("GetProvider", typeof(MethodCallProviderRegistry));

                 // Create the stack that will hold the method arguments
                 il.Emit(OpCodes.Newobj, _stackCtor);
@@ -121,7 +123,7 @@
                 var skipCallMapConstruction = il.Create(OpCodes.Nop);

                 il.Emit(OpCodes.Ldloc, provider);
-                il.Emit(OpCodes.Brfalse, skipCallMapConstruction);
+                il.Emit(OpCodes.Brfalse, skipCallMapConstruction);

                 // if (provider != null) {

@@ -146,7 +148,7 @@
                 il.Emit(OpCodes.Ldloc, _interceptedMethods);
                 il.Emit(OpCodes.Ldloc, _callMap);
                 il.PushStackTrace(module);
-                il.Emit(OpCodes.Callvirt, _addMethodCalls);
+                il.Emit(OpCodes.Callvirt, _addMethodCalls);

                 il.Append(skipCallMapConstruction);

@@ -159,12 +161,22 @@
                         continue;
                     }

-                    ReplaceMethodCallInstruction(instruction, method, il);
+                    if (opCode == OpCodes.Call || opCode == OpCodes.Callvirt)
+                        ReplaceMethodCallInstruction(instruction, method, il);
+
+                    if(opCode == OpCodes.Newobj)
+                        ReplaceConstructorCall(instruction, method, il);
                 }
             }

             // Add the attribute marker so that this method is only modified once
             customAttributes.Add(new CustomAttribute(_markerAttributeCtor));
+        }
+
+        private void ReplaceConstructorCall(Instruction oldInstruction, MethodDefinition hostMethod,
+            ILProcessor il)
+        {
+            il.Append(oldInstruction);
         }

         private void ReplaceMethodCallInstruction(Instruction oldInstruction, MethodDefinition hostMethod,


fix QuickSets to return results of expected sets in dict[]

older partial sets are being included that are not in dict[]

--- Duplicati/Library/Main/Database/LocalListDatabase.cs
+++ Duplicati/Library/Main/Database/LocalListDatabase.cs
@@ -372,9 +372,12 @@
                             while (rd.Read())
                             {
                                 var id = rd.GetInt64(0);
+
+                                if (!dict.ContainsKey(id)) continue;
+
                                 var backupType = rd.GetInt32(1);
                                 var e = dict[id];
-
+
                                 if (isFullBackupEncountered && backupType != BackupType.FULL_BACKUP) continue;

                                 yield return new Fileset(e, backupType, m_filesets[e].Value, -1L, -1L);


Adding redirect to beta

Adding redirect to beta

--- EmpleoDotNet/Controllers/JobOpportunityController.cs
+++ EmpleoDotNet/Controllers/JobOpportunityController.cs
@@ -93,9 +93,9 @@

         [HttpGet]

-        [Authorize]
         public ActionResult New()
         {
+            return Redirect("https://beta.emplea.do");
             var viewModel = new NewJobOpportunityViewModel();
             viewModel.MapsApiKey = ConfigurationManager.AppSettings["GoogleMapsApiKey"];

@@ -149,6 +149,7 @@
         [HttpGet]
         public ActionResult Wizard()
         {
+            return Redirect("https://beta.emplea.do");
             var viewModel = new Wizard();
             viewModel.MapsApiKey = ConfigurationManager.AppSettings["GoogleMapsApiKey"];
             return View(viewModel);


Make SpecialGremlinString public so it can be used with AddStep to write queries that cannot be expressed by the fluent interface alone.

--- ExRam.Gremlinq/Serialization/SpecialGremlinString.cs
+++ ExRam.Gremlinq/Serialization/SpecialGremlinString.cs
@@ -3,7 +3,7 @@

 namespace ExRam.Gremlinq
 {
-    internal struct SpecialGremlinString : IGremlinSerializable
+    public struct SpecialGremlinString : IGremlinSerializable
     {
         private readonly string _value;


Added internal CollectionChanged event handler to simplify adding and removing children to a TreeItemVM

--- FactorioModBuilder/ViewModels/Base/TreeItemVMBase.cs
+++ FactorioModBuilder/ViewModels/Base/TreeItemVMBase.cs
@@ -13,6 +13,7 @@
 using System.ComponentModel;
 using FactorioModBuilder.Resources.Icons;
 using System.Windows.Input;
+using System.Collections.Specialized;

 namespace FactorioModBuilder.ViewModels.Base
 {
@@ -168,15 +169,57 @@
             _parent = parent;
             _item = item;
             this.Children = new ObservableCollection<TreeItemVMBase>();
+            this.Children.CollectionChanged += OnChildrenCollectionChanged;
             foreach (var c in children)
-            {
-                c._parent = this;
-                this.OnInitComplete += c.ParentInitComplete;
                 this.Children.Add(c);
-            }

             if(_parent != null)
                 parent.OnInitComplete += ParentInitComplete;
+        }
+
+        private void OnChildrenCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
+        {
+            switch (e.Action)
+            {
+                case NotifyCollectionChangedAction.Add:
+                    foreach(TreeItemVMBase i in e.NewItems)
+                    {
+                        i._parent = this;
+                        this.OnInitComplete += i.ParentInitComplete;
+                    }
+                    break;
+                case NotifyCollectionChangedAction.Remove:
+                    foreach(TreeItemVMBase i in e.OldItems)
+                    {
+                        if (ReferenceEquals(this, i._parent))
+                            i._parent = null;
+                        this.OnInitComplete -= i.ParentInitComplete;
+                    }
+                    break;
+                case NotifyCollectionChangedAction.Replace:
+                    foreach(TreeItemVMBase oi in e.OldItems)
+                    {
+                        if (ReferenceEquals(this, oi._parent))
+                            oi._parent = null;
+                        this.OnInitComplete -= oi.ParentInitComplete;
+                    }
+                    foreach(TreeItemVMBase ni in e.NewItems)
+                    {
+                        ni._parent = this;
+                        this.OnInitComplete += ni.ParentInitComplete;
+                    }
+                    break;
+                case NotifyCollectionChangedAction.Reset:
+                    foreach(TreeItemVMBase i in e.OldItems)
+                    {
+                        if (ReferenceEquals(this, i._parent))
+                            i._parent = null;
+                        this.OnInitComplete -= i.ParentInitComplete;
+                    }
+                    break;
+                default:
+                    throw new Exception("Unhandled Children Collection Changed");
+            }
         }

         /// <summary>


adds a few more MessageLevel colors

adds a few more MessageLevel colors

--- Handle.WPF/Handle.WPF/Converters/MessageConverter.cs
+++ Handle.WPF/Handle.WPF/Converters/MessageConverter.cs
@@ -35,6 +35,7 @@
   using System.Windows.Documents;
   using System.Windows.Media;
   using Caliburn.Micro;
+  using System.Windows;

   /// <summary>
   /// Represents a concrete ValueConverter to convert strings, possibly containing links, to TextBlocks
@@ -94,11 +95,20 @@
       }

       TextBlock tb = new TextBlock();
+      var msg = value as Handle.WPF.Message;
       foreach (var inline in inlines)
       {
-        if ((value as Handle.WPF.Message).Levels.Contains(MessageLevels.Highlight))
+        if (inline is Run)
         {
-          if (inline is Run)
+          if (msg.Levels.Contains(MessageLevels.Highlight))
+          {
+            inline.FontWeight = FontWeights.DemiBold;
+          }
+          else if (msg.Levels.Contains(MessageLevels.Join))
+          {
+            inline.Foreground = Brushes.Green;
+          }
+          else if (msg.Levels.Contains(MessageLevels.Part))
           {
             inline.Foreground = Brushes.Red;
           }


Fixed #108.

Fixed #108.

--- JexusManager.Features.Rewrite/Inbound/InboundRule.cs
+++ JexusManager.Features.Rewrite/Inbound/InboundRule.cs
@@ -107,6 +107,7 @@
             ConfigurationElement matchElement = Element.ChildElements["match"];
             PatternUrl = (string)matchElement["url"];
             Negate = (bool)matchElement["negate"];
+            IgnoreCase = (bool)matchElement["ignoreCase"];
             ConfigurationElement actionElement = Element.ChildElements["action"];
             Type = (long)actionElement["type"];
             ActionUrl = (string)actionElement["url"];
@@ -173,6 +174,7 @@
             ConfigurationElement matchElement = Element.ChildElements["match"];
             matchElement["url"] = PatternUrl;
             matchElement["negate"] = Negate;
+            matchElement["ignoreCase"] = IgnoreCase;
             ConfigurationElement actionElement = Element.ChildElements["action"];
             actionElement["type"] = Type;
             actionElement["url"] = ActionUrl;


Workaround for Mono bug where ParameterInfo returns an empty string in case of return argument.

--- JsonRpc.Commons/Contracts/JsonRpcContractResolver.cs
+++ JsonRpc.Commons/Contracts/JsonRpcContractResolver.cs
@@ -141,7 +141,7 @@
                 throw new NotSupportedException("Argument with out, ref, or of pointer type is not supported.");
             // parameter.Name == null for return parameter
             var taskResultType = Utility.GetTaskResultType(parameter.ParameterType);
-            if (parameter.Name != null && taskResultType != null)
+            if (String.IsNullOrWhiteSpace(parameter.Name) != true && taskResultType != null)
                 throw new NotSupportedException("Argument with type of System.Threading.Task is not supported.");
             var attr = parameter.GetCustomAttribute<JsonRpcParameterAttribute>();
             var inst = new JsonRpcParameter


Now continuously sending neutral panning speed on selected camera

--- MarsRover/RoverOperator/Gamepad/GamepadController.cs
+++ MarsRover/RoverOperator/Gamepad/GamepadController.cs
@@ -14,7 +14,7 @@
     {
         private Logger logger = LogManager.GetCurrentClassLogger();
         private const int POLLING_RATE = 200; //milliseconds
-        private const int STATE_CHECK_INTERVAL = 200;
+        private const int STATE_CHECK_INTERVAL = 50;
         private const int BUTTON_PRESS_SAFE_INTERVAL = 1000;
         Dictionary<int, CameraState> cameraStates;

@@ -223,14 +223,19 @@
                     }
                 }

+                bool panning = false;
+                bool tilting = false;
+
                 //Actually panning/tilting
                 if (state.Gamepad.Buttons.HasFlag(GamepadButtonFlags.DPadLeft)) //Left Pan
                 {
+                    panning = true;
                     cameraStates[selectedCamera].Pan = 0;
                 }

                 else if (state.Gamepad.Buttons.HasFlag(GamepadButtonFlags.DPadRight)) //Right Pan
                 {
+                    panning = true;
                     cameraStates[selectedCamera].Pan = 200;
                 }

@@ -240,6 +245,7 @@
                         cameraStates[selectedCamera].Tilt = 90;
                     else
                         cameraStates[selectedCamera].Tilt += angleIncrement;
+                    tilting = true;
                 }

                 else if (state.Gamepad.Buttons.HasFlag(GamepadButtonFlags.DPadDown)) //Down Tilt
@@ -248,16 +254,22 @@
                         cameraStates[selectedCamera].Tilt = 0;
                     else
                         cameraStates[selectedCamera].Tilt -= angleIncrement;
+                    tilting = true;
                 }

                 //Sending commands
-                if (state.Gamepad.Buttons.HasFlag(GamepadButtonFlags.DPadLeft) || state.Gamepad.Buttons.HasFlag(GamepadButtonFlags.DPadRight))
+                if (panning)
                 {
                     string command = "<P" + selectedCamera + getPaddedInt(cameraStates[selectedCamera].Pan) + ">";
                     commands.Add(command.ToString());
                 }
-
-                else if (state.Gamepad.Buttons.HasFlag(GamepadButtonFlags.DPadUp) || state.Gamepad.Buttons.HasFlag(GamepadButtonFlags.DPadDown))
+                else
+                {
+                    string command = "<P" + selectedCamera + "100>";
+                    commands.Add(command.ToString());
+                }
+
+                if (tilting)
                 {
                     string command = "<T" + selectedCamera + getPaddedInt(cameraStates[selectedCamera].Tilt) + ">";
                     commands.Add(command.ToString());
@@ -297,7 +309,7 @@
                 {
                     CommandSender.Instance.UpdateCommand(command.ToString());
                     Thread.Sleep(STATE_CHECK_INTERVAL);
-                    logger.Debug(command.ToString());
+                    //logger.Debug(command.ToString());
                 }
             }


Change color of 'update available'

Change color of 'update available'

issue: MatterHackers/MCCentral#5995
Change 'Update Available' to be in the accent color.

--- MatterControlLib/PartPreviewWindow/MainViewWidget.cs
+++ MatterControlLib/PartPreviewWindow/MainViewWidget.cs
@@ -237,7 +237,8 @@
 					Name = "Update Available Link",
 					ToolTipText = "There is a new update available for download".Localize(),
 					VAnchor = VAnchor.Center,
-					Margin = new BorderDouble(10, 0)
+					Margin = new BorderDouble(10, 0),
+					TextColor = theme.PrimaryAccentColor
 				};

 				// Register listeners
@@ -485,7 +486,7 @@
 			double totalSeconds = 0;

 			var textWidgets = updateAvailableButton.Descendants<TextWidget>().Where((w) => w.Visible == true).ToArray();
-			Color startColor = theme.TextColor;
+			Color startColor = theme.PrimaryAccentColor;

 			// Show a highlight on the button as the user did not click it
 			var flashBackground = new Animation()


New tabs should open to the far right

New tabs should open to the far right

- Issue MatterHackers/MCCentral#4693
Added printer/part tabs should be at position count + 1

--- MatterControlLib/PartPreviewWindow/MainViewWidget.cs
+++ MatterControlLib/PartPreviewWindow/MainViewWidget.cs
@@ -549,15 +549,8 @@
 				// Unregister listener on Tab close
 				printerTab.Closed += (s, e) => printer.Settings.SettingChanged -= Printer_SettingChanged;

-				// Add printer into fixed position
-				if (tabControl.AllTabs.Any())
-				{
-					tabControl.AddTab(printerTab, 3);
-				}
-				else
-				{
-					tabControl.AddTab(printerTab);
-				}
+				// Add printer tab
+				tabControl.AddTab(printerTab);

 				return printerTab;
 			}
@@ -578,8 +571,6 @@
 			{
 				Name = "New Design".Localize() + (partCount == 0 ? "" : $" ({partCount})"),
 			};
-
-			partCount++;

 			await workspace.SceneContext.LoadContent(
 				new EditContext()


- Experimental Branch Merge #251

- Experimental Branch Merge #251

git-svn-id: 61c3ae23f3a6520e9bc357b51591209af2ede9d8@1153 45b04e34-05f1-4d87-a130-40a8491d5c8b

--- Mosa/Platforms/x86/LongOperandTransformationStage.cs
+++ Mosa/Platforms/x86/LongOperandTransformationStage.cs
@@ -218,31 +218,31 @@
 			RegisterOperand ecx = new RegisterOperand(I4, GeneralPurposeRegister.ECX);
 			RegisterOperand edx = new RegisterOperand(I4, GeneralPurposeRegister.EDX);

-			newBlocks[0].InsertInstructionAfter(IR.Instruction.MoveInstruction, eax, op1H);
-			newBlocks[0].InsertInstructionAfter(IR.Instruction.MoveInstruction, ecx, op2H);
+			newBlocks[0].InsertInstructionAfter(CPUx86.Instruction.MoveInstruction, eax, op1H);
+			newBlocks[0].InsertInstructionAfter(CPUx86.Instruction.MoveInstruction, ecx, op2H);
 			newBlocks[0].InsertInstructionAfter(CPUx86.Instruction.LogicalOrInstruction, ecx, eax);
-			newBlocks[0].InsertInstructionAfter(IR.Instruction.MoveInstruction, ecx, op2L);
+			newBlocks[0].InsertInstructionAfter(CPUx86.Instruction.MoveInstruction, ecx, op2L);
 			newBlocks[0].InsertInstructionAfter(IR.Instruction.BranchInstruction, IR.ConditionCode.NotEqual, newBlocks[2].BasicBlock);
 			newBlocks[0].InsertInstructionAfter(CPUx86.Instruction.JumpInstruction, newBlocks[1].BasicBlock);

-			newBlocks[1].InsertInstructionAfter(IR.Instruction.MoveInstruction, eax, op1L);
+			newBlocks[1].InsertInstructionAfter(CPUx86.Instruction.MoveInstruction, eax, op1L);
 			newBlocks[1].InsertInstructionAfter(CPUx86.Instruction.DirectMultiplicationInstruction, ecx);
 			newBlocks[1].InsertInstructionAfter(CPUx86.Instruction.JumpInstruction, nextBlock.BasicBlock);

 			newBlocks[2].InsertInstructionAfter(CPUx86.Intrinsics.PushInstruction, null, ebx);
 			newBlocks[2].InsertInstructionAfter(CPUx86.Instruction.DirectMultiplicationInstruction, ecx);
-			newBlocks[2].InsertInstructionAfter(IR.Instruction.MoveInstruction, ebx, eax);
-			newBlocks[2].InsertInstructionAfter(IR.Instruction.MoveInstruction, eax, op1L);
+			newBlocks[2].InsertInstructionAfter(CPUx86.Instruction.MoveInstruction, ebx, eax);
+			newBlocks[2].InsertInstructionAfter(CPUx86.Instruction.MoveInstruction, eax, op1L);
 			newBlocks[2].InsertInstructionAfter(CPUx86.Instruction.DirectMultiplicationInstruction, op2H);
 			newBlocks[2].InsertInstructionAfter(CPUx86.Instruction.AddInstruction, ebx, eax);
-			newBlocks[2].InsertInstructionAfter(IR.Instruction.MoveInstruction, eax, op1L);
+			newBlocks[2].InsertInstructionAfter(CPUx86.Instruction.MoveInstruction, eax, op1L);
 			newBlocks[2].InsertInstructionAfter(CPUx86.Instruction.DirectMultiplicationInstruction, ecx);
 			newBlocks[2].InsertInstructionAfter(CPUx86.Instruction.AddInstruction, edx, ebx);
 			newBlocks[2].InsertInstructionAfter(CPUx86.Intrinsics.PopInstruction, ebx);
 			newBlocks[2].InsertInstructionAfter(CPUx86.Instruction.JumpInstruction, nextBlock.BasicBlock);

-			nextBlock.InsertInstructionAfter(IR.Instruction.MoveInstruction, op0L, eax);
-			nextBlock.InsertInstructionAfter(IR.Instruction.MoveInstruction, op0H, edx);
+			nextBlock.InsertInstructionAfter(CPUx86.Instruction.MoveInstruction, op0L, eax);
+			nextBlock.InsertInstructionAfter(CPUx86.Instruction.MoveInstruction, op0H, edx);

 			// Link the created Blocks together
 			LinkBlocks(newBlocks, ctx, nextBlock);
@@ -1205,12 +1205,12 @@
 				SplitLongOperand(ctx.Result, out op0L, out op0H);
 				SplitLongOperand(ctx.Operand1, out op1L, out op1H);

-				ctx.SetInstruction(IR.Instruction.MoveInstruction, op0L, op1L);
-				ctx.InsertInstructionAfter(IR.Instruction.MoveInstruction, op0H, op1H);
+				ctx.SetInstruction(CPUx86.Instruction.MoveInstruction, op0L, op1L);
+				ctx.InsertInstructionAfter(CPUx86.Instruction.MoveInstruction, op0H, op1H);
 			}
 			else {
 				SplitLongOperand(ctx.Operand1, out op1L, out op1H);
-				ctx.SetInstruction(IR.Instruction.MoveInstruction, ctx.Result, op1L);
+				ctx.SetInstruction(CPUx86.Instruction.MoveInstruction, ctx.Result, op1L);
 			}
 		}

@@ -1305,7 +1305,7 @@
 				case CilElementType.I2: goto case CilElementType.I1;

 				case CilElementType.I4:
-					ctx.SetInstruction(IR.Instruction.MoveInstruction, eax, op1);
+					ctx.SetInstruction(CPUx86.Instruction.MoveInstruction, eax, op1);
 					ctx.InsertInstructionAfter(CPUx86.Instruction.CdqInstruction);
 					ctx.InsertInstructionAfter(CPUx86.Instruction.MoveInstruction, op0L, eax);
 					ctx.InsertInstructionAfter(CPUx86.Instruction.MoveInstruction, op0H, edx);
@@ -1615,11 +1615,11 @@
 			newBlocks[2].InsertInstructionAfter(CPUx86.Instruction.JumpInstruction, newBlocks[4].BasicBlock);

 			// Success
-			newBlocks[3].InsertInstructionAfter(IR.Instruction.MoveInstruction, op0, new ConstantOperand(I4, 1));
+			newBlocks[3].InsertInstructionAfter(CPUx86.Instruction.MoveInstruction, op0, new ConstantOperand(I4, 1));
 			newBlocks[3].InsertInstructionAfter(CPUx86.Instruction.JumpInstruction, nextBlock.BasicBlock);

 			// Failed
-			newBlocks[4].InsertInstructionAfter(IR.Instruction.MoveInstruction, op0, new ConstantOperand(I4, 0));
+			newBlocks[4].InsertInstructionAfter(CPUx86.Instruction.MoveInstruction, op0, new ConstantOperand(I4, 0));
 			newBlocks[4].InsertInstructionAfter(CPUx86.Instruction.JumpInstruction, nextBlock.BasicBlock);

 			LinkBlocks(newBlocks, ctx, nextBlock);


xmlRewriterTests: add test for entry content sources getting re-written

--- NuCache.Tests/RewriterTests/EntryXmlRewriterTests.cs
+++ NuCache.Tests/RewriterTests/EntryXmlRewriterTests.cs
@@ -1,5 +1,8 @@
-using System.IO;
+using System;
+using System.IO;
+using System.Linq;
 using System.Xml.Linq;
+using Should;
 using Xunit;

 namespace NuCache.Tests.RewriterTests
@@ -20,7 +23,17 @@
 		[Fact]
 		public void When_processing_query_entry_xml()
 		{
-
+			var urls = _result
+				.Descendants(_namespace + "entry")
+				.Elements(_namespace + "content")
+				.Attributes("src")
+				.Select(a => new Uri(a.Value))
+				.ToList();
+
+			foreach (var url in urls)
+			{
+				ValidateUri(url);
+			}
 		}
 	}
 }


Added precondition and postcondition attributes

--- NullGuard.Fody/NullableReferenceTypesModeAnalyzer.cs
+++ NullGuard.Fody/NullableReferenceTypesModeAnalyzer.cs
@@ -13,6 +13,24 @@
     const string NullableContextAttributeTypeName = "System.Runtime.CompilerServices.NullableContextAttribute";
     const string NullableAttributeTypeName = "System.Runtime.CompilerServices.NullableAttribute";

+    // Input Preconditions:
+
+    const string AllowNullAttributeTypeName = "System.Diagnostics.CodeAnalysis.AllowNullAttribute";
+    const string DisallowNullAttributeTypeName = "System.Diagnostics.CodeAnalysis.DisallowNullAttribute";
+
+    // Output Postconditions:
+
+    // Ignore the following attributes since they are conditional and thus the value may still be null under some
+    // circumstances but we eventually want to add checks for these as well:
+    // - System.Diagnostics.CodeAnalysis.NotNullIfNotNull
+    // - System.Diagnostics.CodeAnalysis.NotNullWhen
+
+    const string NotNullAttributeTypeName = "System.Diagnostics.CodeAnalysis.NotNull";
+
+    // Treat all MaybeNull attributes as marking the type as nullable:
+
+    const string MaybeNullAttributeTypeName = "System.Diagnostics.CodeAnalysis.MaybeNull";
+    const string MaybeNullWhenAttributeTypeName = "System.Diagnostics.CodeAnalysis.MaybeNullWhen";

     enum Nullable
     {
@@ -30,37 +48,56 @@

     public bool AllowsNullInput(ParameterDefinition parameter, MethodDefinition method)
     {
-        return GetItemAllowsNull(parameter)
+        return GetItemPreconditionAllowsNull(parameter)
+               ?? GetItemAllowsNull(parameter)
                ?? GetContextAllowsNull(method)
                ?? true;
     }

     public bool AllowsNullOutput(ParameterDefinition parameter, MethodDefinition method)
     {
-        return GetItemAllowsNull(parameter)
+        return GetItemPostconditionAllowsNull(parameter)
+               ?? GetItemAllowsNull(parameter)
                ?? GetContextAllowsNull(method)
                ?? true;
     }

     public bool AllowsNullReturnValue(MethodDefinition method)
     {
-        return GetItemAllowsNull(method.MethodReturnType)
+        return GetItemPostconditionAllowsNull(method.MethodReturnType)
+               ?? GetItemAllowsNull(method.MethodReturnType)
                ?? GetContextAllowsNull(method)
                ?? true;
     }

     public bool AllowsGetMethodToReturnNull(PropertyDefinition property, MethodDefinition getMethod)
     {
-        return GetItemAllowsNull(getMethod.MethodReturnType)
+        return GetItemPostconditionAllowsNull(getMethod.MethodReturnType)
+               ?? GetItemAllowsNull(getMethod.MethodReturnType)
                ?? GetContextAllowsNull(getMethod)
                ?? true;
     }

     public bool AllowsSetMethodToAcceptNull(PropertyDefinition property, MethodDefinition setMethod, ParameterDefinition valueParameter)
     {
-        return GetItemAllowsNull(valueParameter)
+        return GetItemPreconditionAllowsNull(valueParameter)
+               ?? GetItemAllowsNull(valueParameter)
                ?? GetContextAllowsNull(setMethod)
                ?? true;
+    }
+
+    static bool? GetItemPreconditionAllowsNull(ICustomAttributeProvider customAttributeProvider)
+    {
+        return ContainsAttribute(customAttributeProvider, AllowNullAttributeTypeName) ? true :
+               ContainsAttribute(customAttributeProvider, DisallowNullAttributeTypeName) ? false :
+               (bool?)null;
+    }
+
+    static bool? GetItemPostconditionAllowsNull(ICustomAttributeProvider customAttributeProvider)
+    {
+        return ContainsAnyAttribute(customAttributeProvider, MaybeNullAttributeTypeName, MaybeNullWhenAttributeTypeName) ? true :
+               ContainsAttribute(customAttributeProvider, NotNullAttributeTypeName) ? false :
+               (bool?) null;
     }

     static bool? GetItemAllowsNull(ICustomAttributeProvider customAttributeProvider)
@@ -81,6 +118,16 @@

         return GetAllowsNull(type, NullableContextAttributeTypeName)
                ?? GetContextAllowsNull(type.DeclaringType);
+    }
+
+    static bool ContainsAttribute(ICustomAttributeProvider customAttributeProvider, string fullName)
+    {
+        return customAttributeProvider.CustomAttributes.Any(a => a.AttributeType.FullName == fullName);
+    }
+
+    static bool ContainsAnyAttribute(ICustomAttributeProvider customAttributeProvider, params string[] fullNames)
+    {
+        return fullNames.Any(n => ContainsAttribute(customAttributeProvider, n));
     }

     static bool? GetAllowsNull(ICustomAttributeProvider customAttributeProvider, string attributeTypeName)