Fix some method method names, found by Sebastien

--- src/appkit.cs
+++ src/appkit.cs
@@ -1003,7 +1003,7 @@

 	[BaseType (typeof (NSImageRep))]
 	[DisableDefaultCtor] // An uncaught exception was raised: -[NSBitmapImageRep init]: unrecognized selector sent to instance 0x686880
-	public interface NSBitmapImageRep {
+	public partial interface NSBitmapImageRep {
 		[Export ("initWithFocusedViewRect:")]
 		IntPtr Constructor (RectangleF rect);

@@ -1060,10 +1060,10 @@
 		NSBitmapFormat BitmapFormat { get; }

 		[Export ("getCompression:factor:")]
-		void GetCompressionfactor (out NSTiffCompression compression, out float factor);
+		void GetCompressionFactor (out NSTiffCompression compression, out float factor);

 		[Export ("setCompression:factor:")]
-		void SetCompressionfactor (NSTiffCompression compression, float factor);
+		void SetCompressionFactor (NSTiffCompression compression, float factor);

 		[Export ("TIFFRepresentation")]
 		NSData TiffRepresentation { get; }
@@ -1229,7 +1229,7 @@

 	[BaseType (typeof (NSControl))]
 		// , Delegates=new string [] { "Delegate" }, Events=new Type [] { typeof (NSBrowserDelegate)})]
-	public interface NSBrowser {
+	public partial interface NSBrowser {
 		[Export ("initWithFrame:")]
 		IntPtr Constructor (RectangleF frameRect);

@@ -1246,7 +1246,7 @@
 		NSObject ItemAtIndexPath (NSIndexPath indexPath);

 		[Export ("itemAtRow:inColumn:")]
-		NSObject ItemAtRowinColumn (int row, int column);
+		NSObject GetItem (int row, int column);

 		[Export ("indexPathForColumn:")]
 		NSIndexPath IndexPathForColumn (int column);
@@ -1545,7 +1545,7 @@
 		bool SelectCellWithString (NSBrowser sender, string title, int column);

 		[Export ("browser:selectRow:inColumn:")]
-		bool SelectRowinColumn (NSBrowser sender, int row, int column);
+		bool SelectRowInColumn (NSBrowser sender, int row, int column);

 		[Export ("browser:isColumnValid:")]
 		bool IsColumnValid (NSBrowser sender, int column);
@@ -1604,7 +1604,7 @@
 		NSViewController HeaderViewControllerForItem (NSBrowser browser, NSObject item);

 		[Export ("browser:didChangeLastColumn:toColumn:")]
-		void DidChangeLastColumntoColumn (NSBrowser browser, int oldLastColumn, int column);
+		void DidChangeLastColumn (NSBrowser browser, int oldLastColumn, int toColumn);

 		[Export ("browser:selectionIndexesForProposedSelection:inColumn:")]
 		NSIndexSet SelectionIndexesForProposedSelection (NSBrowser browser, NSIndexSet proposedSelectionIndexes, int inColumn);
@@ -3311,7 +3311,7 @@
 		NSCursor IBeamCursorForVerticalLayout { get; }

 		[Export ("initWithImage:hotSpot:")]
-		NSObject InitWithImagehotSpot (NSImage newImage, PointF aPoint);
+		IntPtr Constructor (NSImage newImage, PointF aPoint);

 		[Export ("initWithImage:foregroundColorHint:backgroundColorHint:hotSpot:")]
 		IntPtr Constructor (NSImage newImage, NSColor fg, NSColor bg, PointF hotSpot);
@@ -3887,7 +3887,7 @@
 		NSUrl [] UrlsFromRunningOpenPanel ();

 		[Export ("runModalOpenPanel:forTypes:")]
-		int RunModalOpenPanelforTypes (NSOpenPanel openPanel, string [] types);
+		int RunModalOpenPanel (NSOpenPanel openPanel, string [] types);

 		[Export ("openDocumentWithContentsOfURL:display:error:")]
 		NSObject OpenDocument (NSUrl url, bool displayDocument, out NSError outError);
@@ -5239,7 +5239,7 @@
 		bool IsEnteringProximity { get; }

 		[Export ("touchesMatchingPhase:inView:")]
-		NSSet TouchesMatchingPhaseinView (NSTouchPhase phase, NSView view);
+		NSSet TouchesMatchingPhase (NSTouchPhase phase, NSView view);

 		[Static]
 		[Export ("startPeriodicEventsAfterDelay:withPeriod:")]
@@ -5363,7 +5363,7 @@
 		bool PopUpMenu ([NullAllowed] NSMenuItem item, PointF location, [NullAllowed] NSView view);

 		[Export ("insertItem:atIndex:")]
-		void InsertItematIndex (NSMenuItem newItem, int index);
+		void InsertItem (NSMenuItem newItem, int index);

 		[Export ("addItem:")]
 		void AddItem (NSMenuItem newItem);
@@ -6761,7 +6761,7 @@
 	}

 	[BaseType (typeof (NSControl), Delegates=new string [] { "WeakDelegate" }, Events=new Type [] { typeof (NSMatrixDelegate)})]
-	public interface NSMatrix {
+	public partial interface NSMatrix {
 		[Export ("initWithFrame:")]
 		IntPtr Constructor (RectangleF frameRect);

@@ -6772,7 +6772,7 @@
 		IntPtr Constructor (RectangleF frameRect, NSMatrixMode aMode, Class factoryId, int rowsHigh, int colsWide);

 		[Export ("makeCellAtRow:column:")]
-		NSCell MakeCellAtRowcolumn (int row, int col);
+		NSCell MakeCell (int row, int col);

 		[Export ("sendAction:to:forAllCells:")]
 		void SendAction (Selector aSelector, NSObject anObject, bool forAllCells);
@@ -6810,7 +6810,7 @@
 		void DeselectAllCells ();

 		[Export ("selectCellAtRow:column:")]
-		void SelectCellAtRowcolumn (int row, int col);
+		void SelectCell (int row, int column);

 		[Export ("selectAll:")]
 		void SelectAll (NSObject sender);
@@ -6822,7 +6822,7 @@
 		void SetScrollable (bool flag);

 		[Export ("setState:atRow:column:")]
-		void SetState (int state, int row, int col);
+		void SetState (int state, int row, int column);

 		[Export ("getNumberOfRows:columns:")]
 		void GetRowsAndColumnsCount (out int rowCount, out int colCount);
@@ -6834,22 +6834,22 @@
 		int Columns { get; }

 		[Export ("cellAtRow:column:")][Internal]
-		NSCell CellAtRowColumn (int row, int col);
+		NSCell CellAtRowColumn (int row, int column);

 		[Export ("cellFrameAtRow:column:")]
-		RectangleF CellFrameAtRowColumn (int row, int col);
+		RectangleF CellFrameAtRowColumn (int row, int column);

 		[Export ("getRow:column:ofCell:")]
-		bool GetRowColumn (out int row, out int col, NSCell aCell);
+		bool GetRowColumn (out int row, out int column, NSCell aCell);

 		[Export ("getRow:column:forPoint:")]
-		bool GetRowcolumnForPoint (out int row, out int col, PointF aPoint);
+		bool GetRowColumnForPoint (out int row, out int column, PointF aPoint);

 		[Export ("renewRows:columns:")]
 		void RenewRowsColumns (int newRows, int newCols);

 		[Export ("putCell:atRow:column:")]
-		void PutCellatRowColumn (NSCell newCell, int row, int col);
+		void PutCell (NSCell newCell, int row, int column);

 		[Export ("addRow")]
 		void AddRow ();
@@ -6876,7 +6876,7 @@
 		void InsertColumn (int column);

 		[Export ("insertColumn:withCells:")]
-		void InsertColumnwithCells (int column, NSCell [] newCells);
+		void InsertColumn (int column, NSCell [] newCells);

 		[Export ("removeColumn:")]
 		void RemoveColumn (int col);
@@ -6891,13 +6891,13 @@
 		void SetValidateSize (bool flag);

 		[Export ("drawCellAtRow:column:")]
-		void DrawCellAtRowColumn (int row, int col);
+		void DrawCellAtRowColumn (int row, int column);

 		[Export ("highlightCell:atRow:column:")]
-		void HighlightCellatRowColumn (bool highlight, int row, int col);
+		void HighlightCell (bool highlight, int row, int column);

 		[Export ("scrollCellToVisibleAtRow:column:")]
-		void ScrollCellToVisibleAtRowcolumn (int row, int col);
+		void ScrollCellToVisible (int row, int column);

 		[Export ("mouseDownFlags")]
 		int MouseDownFlags ();
@@ -6933,7 +6933,7 @@
 		void SelectText (NSObject sender);

 		[Export ("selectTextAtRow:column:")]
-		NSObject SelectTextAtRowColumn (int row, int col);
+		NSObject SelectTextAtRowColumn (int row, int column);

 		[Export ("acceptsFirstMouse:")]
 		bool AcceptsFirstMouse (NSEvent theEvent);
@@ -6942,7 +6942,7 @@
 		void ResetCursorRects ();

 		[Export ("setToolTip:forCell:")]
-		void SetToolTipforCell (string toolTipString, NSCell cell);
+		void SetToolTipForCell (string toolTipString, NSCell cell);

 		[Export ("toolTipForCell:")]
 		string ToolTipForCell (NSCell cell);
@@ -9160,7 +9160,7 @@
 		NSUsableScrollerParts UsableParts { get; }

 		[Export ("drawArrow:highlight:")]
-		void DrawArrowhighlight (NSScrollerArrow whichArrow, bool highlight);
+		void DrawArrow (NSScrollerArrow whichArrow, bool highlight);

 		[Export ("drawKnob")]
 		void DrawKnob ();
@@ -9819,7 +9819,7 @@
 		void DidFinishSpeaking (NSSpeechSynthesizer sender, bool finishedSpeaking);

 		[Export ("speechSynthesizer:willSpeakWord:ofString:")]
-		void WillSpeakWordofString (NSSpeechSynthesizer sender, NSRange characterRange, string theString);
+		void WillSpeakWord (NSSpeechSynthesizer sender, NSRange wordCharacterRange, string ofString);

 		[Export ("speechSynthesizer:willSpeakPhoneme:")]
 		void WillSpeakPhoneme (NSSpeechSynthesizer sender, short phonemeOpcode);
@@ -10052,7 +10052,7 @@
 		float MaxPositionOfDivider (int dividerIndex);

 		[Export ("setPosition:ofDividerAtIndex:")]
-		void SetPositionofDivider (float position, int dividerIndex);
+		void SetPositionOfDivider (float position, int dividerIndex);

 		//Detected properties
 		[Export ("vertical")]
@@ -10081,10 +10081,10 @@
 		bool ShouldCollapseForDoubleClick (NSSplitView splitView, NSView subview, int doubleClickAtDividerIndex);

 		[Export ("splitView:constrainMinCoordinate:ofSubviewAt:")]
-		float SetMinCoordinateofSubview (NSSplitView splitView, float proposedMinimumPosition, int subviewDividerIndex);
+		float SetMinCoordinateOfSubview (NSSplitView splitView, float proposedMinimumPosition, int subviewDividerIndex);

 		[Export ("splitView:constrainMaxCoordinate:ofSubviewAt:")]
-		float SetMaxCoordinateofSubview (NSSplitView splitView, float proposedMaximumPosition, int subviewDividerIndex);
+		float SetMaxCoordinateOfSubview (NSSplitView splitView, float proposedMaximumPosition, int subviewDividerIndex);

 		[Export ("splitView:constrainSplitPosition:ofSubviewAt:")]
 		float ConstrainSplitPosition (NSSplitView splitView, float proposedPosition, int subviewDividerIndex);
@@ -10131,7 +10131,7 @@

 	[BaseType (typeof (NSObject))]
 	[PrivateDefaultCtor]
-	public interface NSStatusItem {
+	public partial interface NSStatusItem {
 		[Export ("statusBar")]
 		NSStatusBar StatusBar { get; }

@@ -10148,7 +10148,7 @@
 		void PopUpStatusItemMenu (NSMenu menu);

 		[Export ("drawStatusBarBackgroundInRect:withHighlight:")]
-		void DrawStatusBarBackgroundInRectwithHighlight (RectangleF rect, bool highlight);
+		void DrawStatusBarBackground (RectangleF rect, bool highlight);

 		//Detected properties
 		[Export ("doubleAction")]
@@ -10533,13 +10533,13 @@
 		void DrawRect (RectangleF dirtyRect);

 		[Export ("displayRectIgnoringOpacity:inContext:")]
-		void DisplayRectIgnoringOpacityinContext (RectangleF aRect, NSGraphicsContext context);
+		void DisplayRectIgnoringOpacity (RectangleF aRect, NSGraphicsContext context);

 		[Export ("bitmapImageRepForCachingDisplayInRect:")]
 		NSBitmapImageRep BitmapImageRepForCachingDisplayInRect (RectangleF rect);

 		[Export ("cacheDisplayInRect:toBitmapImageRep:")]
-		void CacheDisplayInRecttoBitmapImageRep (RectangleF rect, NSBitmapImageRep bitmapImageRep);
+		void CacheDisplay (RectangleF rect, NSBitmapImageRep bitmapImageRep);

 		[Export ("viewWillDraw")]
 		void ViewWillDraw ();
@@ -10572,16 +10572,16 @@
 		RectangleF AdjustScroll (RectangleF newVisible);

 		[Export ("scrollRect:by:")]
-		void ScrollRectby (RectangleF aRect, SizeF delta);
+		void ScrollRect (RectangleF aRect, SizeF delta);

 		[Export ("translateRectsNeedingDisplayInRect:by:")]
-		void TranslateRectsNeedingDisplayInRectby (RectangleF clipRect, SizeF delta);
+		void TranslateRectsNeedingDisplay (RectangleF clipRect, SizeF delta);

 		[Export ("hitTest:")]
 		NSView HitTest (PointF aPoint);

 		[Export ("mouse:inRect:")]
-		bool MouseinRect (PointF aPoint, RectangleF aRect);
+		bool IsMouseInRect (PointF aPoint, RectangleF aRect);

 		[Export ("viewWithTag:")]
 		NSObject ViewWithTag (int aTag);
@@ -10877,7 +10877,7 @@
 		float GetContentHuggingPriorityForOrientation (NSLayoutConstraintOrientation orientation);

 		[Lion, Export ("setContentHuggingPriority:forOrientation:")]
-		void SetContentHuggingPriorityforOrientation (float priority, NSLayoutConstraintOrientation orientation);
+		void SetContentHuggingPriorityForOrientation (float priority, NSLayoutConstraintOrientation orientation);

 		[Lion, Export ("contentCompressionResistancePriorityForOrientation:")]
 		float GetContentCompressionResistancePriority (NSLayoutConstraintOrientation orientation);
@@ -11192,7 +11192,7 @@
 		bool TargetForDropOperation { [Bind ("isTargetForDropOperation")] get; set; }

 		[Export ("drawBackgroundInRect:")]
-		void DrawBackgrounn (RectangleF dirtyRect);
+		void DrawBackground (RectangleF dirtyRect);

 		[Export ("drawSelectionInRect:")]
 		void DrawSelection (RectangleF dirtyRect);
@@ -12216,7 +12216,7 @@
 		void Highlight (bool highlight, RectangleF cellFrame, NSView controlView);

 		[Export ("trackMouse:inRect:ofView:untilMouseUp:")]
-		bool TrackMouseinRectofViewuntilMouseUp (NSEvent theEvent, RectangleF cellFrame, NSView controlView, bool untilMouseUp);
+		bool TrackMouse (NSEvent theEvent, RectangleF cellFrame, NSView controlView, bool untilMouseUp);

 		[Export ("cellSize")]
 		SizeF CellSize { get; }
@@ -12290,7 +12290,7 @@
 		float GetWidth (NSTextBlockLayer layer, NSRectEdge edge);

 		[Export ("widthValueTypeForLayer:edge:")]
-		NSTextBlockValueType WidthValueTypeForLayeredge (NSTextBlockLayer layer, NSRectEdge edge);
+		NSTextBlockValueType WidthValueTypeForLayer (NSTextBlockLayer layer, NSRectEdge edge);

 		[Export ("setBorderColor:forEdge:")]
 		void SetBorderColor (NSColor color, NSRectEdge edge);
@@ -12701,10 +12701,10 @@
 		void SetConstrainedFrameSize (SizeF desiredSize);

 		[Export ("setAlignment:range:")]
-		void SetAlignmentrange (NSTextAlignment alignment, NSRange range);
+		void SetAlignmentRange (NSTextAlignment alignment, NSRange range);

 		[Export ("setBaseWritingDirection:range:")]
-		void SetBaseWritingDirectionrange (NSWritingDirection writingDirection, NSRange range);
+		void SetBaseWritingDirection (NSWritingDirection writingDirection, NSRange range);

 		[Export ("turnOffKerning:")]
 		void TurnOffKerning (NSObject sender);
@@ -12782,13 +12782,13 @@
 		bool RulerViewShouldAddMarker (NSRulerView ruler, NSRulerMarker marker);

 		[Export ("rulerView:willMoveMarker:toLocation:")]
-		float RulerViewWillMoveMarkertoLocation (NSRulerView ruler, NSRulerMarker marker, float location);
+		float RulerViewWillMoveMarker (NSRulerView ruler, NSRulerMarker marker, float location);

 		[Export ("rulerView:shouldRemoveMarker:")]
 		bool RulerViewShouldRemoveMarker (NSRulerView ruler, NSRulerMarker marker);

 		[Export ("rulerView:willAddMarker:atLocation:")]
-		float RulerViewWillAddMarkeratLocation (NSRulerView ruler, NSRulerMarker marker, float location);
+		float RulerViewWillAddMarker (NSRulerView ruler, NSRulerMarker marker, float location);

 		[Export ("rulerView:handleMouseDown:")]
 		void RulerViewHandleMouseDown (NSRulerView ruler, NSEvent theEvent);
@@ -12800,7 +12800,7 @@
 		bool ShouldDrawInsertionPoint { get; }

 		[Export ("drawInsertionPointInRect:color:turnedOn:")]
-		void DrawInsertionPointInRectcolorturnedOn (RectangleF rect, NSColor color, bool turnedOn);
+		void DrawInsertionPoint (RectangleF rect, NSColor color, bool turnedOn);

 		[Export ("drawViewBackgroundInRect:")]
 		void DrawViewBackgroundInRect (RectangleF rect);
@@ -12849,26 +12849,26 @@
 		string [] CompletionsForPartialWord (NSRange charRange, out int index);

 		[Export ("insertCompletion:forPartialWordRange:movement:isFinal:")]
-		void InsertCompletionforPartialWord (string word, NSRange charRange, int movement, bool isFinal);
+		void InsertCompletion (string completion, NSRange partialWordCharRange, int movement, bool isFinal);

 		// Pasteboard
 		[Export ("writablePasteboardTypes")]
 		string [] WritablePasteboardTypes ();

 		[Export ("writeSelectionToPasteboard:type:")]
-		bool WriteSelectionToPasteboardtype (NSPasteboard pboard, string type);
+		bool WriteSelectionToPasteboard (NSPasteboard pboard, string type);

 		[Export ("writeSelectionToPasteboard:types:")]
-		bool WriteSelectionToPasteboardtypes (NSPasteboard pboard, string [] types);
+		bool WriteSelectionToPasteboard (NSPasteboard pboard, string [] types);

 		[Export ("readablePasteboardTypes")]
 		string [] ReadablePasteboardTypes ();

 		[Export ("preferredPasteboardTypeFromArray:restrictedToTypesFromArray:")]
-		string PreferredPasteboardTypeFromArrayrestrictedToTypesFromArray (string [] availableTypes, string [] allowedTypes);
+		string GetPreferredPasteboardType (string [] availableTypes, string [] allowedTypes);

 		[Export ("readSelectionFromPasteboard:type:")]
-		bool ReadSelectionFromPasteboardtype (NSPasteboard pboard, string type);
+		bool ReadSelectionFromPasteboard (NSPasteboard pboard, string type);

 		[Export ("readSelectionFromPasteboard:")]
 		bool ReadSelectionFromPasteboard (NSPasteboard pboard);
@@ -12878,7 +12878,7 @@
 		void RegisterForServices ();

 		[Export ("validRequestorForSendType:returnType:")]
-		NSObject ValidRequestorForSendTypereturnType (string sendType, string returnType);
+		NSObject ValidRequestorForSendType (string sendType, string returnType);

 		[Export ("pasteAsPlainText:")]
 		void PasteAsPlainText (NSObject sender);
@@ -12898,16 +12898,16 @@
 		string [] AcceptableDragTypes ();

 		[Export ("dragOperationForDraggingInfo:type:")]
-		NSDragOperation DragOperationForDraggingInfotype (NSDraggingInfo dragInfo, string type);
+		NSDragOperation DragOperationForDraggingInfo (NSDraggingInfo dragInfo, string type);

 		[Export ("cleanUpAfterDragOperation")]
 		void CleanUpAfterDragOperation ();

 		[Export ("setSelectedRanges:affinity:stillSelecting:")]
-		void SetSelectedRangesaffinitystillSelecting (NSArray /*NSRange []*/ ranges, NSSelectionAffinity affinity, bool stillSelectingFlag);
+		void SetSelectedRanges (NSArray /*NSRange []*/ ranges, NSSelectionAffinity affinity, bool stillSelectingFlag);

 		[Export ("setSelectedRange:affinity:stillSelecting:")]
-		void SetSelectedRangeaffinitystillSelecting (NSRange charRange, NSSelectionAffinity affinity, bool stillSelectingFlag);
+		void SetSelectedRange (NSRange charRange, NSSelectionAffinity affinity, bool stillSelectingFlag);

 		[Export ("selectionAffinity")]
 		NSSelectionAffinity SelectionAffinity ();
@@ -12925,10 +12925,10 @@
 		void ToggleGrammarChecking (NSObject sender);

 		[Export ("setSpellingState:range:")]
-		void SetSpellingStaterange (int value, NSRange charRange);
+		void SetSpellingState (int value, NSRange charRange);

 		[Export ("shouldChangeTextInRanges:replacementStrings:")]
-		bool ShouldChangeTextInRangesreplacementStrings (NSArray /* NSRange [] */ affectedRanges, string [] replacementStrings);
+		bool ShouldChangeText (NSArray /* NSRange [] */ affectedRanges, string [] replacementStrings);

 		[Export ("rangesForUserTextChange")]
 		NSArray /* NSRange [] */ RangesForUserTextChange ();
@@ -12939,8 +12939,8 @@
 		[Export ("rangesForUserParagraphAttributeChange")]
 		NSArray /* NSRange [] */ RangesForUserParagraphAttributeChange ();

-		[Export ("shouldChangeTextInRange:replacementString:")]
-		bool ShouldChangeTextInRangereplacementString (NSRange affectedCharRange, string replacementString);
+		//[Export ("shouldChangeTextInRange:replacementString:")]
+		//bool ShouldChangeText (NSRange affectedCharRange, string replacementString);

 		[Export ("rangeForUserTextChange")]
 		NSRange RangeForUserTextChange ();
@@ -13047,9 +13047,6 @@

 		[Export ("allowedInputSourceLocales")]
 		string [] AllowedInputSourceLocales { get; set; }
-
-		[Export ("setSelectedRange:affinity:stillSelecting:")]
-		void SetSelectedRange (NSRange charRange, NSSelectionAffinity affinity, bool stillSelectingFlag);

 		// FIXME: binding
 		//[Export ("shouldChangeTextInRanges:replacementStrings:")]
@@ -14070,7 +14067,7 @@
 		string StringWithSavedFrame ();

 		[Export ("setFrameFromString:")]
-		void SetFrameFroom (string str);
+		void SetFrameFrom (string str);

 		[Export ("saveFrameUsingName:")]
 		void SaveFrameUsingName (string  name);


Fix for commit 4b8054daa40282eb1e74aadf99923389b3c5467b

--- src/FubarDev.FtpServer/Networking/PausableFtpService.cs
+++ src/FubarDev.FtpServer/Networking/PausableFtpService.cs
@@ -124,7 +124,7 @@
                 return;
             }

-            if (IsRunning)
+            if (!IsRunning)
             {
                 throw new InvalidOperationException($"Status must be {FtpServiceStatus.Running}, but was {Status}.");
             }


Renames and removed old EF Convention

Renames and removed old EF Convention

--- src/FujiyBlog.Core/EntityFramework/FujiyBlogDatabase.cs
+++ src/FujiyBlog.Core/EntityFramework/FujiyBlogDatabase.cs
@@ -20,10 +20,10 @@
         public DbSet<Page> Pages { get; set; }
         public DbSet<RoleGroup> RoleGroups { get; set; }

-        private static string lastCache;
-        public string LastCache
+        private static string lastDatabaseChange;
+        public string LastDatabaseChange
         {
-            get { return lastCache; }
+            get { return lastDatabaseChange; }
         }

         public FujiyBlogDatabase()
@@ -31,19 +31,17 @@
             Database.SetInitializer(new FujiyBlogDatabaseInitializer());

             Setting setting = Settings.SingleOrDefault(x => x.Id == 24);
-            string lastCacheAtDb = setting != null ? setting.Value : "0";
+            string lastDatabaseChangeAtDb = setting != null ? setting.Value : "0";

-            if (lastCacheAtDb != lastCache)
+            if (lastDatabaseChangeAtDb != lastDatabaseChange)
             {
-                lastCache = lastCacheAtDb;
+                lastDatabaseChange = lastDatabaseChangeAtDb;
                 CacheHelper.ClearCache();
             }
         }

         protected override void OnModelCreating(DbModelBuilder builder)
         {
-            builder.Conventions.Remove<IncludeMetadataConvention>();
-
             builder.Configurations.Add(new PostCommentConfiguration());
             builder.Configurations.Add(new PostConfiguration());
             builder.Configurations.Add(new UserConfiguration());


Added all/none toggles, updated change count label.

--- src/GitHub.Unity/Assets/Plugins/GitHub/Editor/Window.cs
+++ src/GitHub.Unity/Assets/Plugins/GitHub/Editor/Window.cs
@@ -83,8 +83,11 @@
 			SummaryLabel = "Commit summary",
 			DescriptionLabel = "Commit description",
 			CommitButton = "Commit to <b>{0}</b>",
+			CommitSelectAllButton = "All",
+			CommitSelectNoneButton = "None",
 			ChangedFilesLabel = "{0} changed files",
 			OneChangedFileLabel = "1 changed file",
+			NoChangedFilesLabel = "No changed files",
 			BasePathLabel = "{0}",
 			NoChangesLabel = "No changes found";
 		const float
@@ -332,7 +335,28 @@
 			{
 				GUILayout.BeginScrollView(verticalCommitScroll);
 			}
-				GUILayout.Label(entries.Count == 0 ? OneChangedFileLabel : string.Format(ChangedFilesLabel, entries.Count), EditorStyles.boldLabel);
+				GUILayout.BeginHorizontal();
+					EditorGUI.BeginDisabledGroup(entries.Count == 0);
+						if (GUILayout.Button(CommitSelectAllButton, EditorStyles.miniButtonLeft))
+						{
+							CommitSelectAll();
+						}
+
+						if (GUILayout.Button(CommitSelectNoneButton, EditorStyles.miniButtonRight))
+						{
+							CommitSelectNone();
+						}
+					EditorGUI.EndDisabledGroup();
+
+					GUILayout.FlexibleSpace();
+
+					GUILayout.Label(
+						entries.Count == 0 ? NoChangedFilesLabel :
+							entries.Count == 1 ? OneChangedFileLabel :
+								string.Format(ChangedFilesLabel, entries.Count),
+						EditorStyles.miniLabel
+					);
+				GUILayout.EndHorizontal();

 				GUILayout.BeginVertical(CommitFileAreaStyle);
 					if (commitTreeHeight > 0)
@@ -469,6 +493,24 @@
 		}

+		void CommitSelectAll()
+		{
+			for (int index = 0; index < entryCommitTargets.Count; ++index)
+			{
+				entryCommitTargets[index].All = true;
+			}
+		}
+
+
+		void CommitSelectNone()
+		{
+			for (int index = 0; index < entryCommitTargets.Count; ++index)
+			{
+				entryCommitTargets[index].All = false;
+			}
+		}
+
+
 		void Commit()
 		{
 			// Do not allow new commits before we have received one successful update


Correctly initialize GitHubPane

Correctly initialize GitHubPane

When opened via the ShowGitHubPane command. Fixes #355.

--- src/GitHub.VisualStudio/UI/Views/GitHubPaneViewModel.cs
+++ src/GitHub.VisualStudio/UI/Views/GitHubPaneViewModel.cs
@@ -85,6 +85,10 @@
                 true);

             initialized = true;
+
+            // The base Initialized call will have called RepoChanged(true) but at that point
+            // initialized will have been false, so call it again now.
+            RepoChanged(true);
         }

         public void Initialize([AllowNull] ViewWithData data)


All tests passing + refactoring.

All tests passing + refactoring.

--- src/GraphQL/Validation/Complexity/ComplexityAnalyzer.cs
+++ src/GraphQL/Validation/Complexity/ComplexityAnalyzer.cs
@@ -34,20 +34,11 @@
         {
             if (complexityParameters == null) return;
             var complexityResult = Analyze(document, complexityParameters.FieldImpact ?? 2.0f);
-
 #if DEBUG
             Debug.WriteLine($"Complexity: {complexityResult.Complexity}");
             Debug.WriteLine($"Sum(Query depth across all subqueries) : {complexityResult.TotalQueryDepth}");
             foreach (var node in complexityResult.ComplexityMap) Debug.WriteLine($"{node.Key} : {node.Value}");
 #endif
-
-            Validate(complexityResult, complexityParameters);
-        }
-
-        public static void Validate(ComplexityResult complexityResult, ComplexityConfiguration complexityParameters)
-        {
-            if (complexityParameters == null) return;
-
             if (complexityParameters.MaxComplexity.HasValue &&
                 complexityResult.Complexity > complexityParameters.MaxComplexity.Value)
                 throw new InvalidOperationException(
@@ -62,7 +53,7 @@
         /// <summary>
         /// Analyzes the complexity of a document.
         /// </summary>
-        public ComplexityResult Analyze(Document doc, double avgImpact = 2.0d)
+        internal ComplexityResult Analyze(Document doc, double avgImpact = 2.0d)
         {
             if (avgImpact <= 1) throw new ArgumentOutOfRangeException(nameof(avgImpact));


Force GC between project in a batch.

Force GC between project in a batch.

--- src/HtmlGenerator/Pass1-Generation/SolutionGenerator.cs
+++ src/HtmlGenerator/Pass1-Generation/SolutionGenerator.cs
@@ -335,6 +335,9 @@
                 finally
                 {
                     CurrentAssemblyName = null;
+                    GC.Collect();
+                    GC.WaitForPendingFinalizers();
+                    GC.Collect();
                 }
             }


Add logger phase name for post processor (#496)

--- src/Microsoft.DocAsCode.Build.Engine/DocumentBuilder.cs
+++ src/Microsoft.DocAsCode.Build.Engine/DocumentBuilder.cs
@@ -160,10 +160,13 @@
                 var postProcessors = GetPostProcessor(postProcessorNames);
                 foreach (var postProcessor in postProcessors)
                 {
-                    parameters.Metadata = postProcessor.Item2.PrepareMetadata(parameters.Metadata);
-                    if (parameters.Metadata == null)
-                    {
-                        throw new DocfxException($"Plugin {postProcessor.Item1} should not return null metadata");
+                    using (new LoggerPhaseScope(postProcessor.Item1))
+                    {
+                        parameters.Metadata = postProcessor.Item2.PrepareMetadata(parameters.Metadata);
+                        if (parameters.Metadata == null)
+                        {
+                            throw new DocfxException($"Plugin {postProcessor.Item1} should not return null metadata");
+                        }
                     }
                 }

@@ -215,10 +218,13 @@
                         // post process
                         foreach (var postProcessor in postProcessors)
                         {
-                            generatedManifest = postProcessor.Item2.Process(generatedManifest, parameters.OutputBaseDir);
-                            if (generatedManifest == null)
+                            using (new LoggerPhaseScope(postProcessor.Item1))
                             {
-                                throw new DocfxException($"Plugin {postProcessor.Item1} should not return null manifest");
+                                generatedManifest = postProcessor.Item2.Process(generatedManifest, parameters.OutputBaseDir);
+                                if (generatedManifest == null)
+                                {
+                                    throw new DocfxException($"Plugin {postProcessor.Item1} should not return null manifest");
+                                }
                             }
                         }


win: improve parsing of SDK version

win: improve parsing of SDK version

This makes the parsing more robust and fixes the additional issue
related to USB Device Connectivity component.

Fixes: https://github.com/nodejs/node-gyp/issues/1466
PR-URL: https://github.com/nodejs/node-gyp/pull/1516
Reviewed-By: João Reis <5095b819f0ac7660978fa44706cfa411a9116ec5@janeasystems.com>
Reviewed-By: Refael Ackermann <0604a90ccdde7a0adfa2ff3857349859a7209740@gmail.com>
Reviewed-By: Richard Lau <8193d74c06330af7778ef55510160e4e561ed6a1@uk.ibm.com>

--- lib/Find-VS2017.cs
+++ lib/Find-VS2017.cs
@@ -232,7 +232,9 @@
                     string[] parts = id.Substring(Win10SDKPrefix.Length).Split('.');
                     if (parts.Length > 1 && parts[1] != "Desktop")
                         continue;
-                    Win10SDKVer = Math.Max(Win10SDKVer, UInt32.Parse(parts[0]));
+                    uint foundSdkVer;
+                    if (UInt32.TryParse(parts[0], out foundSdkVer))
+                        Win10SDKVer = Math.Max(Win10SDKVer, foundSdkVer);
                 } else if (id == "Microsoft.VisualStudio.Component.Windows81SDK")
                     hasWin8SDK = true;
                 else


Fix tests related to WeakReference and upcoming .NET Core changes.

.NET Core extended the lifetime of some temporary variables and that affected how the tests were constructed to test WeakReference as used in WeakHashtable and WeakRefWrapper.  Making sure the temporary variables are short lived in a NoInlining method is the solution.

--- src/NHibernate.Test/UtilityTest/WeakHashtableFixture.cs
+++ src/NHibernate.Test/UtilityTest/WeakHashtableFixture.cs
@@ -1,7 +1,6 @@
 using System;
 using System.Collections;
-using System.IO;
-using System.Runtime.Serialization.Formatters.Binary;
+using System.Runtime.CompilerServices;

 using NHibernate.Util;
 using NUnit.Framework;
@@ -11,9 +10,28 @@
 	[TestFixture]
 	public class WeakHashtableFixture
 	{
-		protected WeakHashtable Create()
+		private static WeakHashtable Create()
 		{
 			return new WeakHashtable();
+		}
+
+		// NoInlining to keep temporary variables' lifetime from being extended.
+		[MethodImpl(MethodImplOptions.NoInlining)]
+		private static WeakHashtable CreateWithTwoObjects()
+		{
+			var table = Create();
+
+			table[new object()] = new object();
+			table[new object()] = new object();
+
+			return table;
+		}
+
+		[MethodImpl(MethodImplOptions.NoInlining)]
+		private static WeakRefWrapper CreateWeakRefWrapper()
+		{
+			object obj = new object();
+			return new WeakRefWrapper(obj);
 		}

 		[Test]
@@ -33,10 +51,8 @@
 		[Test]
 		public void WeakReferenceGetsFreedButHashCodeRemainsConstant()
 		{
-			object obj = new object();
-			WeakRefWrapper wr = new WeakRefWrapper(obj);
+			WeakRefWrapper wr = CreateWeakRefWrapper();
 			int hashCode = wr.GetHashCode();
-			obj = null;

 			GC.Collect();

@@ -48,10 +64,7 @@
 		[Test]
 		public void Scavenging()
 		{
-			WeakHashtable table = Create();
-
-			table[new object()] = new object();
-			table[new object()] = new object();
+			WeakHashtable table = CreateWithTwoObjects();

 			GC.Collect();
 			table.Scavenge();
@@ -62,10 +75,7 @@
 		[Test]
 		public void IterationAfterGC()
 		{
-			WeakHashtable table = Create();
-
-			table[new object()] = new object();
-			table[new object()] = new object();
+			WeakHashtable table = CreateWithTwoObjects();

 			GC.Collect();


Fix last SL build error

Fix last SL build error

--- src/NLog/LayoutRenderers/Log4JXmlEventLayoutRenderer.cs
+++ src/NLog/LayoutRenderers/Log4JXmlEventLayoutRenderer.cs
@@ -281,7 +281,11 @@
                 xtw.WriteStartElement("log4j", "data", dummyNamespace);
                 xtw.WriteAttributeString("name", "log4jmachinename");

+#if SILVERLIGHT
+            xtw.WriteAttributeString("value", "silverlight");
+#else
                 xtw.WriteAttributeString("value", Environment.MachineName);
+#endif
                 xtw.WriteEndElement();
                 xtw.WriteEndElement();


Add check for null, just in case!

Add check for null, just in case!

--- src/NUnitEngine/nunit.engine.api/TestEngineActivator.cs
+++ src/NUnitEngine/nunit.engine.api/TestEngineActivator.cs
@@ -105,7 +105,7 @@
             // allows the console or other runner to be executed with
             // a different application base and still function. In
             // particular, we do this in some tests of NUnit.
-            if (newestAssemblyFound == null)
+            if (newestAssemblyFound == null && AppDomain.CurrentDomain.RelativeSearchPath != null)
             {
                 foreach (string relpath in AppDomain.CurrentDomain.RelativeSearchPath.Split(new char[] { ';' }))
                 {


Clean up ReleaseManagerTests

Clean up ReleaseManagerTests

--- src/NerdBank.GitVersioning.Tests/ReleaseManagerTests.cs
+++ src/NerdBank.GitVersioning.Tests/ReleaseManagerTests.cs
@@ -6,10 +6,11 @@
 using Nerdbank.GitVersioning.Tests;
 using Xunit;
 using Xunit.Abstractions;
+
 using ReleaseOptions = Nerdbank.GitVersioning.VersionOptions.ReleaseOptions;
-using ReleaseVersionIncrement = Nerdbank.GitVersioning.VersionOptions.ReleaseVersionIncrement;
 using ReleasePreparationError = Nerdbank.GitVersioning.ReleaseManager.ReleasePreparationError;
 using ReleasePreparationException = Nerdbank.GitVersioning.ReleaseManager.ReleasePreparationException;
+using ReleaseVersionIncrement = Nerdbank.GitVersioning.VersionOptions.ReleaseVersionIncrement;

 public class ReleaseManagerTests : RepoTestBase
 {
@@ -20,17 +21,22 @@
     [Fact]
     public void PrepareRelease_NoGitRepo()
     {
-        this.AssertError(() => new ReleaseManager().PrepareRelease(this.RepoPath), ReleasePreparationError.NoGitRepo);
+        // running PrepareRelease should result in an error
+        // because the repo directory is not a git repository
+        this.AssertError(() => new ReleaseManager().PrepareRelease(this.RepoPath), ReleasePreparationError.NoGitRepo);
     }

     [Fact]
     public void PrepareRelease_DirtyWorkingDirecotory()
-    {
-        this.InitializeSourceControl();
-
+    {
+        this.InitializeSourceControl();
+
+        // create a file
         File.WriteAllText(Path.Combine(this.RepoPath, "file1.txt"), "");

-        this.AssertError(() => new ReleaseManager().PrepareRelease(this.RepoPath), ReleasePreparationError.UncommittedChanges);
+        // running PrepareRelease should result in an error
+        // because there is a new file not under version control
+        this.AssertError(() => new ReleaseManager().PrepareRelease(this.RepoPath), ReleasePreparationError.UncommittedChanges);
     }

     [Fact]
@@ -38,11 +44,13 @@
     {
         this.InitializeSourceControl();

+        // create a file and stage it
         var filePath = Path.Combine(this.RepoPath, "file1.txt");
         File.WriteAllText(filePath, "");
-
         Commands.Stage(this.Repo, filePath);
-
+
+        // running PrepareRelease should result in an error
+        // because there are uncommitted changes
         this.AssertError(() => new ReleaseManager().PrepareRelease(this.RepoPath), ReleasePreparationError.UncommittedChanges);
     }

@@ -50,6 +58,9 @@
     public void PrepareRelease_NoVersionFile()
     {
         this.InitializeSourceControl();
+
+        // running PrepareRelease should result in an error
+        // because there is no version.json
         this.AssertError(() => new ReleaseManager().PrepareRelease(this.RepoPath), ReleasePreparationError.NoVersionFile);
     }

@@ -69,6 +80,8 @@
         };
         this.WriteVersionFile(versionOptions);

+        // running PrepareRelease should result in an error
+        // because the branchName does not have a placeholder for the version
         this.AssertError(() => new ReleaseManager().PrepareRelease(this.RepoPath), ReleasePreparationError.InvalidBranchNameSetting);
     }

@@ -83,9 +96,9 @@
     [InlineData("1.2-beta.{height}", null, "rc", "1.2-rc.{height}")]
     [InlineData("1.2-beta.{height}", "v{0}", "rc", "1.2-rc.{height}")]
     [InlineData("1.2-beta.{height}+metadata", null, "rc", "1.2-rc.{height}+metadata")]
-    public void PrepareRelease_OnReleaseBranch(string currentVersion, string releaseBranchName, string releaseUnstableTag, string expectedVersion)
-    {
-        releaseBranchName = releaseBranchName ?? new ReleaseOptions().BranchNameOrDefault;
+    public void PrepareRelease_OnReleaseBranch(string initialVersion, string releaseOptionsBranchName, string releaseUnstableTag, string resultingVersion)
+    {
+        releaseOptionsBranchName = releaseOptionsBranchName ?? new ReleaseOptions().BranchNameOrDefault;

         // create and configure repository
         this.InitializeSourceControl();
@@ -94,32 +107,43 @@

         var initialVersionOptions = new VersionOptions()
         {
-            Version = SemanticVersion.Parse(currentVersion),
-            Release = new ReleaseOptions()
-            {
-                BranchName = releaseBranchName
+            Version = SemanticVersion.Parse(initialVersion),
+            Release = new ReleaseOptions()
+            {
+                BranchName = releaseOptionsBranchName
             }
         };

         var expectedVersionOptions = new VersionOptions()
         {
-            Version = SemanticVersion.Parse(expectedVersion),
-            Release = new ReleaseOptions()
-            {
-                BranchName = releaseBranchName
-            }
-        };
-
+            Version = SemanticVersion.Parse(resultingVersion),
+            Release = new ReleaseOptions()
+            {
+                BranchName = releaseOptionsBranchName
+            }
+        };
+
+        // create version.json
         this.WriteVersionFile(initialVersionOptions);

         // switch to release branch
-        var branchName = string.Format(releaseBranchName, initialVersionOptions.Version.Version);
+        var branchName = string.Format(releaseOptionsBranchName, initialVersionOptions.Version.Version);
         Commands.Checkout(this.Repo, this.Repo.CreateBranch(branchName));

-        new ReleaseManager().PrepareRelease(this.RepoPath, releaseUnstableTag);
-
-        // TODO: Check if a commit was created
-
+        var tipBeforePrepareRelease = this.Repo.Head.Tip;
+
+        // run PrepareRelease
+        var releaseManager = new ReleaseManager();
+        releaseManager.PrepareRelease(this.RepoPath, releaseUnstableTag);
+
+        // Check if a commit was created
+        {
+            var updateVersionCommit = this.Repo.Head.Tip;
+            Assert.NotEqual(tipBeforePrepareRelease.Id, updateVersionCommit.Id);
+            Assert.Single(updateVersionCommit.Parents);
+            Assert.Equal(updateVersionCommit.Parents.Single().Id, tipBeforePrepareRelease.Id);
+        }
+
         // check version on release branch
         {
             var actualVersionOptions = VersionFile.GetVersion(this.Repo.Branches[branchName].Tip);
@@ -130,48 +154,50 @@
     [Theory]
     [InlineData("1.2", "rc")]
     [InlineData("1.2+metadata", "rc")]
-    public void PrepeareRelease_OnReleaseBranch_VersionDecrement(string currentVersion, string releaseUnstableTag)
+    public void PrepeareRelease_OnReleaseBranchWithVersionDecrement(string initialVersion, string releaseUnstableTag)
     {
         // create and configure repository
         this.InitializeSourceControl();
         this.Repo.Config.Set("user.name", this.Signer.Name, ConfigurationLevel.Local);
         this.Repo.Config.Set("user.email", this.Signer.Email, ConfigurationLevel.Local);

-        var versionOptions = new VersionOptions()
-        {
-            Version = SemanticVersion.Parse(currentVersion)
-        };
-
+        // create version.json
+        var versionOptions = new VersionOptions() { Version = SemanticVersion.Parse(initialVersion) };
         this.WriteVersionFile(versionOptions);

         // switch to release branch
         var branchName = string.Format(versionOptions.ReleaseOrDefault.BranchNameOrDefault, versionOptions.Version.Version);
         Commands.Checkout(this.Repo, this.Repo.CreateBranch(branchName));

+        // running PrepareRelease should result in an error
+        // because we're trying to add a prerelease tag to a version without prerelease tag
         this.AssertError(() => new ReleaseManager().PrepareRelease(this.RepoPath, releaseUnstableTag), ReleasePreparationError.VersionDecrement);
     }

     [Theory]
-    [InlineData("1.2-pre", "1.2", "1.3-pre", ReleaseVersionIncrement.Minor, null, "pre", null)]
-    [InlineData("1.2-pre", "1.2", "2.2-pre", ReleaseVersionIncrement.Major, null, "pre", null)]
-    [InlineData("1.2-pre", "1.2", "1.3-pre", ReleaseVersionIncrement.Minor, "v{0}", "pre", null)]
-    [InlineData("1.2-pre+metadata", "1.2+metadata", "1.3-pre+metadata", ReleaseVersionIncrement.Minor, null, "pre", null)]
-    [InlineData("1.2-rc.{height}", "1.2", "1.3-beta.{height}", ReleaseVersionIncrement.Minor, null, "beta", null)]
-    [InlineData("1.2-rc.{height}", "1.2", "1.3-beta.{height}", ReleaseVersionIncrement.Minor, null, "-beta", null)]
-    [InlineData("1.2-beta.{height}", "1.2-rc.{height}", "1.3-alpha.{height}", ReleaseVersionIncrement.Minor, null, "alpha", "rc")]
-    [InlineData("1.2-beta", "1.2-rc", "1.3-alpha", ReleaseVersionIncrement.Minor, null, "alpha", "rc")]
-    [InlineData("1.2-beta+metadata", "1.2-rc+metadata", "1.3-alpha+metadata", ReleaseVersionIncrement.Minor, null, "alpha", "rc")]
+    [InlineData("1.2-pre", null, ReleaseVersionIncrement.Minor, "pre", null, "1.2", "1.3-pre")]
+    [InlineData("1.2-pre", null, ReleaseVersionIncrement.Major, "pre", null, "1.2", "2.2-pre")]
+    [InlineData("1.2-pre", "v{0}", ReleaseVersionIncrement.Minor, "pre", null, "1.2", "1.3-pre")]
+    [InlineData("1.2-pre+metadata", null, ReleaseVersionIncrement.Minor, "pre", null, "1.2+metadata", "1.3-pre+metadata")]
+    [InlineData("1.2-rc.{height}", null, ReleaseVersionIncrement.Minor, "beta", null, "1.2", "1.3-beta.{height}")]
+    [InlineData("1.2-rc.{height}", null, ReleaseVersionIncrement.Minor, "-beta", null, "1.2", "1.3-beta.{height}")]
+    [InlineData("1.2-beta.{height}", null, ReleaseVersionIncrement.Minor, "alpha", "rc", "1.2-rc.{height}", "1.3-alpha.{height}")]
+    [InlineData("1.2-beta", null, ReleaseVersionIncrement.Minor, "alpha", "rc", "1.2-rc", "1.3-alpha")]
+    [InlineData("1.2-beta+metadata", null, ReleaseVersionIncrement.Minor, "alpha", "rc", "1.2-rc+metadata", "1.3-alpha+metadata")]
     public void PrepareRelease_OnMaster(
-        string initialVersion,
-        string releaseVersion,
-        string nextVersion,
-        ReleaseVersionIncrement versionIncrement,
-        string releaseBranchName,
-        string firstUnstableTag,
-        string releaseUnstableTag)
-    {
-        releaseBranchName = releaseBranchName ?? new ReleaseOptions().BranchNameOrDefault;
+        // data for initial setup (version and release options configured in version.json)
+        string initialVersion,
+        string releaseOptionsBranchName,
+        ReleaseVersionIncrement releaseOptionsVersionIncrement,
+        string releaseOptionsFirstUnstableTag,
+        // arguments passed to PrepareRelease()
+        string releaseUnstableTag,
+        // expected versions after running PrepareRelease()
+        string resultingReleaseVersion,
+        string resultingMainVersion)
+    {
+        releaseOptionsBranchName = releaseOptionsBranchName ?? new ReleaseOptions().BranchNameOrDefault;

         // create and configure repository
         this.InitializeSourceControl();
@@ -184,41 +210,42 @@
             Version = SemanticVersion.Parse(initialVersion),
             Release = new ReleaseOptions()
             {
-                VersionIncrement = versionIncrement,
-                BranchName = releaseBranchName,
-                FirstUnstableTag = firstUnstableTag
+                VersionIncrement = releaseOptionsVersionIncrement,
+                BranchName = releaseOptionsBranchName,
+                FirstUnstableTag = releaseOptionsFirstUnstableTag
             }
         };
         this.WriteVersionFile(initialVersionOptions);

         var expectedVersionOptionsReleaseBranch = new VersionOptions()
         {
-            Version = SemanticVersion.Parse(releaseVersion),
-            Release = new ReleaseOptions()
-            {
-                VersionIncrement = versionIncrement,
-                BranchName = releaseBranchName,
-                FirstUnstableTag = firstUnstableTag
+            Version = SemanticVersion.Parse(resultingReleaseVersion),
+            Release = new ReleaseOptions()
+            {
+                VersionIncrement = releaseOptionsVersionIncrement,
+                BranchName = releaseOptionsBranchName,
+                FirstUnstableTag = releaseOptionsFirstUnstableTag
             }
         };

         var expectedVersionOptionsCurrentBrach = new VersionOptions()
         {
-            Version = SemanticVersion.Parse(nextVersion),
-            Release = new ReleaseOptions()
-            {
-                VersionIncrement = versionIncrement,
-                BranchName = releaseBranchName,
-                FirstUnstableTag = firstUnstableTag
-            }
-        };
-
-        var expectedBranchName = string.Format(releaseBranchName, expectedVersionOptionsReleaseBranch.Version.Version);
+            Version = SemanticVersion.Parse(resultingMainVersion),
+            Release = new ReleaseOptions()
+            {
+                VersionIncrement = releaseOptionsVersionIncrement,
+                BranchName = releaseOptionsBranchName,
+                FirstUnstableTag = releaseOptionsFirstUnstableTag
+            }
+        };
+
+        var expectedBranchName = string.Format(releaseOptionsBranchName, expectedVersionOptionsReleaseBranch.Version.Version);
         var initialBranchName = this.Repo.Head.FriendlyName;
-        var tipBeforeRelease = this.Repo.Head.Tip;
+        var tipBeforePrepareRelease = this.Repo.Head.Tip;

         // prepare release
-        new ReleaseManager().PrepareRelease(this.RepoPath, releaseUnstableTag);
+        var releaseManager = new ReleaseManager();
+        releaseManager.PrepareRelease(this.RepoPath, releaseUnstableTag);

         // check if a branch was created
         Assert.Contains(this.Repo.Branches, branch => branch.FriendlyName == expectedBranchName);
@@ -230,8 +257,8 @@
         // parent of new commit must be the commit before preparing the release
         var releaseBranch = this.Repo.Branches[expectedBranchName];
         {
-            Assert.NotEqual(releaseBranch.Tip.Id, tipBeforeRelease.Id);
-            Assert.Equal(releaseBranch.Tip.Parents.Single().Id, tipBeforeRelease.Id);
+            Assert.NotEqual(releaseBranch.Tip.Id, tipBeforePrepareRelease.Id);
+            Assert.Equal(releaseBranch.Tip.Parents.Single().Id, tipBeforePrepareRelease.Id);
         }

         // check if current branch contains new commits
@@ -245,7 +272,7 @@

             var updateVersionCommit = mergeCommit.Parents.Single(c => c.Id != releaseBranch.Tip.Id);
             Assert.Single(updateVersionCommit.Parents);
-            Assert.Equal(updateVersionCommit.Parents.Single().Id, tipBeforeRelease.Id);
+            Assert.Equal(updateVersionCommit.Parents.Single().Id, tipBeforePrepareRelease.Id);
         }

         // check version on release branch
@@ -264,24 +291,21 @@
     [Theory]
     [InlineData("1.2", "rc")]
     [InlineData("1.2+metadata", "rc")]
-    public void PrepareRelease_OnMaster_VersionDecrement(string currentVersion, string releaseUnstableTag)
+    public void PrepareRelease_OnMasterWithVersionDecrement(string initialVersion, string releaseUnstableTag)
     {
         // create and configure repository
         this.InitializeSourceControl();
         this.Repo.Config.Set("user.name", this.Signer.Name, ConfigurationLevel.Local);
         this.Repo.Config.Set("user.email", this.Signer.Email, ConfigurationLevel.Local);

-        var versionOptions = new VersionOptions()
-        {
-            Version = SemanticVersion.Parse(currentVersion)
-        };
-
+        // create version.json
+        var versionOptions = new VersionOptions() { Version = SemanticVersion.Parse(initialVersion) };
         this.WriteVersionFile(versionOptions);

-        // switch to release branch
+        // running PrepareRelease should result in an error
+        // because we're trying to add a prerelease tag to a version without prerelease tag
         this.AssertError(() => new ReleaseManager().PrepareRelease(this.RepoPath, releaseUnstableTag), ReleasePreparationError.VersionDecrement);
     }
-

     private void AssertError(Action testCode, ReleasePreparationError expectedError)


Fix permission issue (#2979)

Fix permission issue (#2979)

--- src/OrchardCore.Modules/OrchardCore.Lucene/AdminMenu.cs
+++ src/OrchardCore.Modules/OrchardCore.Lucene/AdminMenu.cs
@@ -37,6 +37,7 @@
                     .Add(T["Settings"], settings => settings
                         .Add(T["Search"], T["Search"], entry => entry
                             .Action("Index", "Admin", new { area = "OrchardCore.Settings", groupId = "search" })
+                            .Permission(Permissions.ManageIndexes)
                             .LocalNav()
                         )));


Avoid serialization of Delegate fields

Avoid serialization of Delegate fields

--- src/OrleansCodeGenerator/SerializerGenerationManager.cs
+++ src/OrleansCodeGenerator/SerializerGenerationManager.cs
@@ -52,7 +52,8 @@
             var typeInfo = t.GetTypeInfo();

             if (typeInfo.IsGenericParameter || ProcessedTypes.Contains(t) || TypesToProcess.Contains(t)
-                || typeof(Exception).GetTypeInfo().IsAssignableFrom(t)) return false;
+                || typeof(Exception).GetTypeInfo().IsAssignableFrom(t)
+                || typeof(Delegate).GetTypeInfo().IsAssignableFrom(t)) return false;

             if (typeInfo.IsArray)
             {


better support for byte and DateTime? types

--- isukces.code/Features/AutoCode/GeneratorsHelper.cs
+++ isukces.code/Features/AutoCode/GeneratorsHelper.cs
@@ -14,131 +14,15 @@
     {
         #region Static Methods

-        public static HashSet<T> MakeCopy<T>(IEnumerable<T> source, IEnumerable<T> append = null,
-            IEnumerable<T> remove = null)
+        public static string FieldName(string x)
         {
-            var s = new HashSet<T>();
-            if (source != null)
-                foreach (var i in source)
-                    s.Add(i);
-            if (append != null)
-                foreach (var i in append)
-                    s.Add(i);
-            if (remove != null)
-                foreach (var i in remove)
-                    s.Remove(i);
-            return s;
+            return "_" + x.Substring(0, 1).ToLower() + x.Substring(1);
         }
-
-        public static string TypeName(Type type, INamespaceContainer container)
-        {
-            //todo: Generic types
-            if (type == null)
-                return null;
-            if (type.IsArray)
-            {
-                var arrayRank = type.GetArrayRank();
-                var st = TypeName(type.GetElementType(), container);
-                if (arrayRank < 2)
-                    return st + "[]";
-                return string.Format("{0}[{1}]", st, new string(',', arrayRank - 1));
-            }
-            var simple = SimpleTypeName(type);
-            if (!String.IsNullOrEmpty(simple))
-                return simple;
-            if (type.DeclaringType != null)
-                return TypeName(type.DeclaringType, container) + "." + type.Name;
-
-            string fullName;
-            {
-                if (type.IsGenericType)
-                {
-                    var gt = type.GetGenericTypeDefinition();
-                    var args = type.GetGenericArguments();
-                    var args2 = String.Join(",", args.Select(a => TypeName(a, container)));
-                    fullName = gt.FullName.Split('`')[0] + "<" + args2 + ">";
-                }
-                else
-                    fullName = type.FullName;
-            }
-            var typeNamespace = type.Namespace;
-            return !String.IsNullOrEmpty(typeNamespace) &&
-                   (container?.GetNamespaces(true)?.Contains(typeNamespace) ?? false)
-                ? fullName.Substring(typeNamespace.Length + 1)
-                : fullName;
-        }
-
-        private static string SimpleTypeName(Type t)
-        {
-            if (t == typeof(string)) return "string";
-            if (t == typeof(int)) return "int";
-            if (t == typeof(uint)) return "uint";
-            if (t == typeof(double)) return "double";
-            if (t == typeof(short)) return "short";
-            if (t == typeof(ushort)) return "ushort";
-            if (t == typeof(object)) return "object";
-            if (t == typeof(bool)) return "bool";
-            if (t == typeof(decimal)) return "decimal";
-
-            Type[] args = null;
-            if (t.IsGenericType)
-            {
-                var gt = t.GetGenericTypeDefinition();
-                args = t.GetGenericArguments();
-                if (gt == typeof(Nullable<>))
-                {
-                    var simple = SimpleTypeName(args[0]);
-                    if (string.IsNullOrEmpty(simple))
-                    {
-                        throw new NotSupportedException(args[0].ToString());
-                    }
-                    return simple + "?";
-                }
-
-            }
-
-            return null;
-
-            // var ns = t.Namespace;
-            // var fullName = t.FullName.Split('`')[0];
-
-            // System.Nullable`1[[System.Int16, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
-
-            /*
-            foreach (var i in CopyMeMaker.GetNameSpaces().OrderByDescending(a => a.Length))
-            {
-                if (ns != i) continue;
-                var c = fullName.Substring(ns.Length + 1);
-                if (!c.Contains("."))
-                    fullName = c;
-                else
-                    fullName = c;
-                break;
-            }
-            if (args != null)
-            {
-                fullName += "<" + String.Join(",", args.Select(TypeName)) + ">";
-            }
-            if (fullName.Contains("+"))
-                fullName = fullName.Replace("+", ".");
-            return fullName;
-            */
-        }
-
-        #endregion

         public static string GetWriteMemeberName(PropertyInfo pi)
         {
             var props = pi.GetCustomAttribute<Auto.WriteMemberAttribute>();
-            return !String.IsNullOrEmpty(props?.Name) ? props.Name : pi.Name;
-        }
-
-        public const BindingFlags All =
-            BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static;
-
-        public static string FieldName(string x)
-        {
-            return "_" + x.Substring(0, 1).ToLower() + x.Substring(1);
+            return !string.IsNullOrEmpty(props?.Name) ? props.Name : pi.Name;
         }

         public static bool IsMemberStatic(MemberInfo mi)
@@ -172,5 +56,135 @@
             }
             throw new NotSupportedException();
         }
+
+        public static HashSet<T> MakeCopy<T>(IEnumerable<T> source, IEnumerable<T> append = null,
+            IEnumerable<T> remove = null)
+        {
+            var s = new HashSet<T>();
+            if (source != null)
+                foreach (var i in source)
+                    s.Add(i);
+            if (append != null)
+                foreach (var i in append)
+                    s.Add(i);
+            if (remove != null)
+                foreach (var i in remove)
+                    s.Remove(i);
+            return s;
+        }
+
+        public static string TypeName(Type type, INamespaceContainer container)
+        {
+            //todo: Generic types
+            if (type == null)
+                return null;
+            if (type.IsArray)
+            {
+                var arrayRank = type.GetArrayRank();
+                var st = TypeName(type.GetElementType(), container);
+                if (arrayRank < 2)
+                    return st + "[]";
+                return string.Format("{0}[{1}]", st, new string(',', arrayRank - 1));
+            }
+            var simple = SimpleTypeName(type);
+            if (!string.IsNullOrEmpty(simple))
+                return simple;
+            if (type.DeclaringType != null)
+                return TypeName(type.DeclaringType, container) + "." + type.Name;
+
+            string fullName;
+            {
+                if (type.IsGenericType)
+                {
+                    {
+                        var nullable = GetNullableType(type);
+                        if (nullable != null)
+                            return TypeName(nullable, container) + "?";
+                    }
+                    var gt = type.GetGenericTypeDefinition();
+                    var args = type.GetGenericArguments();
+                    var args2 = string.Join(",", args.Select(a => TypeName(a, container)));
+                    fullName = gt.FullName.Split('`')[0] + "<" + args2 + ">";
+                }
+                else
+                    fullName = type.FullName;
+            }
+            var typeNamespace = type.Namespace;
+            return !string.IsNullOrEmpty(typeNamespace) &&
+                   (container?.GetNamespaces(true)?.Contains(typeNamespace) ?? false)
+                ? fullName.Substring(typeNamespace.Length + 1)
+                : fullName;
+        }
+
+        private static Type GetNullableType(Type type)
+        {
+            if ((type == null) || !type.IsGenericType)
+                return null;
+            var gt = type.GetGenericTypeDefinition();
+            var args = type.GetGenericArguments();
+            return gt == typeof(Nullable<>) ? args[0] : null;
+        }
+
+        private static string SimpleTypeName(Type t)
+        {
+            if (t == typeof(string)) return "string";
+            if (t == typeof(int)) return "int";
+            if (t == typeof(uint)) return "uint";
+            if (t == typeof(double)) return "double";
+            if (t == typeof(short)) return "short";
+            if (t == typeof(ushort)) return "ushort";
+            if (t == typeof(object)) return "object";
+            if (t == typeof(bool)) return "bool";
+            if (t == typeof(decimal)) return "decimal";
+            if (t == typeof(byte)) return "byte";
+
+            {
+                // nullable support
+                var nullableType = GetNullableType(t);
+                if (nullableType != null)
+                {
+                    var simple = SimpleTypeName(nullableType);
+                    if (string.IsNullOrEmpty(simple))
+                        return null;
+                    return simple + "?";
+                }
+            }
+
+            return null;
+
+            // var ns = t.Namespace;
+            // var fullName = t.FullName.Split('`')[0];
+
+            // System.Nullable`1[[System.Int16, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
+
+            /*
+            foreach (var i in CopyMeMaker.GetNameSpaces().OrderByDescending(a => a.Length))
+            {
+                if (ns != i) continue;
+                var c = fullName.Substring(ns.Length + 1);
+                if (!c.Contains("."))
+                    fullName = c;
+                else
+                    fullName = c;
+                break;
+            }
+            if (args != null)
+            {
+                fullName += "<" + String.Join(",", args.Select(TypeName)) + ">";
+            }
+            if (fullName.Contains("+"))
+                fullName = fullName.Replace("+", ".");
+            return fullName;
+            */
+        }
+
+        #endregion
+
+        #region Other
+
+        public const BindingFlags All =
+            BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static;
+
+        #endregion
     }
 }


Add ruler with seconds increments.

Add ruler with seconds increments.

--- src/StructuredLogViewer/Controls/TracingControl.xaml.cs
+++ src/StructuredLogViewer/Controls/TracingControl.xaml.cs
@@ -16,6 +16,8 @@
         // Ratio of time reported to the smallest pixel to render.
         private const double TimeToPixel = 50000;

+        private double OneSecondPixelWidth;
+
         // Build start time to sync all canvas.
         private long GlobalStartTime;

@@ -160,6 +162,8 @@
             sample.Measure(new Size(10000, 10000));
             textHeight = sample.DesiredSize.Height;

+            OneSecondPixelWidth = ConvertTimeToPixel(TimeSpan.FromSeconds(1).Ticks);
+
             Draw();
         }

@@ -177,7 +181,7 @@
             var keys = Timeline.Lanes.Keys.ToList();
             keys.Sort();

-            bool topRuler = false;
+            bool topRuler = true;

             foreach (var key in keys)
             {
@@ -187,7 +191,7 @@
                 {
                     if (ShowNodes || topRuler)
                     {
-                        var nodePanal = CreatePanelForNodeDivider();
+                        var nodePanal = CreatePanelForNodeDivider(topRuler);
                         lanesPanel.Children.Add(nodePanal);
                         topRuler = false;
                     }
@@ -198,18 +202,19 @@
             }
         }

-        private Panel CreatePanelForNodeDivider()
+        private Panel CreatePanelForNodeDivider(bool showTime)
         {
             var canvas = new Canvas();
             canvas.VerticalAlignment = VerticalAlignment.Top;

             var timeWidth = ConvertTimeToPixel(GlobalEndTime - GlobalStartTime);

-            /*
-            // TODO: match line with Time
+            double gapWidth = (OneSecondPixelWidth / textHeight) - 0.1;
+
+            // A dash or gap relative to the Thickness of the pen
             Line nodeLine = new Line()
             {
-                StrokeDashArray = new DoubleCollection { 0.05, 9.95 },
+                StrokeDashArray = new DoubleCollection { 0.1, gapWidth },
                 Stroke = Brushes.Black,
                 StrokeThickness = textHeight,
                 Height = textHeight,
@@ -218,8 +223,22 @@
                 Y2 = textHeight / 2,
             };
             canvas.Children.Add(nodeLine);
-            */
-
+
+            if (showTime)
+            {
+                for (int i = 0; i < timeWidth / OneSecondPixelWidth; i++)
+                {
+                    var textBlock = new TextBlock();
+                    textBlock.Text = $"{i}s";
+
+                    // buffer 2 pixels
+                    Canvas.SetLeft(textBlock, 2 + i * OneSecondPixelWidth);
+                    // Canvas.SetTop(textBlock, indentOffset);
+                    canvas.Children.Add(textBlock);
+                }
+            }
+
+            canvas.VerticalAlignment = VerticalAlignment.Top;
             canvas.Background = nodeBackground;
             canvas.Height = textHeight;
             canvas.Width = timeWidth;
@@ -227,7 +246,7 @@
             return canvas;
         }

-        private double ConvertTimeToPixel(double time)
+        private static double ConvertTimeToPixel(double time)
         {
             return time / TimeToPixel;
         }


Use Dns.GetHostAddresses in Socket.Connect (#37324)

Replace Dns.GetHostAddressesAsync with Dns.GetHostAddresses in Socket.Connect

--- src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs
+++ src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs
@@ -899,7 +899,7 @@
             }
             else
             {
-                IPAddress[] addresses = Dns.GetHostAddressesAsync(host).GetAwaiter().GetResult();
+                IPAddress[] addresses = Dns.GetHostAddresses(host);
                 Connect(addresses, port);
             }


Remove ByReference workaround on TypedReference.cs (#3352)

--- src/System.Private.CoreLib/src/System/TypedReference.cs
+++ src/System.Private.CoreLib/src/System/TypedReference.cs
@@ -3,12 +3,10 @@
 // See the LICENSE file in the project root for more information.

 using System.Reflection;
-using System.Diagnostics;
 using System.Runtime;
 using System.Runtime.InteropServices;
 using System.Runtime.CompilerServices;

-using Internal.Runtime.Augments;
 using Internal.Reflection.Augments;

 namespace System
@@ -18,20 +16,12 @@
     public struct TypedReference
     {
         // Do not change the ordering of these fields. The JIT has a dependency on this layout.
-#if CORERT
         private readonly ByReference<byte> _value;
-#else
-        private readonly ByReferenceOfByte _value;
-#endif
         private readonly RuntimeTypeHandle _typeHandle;

         private TypedReference(object target, int offset, RuntimeTypeHandle typeHandle)
         {
-#if CORERT
             _value = new ByReference<byte>(ref Unsafe.Add<byte>(ref target.GetRawData(), offset));
-#else
-            _value = new ByReferenceOfByte(target, offset);
-#endif
             _typeHandle = typeHandle;
         }

@@ -94,22 +84,6 @@
                 return ref _value.Value;
             }
         }
-
-        // @todo: ByReferenceOfByte is a workaround for the fact that ByReference<T> is broken on Project N right now.
-        // Once that's fixed, delete this class and replace references to ByReferenceOfByte to ByReference<byte>.
-        private struct ByReferenceOfByte
-        {
-            public ByReferenceOfByte(object target, int offset)
-            {
-                _target = target;
-                _offset = offset;
-            }
-
-            public ref byte Value => ref Unsafe.Add<byte>(ref _target.GetRawData(), _offset);
-
-            private readonly object _target;
-            private readonly int _offset;
-        }
     }
 }


Address remaining PR feedback

Address remaining PR feedback

--- src/System.Runtime/tests/System/GuidTests.netcoreapp.cs
+++ src/System.Runtime/tests/System/GuidTests.netcoreapp.cs
@@ -2,9 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.

-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
 using Xunit;

 namespace System.Tests
@@ -28,7 +25,7 @@

         [Theory]
         [MemberData(nameof(Ctor_ByteArray_TestData))]
-        public static void TryWriteBytes(byte[] b, Guid guid)
+        public static void TryWriteBytes_ValidLength_ReturnsTrue(byte[] b, Guid guid)
         {
             var bytes = new byte[16];
             Assert.True(guid.TryWriteBytes(new Span<byte>(bytes)));
@@ -38,7 +35,7 @@
         [Theory]
         [InlineData(0)]
         [InlineData(15)]
-        public static void TryWriteBytes_ReturnsFalse(int length)
+        public static void TryWriteBytes_LengthTooShort_ReturnsFalse(int length)
         {
             Assert.False(s_testGuid.TryWriteBytes(new Span<byte>(new byte[length])));
         }
@@ -53,17 +50,10 @@

         [Theory]
         [MemberData(nameof(ToString_TestData))]
-        public static void TryFormat_ReturnsTrue(Guid guid, string format, string expected)
-        {
-            Assert.True(guid.TryFormat(new Span<char>(new char[guid.ToString(format).Length]), out int charsWritten, format));
-            Assert.Equal(guid.ToString(format).Length, charsWritten);
-        }
-
-        [Theory]
-        [MemberData(nameof(ToString_TestData))]
-        public static void TryFormat_ReturnsFalse_WhenSpanTooSmall(Guid guid, string format, string expected)
+        public static void TryFormat_LengthTooSmall_ReturnsFalse(Guid guid, string format, string expected)
         {
             Assert.False(guid.TryFormat(new Span<char>(new char[guid.ToString(format).Length - 1]), out int charsWritten, format));
+            Assert.Equal(0, charsWritten);
         }

         [Theory]
@@ -76,7 +66,7 @@

         [Theory]
         [MemberData(nameof(ToString_TestData))]
-        public static void TryFormat_Valid(Guid guid, string format, string expected)
+        public static void TryFormat_ValidLength_ReturnsTrue(Guid guid, string format, string expected)
         {
             char[] chars = new char[guid.ToString(format).Length];
             Assert.True(guid.TryFormat(new Span<char>(chars), out int charsWritten, format));


fixed typing error

fixed typing error

--- src/WpfControlsLib/Controls/Toolbar/ToolbarViewModel.cs
+++ src/WpfControlsLib/Controls/Toolbar/ToolbarViewModel.cs
@@ -30,7 +30,7 @@
         /// </summary>
         public IList<IButton> Buttons => this.ButtonsToShow as IList<IButton>;

-        public ObservableCollection<Button> ButtonsToShow => null;
+        public ObservableCollection<Button> ButtonsToShow => new ObservableCollection<Button>();

         public void AddButton(IButton button) => this.ButtonsToShow.Add(this.WrapIButton(button));


save multiple rooms to dungeon

save multiple rooms to dungeon

--- Assets/Editor/SaveRoomToDungeonTool.cs
+++ Assets/Editor/SaveRoomToDungeonTool.cs
@@ -11,19 +11,39 @@
     }

     [MenuItem("Tools/Save room to dungeon _F7")]
-    private static void AddRoomToDungeon() {
-        Room newRoom = Selection.activeGameObject.GetComponent<Room>();
+    private static void AddRoomsToDungeon() {
         Dungeon dungeon = GameObject.FindObjectOfType<Dungeon>();
         if (dungeon == null) {
             Debug.LogError("No Dungeon generator found");
             return;
         }

-        if (newRoom.exits.Count < 1) {
-            Debug.LogError("The room doesn't have any exit!");
-            return;
+        for (int i = 0; i < Selection.gameObjects.Length; i++) {
+            Room newRoom = Selection.gameObjects[i].GetComponent<Room>();
+            if (newRoom.exits.Count < 1) {
+                Debug.LogError("The room:" + newRoom.name + " doesn't have any exit!");
+                continue;
+            }
+            else if(newRoom.exits.Count > (newRoom.size.x*2 + newRoom.size.y*2)) {
+                Debug.LogError("The room:" + newRoom.name + " has too many exits!");
+                continue;
+            }
+
+            RoomToDungeon(newRoom, dungeon);
+        }
+    }
+
+    private static bool CompareRoomsExits(Room room, Room model) {
+        for (int j = 0; j < room.exits.Count; j++) {
+            if (room.exits[j].dir != model.exits[j].dir || room.exits[j].pos != model.exits[j].pos) { //implies that exits are stored in the same order
+                return false;
+            }
         }

+        return true;
+    }
+
+    private static void RoomToDungeon(Room newRoom, Dungeon dungeon) {
         newRoom.debug = false;

         Undo.RecordObject(dungeon, "Add room to dungeon");
@@ -53,14 +73,4 @@
         roomConfigs[roomConfigs.Count - 1].rooms.Add(newRoom);
         Debug.Log("Room added. Zone: " + newRoom.zoneIndex + " Room config: " + (roomConfigs.Count - 1));
     }
-
-    private static bool CompareRoomsExits(Room room, Room model) {
-        for (int j = 0; j < room.exits.Count; j++) {
-            if (room.exits[j].dir != model.exits[j].dir || room.exits[j].pos != model.exits[j].pos) { //implies that exits are stored in the same order
-                return false;
-            }
-        }
-
-        return true;
-    }
 }


Impl HelenaX second ratio to 0.5f

Impl HelenaX second ratio to 0.5f

--- Assets/Scripts/Skill/Helena/HelenaX.cs
+++ Assets/Scripts/Skill/Helena/HelenaX.cs
@@ -48,7 +48,12 @@

         DamageCalculator.Calculate(_skillUserObj, _attackInfo);

-        _synchronizer.SyncAttack(_skillUserViewID, target.PhotonView.viewID, DamageCalculator.Damage, DamageCalculator.IsCritical, HitEffectType.Helena);
+        if (_isSecond)
+          _synchronizer.SyncAttack(_skillUserViewID, target.PhotonView.viewID, (int)(DamageCalculator.Damage * _secondRatio), DamageCalculator.IsCritical, HitEffectType.Nage);
+        else {
+          _synchronizer.SyncAttack(_skillUserViewID, target.PhotonView.viewID, DamageCalculator.Damage, DamageCalculator.IsCritical, HitEffectType.Nage);
+          _isSecond = true;
+        }
       }
     }

@@ -65,5 +70,7 @@
     private HitRistrictor _hitRistrictor;
     private float _spd = 8.0f;
     private float _existTime = 0.37f;
+    private bool _isSecond;
+    private float _secondRatio = 0.5f;
   }
 }


add extra iges test

add extra iges test

--- BCad.Test/IgesTests/IgesWriterTests.cs
+++ BCad.Test/IgesTests/IgesWriterTests.cs
@@ -64,6 +64,24 @@
         }

         [Fact]
+        public void WriteLineWithSpanningParametersTest()
+        {
+            var file = new IgesFile();
+            file.Entities.Add(new IgesLine()
+            {
+                P1 = new IgesPoint(1.1234512345, 2.1234512345, 3.1234512345),
+                P2 = new IgesPoint(4.1234512345, 5.1234512345, 6.1234512345),
+                Color = IgesColorNumber.Color3
+            });
+            VerifyFileContains(file, @"
+     110       1       0       0       0                               0D      1
+     110       0       3       1       0                                D      2
+110,1.1234512345,2.1234512345,3.1234512345,4.1234512345,5.1234512345,  1P      1
+110,6.1234512345;                                                      1P      2
+");
+        }
+
+        [Fact]
         public void WriteSpecificGlobalValuesTest()
         {
             var file = new IgesFile()


Add proper shutdown of the receive loop

Add proper shutdown of the receive loop

--- src/Dbus/Connection.cs
+++ src/Dbus/Connection.cs
@@ -14,6 +14,7 @@
     {
         private Socket socket;
         private Stream stream;
+        private readonly CancellationTokenSource receiveCts;
         private int serialCounter;
         private static readonly Encoding encoding = Encoding.UTF8;
         private ConcurrentDictionary<int, TaskCompletionSource<ReceivedMethodReturn>> expectedMessages;
@@ -24,7 +25,7 @@
             socket = new Socket(AddressFamily.Unix, SocketType.Stream, 0);
             socket.Connect(new systemBusEndPoint());
             stream = new LoggingStream(new NetworkStream(socket));
-
+            receiveCts = new CancellationTokenSource();
             Task.Run(receive);
         }

@@ -124,11 +125,11 @@
         private async Task receive()
         {
             var fixedLengthHeader = new byte[16]; // header up until the array length
-            while (true)
+            var token = receiveCts.Token;
+            while (!token.IsCancellationRequested)
             {
-                Console.WriteLine("start reading");
-                await stream.ReadAsync(fixedLengthHeader, 0, fixedLengthHeader.Length).ConfigureAwait(false);
-                Console.WriteLine("end reading");
+                await stream.ReadAsync(fixedLengthHeader, 0, fixedLengthHeader.Length, token).ConfigureAwait(false);
+                token.ThrowIfCancellationRequested();

                 if (fixedLengthHeader[0] != (byte)'l')
                     throw new InvalidDataException("Wrong endianess");
@@ -141,10 +142,12 @@
                 var receivedArrayLength = BitConverter.ToInt32(fixedLengthHeader, 12);

                 var arrayData = new byte[receivedArrayLength + calculateRequiredAlignment(receivedArrayLength, 8)];
-                await stream.ReadAsync(arrayData, 0, arrayData.Length).ConfigureAwait(false);
+                await stream.ReadAsync(arrayData, 0, arrayData.Length, token).ConfigureAwait(false);
+                token.ThrowIfCancellationRequested();

                 var body = new byte[bodyLength];
-                await stream.ReadAsync(body, 0, body.Length).ConfigureAwait(false);
+                await stream.ReadAsync(body, 0, body.Length, token).ConfigureAwait(false);
+                token.ThrowIfCancellationRequested();

                 var serial = 0;
                 var bodySignature = string.Empty;
@@ -203,6 +206,7 @@

         public void Dispose()
         {
+            receiveCts.Cancel();
             stream.Dispose();
             socket.Dispose();
         }


Load fontimage and fontinfo

Load fontimage and fontinfo

--- OpenKh.Game/Infrastructure/Kernel.cs
+++ OpenKh.Game/Infrastructure/Kernel.cs
@@ -1,11 +1,11 @@
 using OpenKh.Common;
 using OpenKh.Kh2;
 using OpenKh.Kh2.Battle;
+using OpenKh.Kh2.Contextes;
 using OpenKh.Kh2.System;
 using System;
 using System.Collections.Generic;
 using System.IO;
-using System.Linq;

 namespace OpenKh.Game.Infrastructure
 {
@@ -14,6 +14,7 @@
         private readonly IDataContent _dataContent;

         public string Language { get; private set; }
+        public FontContext FontContext { get; private set; }
         public BaseTable<Objentry> ObjEntries { get; private set; }
         public Dictionary<string, List<Place>> Places { get; private set; }
         public List<Ftst.Entry> Ftst { get; private set; }
@@ -24,6 +25,7 @@

         public Kernel(IDataContent dataContent, int languageId = 0)
         {
+            FontContext = new FontContext();
             Language = Constants.Languages[languageId];
             _dataContent = dataContent;

@@ -37,8 +39,9 @@
             // 07localset
             // 12soundinfo
             // 14mission
-            // msg/jp/fontimage
-            // msg/jp/fontinfo
+
+            LoadFontImage($"msg/{Language}/fontimage.bar");
+            LoadFontInfo($"msg/{Language}/fontinfo.bar");
             Places = LoadFile($"msg/{Language}/place.bin", stream => Place.Read(stream));
             // msg/jp/sys
             // 15jigsaw
@@ -67,5 +70,15 @@
             bar.ForEntry("item", stream => Item = Kh2.System.Item.Read(stream));
             bar.ForEntry("lvup", stream => Lvup = Kh2.Lvup.Open(stream));
         }
+
+        private void LoadFontInfo(string fileName)
+        {
+            var bar = _dataContent.FileOpen(fileName)
+                .Using(stream => Bar.Read(stream));
+            FontContext.Read(bar);
+        }
+
+        private void LoadFontImage(string fileName) =>
+            LoadFontInfo(fileName);
     }
 }


Prevent the crash due to exception in system ReadLine that I saw today  during loadtesting.

--- OpenSim/Framework/Console/LogBase.cs
+++ OpenSim/Framework/Console/LogBase.cs
@@ -302,9 +302,14 @@

         public string ReadLine()
         {
-            string TempStr = System.Console.ReadLine();
-            Log.WriteLine(TempStr);
-            return TempStr;
+            try {
+                string TempStr = System.Console.ReadLine();
+                Log.WriteLine(TempStr);
+                return TempStr;
+            } catch (Exception e) {
+                MainLog.Instance.Error("Console", "System.Console.ReadLine exception " + e.ToString());
+                return "";
+            }
         }

         public int Read()


Null ref fix for people too poor to buy physical machines for everything

--- Opserver.Core/Data/Dashboard/Node.cs
+++ Opserver.Core/Data/Dashboard/Node.cs
@@ -19,7 +19,7 @@
         public string Name { get; internal set; }
         public DateTime? LastSync { get; internal set; }
         public string MachineType { get; internal set; }
-        public string MachineTypePretty => MachineType.Replace("Microsoft Windows ", "");
+        public string MachineTypePretty => MachineType?.Replace("Microsoft Windows ", "");
         public string Ip { get; internal set; }
         public short? PollIntervalSeconds { get; internal set; }


CustomerOrderVM updates - CanSubmit, SubmitAsync

--- Orders.com.WPF/VM/CustomerOrderVM.cs
+++ Orders.com.WPF/VM/CustomerOrderVM.cs
@@ -124,7 +124,7 @@

         public bool CanSubmit()
         {
-            return CurrentEntity.OrderStatus().IsPending && CanSave();
+            return CurrentEntity.OrderStatus().IsPending && CanSave() && _orderItems.All(i => i.CanSave());
         }

         public ICommand DeleteSelectedItemCommand
@@ -161,6 +161,7 @@

         public async Task SubmitAsync()
         {
+            await SaveAsync();
             var result = await _orderService.SubmitCommand(CurrentEntity.OrderID).ExecuteAsync();
             CurrentEntity = result.Value;
             _eventAggregator.SendMessage<OrderUpdatedEvent>(new OrderUpdatedEvent(this));


Object powerr!!!!

Object powerr!!!!

--- OxidePlugins/EasyVoteHighestvoter.cs
+++ OxidePlugins/EasyVoteHighestvoter.cs
@@ -11,7 +11,7 @@

 namespace Oxide.Plugins
 {
-    [Info("EasyVote-HighestVoter", "Exel80", "1.0.0")]
+    [Info("EasyVote-HighestVoter", "Exel80", "1.0.0", ResourceId = 2671)]
     class EasyVoteHighestvoter : RustPlugin
     {
         // EasyVote is life and <3
@@ -24,7 +24,7 @@
         void onUserReceiveHighestVoterReward(Dictionary<string, object> RewardData)
         {
             // Convert to bool
-            bool ReceivedReward = Convert.ToBoolean(RewardData["ReceivedReward"]);
+            bool ReceivedReward = (bool)RewardData["ReceivedReward"];

             // Logging data to oxide/logs/EasyVoteHighestvoter
             if (config.logEnabled)
@@ -227,7 +227,7 @@
             RewardData.Add("OldHighestPlayerID", OldHighestPlayer);
             RewardData.Add("RewardType", (config.rewardIs.ToLower() != "item" ? "group" : "item"));
             RewardData.Add("Reward", string.Empty);
-            RewardData.Add("ReceivedReward", "false");
+            RewardData.Add("ReceivedReward", false);

             // Try found player
             BasePlayer player = FindPlayer(HighestPlayer).FirstOrDefault();
@@ -262,7 +262,7 @@

                                     tempItems.Append($"{amount}x {itemToReceive.info.displayName.translated}, ");

-                                    RewardData["ReceivedReward"] = "true";
+                                    RewardData["ReceivedReward"] = true;

                                     //If the item does not end up in the inventory
                                     //Drop it on the ground for them
@@ -286,7 +286,7 @@

                                 RewardData["Reward"] = $"{amount}x {itemToReceive.info.displayName.translated}";

-                                RewardData["ReceivedReward"] = "true";
+                                RewardData["ReceivedReward"] = true;

                                 //If the item does not end up in the inventory
                                 //Drop it on the ground for them
@@ -306,7 +306,7 @@

                     RewardData["Reward"] = config.group;

-                    RewardData["ReceivedReward"] = "true";
+                    RewardData["ReceivedReward"] = true;

                     // If there was old highest player, remove his from group
                     if (!string.IsNullOrEmpty(OldHighestPlayer))
@@ -330,7 +330,7 @@

                 RewardData["Reward"] = config.group;

-                RewardData["ReceivedReward"] = "true";
+                RewardData["ReceivedReward"] = true;

                 // Congrats msg <3
                 Congrats(HighestPlayer);


Fix Suppression automatique

Fix Suppression automatique

Fix Suppression automatique

--- BlueSheep/Interface/UCs/GestItemsUC.cs
+++ BlueSheep/Interface/UCs/GestItemsUC.cs
@@ -87,7 +87,11 @@
                 foreach (ListViewItem item in LVGestItems.Items)
                 {
                     if (item.SubItems[1].Text == "Suppression automatique")
-                        account.Inventory.DeleteItem(account.Inventory.GetItemFromName(item.SubItems[0].Text).UID, account.Inventory.GetItemFromName(item.SubItems[0].Text).Quantity);
+                    {
+                        BlueSheep.Core.Inventory.Item i = account.Inventory.GetItemFromName(item.SubItems[0].Text);
+                        if (i != null)
+                            account.Inventory.DeleteItem(i.UID, i.Quantity);
+                    }
                 }
                 Reset();
             }


Saved by a unit test.

Saved by a unit test.

--- v1/Mantle/Mantle.Configuration/Configurers/BaseConfigurer.cs
+++ v1/Mantle/Mantle.Configuration/Configurers/BaseConfigurer.cs
@@ -26,7 +26,10 @@
             if (propertyConfigurers == null)
             {
                 var localPropertyConfigurerTypes = Assembly.GetExecutingAssembly().GetTypes()
-                    .Where(t => typeof(IPropertyConfigurer).IsAssignableFrom(t)).ToList();
+                    .Where(t => (typeof(IPropertyConfigurer).IsAssignableFrom(t)) &&
+                                (t.IsAbstract == false) &&
+                                (t.IsInterface == false) &&
+                                (t.GetConstructor(Type.EmptyTypes) != null)).ToList();

                 propertyConfigurers = localPropertyConfigurerTypes // This relies on all local property configurers
                     .Select(Activator.CreateInstance)              // having default constructors.


another fix for the WinGL build.

another fix for the WinGL build.

--- cocos2d/tileMap_parallax_nodes/CCTMXMapInfo.cs
+++ cocos2d/tileMap_parallax_nodes/CCTMXMapInfo.cs
@@ -486,7 +486,7 @@
                     {
                         try
                         {
-#if WINDOWS || WINDOWSGL_PHONE
+#if WINDOWS || WINDOWSGL
                         GZipStream inGZipStream = new GZipStream(new MemoryStream(pTMXMapInfo.CurrentString));
 #elif !NETFX_CORE
                             var inGZipStream = new GZipStream(new MemoryStream(pTMXMapInfo.CurrentString), CompressionMode.Decompress);


Previous commit was not necessary. Just needed to fix the name of the package action.

--- src/formulate.app/Handlers/ApplicationStartedHandler.cs
+++ src/formulate.app/Handlers/ApplicationStartedHandler.cs
@@ -58,7 +58,7 @@
             }
             else if (needsUpgrade)
             {
-                AddVersion();
+                EnsureVersion();
             }
         }

@@ -68,20 +68,12 @@
         /// </summary>
         private void HandleInstall(ApplicationContext applicationContext)
         {
-
-            // Only proceed if some users exist already (ensures
-            // automatic permission assignment works as expected).
-            var usersExist = DoAnyUsersExist();
-            if (usersExist)
-            {
-                AddSection(applicationContext);
-                AddDashboard();
-                AddFormulateDeveloperTab();
-                PermitAccess();
-                AddConfigurationGroup();
-                AddVersion();
-            }
-
+            AddSection(applicationContext);
+            AddDashboard();
+            AddFormulateDeveloperTab();
+            PermitAccess();
+            AddConfigurationGroup();
+            EnsureVersion();
         }

@@ -219,9 +211,9 @@

         /// <summary>
-        /// Adds the Formulate version number to the web.config.
-        /// </summary>
-        private void AddVersion()
+        /// Adds or replaces the Formulate version number in the web.config.
+        /// </summary>
+        private void EnsureVersion()
         {

             // Variables.
@@ -270,7 +262,7 @@

             // Grant access permission.
             PackageAction.RunPackageAction("Formulate",
-                "GrantPermissionToSection", doc.FirstChild);
+                "Formulate.GrantPermissionToSection", doc.FirstChild);

         }

@@ -307,23 +299,6 @@

         }

-
-        /// <summary>
-        /// Indicates whether or not any users exist yet.
-        /// </summary>
-        /// <returns>
-        /// True, if any users exist; otherwise, false.
-        /// </returns>
-        private bool DoAnyUsersExist()
-        {
-            var services = ApplicationContext.Current.Services;
-            var service = services.UserService;
-            var total = default(int);
-            var users = service.GetAll(0, 1, out total).ToList();
-            var usersExist = users.Any();
-            return usersExist;
-        }
-
         #endregion

     }


Extra test code

Extra test code

--- CConst/CConst.Test/SyntaxVisualizer.cs
+++ CConst/CConst.Test/SyntaxVisualizer.cs
@@ -6,6 +6,11 @@

 namespace FonsDijkstra.CConst.Test
 {
+    class Iets
+    {
+        public int a;
+    }
+
     class SyntaxVisualizer
     {
         private int i;
@@ -14,8 +19,13 @@

         public SyntaxVisualizer()
         {
+            int k;
+            k = 1;
+
             i = 0;
             J = 0;
+
+            i = new Iets { a = 1, }.a;
         }
     }
 }


Code cleanup.

Code cleanup.

--- test/NUnitLiteRunner/Program.cs
+++ test/NUnitLiteRunner/Program.cs
@@ -20,8 +20,6 @@

 using System;
 using System.Collections.Generic;
-using System.Globalization;
-using System.Threading;

 using NUnitLite.Runner;


Escaped C# keywords.

Escaped C# keywords.

--- Pegasus/Compiler/GenerateCodePass.cs
+++ Pegasus/Compiler/GenerateCodePass.cs
@@ -13,6 +13,7 @@
     using System.IO;
     using System.Reflection;
     using Pegasus.Expressions;
+    using System.Collections.Generic;

     internal class GenerateCodePass : CompilePass
     {
@@ -44,6 +45,41 @@
             }

             private string currentResultName = null;
+
+            private static HashSet<string> keywords = new HashSet<string>
+            {
+                "abstract", "as", "base",
+                "bool", "break", "byte",
+                "case", "catch", "char",
+                "checked", "class", "const",
+                "continue", "decimal", "default",
+                "delegate", "do", "double",
+                "else", "enum", "event",
+                "explicit", "extern", "false",
+                "finally", "fixed", "float",
+                "for", "foreach", "goto",
+                "if", "implicit", "in",
+                "int", "interface", "internal",
+                "is", "lock", "long",
+                "namespace", "new", "null",
+                "object", "operator", "out",
+                "override", "params", "private",
+                "protected", "public", "readonly",
+                "ref", "return", "sbyte",
+                "sealed", "short", "sizeof",
+                "stackalloc", "static", "string",
+                "struct", "switch", "this",
+                "throw", "true", "try",
+                "typeof", "uint", "ulong",
+                "unchecked", "unsafe", "ushort",
+                "using", "virtual", "void",
+                "volatile", "while",
+            };
+
+            private static string EscapeName(string name)
+            {
+                return keywords.Contains(name) ? "@" + name : name;
+            }

             public override void WalkGrammar(Grammar grammar)
             {
@@ -78,7 +114,7 @@
                 this.code.WriteLine("{");
                 this.code.Indent++;
                 this.code.WriteLine("var cursor = new Cursor(subject, 0);");
-                this.code.WriteLine("var result = this." + grammar.Rules[0].Name + "(ref cursor);");
+                this.code.WriteLine("var result = this." + EscapeName(grammar.Rules[0].Name) + "(ref cursor);");
                 this.code.WriteLine("if (result == null)");
                 this.code.WriteLine("{");
                 this.code.Indent++;
@@ -145,7 +181,7 @@
             protected override void WalkRule(Rule rule)
             {
                 this.code.WriteLineNoTabs("");
-                this.code.WriteLine("private ParseResult<string> " + rule.Name + "(ref Cursor cursor)");
+                this.code.WriteLine("private ParseResult<string> " + EscapeName(rule.Name) + "(ref Cursor cursor)");
                 this.code.WriteLine("{");
                 this.code.Indent++;

@@ -171,7 +207,7 @@

             protected override void WalkNameExpression(NameExpression nameExpression)
             {
-                this.code.WriteLine(this.currentResultName + " = this." + nameExpression.Name + "(ref cursor);");
+                this.code.WriteLine(this.currentResultName + " = this." + EscapeName(nameExpression.Name) + "(ref cursor);");
             }

             protected override void WalkSequenceExpression(SequenceExpression sequenceExpression)


Fix whitelist bug, auto allow all module manager dll's.

--- Client/ModWorker.cs
+++ Client/ModWorker.cs
@@ -273,39 +273,49 @@
                 foreach (string fileName in Directory.GetFiles(Client.dmpClient.gameDataDir))
                 {
                     string fileNameLower = fileName.ToLower();
+                    if (!fileNameLower.Contains("gamedata"))
+                    {
+                        //This case is hit when directories are symlinked, for developing DarkMultiPlayer.
+                        continue;
+                    }
+                    string croppedFileName = fileNameLower.Substring(fileNameLower.IndexOf("gamedata", StringComparison.Ordinal) + 9).Replace('\\', '/');
                     //Ignore non DLL files
-                    if (!fileNameLower.EndsWith(".dll", StringComparison.Ordinal))
+                    if (!croppedFileName.EndsWith(".dll", StringComparison.Ordinal))
+                    {
+                        continue;
+                    }
+                    if (croppedFileName.StartsWith("ModuleManager", StringComparison.Ordinal))
                     {
                         continue;
                     }
                     //Allow DMP files
-                    if (autoAllowed.Contains(fileNameLower))
+                    if (autoAllowed.Contains(croppedFileName))
                     {
                         continue;
                     }
                     //Ignore squad plugins
-                    if (fileNameLower.StartsWith("squad/plugins", StringComparison.Ordinal))
+                    if (croppedFileName.StartsWith("squad/plugins", StringComparison.Ordinal))
                     {
                         continue;
                     }
                     //Check required (Required implies whitelist)
-                    if (parseRequired.ContainsKey(fileNameLower))
+                    if (parseRequired.ContainsKey(croppedFileName))
                     {
                         continue;
                     }
                     //Check optional (Optional implies whitelist)
-                    if (parseOptional.ContainsKey(fileNameLower))
+                    if (parseOptional.ContainsKey(croppedFileName))
                     {
                         continue;
                     }
                     //Check whitelist
-                    if (parseWhiteBlackList.Contains(fileNameLower))
+                    if (parseWhiteBlackList.Contains(croppedFileName))
                     {
                         continue;
                     }
                     modCheckOk = false;
-                    DarkLog.Debug("Non-whitelisted resource " + fileNameLower + " exists on client!");
-                    sb.AppendLine("Non-whitelisted resource " + fileNameLower + " exists on client!");
+                    DarkLog.Debug("Non-whitelisted resource " + croppedFileName + " exists on client!");
+                    sb.AppendLine("Non-whitelisted resource " + croppedFileName + " exists on client!");
                 }
             }
             else
@@ -384,9 +394,11 @@
             {
                 foreach (string fileName in allFiles)
                 {
-                    if (fileName.ToLower().EndsWith(".dll", StringComparison.Ordinal))
-                    {
-                        optionalFiles.Add(Path.GetFileName(fileName.ToLower()));
+                    string fileNameLower = fileName.ToLower();
+                    string croppedFileName = fileNameLower.Substring(fileNameLower.IndexOf("gamedata", StringComparison.Ordinal) + 9).Replace('\\', '/');
+                    if (croppedFileName.EndsWith(".dll", StringComparison.Ordinal))
+                    {
+                        optionalFiles.Add(croppedFileName);
                     }
                 }
             }


Fixed build.

Fixed build.

--- AGXUnity/DeformableTerrain.cs
+++ AGXUnity/DeformableTerrain.cs
@@ -140,7 +140,7 @@
                                        0.0f );

       Native.setTransform( Utils.TerrainUtils.CalculateNativeOffset( transform, TerrainData ) );
-      Native.loadLibraryMaterial( agxTerrain.Terrain.MaterialLibrary.GRAVEL_1 );
+      Native.loadLibraryMaterial( agxTerrain.TerrainMaterialLibrary.MaterialPreset.GRAVEL_1 );

       foreach ( var shovel in Shovels )
         Native.add( shovel.GetInitialized<DeformableTerrainShovel>()?.Native );