Fixed major flaw with user registration when putting leading space in registered username allowed attacker to get access to user's account (even admin's).

--- yafsrc/YetAnotherForum.NET/pages/register.ascx.cs
+++ yafsrc/YetAnotherForum.NET/pages/register.ascx.cs
@@ -40,79 +40,79 @@
 	{

 		public register()
-			: base( "REGISTER" )
-		{
-		}
-
-		protected void Page_Load( object sender, System.EventArgs e )
+			: base("REGISTER")
+		{
+		}
+
+		protected void Page_Load(object sender, System.EventArgs e)
 		{
 			// Ederon : guess we don't need to test CanLogin anymore
-			if ( /*!CanLogin ||*/ PageContext.BoardSettings.DisableRegistrations )
+			if ( /*!CanLogin ||*/ PageContext.BoardSettings.DisableRegistrations)
 				YafBuildLink.AccessDenied();

-			if ( !IsPostBack )
-			{
-				PageLinks.AddLink( PageContext.BoardSettings.Name, YAF.Classes.Utils.YafBuildLink.GetLink( YAF.Classes.Utils.ForumPages.forum ) );
-				PageLinks.AddLink( GetText( "TITLE" ) );
+			if (!IsPostBack)
+			{
+				PageLinks.AddLink(PageContext.BoardSettings.Name, YAF.Classes.Utils.YafBuildLink.GetLink(YAF.Classes.Utils.ForumPages.forum));
+				PageLinks.AddLink(GetText("TITLE"));

 				// handle the CreateUser Step localization
 				Control createUserTemplateRef = CreateUserWizard1.CreateUserStep.ContentTemplateContainer;

-				CompareValidator passwordNoMatch = ( CompareValidator ) createUserTemplateRef.FindControl( "PasswordCompare" );
-				RequiredFieldValidator usernameRequired = ( RequiredFieldValidator ) createUserTemplateRef.FindControl( "UserNameRequired" );
-				RequiredFieldValidator passwordRequired = ( RequiredFieldValidator ) createUserTemplateRef.FindControl( "PasswordRequired" );
-				RequiredFieldValidator confirmPasswordRequired = ( RequiredFieldValidator ) createUserTemplateRef.FindControl( "ConfirmPasswordRequired" );
-				RequiredFieldValidator emailRequired = ( RequiredFieldValidator ) createUserTemplateRef.FindControl( "EmailRequired" );
-				RequiredFieldValidator questionRequired = ( RequiredFieldValidator ) createUserTemplateRef.FindControl( "QuestionRequired" );
-				RequiredFieldValidator answerRequired = ( RequiredFieldValidator ) createUserTemplateRef.FindControl( "AnswerRequired" );
-				Button createUser = ( Button ) createUserTemplateRef.FindControl( "StepNextButton" );
-
-				usernameRequired.ToolTip = usernameRequired.ErrorMessage = GetText( "NEED_USERNAME" );
-				passwordRequired.ToolTip = passwordRequired.ErrorMessage = GetText( "NEED_PASSWORD" );
-				confirmPasswordRequired.ToolTip = confirmPasswordRequired.ErrorMessage = GetText( "RETYPE_PASSWORD" );
-				passwordNoMatch.ToolTip = passwordNoMatch.ErrorMessage = GetText( "NEED_MATCH" );
-				emailRequired.ToolTip = emailRequired.ErrorMessage = GetText( "NEED_EMAIL" );
-				questionRequired.ToolTip = questionRequired.ErrorMessage = GetText( "NEED_QUESTION" );
-				answerRequired.ToolTip = answerRequired.ErrorMessage = GetText( "NEED_ANSWER" );
-				createUser.ToolTip = createUser.Text = GetText( "CREATE_USER" );
+				CompareValidator passwordNoMatch = (CompareValidator)createUserTemplateRef.FindControl("PasswordCompare");
+				RequiredFieldValidator usernameRequired = (RequiredFieldValidator)createUserTemplateRef.FindControl("UserNameRequired");
+				RequiredFieldValidator passwordRequired = (RequiredFieldValidator)createUserTemplateRef.FindControl("PasswordRequired");
+				RequiredFieldValidator confirmPasswordRequired = (RequiredFieldValidator)createUserTemplateRef.FindControl("ConfirmPasswordRequired");
+				RequiredFieldValidator emailRequired = (RequiredFieldValidator)createUserTemplateRef.FindControl("EmailRequired");
+				RequiredFieldValidator questionRequired = (RequiredFieldValidator)createUserTemplateRef.FindControl("QuestionRequired");
+				RequiredFieldValidator answerRequired = (RequiredFieldValidator)createUserTemplateRef.FindControl("AnswerRequired");
+				Button createUser = (Button)createUserTemplateRef.FindControl("StepNextButton");
+
+				usernameRequired.ToolTip = usernameRequired.ErrorMessage = GetText("NEED_USERNAME");
+				passwordRequired.ToolTip = passwordRequired.ErrorMessage = GetText("NEED_PASSWORD");
+				confirmPasswordRequired.ToolTip = confirmPasswordRequired.ErrorMessage = GetText("RETYPE_PASSWORD");
+				passwordNoMatch.ToolTip = passwordNoMatch.ErrorMessage = GetText("NEED_MATCH");
+				emailRequired.ToolTip = emailRequired.ErrorMessage = GetText("NEED_EMAIL");
+				questionRequired.ToolTip = questionRequired.ErrorMessage = GetText("NEED_QUESTION");
+				answerRequired.ToolTip = answerRequired.ErrorMessage = GetText("NEED_ANSWER");
+				createUser.ToolTip = createUser.Text = GetText("CREATE_USER");

 				// handle other steps localization
-				( ( LinkButton ) FindWizardControl( "AgreeLink" ) ).Text = GetText( "TERMSANDCONDITIONS_AGREE" );
-				( ( LinkButton ) FindWizardControl( "DisagreeLink" ) ).Text = GetText( "TERMSANDCONDITIONS_DISAGREE" );
-				( ( Button ) FindWizardControl( "ProfileNextButton" ) ).Text = GetText( "SAVE" );
-        ( ( Button ) FindWizardControl( "ContinueButton" ) ).Text = GetText( "CONTINUE" );
-
-        // agreement terms and conditions
-        ( ( Literal ) FindWizardControl( "TermsAndConditions" ) ).Text = YAF.Classes.UI.BBCode.MakeHtml( GetText( "TERMS_AND_CONDITIONS" ), true, false );
+				((LinkButton)FindWizardControl("AgreeLink")).Text = GetText("TERMSANDCONDITIONS_AGREE");
+				((LinkButton)FindWizardControl("DisagreeLink")).Text = GetText("TERMSANDCONDITIONS_DISAGREE");
+				((Button)FindWizardControl("ProfileNextButton")).Text = GetText("SAVE");
+				((Button)FindWizardControl("ContinueButton")).Text = GetText("CONTINUE");
+
+				// agreement terms and conditions
+				((Literal)FindWizardControl("TermsAndConditions")).Text = YAF.Classes.UI.BBCode.MakeHtml(GetText("TERMS_AND_CONDITIONS"), true, false);

 				// get the time zone data source
-				DropDownList timeZones = ( ( DropDownList ) FindWizardControl( "TimeZones" ) );
+				DropDownList timeZones = ((DropDownList)FindWizardControl("TimeZones"));
 				timeZones.DataSource = YafStaticData.TimeZones();

-				if ( !PageContext.BoardSettings.EmailVerification )
+				if (!PageContext.BoardSettings.EmailVerification)
 				{
 					// automatically log in created users
 					CreateUserWizard1.LoginCreatedUser = true;
 					CreateUserWizard1.DisableCreatedUser = false;
-          // success notification localization
-          ( ( Literal ) FindWizardControl( "AccountCreated" ) ).Text = YAF.Classes.UI.BBCode.MakeHtml( GetText( "ACCOUNT_CREATED" ), true, false );
+					// success notification localization
+					((Literal)FindWizardControl("AccountCreated")).Text = YAF.Classes.UI.BBCode.MakeHtml(GetText("ACCOUNT_CREATED"), true, false);
 				}
 				else
 				{
 					CreateUserWizard1.LoginCreatedUser = false;
 					CreateUserWizard1.DisableCreatedUser = true;
-          // success notification localization
-          ( ( Literal ) FindWizardControl( "AccountCreated" ) ).Text = YAF.Classes.UI.BBCode.MakeHtml( GetText( "ACCOUNT_CREATED_VERIFICATION" ), true, false );
+					// success notification localization
+					((Literal)FindWizardControl("AccountCreated")).Text = YAF.Classes.UI.BBCode.MakeHtml(GetText("ACCOUNT_CREATED_VERIFICATION"), true, false);
 				}

-				if ( PageContext.BoardSettings.EnableCaptchaForRegister )
-				{
-					Session ["CaptchaImageText"] = General.GetCaptchaString();
-					Image imgCaptcha = ( Image ) createUserTemplateRef.FindControl( "imgCaptcha" );
-					HtmlTableRow tr_captcha1 = ( HtmlTableRow ) createUserTemplateRef.FindControl( "tr_captcha1" );
-					HtmlTableRow tr_captcha2 = ( HtmlTableRow ) createUserTemplateRef.FindControl( "tr_captcha2" );
-
-					imgCaptcha.ImageUrl = String.Format( "{0}resource.ashx?c=1", YafForumInfo.ForumRoot );
+				if (PageContext.BoardSettings.EnableCaptchaForRegister)
+				{
+					Session["CaptchaImageText"] = General.GetCaptchaString();
+					Image imgCaptcha = (Image)createUserTemplateRef.FindControl("imgCaptcha");
+					HtmlTableRow tr_captcha1 = (HtmlTableRow)createUserTemplateRef.FindControl("tr_captcha1");
+					HtmlTableRow tr_captcha2 = (HtmlTableRow)createUserTemplateRef.FindControl("tr_captcha2");
+
+					imgCaptcha.ImageUrl = String.Format("{0}resource.ashx?c=1", YafForumInfo.ForumRoot);
 					tr_captcha1.Visible = true;
 					tr_captcha2.Visible = true;
 				}
@@ -121,7 +121,7 @@

 				DataBind();

-				timeZones.Items.FindByValue( "0" ).Selected = true;
+				timeZones.Items.FindByValue("0").Selected = true;
 			}
 		}

@@ -130,19 +130,19 @@
 		/// </summary>
 		/// <param name="id">ID of target control</param>
 		/// <returns>A control reference, if found, null, if not</returns>
-		protected Control FindWizardControl( string id )
+		protected Control FindWizardControl(string id)
 		{
 			Control ctrlRtn = null;

-			for ( int i = 0; i < CreateUserWizard1.WizardSteps.Count; i++ )
-			{
-				for ( int j = 0; j <
-				CreateUserWizard1.WizardSteps [i].Controls.Count; j++ )
-				{
-					ctrlRtn =	FindWizardControl( ( Control ) CreateUserWizard1.WizardSteps [i].Controls [j], id );
-					if ( ctrlRtn != null ) break;
+			for (int i = 0; i < CreateUserWizard1.WizardSteps.Count; i++)
+			{
+				for (int j = 0; j <
+				CreateUserWizard1.WizardSteps[i].Controls.Count; j++)
+				{
+					ctrlRtn = FindWizardControl((Control)CreateUserWizard1.WizardSteps[i].Controls[j], id);
+					if (ctrlRtn != null) break;
 				}
-				if ( ctrlRtn != null ) break;
+				if (ctrlRtn != null) break;
 			}

 			return ctrlRtn;
@@ -155,20 +155,20 @@
 		/// <param name="srcCtrl">Source/Root Control</param>
 		/// <param name="id">ID of target control</param>
 		/// <returns>A Control, if found; null, if not</returns>
-		protected Control FindWizardControl( Control srcCtrl, string id )
-		{
-			Control ctrlRtn = srcCtrl.FindControl( id );
-
-			if ( ctrlRtn == null )
-			{
-				if ( srcCtrl.HasControls() )
+		protected Control FindWizardControl(Control srcCtrl, string id)
+		{
+			Control ctrlRtn = srcCtrl.FindControl(id);
+
+			if (ctrlRtn == null)
+			{
+				if (srcCtrl.HasControls())
 				{
 					int nbrCtrls = srcCtrl.Controls.Count;
-					for ( int i = 0; i < nbrCtrls; i++ )
+					for (int i = 0; i < nbrCtrls; i++)
 					{
 						// Check all child controls of srcCtrl
-						ctrlRtn = FindWizardControl( srcCtrl.Controls [i], id );
-						if ( ctrlRtn != null ) break;
+						ctrlRtn = FindWizardControl(srcCtrl.Controls[i], id);
+						if (ctrlRtn != null) break;
 					} // endfor (int i=0; i < nbrCtrls; i++)
 				} // endif (HasControls)

@@ -177,71 +177,71 @@
 			return ctrlRtn;
 		} // end protected Control FindWizardControl(Control srcCtrl, string id)

-		protected void CreateUserWizard1_PreviousButtonClick( object sender, WizardNavigationEventArgs e )
+		protected void CreateUserWizard1_PreviousButtonClick(object sender, WizardNavigationEventArgs e)
 		{
 			// if they clicked declined, redirect to the main page
-			if ( e.CurrentStepIndex == 0 )
-			{
-				YafBuildLink.Redirect( ForumPages.forum );
-			}
-		}
-
-		protected void CreateUserWizard1_NextButtonClick( object sender, WizardNavigationEventArgs e )
-		{
-			if ( e.CurrentStepIndex == 2 )
-			{
-        // this is the "Profile Information" step. Save the data to their profile (+ defaults).
-        DropDownList timeZones = ( ( DropDownList ) FindWizardControl( "TimeZones" ) );
-        TextBox locationTextBox = ( ( TextBox ) FindWizardControl( "Location" ) );
-        TextBox homepageTextBox = ( ( TextBox ) FindWizardControl( "Homepage" ) );
-
-        MembershipUser user = Membership.GetUser( CreateUserWizard1.UserName );
-
-        // setup/save the profile
-        YafUserProfile userProfile = PageContext.GetProfile( CreateUserWizard1.UserName );
-
-        userProfile.Location = locationTextBox.Text.Trim();
-        userProfile.Homepage = homepageTextBox.Text.Trim();
-
-        userProfile.Save();
+			if (e.CurrentStepIndex == 0)
+			{
+				YafBuildLink.Redirect(ForumPages.forum);
+			}
+		}
+
+		protected void CreateUserWizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
+		{
+			if (e.CurrentStepIndex == 2)
+			{
+				// this is the "Profile Information" step. Save the data to their profile (+ defaults).
+				DropDownList timeZones = ((DropDownList)FindWizardControl("TimeZones"));
+				TextBox locationTextBox = ((TextBox)FindWizardControl("Location"));
+				TextBox homepageTextBox = ((TextBox)FindWizardControl("Homepage"));
+
+				MembershipUser user = Membership.GetUser(CreateUserWizard1.UserName);
+
+				// setup/save the profile
+				YafUserProfile userProfile = PageContext.GetProfile(CreateUserWizard1.UserName);
+
+				userProfile.Location = locationTextBox.Text.Trim();
+				userProfile.Homepage = homepageTextBox.Text.Trim();
+
+				userProfile.Save();

 				// save the time zone...
-				YAF.Classes.Data.DB.user_save( UserMembershipHelper.GetUserIDFromProviderUserKey( user.ProviderUserKey ), PageContext.PageBoardID, null, null, Convert.ToInt32( timeZones.SelectedValue ), null, null, null, null, null );
-			}
-		}
-
-    protected void CreateUserWizard1_ContinueButtonClick( object sender, EventArgs e )
-    {
-      // redirect to the main forum URL
-      YafBuildLink.Redirect( ForumPages.forum );
-    }
-
-		protected void CreateUserWizard1_CreateUserError( object sender, CreateUserErrorEventArgs e )
+				YAF.Classes.Data.DB.user_save(UserMembershipHelper.GetUserIDFromProviderUserKey(user.ProviderUserKey), PageContext.PageBoardID, null, null, Convert.ToInt32(timeZones.SelectedValue), null, null, null, null, null);
+			}
+		}
+
+		protected void CreateUserWizard1_ContinueButtonClick(object sender, EventArgs e)
+		{
+			// redirect to the main forum URL
+			YafBuildLink.Redirect(ForumPages.forum);
+		}
+
+		protected void CreateUserWizard1_CreateUserError(object sender, CreateUserErrorEventArgs e)
 		{
 			string createUserError = "";
 			// find the type of error
-			switch ( e.CreateUserError )
+			switch (e.CreateUserError)
 			{
 				case MembershipCreateStatus.DuplicateEmail:
-					createUserError = GetText( "ALREADY_REGISTERED" );
+					createUserError = GetText("ALREADY_REGISTERED");
 					break;
 				case MembershipCreateStatus.DuplicateUserName:
-					createUserError = GetText( "ALREADY_REGISTERED" );
+					createUserError = GetText("ALREADY_REGISTERED");
 					break;
 				case MembershipCreateStatus.InvalidEmail:
-					createUserError = GetText( "BAD_EMAIL" );
+					createUserError = GetText("BAD_EMAIL");
 					break;
 				case MembershipCreateStatus.InvalidPassword:
-					createUserError = GetText( "BAD_PASSWORD" );
+					createUserError = GetText("BAD_PASSWORD");
 					break;
 				case MembershipCreateStatus.InvalidQuestion:
-					createUserError = GetText( "INVALID_QUESTION" );
+					createUserError = GetText("INVALID_QUESTION");
 					break;
 				case MembershipCreateStatus.InvalidUserName:
-					createUserError = GetText( "INVALID_USERNAME" );
+					createUserError = GetText("INVALID_USERNAME");
 					break;
 				case MembershipCreateStatus.InvalidAnswer:
-					createUserError = GetText( "INVALID_ANSWER" );
+					createUserError = GetText("INVALID_ANSWER");
 					break;
 				case MembershipCreateStatus.InvalidProviderUserKey:
 					createUserError = "Invalid provider user key.";
@@ -257,66 +257,69 @@
 					break;
 			}
 			//Display the failure message in a client-side alert box
-			Page.ClientScript.RegisterStartupScript( Page.GetType(), "CreateUserError", String.Format( "alert('{0}');", createUserError.Replace( "'", "\'" ) ), true );
-		}
-
-		protected void CreateUserWizard1_CreatedUser( object sender, EventArgs e )
-		{
-      MembershipUser user = Membership.GetUser( CreateUserWizard1.UserName );
-
-      // setup inital roles (if any) for this user
-      RoleMembershipHelper.SetupUserRoles( YafContext.Current.PageBoardID, CreateUserWizard1.UserName );
-
-      // create the user in the YAF DB as well as sync roles...
-      int? userID = RoleMembershipHelper.CreateForumUser( user, YafContext.Current.PageBoardID );
-
-      // create empty profile just so they have one
-      YafUserProfile userProfile = PageContext.GetProfile( CreateUserWizard1.UserName );
+			Page.ClientScript.RegisterStartupScript(Page.GetType(), "CreateUserError", String.Format("alert('{0}');", createUserError.Replace("'", "\'")), true);
+		}
+
+		protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
+		{
+			MembershipUser user = Membership.GetUser(CreateUserWizard1.UserName);
+
+			// setup inital roles (if any) for this user
+			RoleMembershipHelper.SetupUserRoles(YafContext.Current.PageBoardID, CreateUserWizard1.UserName);
+
+			// create the user in the YAF DB as well as sync roles...
+			int? userID = RoleMembershipHelper.CreateForumUser(user, YafContext.Current.PageBoardID);
+
+			// create empty profile just so they have one
+			YafUserProfile userProfile = PageContext.GetProfile(CreateUserWizard1.UserName);
 			// setup their inital profile information
-      userProfile.Save();
-
-      if (userID == null)
-      {
-        // something is seriously wrong here -- redirect to failure...
-        YafBuildLink.Redirect(ForumPages.info,"i=7");
-      }
-
-      // handle e-mail verification if needed
-      if ( PageContext.BoardSettings.EmailVerification )
-      {
-        // get the user email
-        TextBox emailTextBox = ( TextBox ) CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl( "Email" );
-        string email = emailTextBox.Text.Trim();
-
-        string hashinput = DateTime.Now.ToString() + email + Security.CreatePassword( 20 );
-        string hash = FormsAuthentication.HashPasswordForStoringInConfigFile( hashinput, "md5" );
-
-        // save verification record...
-        YAF.Classes.Data.DB.checkemail_save( userID, hash, user.Email );
-
-        string body = General.ReadTemplate( "verifyemail.txt" );
-        string subject = String.Format( GetText( "VERIFICATION_EMAIL_SUBJECT" ), PageContext.BoardSettings.Name );
-
-        body = body.Replace( "{link}", String.Format( "{1}{0}", YafBuildLink.GetLinkNotEscaped( ForumPages.approve, "k={0}", hash ), YafForumInfo.ServerURL ) );
-        body = body.Replace( "{key}", hash );
-        body = body.Replace( "{forumname}", PageContext.BoardSettings.Name );
-        body = body.Replace( "{forumlink}", String.Format( "{0}", YafForumInfo.ForumURL ) );
-
-        General.SendMail( PageContext.BoardSettings.ForumEmail, email, subject, body );
-      }
-		}
-
-		protected void CreateUserWizard1_CreatingUser( object sender, LoginCancelEventArgs e )
-		{
+			userProfile.Save();
+
+			if (userID == null)
+			{
+				// something is seriously wrong here -- redirect to failure...
+				YafBuildLink.Redirect(ForumPages.info, "i=7");
+			}
+
+			// handle e-mail verification if needed
+			if (PageContext.BoardSettings.EmailVerification)
+			{
+				// get the user email
+				TextBox emailTextBox = (TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Email");
+				string email = emailTextBox.Text.Trim();
+
+				string hashinput = DateTime.Now.ToString() + email + Security.CreatePassword(20);
+				string hash = FormsAuthentication.HashPasswordForStoringInConfigFile(hashinput, "md5");
+
+				// save verification record...
+				YAF.Classes.Data.DB.checkemail_save(userID, hash, user.Email);
+
+				string body = General.ReadTemplate("verifyemail.txt");
+				string subject = String.Format(GetText("VERIFICATION_EMAIL_SUBJECT"), PageContext.BoardSettings.Name);
+
+				body = body.Replace("{link}", String.Format("{1}{0}", YafBuildLink.GetLinkNotEscaped(ForumPages.approve, "k={0}", hash), YafForumInfo.ServerURL));
+				body = body.Replace("{key}", hash);
+				body = body.Replace("{forumname}", PageContext.BoardSettings.Name);
+				body = body.Replace("{forumlink}", String.Format("{0}", YafForumInfo.ForumURL));
+
+				General.SendMail(PageContext.BoardSettings.ForumEmail, email, subject, body);
+			}
+		}
+
+		protected void CreateUserWizard1_CreatingUser(object sender, LoginCancelEventArgs e)
+		{
+			// trim username on postback
+			CreateUserWizard1.UserName = CreateUserWizard1.UserName.Trim();
+
 			Control createUserTemplateRef = CreateUserWizard1.CreateUserStep.ContentTemplateContainer;
-			TextBox tbCaptcha = ( TextBox ) createUserTemplateRef.FindControl( "tbCaptcha" );
+			TextBox tbCaptcha = (TextBox)createUserTemplateRef.FindControl("tbCaptcha");

 			// verify captcha if enabled
-			if ( PageContext.BoardSettings.EnableCaptchaForRegister && Session ["CaptchaImageText"].ToString() != tbCaptcha.Text.Trim() )
-			{
-				PageContext.AddLoadMessage( GetText( "BAD_CAPTCHA" ) );
+			if (PageContext.BoardSettings.EnableCaptchaForRegister && Session["CaptchaImageText"].ToString() != tbCaptcha.Text.Trim())
+			{
+				PageContext.AddLoadMessage(GetText("BAD_CAPTCHA"));
 				e.Cancel = true;
 			}
 		}
+	}
 }
-}


Add link to kendo grid title

Add link to kendo grid title

--- VotingSystem.Web/Views/Polls/All.cshtml
+++ VotingSystem.Web/Views/Polls/All.cshtml
@@ -12,14 +12,17 @@
     .Columns(col =>
         {
             col.Bound(poll => poll.Id).Hidden();
-            col.Bound(poll => poll.Title).ClientTemplate("#= Title #");
+            col.Bound(p => p.Title).Template(@<text>
+                @item.Title
+            </text>);
+            col.Bound(poll => poll.Title);
             col.Bound(poll => poll.Description);
             col.Bound(poll => poll.Author);
             col.Bound(poll => poll.StartDate);
             col.Bound(poll => poll.EndDate);

         })
-        .Sortable()
-        .Pageable()
-        .Filterable())
+                            .Sortable()
+                            .Pageable()
+                            .Filterable())


Reduce log rate in AsyncMutex class.

Reduce log rate in AsyncMutex class.

--- WalletWasabi/Nito/AsyncEx/AsyncMutex.cs
+++ WalletWasabi/Nito/AsyncEx/AsyncMutex.cs
@@ -401,18 +401,29 @@
 				}
 			}

+			var lastLog = DateTime.MinValue;
+			var lastNumberOfAliveMutexes = 0;
+
 			while (true)
 			{
 				lock (AsyncMutexesLock)
 				{
-					bool stillRunning = AsyncMutexes.Any(am => am.Value.IsAlive);
-					if (!stillRunning)
+					int numberOfAliveMutexes = AsyncMutexes.Count(am => am.Value.IsAlive);
+					if (numberOfAliveMutexes == 0)
 					{
 						return;
 					}
-					Logger.LogDebug($"Waiting for: {string.Join(", ", AsyncMutexes.Where(am => am.Value.IsAlive).Select(m => m.Value.ShortName))}.");
-				}
-				await Task.Delay(200).ConfigureAwait(false);
+
+					// Log every 10 second or status change.
+					if ((DateTime.Now - lastLog) > TimeSpan.FromSeconds(10) || lastNumberOfAliveMutexes != numberOfAliveMutexes)
+					{
+						Logger.LogDebug($"Waiting for: {string.Join(", ", AsyncMutexes.Where(am => am.Value.IsAlive).Select(m => m.Value.ShortName))}.");
+						lastNumberOfAliveMutexes = numberOfAliveMutexes;
+						lastLog = DateTime.Now;
+					}
+				}
+
+				await Task.Delay(500).ConfigureAwait(false);
 				if (DateTime.Now - start > TimeSpan.FromSeconds(60))
 				{
 					var mutexesAlive = AsyncMutexes.Where(am => am.Value.IsAlive).Select(m => m.Value.ShortName);


Remove redundant null checks

Remove redundant null checks

--- TestFirst.Net/Matcher/Matchers.cs
+++ TestFirst.Net/Matcher/Matchers.cs
@@ -19,19 +19,11 @@

         public static IMatcher<T> Function<T>(Func<T, bool> matchFunc, Func<string> mismatchMessageFactory)
         {
-            if (matchFunc == null)
-            {
-                throw new NullReferenceException("Expected non null matching function");
-            }
             return new FuncTypeName<T>(matchFunc, mismatchMessageFactory);
         }

         public static IMatcher<T> Function<T>(Func<T, bool> matchFunc, Action<IDescription> mismatchMessageFactory)
         {
-            if (matchFunc == null)
-            {
-                throw new NullReferenceException("Expected non null matching function");
-            }
             return new FuncTypeName<T>(matchFunc, mismatchMessageFactory);
         }

@@ -42,19 +34,11 @@

         public static IMatcher<TActual> Function<TActual>(Func<TActual, IMatchDiagnostics, bool> matchFunc, Func<string> mismatchMessageFactory)
         {
-            if (matchFunc == null)
-            {
-                throw new NullReferenceException("Expected non null matching function");
-            }
             return new FuncWithDiagnosticsTypeName<TActual>(matchFunc, mismatchMessageFactory);
         }

         public static IMatcher<TActual> Function<TActual>(Func<TActual, IMatchDiagnostics, bool> matchFunc, Action<IDescription> mismatchMessageFactory)
         {
-            if (matchFunc == null)
-            {
-                throw new NullReferenceException("Expected non null matching function");
-            }
             return new FuncWithDiagnosticsTypeName<TActual>(matchFunc, mismatchMessageFactory);
         }


Added an empty tag test case.

Added an empty tag test case.

--- Tests/Exceptions/SiteTestCases.cs
+++ Tests/Exceptions/SiteTestCases.cs
@@ -72,6 +72,48 @@
                     "Filename: \\\\?\\{0}\r\nLine number: 11\r\nError: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault=\"Deny\"), or set explicitly by a location tag with overrideMode=\"Deny\" or the legacy allowOverride=\"false\".\r\n\r\n",
                     siteConfig),
                 exception.Message);
+        }
+
+        [Fact]
+        public void TestIisExpressEmptyTag()
+        {
+            var directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+            Environment.SetEnvironmentVariable("JEXUS_TEST_HOME", directoryName);
+
+            if (directoryName == null)
+            {
+                return;
+            }
+
+            string Current = Path.Combine(directoryName, @"applicationHost.config");
+            string Original = Path.Combine(directoryName, @"original2.config");
+            var siteConfig = TestHelper.CopySiteConfig(directoryName, "original.config");
+            File.Copy(Original, Current, true);
+            TestHelper.FixPhysicalPathMono(Current);
+
+            {
+                // add the section.
+                var file = XDocument.Load(siteConfig);
+                var root = file.Root;
+                if (root == null)
+                {
+                    return;
+                }
+
+                var pool = root.XPathSelectElement("/configuration/system.webServer");
+                pool?.RemoveAll();
+                file.Save(siteConfig);
+            }
+
+#if IIS
+            var server = new ServerManager(Current);
+#else
+            var server = new IisExpressServerManager(Current);
+#endif
+            var config = server.Sites[0].Applications[0].GetWebConfiguration();
+            // enable Windows authentication
+            var windowsSection =
+                config.GetSection("system.webServer/security/authentication/windowsAuthentication");
         }

         [Fact]


Converted TreeIteratorLeafOnlyTest.cs tests

--- Tests/TreeIteratorLeafOnlyTest.cs
+++ Tests/TreeIteratorLeafOnlyTest.cs
@@ -36,97 +36,101 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */

+using System.IO;
 using NUnit.Framework;
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;

 namespace GitSharp.Tests
 {
-    [TestFixture]
-public class TreeIteratorLeafOnlyTest : RepositoryTestCase {
-#if false
+	[TestFixture]
+	public class TreeIteratorLeafOnlyTest : RepositoryTestCase
+	{
+		/// <summary>
+		/// Empty tree
+		/// </summary>
+		[Test]
+		public void testEmpty()
+		{
+			Tree tree = new Tree(db);
+			TreeIterator i = MakeIterator(tree);
+			Assert.IsFalse(i.MoveNext());
+		}

-	/** Empty tree */
-	public void testEmpty() {
-		Tree tree = new Tree(db);
-		TreeIterator i = makeIterator(tree);
-		assertFalse(i.hasNext());
+		///	<summary>
+		/// One file
+		///	</summary>
+		///	<exception cref="IOException"> </exception>
+		[Test]
+		public void testSimpleF1()
+		{
+			Tree tree = new Tree(db);
+			tree.AddFile("x");
+			TreeIterator i = MakeIterator(tree);
+			Assert.IsTrue(i.MoveNext());
+			Assert.AreEqual("x", i.Current.Name);
+		}
+
+		///	<summary>
+		/// two files
+		///	</summary>
+		///	<exception cref="IOException"> </exception>
+		[Test]
+		public void testSimpleF2()
+		{
+			Tree tree = new Tree(db);
+			tree.AddFile("a");
+			tree.AddFile("x");
+			TreeIterator i = MakeIterator(tree);
+			Assert.IsTrue(i.MoveNext());
+			Assert.AreEqual("a", i.Current.Name);
+			Assert.AreEqual("x", i.Current.Name);
+		}
+
+		///	<summary>
+		/// Empty tree
+		///	</summary>
+		///	<exception cref="IOException"> </exception>
+		[Test]
+		public void testSimpleT()
+		{
+			Tree tree = new Tree(db);
+			tree.AddTree("a");
+			TreeIterator i = MakeIterator(tree);
+			Assert.IsFalse(i.MoveNext());
+		}
+
+		[Test]
+		public void testTricky()
+		{
+			Tree tree = new Tree(db);
+			tree.AddFile("a.b");
+			tree.AddFile("a.c");
+			tree.AddFile("a/b.b/b");
+			tree.AddFile("a/b");
+			tree.AddFile("a/c");
+			tree.AddFile("a=c");
+			tree.AddFile("a=d");
+
+			TreeIterator i = MakeIterator(tree);
+			Assert.IsTrue(i.MoveNext());
+			Assert.AreEqual("a.b", i.Current.FullName);
+			Assert.IsTrue(i.MoveNext());
+			Assert.AreEqual("a.c", i.Current.FullName);
+			Assert.IsTrue(i.MoveNext());
+			Assert.AreEqual("a/b", i.Current.FullName);
+			Assert.IsTrue(i.MoveNext());
+			Assert.AreEqual("a/b.b/b", i.Current.FullName);
+			Assert.IsTrue(i.MoveNext());
+			Assert.AreEqual("a/c", i.Current.FullName);
+			Assert.IsTrue(i.MoveNext());
+			Assert.AreEqual("a=c", i.Current.FullName);
+			Assert.IsTrue(i.MoveNext());
+			Assert.AreEqual("a=d", i.Current.FullName);
+			Assert.IsFalse(i.MoveNext());
+		}
+
+		private static TreeIterator MakeIterator(Tree tree)
+		{
+			return new TreeIterator(tree);
+		}
 	}
-
-	/**
-	 * one file
-	 *
-	 * @throws IOException
-	 */
-	public void testSimpleF1() throws IOException {
-		Tree tree = new Tree(db);
-		tree.addFile("x");
-		TreeIterator i = makeIterator(tree);
-		assertTrue(i.hasNext());
-		assertEquals("x", i.next().getName());
-	}
-
-	/**
-	 * two files
-	 *
-	 * @throws IOException
-	 */
-	public void testSimpleF2() throws IOException {
-		Tree tree = new Tree(db);
-		tree.addFile("a");
-		tree.addFile("x");
-		TreeIterator i = makeIterator(tree);
-		assertTrue(i.hasNext());
-		assertEquals("a", i.next().getName());
-		assertEquals("x", i.next().getName());
-	}
-
-	/**
-	 * Empty tree
-	 *
-	 * @throws IOException
-	 */
-	public void testSimpleT() throws IOException {
-		Tree tree = new Tree(db);
-		tree.addTree("a");
-		TreeIterator i = makeIterator(tree);
-		assertFalse(i.hasNext());
-	}
-
-	public void testTricky() throws IOException {
-		Tree tree = new Tree(db);
-		tree.addFile("a.b");
-		tree.addFile("a.c");
-		tree.addFile("a/b.b/b");
-		tree.addFile("a/b");
-		tree.addFile("a/c");
-		tree.addFile("a=c");
-		tree.addFile("a=d");
-
-		TreeIterator i = makeIterator(tree);
-		assertTrue(i.hasNext());
-		assertEquals("a.b", i.next().getFullName());
-		assertTrue(i.hasNext());
-		assertEquals("a.c", i.next().getFullName());
-		assertTrue(i.hasNext());
-		assertEquals("a/b", i.next().getFullName());
-		assertTrue(i.hasNext());
-		assertEquals("a/b.b/b", i.next().getFullName());
-		assertTrue(i.hasNext());
-		assertEquals("a/c", i.next().getFullName());
-		assertTrue(i.hasNext());
-		assertEquals("a=c", i.next().getFullName());
-		assertTrue(i.hasNext());
-		assertEquals("a=d", i.next().getFullName());
-		assertFalse(i.hasNext());
-	}
-
-	private TreeIterator makeIterator(Tree tree) {
-		return new TreeIterator(tree);
-	}
-#endif
-    }
-}
+}


Add owner user id for bags

Add owner user id for bags

--- TheCollection.Business/Tea/Bag.cs
+++ TheCollection.Business/Tea/Bag.cs
@@ -9,6 +9,9 @@
         [Key]
         [JsonProperty(PropertyName = "id")]
         public string Id { get; set; }
+
+        [JsonProperty(PropertyName = "userid")]
+        public string UserId { get; set; }

         [Searchable]
         [JsonProperty(PropertyName = "mainid")]


Dispose osz archive.

Dispose osz archive.

--- Training/DataGenerator/Program.cs
+++ Training/DataGenerator/Program.cs
@@ -148,6 +148,8 @@
             using (var mp3 = archive.OpenFile(audioFile))
                 try { fft = MusicProcesser.ProcessMp3(mp3); } catch (MusicProcessException) { return; }

+            (archive as IDisposable)?.Dispose();
+
             int sampleCount = fft.GetUpperBound(0) + 1;
             byte[] data = new byte[sampleCount];
             timingList.Add((double.MaxValue, double.NaN, 0, false)); //fence item


trying to print stuff

trying to print stuff

--- Manager.Integration/Manager.Integration.Test/DebugTCServerTests.cs
+++ Manager.Integration/Manager.Integration.Test/DebugTCServerTests.cs
@@ -15,11 +15,11 @@
         [TestFixtureSetUp]
         public void TestFixtureSetUp()
         {
-            Logger.Info("Running TestFixtureSetUp...");
+            Console.WriteLine("Running TestFixtureSetUp...");
             StartManagerIntegrationConsoleHostProcess =
                 ProcessHelper.StartManagerIntegrationConsoleHostProcess(1);
             Thread.Sleep(TimeSpan.FromSeconds(10));
-            Logger.Info("Finish with TestFixtureSetUp...");
+            Console.WriteLine("Finish with TestFixtureSetUp...");
         }

         [TestFixtureTearDown]


[*] Increased difficulty

[*] Increased difficulty

--- Unity/Assets/Scripts/CarScript.cs
+++ Unity/Assets/Scripts/CarScript.cs
@@ -42,9 +42,9 @@
     void Awake () {
         rigidbody = GetComponent<Rigidbody>();
         cameraBox = transform.Find("Camera Box");
-		timeLeft = timeLimit;
-		Audio.Instance.PlayDriving();
-		Audio.Instance.PlayBackground();
+        timeLeft = timeLimit;
+        Audio.Instance.PlayDriving();
+        Audio.Instance.PlayBackground();

         ladyAnimator = lady.GetComponent<Animator>();
         carLastPosition = transform.localPosition;
@@ -58,7 +58,7 @@

         LadyNoises();

-        stress += Time.deltaTime * 0.2f;
+        TakeDamage(Time.deltaTime * 1.5f);
     }

     void FixedUpdate() {
@@ -96,7 +96,7 @@

         // sidewalk stuff
         if ((transform.position.x < -6.5f) || (transform.position.x > 6.5f)) {
-            TakeDamage(Time.deltaTime * 0.2f);
+            TakeDamage(Time.deltaTime * 3f);
             ShakeCamera(0.1f, 0.5f);
         }
     }
@@ -169,8 +169,11 @@
             if (!Audio.Instance.IsSayingBreathe() )
                 Audio.Instance.PlayManSayingBreathe();

-            if (shootTimer < shootCooldown && !Audio.Instance.IsSayingShutUp()) {
-                Invoke("ShutTheFuckUp", 0.2f);
+            if (shootTimer < shootCooldown) {
+                if (!Audio.Instance.IsSayingShutUp()) {
+                    Invoke("ShutTheFuckUp", 0.2f);
+                }
+                TakeDamage(3f);
                 shootTimer = 0;
                 return;                         // You can not calm her down yet
             }
@@ -191,7 +194,6 @@
     private void ShutTheFuckUp() {
         Audio.Instance.StopScreamingBreathing();
         Audio.Instance.PlayWomanSayingShutup();
-        TakeDamage(3f);
     }

     private void UpdateDistance() {


Make sure root selection set correctly

Make sure root selection set correctly

--- MatterControlLib/DesignTools/Operations/OperationSourceObject3D.cs
+++ MatterControlLib/DesignTools/Operations/OperationSourceObject3D.cs
@@ -258,6 +258,7 @@
 	public class OperationSourceObject3D : Object3D
 	{
 		public override bool CanFlatten => true;
+
 		public OperationSourceObject3D()
 		{
 			Name = "Source".Localize();


cleanup from merge

cleanup from merge

--- Utility/scripts/MiscExtensions.cs
+++ Utility/scripts/MiscExtensions.cs
@@ -164,6 +164,8 @@
 				for (int y = min.Y; y < max.Y; y++)
 					for (int z = min.Z; z < max.Z; z++)
 						toInvoke(new Vector3I(x, y, z));
+		}
+
 		/// <summary>
 		/// Calcluate the vector rejection of A from B.
 		/// </summary>
@@ -179,15 +181,6 @@
 			return vectorA - vectorA.Dot(vectorB) * (Vector3)vectorB_part;
 		}

-		public static Vector3 Round(this Vector3 toRound, float roundTo)
-		{
-			double
-				x = Math.Round(toRound.X * roundTo) / roundTo,
-				y = Math.Round(toRound.Y * roundTo) / roundTo,
-				z = Math.Round(toRound.Z * roundTo) / roundTo;
-			return new Vector3(x, y, z);
-		}
-
 		public static string ToPrettySeconds(this VRage.Library.Utils.MyTimeSpan timeSpan)
 		{ return PrettySI.makePretty(timeSpan.Seconds) + 's'; }


Make sure we only use homing endstop for z

delta printers home to top and x and y are undefined

MatterHackers/MCCentral#5134
Prints confined to negative coordinates

--- MatterControlLib/PrinterCommunication/Io/SoftwareEndstopsStream.cs
+++ MatterControlLib/PrinterCommunication/Io/SoftwareEndstopsStream.cs
@@ -87,6 +87,12 @@
 			int extruderCount = printer.Settings.GetValue<int>(SettingsKey.extruder_count);
 			AxisAlignedBoundingBox aabb = printer.Bed.Aabb;

+			// if the printer has no heigt set than allow it to go up any amount
+			if(aabb.ZSize < 10)
+			{
+				aabb.MaxXYZ.Z = 200;
+			}
+
 			// if the printer has leveling enabled
 			if(printer.Settings.GetValue<bool>(SettingsKey.print_leveling_enabled))
 			{
@@ -98,22 +104,20 @@
 				aabb.MinXYZ.Z = -3;
 			}

-			// find out if the printer knows some of its limits
+			// let the z endstop set the max z bounds
 			var homingPosition = printer.Connection.HomingPosition;
 			// If we know the homing endstop positions, add them in.
-			for (int i = 0; i < extruderCount; i++)
+			if (homingPosition.Z != double.NegativeInfinity)
 			{
-				if (homingPosition[i] != double.NegativeInfinity)
+				// Figure out which side of center it is on and modify the bounds
+				// If the z is less than 20 we assume the printer is bottom homing
+				if (homingPosition.Z < aabb.Center.Z)
 				{
-					// figure out which side of center it is on and modify the bounds
-					if (homingPosition[i] < aabb.Center[i])
-					{
-						aabb.MinXYZ[i] = homingPosition[i];
-					}
-					else
-					{
-						aabb.MaxXYZ[i] = homingPosition[i];
-					}
+					aabb.MinXYZ.Z = homingPosition.Z;
+				}
+				else
+				{
+					aabb.MaxXYZ.Z = homingPosition.Z;
 				}
 			}


For reals this time

For reals this time

--- VersionrUI/ViewModels/StatusVM.cs
+++ VersionrUI/ViewModels/StatusVM.cs
@@ -14,6 +14,8 @@
         private Status _status;
         private AreaVM _areaVM;
         private ObservableCollection<StatusEntryVM> _elements;
+        private bool _pushOnCommit;
+        private string _commitMessage;

         public StatusVM(Status status, AreaVM areaVM)
         {
@@ -28,9 +30,31 @@

         public Status Status { get { return _status; } }

-        public bool PushOnCommit { get; set; }
+        public bool PushOnCommit
+        {
+            get { return _pushOnCommit; }
+            set
+            {
+                if (_pushOnCommit != value)
+                {
+                    _pushOnCommit = value;
+                    NotifyPropertyChanged("PushOnCommit");
+                }
+            }
+        }

-        public string CommitMessage { get; set; }
+        public string CommitMessage
+        {
+            get { return _commitMessage; }
+            set
+            {
+                if (_commitMessage != value)
+                {
+                    _commitMessage = value;
+                    NotifyPropertyChanged("CommitMessage");
+                }
+            }
+        }

         public void RefreshElements()
         {
@@ -69,8 +93,7 @@

             if (PushOnCommit)
                 _areaVM.ExecuteClientCommand((c) => c.Push(), "push", true);
-
-
+
             RefreshElements();
         }
     }


Increase BitcoinCoreVersion constant.

Increase BitcoinCoreVersion constant.

--- WalletWasabi/Helpers/Constants.cs
+++ WalletWasabi/Helpers/Constants.cs
@@ -58,7 +58,7 @@

 		public static readonly Version ClientVersion = new Version(1, 1, 11, 1);
 		public static readonly Version HwiVersion = new Version("1.1.2");
-		public static readonly Version BitcoinCoreVersion = new Version("0.19.1");
+		public static readonly Version BitcoinCoreVersion = new Version("0.20.0");
 		public static readonly Version LegalDocumentsVersion = new Version(2, 0);

 		public static readonly NodeRequirement NodeRequirements = new NodeRequirement


* fix missing lock on XMLRPC GroupsModule

--- OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -1170,8 +1170,11 @@
                 }

                 m_clientRequestIDInfo[client.AgentId].LastUsedTMStamp = DateTime.Now;
-            }
-            return m_clientRequestIDInfo[client.AgentId].RequestID;
+
+                return m_clientRequestIDInfo[client.AgentId].RequestID;
+            }
+
+            return new GroupRequestID();
         }

         /// <summary>


Temporarily print regression TestCastAndConcatString() script compile errors out to console to get a handle on what's going wrong.

Does not fail for me locally and I failed to notice this test was failing on Jenkins.

--- OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
+++ OpenSim/Region/ScriptEngine/Shared/CodeTools/Tests/CompilerTest.cs
@@ -166,10 +166,11 @@

             m_compilerResults = m_CSCodeProvider.CompileAssemblyFromSource(m_compilerParameters, output);

-//            foreach (CompilerError compErr in m_compilerResults.Errors)
-//            {
-//                System.Console.WriteLine("Error: {0}", compErr);
-//            }
+            System.Console.WriteLine("ERRORS: {0}", m_compilerResults.Errors.Count);
+            foreach (CompilerError compErr in m_compilerResults.Errors)
+            {
+                System.Console.WriteLine("Error: {0}", compErr);
+            }

             Assert.AreEqual(0, m_compilerResults.Errors.Count);
         }


Better debug messages

Better debug messages

--- OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -358,7 +358,7 @@

         private bool GetBoolResponse(XmlRpcRequest request, out string reason)
         {
-            //m_log.Debug("[HGrid]: Linking to " + uri);
+            //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL);
             XmlRpcResponse response = null;
             try
             {
@@ -366,14 +366,14 @@
             }
             catch (Exception e)
             {
-                m_log.Debug("[USER AGENT CONNECTOR]: Unable to contact remote server ");
+                m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL);
                 reason = "Exception: " + e.Message;
                 return false;
             }

             if (response.IsFault)
             {
-                m_log.ErrorFormat("[HGrid]: remote call returned an error: {0}", response.FaultString);
+                m_log.ErrorFormat("[HGrid]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString);
                 reason = "XMLRPC Fault";
                 return false;
             }
@@ -383,15 +383,29 @@
             //    m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
             try
             {
+                if (hash == null)
+                {
+                    m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got null response from {0}! THIS IS BAAAAD", m_ServerURL);
+                    reason = "Internal error 1";
+                    return false;
+                }
                 bool success = false;
                 reason = string.Empty;
-                Boolean.TryParse((string)hash["result"], out success);
+                if (hash.ContainsKey("result"))
+                    Boolean.TryParse((string)hash["result"], out success);
+                else
+                {
+                    reason = "Internal error 2";
+                    m_log.WarnFormat("[USER AGENT CONNECTOR]: response from {0} does not have expected key 'result'", m_ServerURL);
+                }

                 return success;
             }
             catch (Exception e)
             {
-                m_log.Error("[HGrid]: Got exception while parsing GetEndPoint response " + e.StackTrace);
+                m_log.ErrorFormat("[HGrid]: Got exception on GetBoolResponse response.");
+                if (hash.ContainsKey("result") && hash["result"] != null)
+                    m_log.ErrorFormat("Reply was ", (string)hash["result"]);
                 reason = "Exception: " + e.Message;
                 return false;
             }


make Deactivate test consistent with Activate

--- PalasoUIWindowsForms.Tests/Keyboarding/IBusAdaptorTestsWithIBus.cs
+++ PalasoUIWindowsForms.Tests/Keyboarding/IBusAdaptorTestsWithIBus.cs
@@ -34,10 +34,11 @@
 					Console.WriteLine("Name {0}, Id {1}", keyboard.ShortName, keyboard.Id);
 				}
 			}
-		 }
+		}

 		[Test]
 		[Category("IBus")]
+		// This will fail because Deactivate does nothing
 		public void Deactivate_SwitchesBackToDefaultKeyboard()
 		{
 			using (var e = new IBusEnvironmentForTest(true))
@@ -55,10 +56,9 @@
 		{
 			using (var e = new IBusEnvironmentForTest(true))
 			{
-				//IBusAdaptor.Deactivate();
-				IBusAdaptor.ActivateKeyboard("m17n:am:sera");
-				Assert.AreEqual("m17n:am:sera", KeyboardController.GetActiveKeyboard());
-				IBusAdaptor.Deactivate();
+				IBusAdaptor.ActivateKeyboard(IBusEnvironmentForTest.OtherKeyboard);
+				string actual = IBusAdaptor.GetActiveKeyboard();
+				Assert.AreEqual(IBusEnvironmentForTest.DefaultKeyboard, actual);
 			}
 		}


Add test that shows deadlock

Add test that shows deadlock

--- WeakEvent.Tests/WeakEventSourceTests.cs
+++ WeakEvent.Tests/WeakEventSourceTests.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Threading;
 using FluentAssertions;
 using Xunit;

@@ -160,6 +161,44 @@
             calledSubscribers.Should().Equal(1, 2);
         }

+        [Fact]
+        public void Can_Subscribe_While_Another_Thread_Is_Invoking()
+        {
+            var sub1CanFinish = new ManualResetEvent(false);
+            var sub2CanSubscribe = new ManualResetEvent(false);
+
+            var pub = new Publisher();
+            var sub1 = new InstanceSubscriber(1, i =>
+            {
+                sub2CanSubscribe.Set();
+                sub1CanFinish.WaitOne();
+            });
+            var sub2 = new InstanceSubscriber(2, i => { });
+            sub1.Subscribe(pub);
+
+            var thread1 = new Thread(() =>
+            {
+                pub.Raise();
+            });
+
+            var thread2 = new Thread(() =>
+            {
+                sub2CanSubscribe.WaitOne();
+                sub2.Subscribe(pub);
+            });
+
+            thread1.Start();
+            thread2.Start();
+            bool subscribeFinished = thread2.Join(500);
+            sub1CanFinish.Set();
+            thread1.Join();
+
+            subscribeFinished.Should().BeTrue();
+
+            GC.KeepAlive(sub1);
+            GC.KeepAlive(sub2);
+        }
+
         #region Test subjects

         class Publisher


Fix for LOG4NET-59 to allow rolling files based on UTC time. Implemented by adding DateTimeStrategy property which accepts an IDateTime. RollingFileAppender contains two IDateTime inner-class implementations: LocalDateTime (DateTime.Now) and UniversalDateTime (DateTime.UtcNow).

git-svn-id: 223c0ba935819ffdcafdc68147dc609b4e469b1e@398209 13f79535-47bb-0310-9956-ffa450edef68

--- src/Appender/RollingFileAppender.cs
+++ src/Appender/RollingFileAppender.cs
@@ -232,12 +232,38 @@
 		/// </remarks>
 		public RollingFileAppender()
 		{
-			m_dateTime = new DefaultDateTime();
 		}

 		#endregion Public Instance Constructors

 		#region Public Instance Properties
+
+		///
+		/// Gets or sets the strategy for determining the current date and time. The default
+		/// implementation is to use LocalDateTime which internally calls through to DateTime.Now.
+		/// DateTime.UtcNow may be used by specifying
+		/// <see cref="RollingFileAppender.UniversalDateTime"/>.
+		///
+		/// <value>
+		/// An implementation of the <see cref="RollingFileAppender.IDateTime"/> interface which returns the current date and time.
+		/// </value>
+		/// <remarks>
+		/// <para>
+		/// Gets or sets the <see cref="RollingFileAppender.IDateTime"/> used to return the current date and time.
+		/// </para>
+		/// <para>
+		/// There are two built strategies for determining the current date and time,
+		/// <see cref="RollingFileAppender.LocalDateTime"/> and <see cref="RollingFileAppender.UniversalDateTime"/>.
+		/// </para>
+		/// <para>
+		/// The default strategy is <see cref="RollingFileAppender.LocalDateTime"/>.
+		/// </para>
+		/// </remarks>
+		public IDateTime DateTimeStrategy
+		{
+			get { return m_dateTime; }
+			set { m_dateTime = value; }
+		}

 		///
 		/// Gets or sets the date pattern to be used for generating file names
@@ -950,6 +976,11 @@
 		/// </remarks>
 		override public void ActivateOptions()
 		{
+			if (m_dateTime == null)
+			{
+				m_dateTime = new LocalDateTime();
+			}
+
 			if (m_rollDate && m_datePattern != null)
 			{
 				m_now = m_dateTime.Now;
@@ -1410,7 +1441,8 @@

 		///
 		/// This object supplies the current date/time.  Allows test code to plug in
-		/// a method to control this class when testing date/time based rolling.
+		/// a method to control this class when testing date/time based rolling. The default
+		/// implementation uses the underlying value of DateTime.Now.
 		///
 		private IDateTime m_dateTime = null;

@@ -1525,7 +1557,7 @@
 		///
 		/// Default implementation of <see cref="IDateTime"/> that returns the current time.
 		///
-		private class DefaultDateTime : IDateTime
+		private class LocalDateTime : IDateTime
 		{
 			///
 			/// Gets the current time.
@@ -1542,6 +1574,26 @@
 			}
 		}

+		///
+		/// Implementation of <see cref="IDateTime"/> that returns the current time as the coordinated universal time (UTC).
+		///
+		private class UniversalDateTime : IDateTime
+		{
+			///
+			/// Gets the current time.
+			///
+			/// <value>The current time.</value>
+			/// <remarks>
+			/// <para>
+			/// Gets the current time.
+			/// </para>
+			/// </remarks>
+			public DateTime Now
+			{
+				get { return DateTime.UtcNow; }
+			}
+		}
+
 		#endregion DateTime
 	}
 }


once we've determined the model is valid we need to check if the jobid actually references a real job

--- Web/Controllers/JobProjectController.cs
+++ Web/Controllers/JobProjectController.cs
@@ -58,6 +58,11 @@
             {
                 return BadRequest(ModelState);
             }
+            var job = _jobRepository.GetById(jobProject.JobId);
+            if (job == null)
+            {
+                return NotFound();
+            }

             var domainModel = JobProjectDomainModelMapper.MapFrom(jobProject);
             var savedJobProject = _jobProjectRepository.Save(domainModel);
@@ -82,14 +87,15 @@
         [HttpPut("{id}")]
         public IActionResult UpdateJobProject(int id, [FromBody] AddUpdateJobProjectViewModel jobProject)
         {
-            var foundJobProject = _jobProjectRepository.GetById(id);
-            if (foundJobProject == null)
-            {
-                return NotFound();
-            }
             if (!ModelState.IsValid)
             {
                 return BadRequest(ModelState);
+            }
+            var job = _jobRepository.GetById(jobProject.JobId);
+            var foundJobProject = _jobProjectRepository.GetById(id);
+            if (job == null || foundJobProject == null)
+            {
+                return NotFound();
             }

             var viewModel = JobProjectViewModelMapper.MapFrom(id, jobProject);


conditional blocks and XML comments don't mix as I would have expected them to

git-svn-id: 223c0ba935819ffdcafdc68147dc609b4e469b1e@1171475 13f79535-47bb-0310-9956-ffa450edef68

--- src/Appender/RollingFileAppender.cs
+++ src/Appender/RollingFileAppender.cs
@@ -239,13 +239,12 @@

 		#region Public Instance Properties

-		/// <summary>
+#if !NET_1_0
+        /// <summary>
 		/// Gets or sets the strategy for determining the current date and time. The default
 		/// implementation is to use LocalDateTime which internally calls through to DateTime.Now.
-#if !NET_1_0
 		/// DateTime.UtcNow may be used on frameworks newer than .NET 1.0 by specifying
 		/// <see cref="RollingFileAppender.UniversalDateTime"/>.
-#endif
 		/// </summary>
 		/// <value>
 		/// An implementation of the <see cref="RollingFileAppender.IDateTime"/> interface which returns the current date and time.
@@ -254,18 +253,33 @@
 		/// <para>
 		/// Gets or sets the <see cref="RollingFileAppender.IDateTime"/> used to return the current date and time.
 		/// </para>
-		/// <para>
-		/// There are two built strategies for determining the current date and time,
+        /// <para>
+        /// There are two built strategies for determining the current date and time,
 		/// <see cref="RollingFileAppender.LocalDateTime"/>
-#if !NET_1_0
         /// and <see cref="RollingFileAppender.UniversalDateTime"/>.
+        /// </para>
+        /// <para>
+		/// The default strategy is <see cref="RollingFileAppender.LocalDateTime"/>.
+		/// </para>
+		/// </remarks>
+#else
+        /// <summary>
+		/// Gets or sets the strategy for determining the current date and time. The default
+		/// implementation is to use LocalDateTime which internally calls through to DateTime.Now.
+		/// </summary>
+		/// <value>
+		/// An implementation of the <see cref="RollingFileAppender.IDateTime"/> interface which returns the current date and time.
+		/// </value>
+		/// <remarks>
+		/// <para>
+		/// Gets or sets the <see cref="RollingFileAppender.IDateTime"/> used to return the current date and time.
+		/// </para>
+        /// <para>
+		/// The default strategy is <see cref="RollingFileAppender.LocalDateTime"/>.
+		/// </para>
+		/// </remarks>
 #endif
-        /// </para>
-		/// <para>
-		/// The default strategy is <see cref="RollingFileAppender.LocalDateTime"/>.
-		/// </para>
-		/// </remarks>
-		public IDateTime DateTimeStrategy
+        public IDateTime DateTimeStrategy
 		{
 			get { return m_dateTime; }
 			set { m_dateTime = value; }


no need to cache the hash code, the fields are readonly

--- src/AutoMapper/ResolutionContext.cs
+++ src/AutoMapper/ResolutionContext.cs
@@ -136,7 +136,6 @@

         private static int CombineHashCodes(int h1, int h2) => ((h1 << 5) + h1) ^ h2;

-        private readonly int _hashCode;
         private readonly object _source;
         private readonly Type _destinationType;

@@ -144,10 +143,9 @@
         {
             _source = source;
             _destinationType = destinationType;
-            _hashCode = CombineHashCodes(_source, _destinationType);
         }

-        public override int GetHashCode() => _hashCode;
+        public override int GetHashCode() => CombineHashCodes(_source, _destinationType);

         public bool Equals(ContextCacheKey other) =>
             _source == other._source && _destinationType == other._destinationType;


Make field readonly.

Make field readonly.

--- src/Avalonia.Base/AvaloniaObject.cs
+++ src/Avalonia.Base/AvaloniaObject.cs
@@ -17,11 +17,11 @@
     /// </remarks>
     public class AvaloniaObject : IAvaloniaObject, IAvaloniaObjectDebug, INotifyPropertyChanged
     {
+        private readonly ValueStore _values;
         private AvaloniaObject? _inheritanceParent;
         private PropertyChangedEventHandler? _inpcChanged;
         private EventHandler<AvaloniaPropertyChangedEventArgs>? _propertyChanged;
         private List<AvaloniaObject>? _inheritanceChildren;
-        private ValueStore _values;

         /// <summary>
         /// Initializes a new instance of the <see cref="AvaloniaObject"/> class.


removido _dacBoleto,que não estava sendo usado

--- src/Boleto.Net/Banco/Banco_Safra.cs
+++ src/Boleto.Net/Banco/Banco_Safra.cs
@@ -21,7 +21,6 @@
     {
         private string _dacNossoNumero = string.Empty;
         private int _dacContaCorrente = 0;
-        private int _dacBoleto = 0;
         private int _numeroArquivoRemessa;

         /// <summary>


Check for current app reported by the sdk

--- Project-Aurora/Project-Aurora/Settings/Layers/RazerLayerHandler.cs
+++ Project-Aurora/Project-Aurora/Settings/Layers/RazerLayerHandler.cs
@@ -1,4 +1,4 @@
-using Aurora.Devices;
+using Aurora.Devices;
 using Aurora.Devices.Razer;
 using Aurora.EffectsEngine;
 using Aurora.Profiles;
@@ -66,6 +66,8 @@
         private Color[] _keyboardColors;
         private Color[] _mousepadColors;
         private Color _mouseColor;
+        private string _currentAppExecutable;
+        private int _currentAppPid;

         public RazerLayerHandler()
         {
@@ -87,8 +89,15 @@
                 };
             }

-            if(_manager != null)
+            if (_manager != null)
+            {
                 _manager.DataUpdated += OnDataUpdated;
+
+                var appList = _manager.GetDataProvider<RzAppListDataProvider>();
+                appList.Update();
+                _currentAppExecutable = appList.CurrentAppExecutable;
+                _currentAppPid = appList.CurrentAppPid;
+            }
         }

         protected override UserControl CreateControl()
@@ -116,11 +125,21 @@
                 for (var i = 0; i < mousePad.ZoneGrid.Height * mousePad.ZoneGrid.Width; i++)
                     _mousepadColors[i] = mousePad.GetZoneColor(i);
             }
+            else if(provider is RzAppListDataProvider appList)
+            {
+                _currentAppExecutable = appList.CurrentAppExecutable;
+                _currentAppPid = appList.CurrentAppPid;
+            }
         }

         public override EffectLayer Render(IGameState gamestate)
         {
             var layer = new EffectLayer();
+
+            if (string.IsNullOrEmpty(_currentAppExecutable) || string.Compare(_currentAppExecutable, "Aurora.exe", true) == 0)
+            {
+                return layer;
+            }

             foreach (var key in (DeviceKeys[])Enum.GetValues(typeof(DeviceKeys)))
             {


[Demo] #ifdefed WpfDemo

[Demo] #ifdefed WpfDemo

--- src/Demo/WpfDemo/MainWindow.xaml.cs
+++ src/Demo/WpfDemo/MainWindow.xaml.cs
@@ -1,4 +1,7 @@
-using Aardvark.Base;
+
+#if WINDOWS
+
+using Aardvark.Base;
 using Aardvark.Base.Incremental.CSharp;
 using Aardvark.SceneGraph;
 using System.Windows;
@@ -60,3 +63,5 @@
         }
     }
 }
+
+#endif


Refactor for clarity

Refactor for clarity

--- RockLib.Configuration.ObjectFactory/ConfigReloadingProxyFactory.cs
+++ RockLib.Configuration.ObjectFactory/ConfigReloadingProxyFactory.cs
@@ -16,13 +16,17 @@
     /// </summary>
     public static class ConfigReloadingProxyFactory
     {
-        private const MethodAttributes ExplicitInterfaceImplementation = MethodAttributes.Private | MethodAttributes.HideBySig | MethodAttributes.NewSlot | MethodAttributes.Virtual | MethodAttributes.Final;
-
+        private delegate object CreateProxyDelegate(IConfiguration configuration, DefaultTypes defaultTypes, ValueConverters valueConverters, Type declaringType, string memberName);
+
+        private const TypeAttributes ProxyClassAttributes = TypeAttributes.Public | TypeAttributes.AnsiClass | TypeAttributes.BeforeFieldInit;
+        private const MethodAttributes ExplicitInterfaceMethodAttributes = MethodAttributes.Private | MethodAttributes.HideBySig | MethodAttributes.NewSlot | MethodAttributes.Virtual | MethodAttributes.Final;
+        private const MethodAttributes TransferStateAttributes = MethodAttributes.FamORAssem | MethodAttributes.HideBySig | MethodAttributes.Virtual | MethodAttributes.Final;
+        private const MethodAttributes ConstructorAttributes = MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName;
         private static readonly MethodInfo _disposeMethod = typeof(IDisposable).GetTypeInfo().GetMethod(nameof(IDisposable.Dispose));
         private static readonly MethodInfo _delegateCombineMethod = typeof(Delegate).GetTypeInfo().GetMethod(nameof(Delegate.Combine), new[] { typeof(Delegate), typeof(Delegate) });
         private static readonly MethodInfo _delegateRemoveMethod = typeof(Delegate).GetTypeInfo().GetMethod(nameof(Delegate.Remove), new[] { typeof(Delegate), typeof(Delegate) });

-        private static readonly ConcurrentDictionary<Type, Func<IConfiguration, DefaultTypes, ValueConverters, Type, string, object>> _proxyFactories = new ConcurrentDictionary<Type, Func<IConfiguration, DefaultTypes, ValueConverters, Type, string, object>>();
+        private static readonly ConcurrentDictionary<Type, CreateProxyDelegate> _proxyFactories = new ConcurrentDictionary<Type, CreateProxyDelegate>();

         /// <summary>
         /// Create an object of type <typeparamref name="TInterface"/> based on the specified configuration. The returned
@@ -73,68 +77,210 @@
             if (interfaceType == null)
                 throw new ArgumentNullException(nameof(interfaceType));
             if (!interfaceType.GetTypeInfo().IsInterface)
-                throw new ArgumentException("Must be an interface type.", nameof(interfaceType));
+                throw new ArgumentException($"Specified type is not an interface: '{interfaceType.FullName}'.", nameof(interfaceType));
+            if (interfaceType == typeof(IEnumerable))
+                throw new ArgumentException("The IEnumerable interface is not supported.");
             if (typeof(IEnumerable).GetTypeInfo().IsAssignableFrom(interfaceType))
-                throw new ArgumentException("Cannot implement IEnumerable.", nameof(interfaceType));
-
-            var createProxy = _proxyFactories.GetOrAdd(interfaceType, CreateProxyTypeFactoryMethod);
-            return createProxy(configuration, defaultTypes, valueConverters, declaringType, memberName);
-        }
-
-        private static Func<IConfiguration, DefaultTypes, ValueConverters, Type, string, object> CreateProxyTypeFactoryMethod(Type type)
-        {
-            var assemblyName = "<" + type.Name + ">a__RockLibDynamicAssembly";
-            var name = "<" + type.Name + ">c__RockLibConfigReloadingProxyClass";
+                throw new ArgumentException($"Interfaces that inherit from IEnumerable are not suported: '{interfaceType.FullName}'", nameof(interfaceType));
+
+            var createReloadingProxy = _proxyFactories.GetOrAdd(interfaceType, CreateProxyTypeFactoryMethod);
+            return createReloadingProxy.Invoke(configuration, defaultTypes, valueConverters, declaringType, memberName);
+        }
+
+        private static CreateProxyDelegate CreateProxyTypeFactoryMethod(Type interfaceType)
+        {
+            var proxyType = CreateProxyType(interfaceType);
+            return CompileFactoryMethod(proxyType);
+        }
+
+        private static TypeInfo CreateProxyType(Type interfaceType)
+        {
+            var baseClass = typeof(ConfigReloadingProxy<>).MakeGenericType(interfaceType);
+
+            var baseConstructor = baseClass.GetTypeInfo().GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance)[0];
+            var baseGetObjectMethod = baseClass.GetTypeInfo().GetProperty("Object").GetMethod;
+            var baseTransferStateMethod = baseClass.GetTypeInfo().GetMethod("TransferState", BindingFlags.NonPublic | BindingFlags.Instance);
+
+            var eventFields = new Dictionary<EventInfo, FieldBuilder>();
+            var implementedMethods = new List<MethodInfo>();
+
+            var proxyTypeBuilder = CreateProxyTypeBuilder(interfaceType, baseClass);
+
+            AddConstructor(proxyTypeBuilder, baseConstructor);
+
+            // As a side-effect, AddProperty adds getter and setter methods to the implementedMethods list.
+            foreach (var property in interfaceType.GetAllProperties())
+                AddProperty(proxyTypeBuilder, property, baseGetObjectMethod, implementedMethods);
+
+            // As a side-effect, AddEvent adds:
+            // - add and remove event handler methods to the implementedMethods list.
+            // - the interface event + backing event handler field to the eventFields dictionary.
+            foreach (var evt in interfaceType.GetAllEvents())
+                AddEvent(proxyTypeBuilder, evt, baseGetObjectMethod, eventFields, implementedMethods);
+
+            // Only add methods that weren't already created in AddProperty and AddEvent.
+            foreach (var method in interfaceType.GetAllMethods().Where(method => !implementedMethods.Contains(method)))
+                AddMethod(proxyTypeBuilder, method, baseGetObjectMethod);
+
+            // The eventFields dictionary needs to be fully populated in order to correctly
+            // implement the TransferState method.
+            AddTransferStateOverrideMethod(proxyTypeBuilder, interfaceType, eventFields, baseTransferStateMethod);
+
+            return proxyTypeBuilder.CreateTypeInfo();
+        }
+
+        private static TypeBuilder CreateProxyTypeBuilder(Type interfaceType, Type baseType)
+        {
+            var assemblyName = $"<{interfaceType.Name}>a__RockLibDynamicAssembly";
+            var name = $"<{interfaceType.Name}>c__RockLibConfigReloadingProxyClass";
             var assemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName(assemblyName), AssemblyBuilderAccess.Run);
             var moduleBuilder = assemblyBuilder.DefineDynamicModule("MainModule");
-
-            var configReloadingProxyType = typeof(ConfigReloadingProxy<>).MakeGenericType(type);
-            var typeBuilder = moduleBuilder.DefineType(name, TypeAttributes.Public | TypeAttributes.AnsiClass | TypeAttributes.BeforeFieldInit,
-                configReloadingProxyType, new[] { type });
-
-            var getObjectMethod = configReloadingProxyType.GetTypeInfo().GetProperty("Object").GetMethod;
-
-            var eventFields = new Dictionary<EventInfo, FieldBuilder>();
-
-            AddTransferStateMethod(typeBuilder, type, eventFields, configReloadingProxyType);
-
-            AddConstructor(typeBuilder, type, configReloadingProxyType);
-
-            foreach (var property in type.GetAllProperties())
-                AddProperty(typeBuilder, property, getObjectMethod);
-
-            foreach (var method in type.GetAllMethods().Where(m => ShouldAdd(m, type)))
-                AddMethod(typeBuilder, method, getObjectMethod);
-
-            foreach (var evt in type.GetAllEvents())
-                AddEvent(typeBuilder, evt, getObjectMethod, eventFields);
-
-            var proxyType = typeBuilder.CreateTypeInfo();
-
-            var sectionParameter = Expression.Parameter(typeof(IConfiguration), "section");
-            var defaultTypesParameter = Expression.Parameter(typeof(DefaultTypes), "defaultTypes");
-            var valueConvertersParameter = Expression.Parameter(typeof(ValueConverters), "valueConverters");
-            var declaringTypeParameter = Expression.Parameter(typeof(Type), "declaringType");
-            var memberNameParameter = Expression.Parameter(typeof(string), "memberName");
-            var lambda = Expression.Lambda<Func<IConfiguration, DefaultTypes, ValueConverters, Type, string, object>>(
-                Expression.New(proxyType.GetConstructors()[0], sectionParameter, defaultTypesParameter, valueConvertersParameter, declaringTypeParameter, memberNameParameter),
-                sectionParameter, defaultTypesParameter, valueConvertersParameter, declaringTypeParameter, memberNameParameter);
-            return lambda.Compile();
-        }
-
-        private static void AddTransferStateMethod(TypeBuilder typeBuilder, Type type, Dictionary<EventInfo, FieldBuilder> eventFields, Type configReloadingProxyType)
-        {
-            var baseTransferStateMethod = configReloadingProxyType.GetTypeInfo().GetMethod("TransferState", BindingFlags.NonPublic | BindingFlags.Instance);
-
-            var transferStateMethod = typeBuilder.DefineMethod("TransferState", MethodAttributes.FamORAssem | MethodAttributes.HideBySig | MethodAttributes.Virtual | MethodAttributes.Final, typeof(void), new[] { type, type });
+            return moduleBuilder.DefineType(name, ProxyClassAttributes, baseType, new[] { interfaceType });
+        }
+
+        private static void AddConstructor(TypeBuilder proxyTypeBuilder, ConstructorInfo baseConstructor)
+        {
+            var constructorBuilder = proxyTypeBuilder.DefineConstructor(ConstructorAttributes, baseConstructor.CallingConvention,
+                new[] { typeof(IConfiguration), typeof(DefaultTypes), typeof(ValueConverters), typeof(Type), typeof(string) });
+
+            var il = constructorBuilder.GetILGenerator();
+
+            il.Emit(OpCodes.Ldarg_0);
+            il.Emit(OpCodes.Ldarg_1);
+            il.Emit(OpCodes.Ldarg_2);
+            il.Emit(OpCodes.Ldarg_3);
+            il.Emit(OpCodes.Ldarg_S, 4);
+            il.Emit(OpCodes.Ldarg_S, 5);
+            il.Emit(OpCodes.Call, baseConstructor);
+            il.Emit(OpCodes.Ret);
+        }
+
+        private static void AddProperty(TypeBuilder proxyTypeBuilder, PropertyInfo interfaceProperty, MethodInfo baseGetObjectMethod, ICollection<MethodInfo> implementedMethods)
+        {
+            var parameters = interfaceProperty.GetIndexParameters().Select(p => p.ParameterType).ToArray();
+            var propertyBuilder = proxyTypeBuilder.DefineProperty(interfaceProperty.Name, interfaceProperty.Attributes, interfaceProperty.PropertyType, parameters);
+
+            if (interfaceProperty.CanRead)
+            {
+                var getMethodBuilder = proxyTypeBuilder.DefineMethod("get_" + interfaceProperty.Name, ExplicitInterfaceMethodAttributes, interfaceProperty.PropertyType, parameters);
+
+                var il = getMethodBuilder.GetILGenerator();
+
+                il.Emit(OpCodes.Ldarg_0);
+                il.Emit(OpCodes.Call, baseGetObjectMethod);
+                for (int i = 0; i < parameters.Length; i++)
+                    il.Emit(OpCodes.Ldarg, i + 1);
+                il.Emit(OpCodes.Callvirt, interfaceProperty.GetMethod);
+                il.Emit(OpCodes.Ret);
+
+                propertyBuilder.SetGetMethod(getMethodBuilder);
+                proxyTypeBuilder.DefineMethodOverride(getMethodBuilder, interfaceProperty.GetMethod);
+                implementedMethods.Add(interfaceProperty.GetMethod);
+            }
+
+            if (interfaceProperty.CanWrite)
+            {
+                var setMethodBuilder = proxyTypeBuilder.DefineMethod("set_" + interfaceProperty.Name, ExplicitInterfaceMethodAttributes, typeof(void), parameters.Concat(new[] { interfaceProperty.PropertyType }).ToArray());
+                var il = setMethodBuilder.GetILGenerator();
+
+                il.Emit(OpCodes.Ldarg_0);
+                il.Emit(OpCodes.Call, baseGetObjectMethod);
+                il.Emit(OpCodes.Ldarg_1);
+                for (int i = 0; i < parameters.Length; i++)
+                    il.Emit(OpCodes.Ldarg, i + 2);
+                il.Emit(OpCodes.Callvirt, interfaceProperty.SetMethod);
+                il.Emit(OpCodes.Ret);
+
+                propertyBuilder.SetSetMethod(setMethodBuilder);
+                proxyTypeBuilder.DefineMethodOverride(setMethodBuilder, interfaceProperty.SetMethod);
+                implementedMethods.Add(interfaceProperty.SetMethod);
+            }
+        }
+
+        private static void AddEvent(TypeBuilder proxyTypeBuilder, EventInfo interfaceEvent, MethodInfo baseGetObjectMethod, IDictionary<EventInfo, FieldBuilder> eventFields, ICollection<MethodInfo> implementedMethods)
+        {
+            var eventField = proxyTypeBuilder.DefineField($"_{interfaceEvent.DeclaringType.FullName.Replace(".", "_")}_{interfaceEvent.Name}", interfaceEvent.EventHandlerType, FieldAttributes.Private);
+            eventFields.Add(interfaceEvent, eventField);
+
+            var parameters = new[] { interfaceEvent.EventHandlerType };
+
+            var eventBuilder = proxyTypeBuilder.DefineEvent(interfaceEvent.Name, interfaceEvent.Attributes, interfaceEvent.EventHandlerType);
+            var addMethod = proxyTypeBuilder.DefineMethod(interfaceEvent.AddMethod.Name, ExplicitInterfaceMethodAttributes, typeof(void), parameters);
+            var removeMethod = proxyTypeBuilder.DefineMethod(interfaceEvent.RemoveMethod.Name, ExplicitInterfaceMethodAttributes, typeof(void), parameters);
+
+            var il = addMethod.GetILGenerator();
+
+            // Add the event handler to Object's event
+            il.Emit(OpCodes.Ldarg_0);
+            il.Emit(OpCodes.Call, baseGetObjectMethod);
+            il.Emit(OpCodes.Ldarg_1);
+            il.Emit(OpCodes.Callvirt, interfaceEvent.AddMethod);
+
+            // Add the event handler to the event's "tracking" field
+            il.Emit(OpCodes.Ldarg_0);
+            il.Emit(OpCodes.Ldarg_0);
+            il.Emit(OpCodes.Ldfld, eventField);
+            il.Emit(OpCodes.Ldarg_1);
+            il.Emit(OpCodes.Call, _delegateCombineMethod);
+            il.Emit(OpCodes.Castclass, interfaceEvent.EventHandlerType);
+            il.Emit(OpCodes.Stfld, eventField);
+            il.Emit(OpCodes.Ret);
+
+            eventBuilder.SetAddOnMethod(addMethod);
+            proxyTypeBuilder.DefineMethodOverride(addMethod, interfaceEvent.AddMethod);
+            implementedMethods.Add(interfaceEvent.AddMethod);
+
+            il = removeMethod.GetILGenerator();
+
+            // Remove the event handler from Object's event
+            il.Emit(OpCodes.Ldarg_0);
+            il.Emit(OpCodes.Call, baseGetObjectMethod);
+            il.Emit(OpCodes.Ldarg_1);
+            il.Emit(OpCodes.Callvirt, interfaceEvent.RemoveMethod);
+
+            // Remove the event handler from the event's "tracking" field
+            il.Emit(OpCodes.Ldarg_0);
+            il.Emit(OpCodes.Ldarg_0);
+            il.Emit(OpCodes.Ldfld, eventField);
+            il.Emit(OpCodes.Ldarg_1);
+            il.Emit(OpCodes.Call, _delegateRemoveMethod);
+            il.Emit(OpCodes.Castclass, interfaceEvent.EventHandlerType);
+            il.Emit(OpCodes.Stfld, eventField);
+            il.Emit(OpCodes.Ret);
+
+            eventBuilder.SetRemoveOnMethod(removeMethod);
+            proxyTypeBuilder.DefineMethodOverride(removeMethod, interfaceEvent.RemoveMethod);
+            implementedMethods.Add(interfaceEvent.RemoveMethod);
+        }
+
+        private static void AddMethod(TypeBuilder proxyTypeBuilder, MethodInfo interfaceMethod, MethodInfo baseGetObjectMethod)
+        {
+            var parameters = interfaceMethod.GetParameters().Select(p => p.ParameterType).ToArray();
+            var methodBuilder = proxyTypeBuilder.DefineMethod(interfaceMethod.Name, ExplicitInterfaceMethodAttributes, interfaceMethod.ReturnType, parameters);
+
+            var il = methodBuilder.GetILGenerator();
+
+            il.Emit(OpCodes.Ldarg_0);
+            il.Emit(OpCodes.Call, baseGetObjectMethod);
+
+            for (int i = 0; i < parameters.Length; i++)
+                il.Emit(OpCodes.Ldarg, i + 1);
+
+            il.Emit(OpCodes.Callvirt, interfaceMethod);
+            il.Emit(OpCodes.Ret);
+
+            proxyTypeBuilder.DefineMethodOverride(methodBuilder, interfaceMethod);
+        }
+
+        private static void AddTransferStateOverrideMethod(TypeBuilder proxyTypeBuilder, Type interfaceType, IReadOnlyDictionary<EventInfo, FieldBuilder> eventFields, MethodInfo baseTransferStateMethod)
+        {
+            var transferStateMethod = proxyTypeBuilder.DefineMethod("TransferState", TransferStateAttributes, typeof(void), new[] { interfaceType, interfaceType });

             var il = transferStateMethod.GetILGenerator();

             // Event handlers from the old object need to be copied to the new one.
-            foreach (var evt in type.GetAllEvents())
+            foreach (var evt in interfaceType.GetAllEvents())
             {
-                eventFields.Add(evt, typeBuilder.DefineField($"_{evt.DeclaringType.FullName.Replace(".", "_")}_{evt.Name}", evt.EventHandlerType, FieldAttributes.Private));
-
                 il.Emit(OpCodes.Ldarg_2);
                 il.Emit(OpCodes.Ldarg_0);
                 il.Emit(OpCodes.Ldfld, eventFields[evt]);
@@ -144,7 +290,7 @@
             // Special case for when the interface has a read/write property: if the new
             // property value is null and the old property value is not null, then copy
             // the value from old to new.
-            foreach (var property in type.GetAllProperties().Where(p => p.CanRead && p.CanWrite && !p.PropertyType.GetTypeInfo().IsValueType))
+            foreach (var property in interfaceType.GetAllProperties().Where(p => p.CanRead && p.CanWrite && !p.PropertyType.GetTypeInfo().IsValueType))
             {
                 var doNotCopyProperty = il.DefineLabel();

@@ -163,172 +309,33 @@

             il.Emit(OpCodes.Ret);

-            typeBuilder.DefineMethodOverride(transferStateMethod, baseTransferStateMethod);
-        }
-
-        private static void AddConstructor(TypeBuilder typeBuilder, Type type, Type configReloadingProxyType)
-        {
-            var baseConstructor = configReloadingProxyType.GetTypeInfo().GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance)[0];
-
-            var constructorBuilder = typeBuilder.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, new[] { typeof(IConfiguration), typeof(DefaultTypes), typeof(ValueConverters), typeof(Type), typeof(string) });
-
-            var il = constructorBuilder.GetILGenerator();
-
-            // Call base constructor
-            il.Emit(OpCodes.Ldarg_0);
-            il.Emit(OpCodes.Ldarg_1);
-            il.Emit(OpCodes.Ldarg_2);
-            il.Emit(OpCodes.Ldarg_3);
-            il.Emit(OpCodes.Ldarg_S, 4);
-            il.Emit(OpCodes.Ldarg_S, 5);
-            il.Emit(OpCodes.Call, baseConstructor);
-            il.Emit(OpCodes.Ret);
-        }
-
-        private static void AddProperty(TypeBuilder typeBuilder, PropertyInfo property, MethodInfo getObject)
-        {
-            var parameters = property.GetIndexParameters().Select(p => p.ParameterType).ToArray();
-            var propertyBuilder = typeBuilder.DefineProperty(property.Name, PropertyAttributes.HasDefault, property.PropertyType, parameters);
-
-            if (property.CanRead)
-            {
-                var getMethodBuilder = typeBuilder.DefineMethod("get_" + property.Name, ExplicitInterfaceImplementation, property.PropertyType, parameters);
-
-                var il = getMethodBuilder.GetILGenerator();
-
-                il.Emit(OpCodes.Ldarg_0);
-                il.Emit(OpCodes.Call, getObject);
-                for (int i = 0; i < parameters.Length; i++)
-                    il.Emit(OpCodes.Ldarg, i + 1);
-                il.Emit(OpCodes.Callvirt, property.GetMethod);
-                il.Emit(OpCodes.Ret);
-
-                propertyBuilder.SetGetMethod(getMethodBuilder);
-                typeBuilder.DefineMethodOverride(getMethodBuilder, property.GetMethod);
-            }
-
-            if (property.CanWrite)
-            {
-                var setMethodBuilder = typeBuilder.DefineMethod("set_" + property.Name, ExplicitInterfaceImplementation, typeof(void), parameters.Concat(new[] { property.PropertyType }).ToArray());
-                var il = setMethodBuilder.GetILGenerator();
-
-                il.Emit(OpCodes.Ldarg_0);
-                il.Emit(OpCodes.Call, getObject);
-                il.Emit(OpCodes.Ldarg_1);
-                for (int i = 0; i < parameters.Length; i++)
-                    il.Emit(OpCodes.Ldarg, i + 2);
-                il.Emit(OpCodes.Callvirt, property.SetMethod);
-                il.Emit(OpCodes.Ret);
-
-                propertyBuilder.SetSetMethod(setMethodBuilder);
-                typeBuilder.DefineMethodOverride(setMethodBuilder, property.SetMethod);
-            }
-        }
-
-        private static void AddMethod(TypeBuilder typeBuilder, MethodInfo method, MethodInfo getObject)
-        {
-            var parameters = method.GetParameters().Select(p => p.ParameterType).ToArray();
-            var methodBuilder = typeBuilder.DefineMethod(method.Name, ExplicitInterfaceImplementation, method.ReturnType, parameters);
-
-            var il = methodBuilder.GetILGenerator();
-
-            il.Emit(OpCodes.Ldarg_0);
-            il.Emit(OpCodes.Call, getObject);
-
-            for (int i = 0; i < parameters.Length; i++)
-                il.Emit(OpCodes.Ldarg, i + 1);
-
-            il.Emit(OpCodes.Callvirt, method);
-            il.Emit(OpCodes.Ret);
-
-            typeBuilder.DefineMethodOverride(methodBuilder, method);
-        }
-
-        private static void AddEvent(TypeBuilder typeBuilder, EventInfo evt, MethodInfo getObject, Dictionary<EventInfo, FieldBuilder> eventFields)
-        {
-            var eventField = eventFields[evt];
-
-            var parameters = new[] { evt.EventHandlerType };
-
-            var eventBuilder = typeBuilder.DefineEvent(evt.Name, evt.Attributes, evt.EventHandlerType);
-            var addMethod = typeBuilder.DefineMethod(evt.AddMethod.Name, ExplicitInterfaceImplementation, typeof(void), parameters);
-            var removeMethod = typeBuilder.DefineMethod(evt.RemoveMethod.Name, ExplicitInterfaceImplementation, typeof(void), parameters);
-
-            var il = addMethod.GetILGenerator();
-
-            // Add the event handler to _object's event
-            il.Emit(OpCodes.Ldarg_0);
-            il.Emit(OpCodes.Call, getObject);
-            il.Emit(OpCodes.Ldarg_1);
-            il.Emit(OpCodes.Callvirt, evt.AddMethod);
-
-            // Add the event handler to the event's "tracking" field
-            il.Emit(OpCodes.Ldarg_0);
-            il.Emit(OpCodes.Ldarg_0);
-            il.Emit(OpCodes.Ldfld, eventField);
-            il.Emit(OpCodes.Ldarg_1);
-            il.Emit(OpCodes.Call, _delegateCombineMethod);
-            il.Emit(OpCodes.Castclass, evt.EventHandlerType);
-            il.Emit(OpCodes.Stfld, eventField);
-            il.Emit(OpCodes.Ret);
-
-            eventBuilder.SetAddOnMethod(addMethod);
-            typeBuilder.DefineMethodOverride(addMethod, evt.AddMethod);
-
-            il = removeMethod.GetILGenerator();
-
-            // Remove the event handler from _object's event
-            il.Emit(OpCodes.Ldarg_0);
-            il.Emit(OpCodes.Call, getObject);
-            il.Emit(OpCodes.Ldarg_1);
-            il.Emit(OpCodes.Callvirt, evt.RemoveMethod);
-
-            // Remove the event handler from the event's "tracking" field
-            il.Emit(OpCodes.Ldarg_0);
-            il.Emit(OpCodes.Ldarg_0);
-            il.Emit(OpCodes.Ldfld, eventField);
-            il.Emit(OpCodes.Ldarg_1);
-            il.Emit(OpCodes.Call, _delegateRemoveMethod);
-            il.Emit(OpCodes.Castclass, evt.EventHandlerType);
-            il.Emit(OpCodes.Stfld, eventField);
-            il.Emit(OpCodes.Ret);
-
-            eventBuilder.SetRemoveOnMethod(removeMethod);
-            typeBuilder.DefineMethodOverride(removeMethod, evt.RemoveMethod);
-        }
-
-        private static IEnumerable<PropertyInfo> GetAllProperties(this Type type)
-        {
-            return type.GetTypeInfo().GetProperties().Concat(type.GetTypeInfo().GetInterfaces().SelectMany(i => i.GetTypeInfo().GetProperties()));
-        }
-
-        private static IEnumerable<MethodInfo> GetAllMethods(this Type type)
-        {
-            return type.GetTypeInfo().GetMethods().Concat(type.GetTypeInfo().GetInterfaces().SelectMany(i => i.GetTypeInfo().GetMethods()));
-        }
-
-        private static IEnumerable<EventInfo> GetAllEvents(this Type type)
-        {
-            return type.GetTypeInfo().GetEvents().Concat(type.GetTypeInfo().GetInterfaces().SelectMany(i => i.GetTypeInfo().GetEvents()));
-        }
-
-        private static bool ShouldAdd(MethodInfo method, Type type)
-        {
-            if (method.Name.StartsWith("add_") || method.Name.StartsWith("remove_"))
-            {
-                var events = type.GetAllEvents();
-                if (events.Any(e => e.AddMethod == method || e.RemoveMethod == method))
-                    return false;
-            }
-            if (method.Name.StartsWith("get_") || method.Name.StartsWith("set_"))
-            {
-                var properties = type.GetAllProperties();
-                if (properties.Any(p => p.GetMethod == method || p.SetMethod == method))
-                    return false;
-            }
-            if (method == _disposeMethod)
-                return false;
-            return true;
-        }
+            proxyTypeBuilder.DefineMethodOverride(transferStateMethod, baseTransferStateMethod);
+        }
+
+        private static CreateProxyDelegate CompileFactoryMethod(TypeInfo proxyType)
+        {
+            var constructor = proxyType.GetConstructors()[0];
+
+            var sectionParameter = Expression.Parameter(typeof(IConfiguration), "section");
+            var defaultTypesParameter = Expression.Parameter(typeof(DefaultTypes), "defaultTypes");
+            var valueConvertersParameter = Expression.Parameter(typeof(ValueConverters), "valueConverters");
+            var declaringTypeParameter = Expression.Parameter(typeof(Type), "declaringType");
+            var memberNameParameter = Expression.Parameter(typeof(string), "memberName");
+
+            var lambda = Expression.Lambda<CreateProxyDelegate>(
+                Expression.New(constructor, sectionParameter, defaultTypesParameter, valueConvertersParameter, declaringTypeParameter, memberNameParameter),
+                sectionParameter, defaultTypesParameter, valueConvertersParameter, declaringTypeParameter, memberNameParameter);
+
+            return lambda.Compile();
+        }
+
+        private static IEnumerable<PropertyInfo> GetAllProperties(this Type type) =>
+            type.GetTypeInfo().GetProperties().Concat(type.GetTypeInfo().GetInterfaces().SelectMany(i => i.GetTypeInfo().GetProperties()));
+
+        private static IEnumerable<MethodInfo> GetAllMethods(this Type type) =>
+            type.GetTypeInfo().GetMethods().Concat(type.GetTypeInfo().GetInterfaces().SelectMany(i => i.GetTypeInfo().GetMethods()));
+
+        private static IEnumerable<EventInfo> GetAllEvents(this Type type) =>
+            type.GetTypeInfo().GetEvents().Concat(type.GetTypeInfo().GetInterfaces().SelectMany(i => i.GetTypeInfo().GetEvents()));
     }
 }


Inactive rule adjustment

Inactive rule adjustment

--- SS.Integration.Adapter/MarketRules/InactiveMarketsFilteringRule.cs
+++ SS.Integration.Adapter/MarketRules/InactiveMarketsFilteringRule.cs
@@ -50,14 +50,11 @@

             var inactiveMarkets = Fixture.Markets.Where(
-                m => (OldState != null && OldState.HasMarket(m.Id))
-                        && (!m.IsActive && !OldState[m.Id].IsActive)
-                        && m.IsResulted == OldState[m.Id].IsResulted
-                    );
+                m => (OldState != null && OldState.HasMarket(m.Id) && OldState[m.Id].IsEqualTo(NewState[m.Id]))
+                        && (!m.IsActive && !OldState[m.Id].IsActive));

             foreach (var market in inactiveMarkets.ToList())
             {
-
                 var marketState = OldState[market.Id];
                 var nextState = NewState[market.Id];


Ported internal class

Ported internal class

--- SemaphoreSlimBenchmark/src/SemaphoreSlimBenchmark/SemaphoreSlim.cs
+++ SemaphoreSlimBenchmark/src/SemaphoreSlimBenchmark/SemaphoreSlim.cs
@@ -912,4 +912,24 @@
         }
         #endregion
     }
+
+    internal static class TimeoutHelper
+    {
+        public static uint GetTime()
+        {
+            return (uint)Environment.TickCount;
+        }
+
+        public static int UpdateTimeOut(uint startTime, int originalWaitMillisecondsTimeout)
+        {
+            uint num1 = TimeoutHelper.GetTime() - startTime;
+            if (num1 > (uint)int.MaxValue)
+                return 0;
+            int num2 = originalWaitMillisecondsTimeout - (int)num1;
+            if (num2 <= 0)
+                return 0;
+            return num2;
+        }
+    }
+
 }


fix(*): preserves character sets

fix(*): preserves character sets

--- src/GitIgnorer/GitIgnoreCompiler.cs
+++ src/GitIgnorer/GitIgnoreCompiler.cs
@@ -51,6 +51,7 @@
         private static string PrepareRegex(GitIgnorePattern pattern)
         {
             return Regex.Escape(pattern.Pattern)
+                .Replace("\\[", "[")
                 .Replace("/\\*\\*/", "((/.*?/)|/)")
                 .Replace("\\\\", "(\\\\|/)")
                 .Replace("/", "(\\\\|/)")


debug

debug

--- src/GraphicObjects/GraphicObject.cs
+++ src/GraphicObjects/GraphicObject.cs
@@ -1163,7 +1163,7 @@
 				onMouseEnter (this, e);
 			}

-			this.onMouseMove (this, e);
+			this.onMouseMove (this, e);//without this, window border doesn't work, should be removed
 		}
 		public virtual void onMouseMove(object sender, MouseMoveEventArgs e)
 		{


added comment.

added comment.

--- src/GriklyApi.Portable/GriklyApi.cs
+++ src/GriklyApi.Portable/GriklyApi.cs
@@ -75,6 +75,7 @@
                 }
                 catch(WebException webException)
                 {
+                    //Catch the exeption here and return properly formatted model.
                     using (WebResponse response = webException.Response)
                     {
                         HttpWebResponse httpResponse = (HttpWebResponse)response;


Added missing ctor on fast hid device.

Added missing ctor on fast hid device.

--- src/HidLibrary/HidFastReadDevice.cs
+++ src/HidLibrary/HidFastReadDevice.cs
@@ -1,12 +1,10 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace HidLibrary
+namespace HidLibrary
 {
     public class HidFastReadDevice : HidDevice
-    {
+    {
+        internal HidFastReadDevice(string devicePath, string description = null)
+             : base(devicePath, description) { }
+
         // FastRead assumes that the device is connected,
         // which could cause stability issues if hardware is
         // disconnected during a read


GoTo - Fixed loading wrong vessel. (#262)

--- src/Kerbalism/Utility/GotoVessel.cs
+++ src/Kerbalism/Utility/GotoVessel.cs
@@ -5,9 +5,8 @@
 		[KSPField(isPersistant = true)] public static int version = 0;
 		public static void JumpToVessel(Vessel v)
 		{
-			int _idx = HighLogic.CurrentGame.flightState.protoVessels.FindLastIndex(pv => pv.vesselID == v.id);
+			string _saveGame = GamePersistence.SaveGame("Goto_" + version.ToString(), HighLogic.SaveFolder, SaveMode.OVERWRITE);

-			string _saveGame = GamePersistence.SaveGame("Goto_" + version.ToString(), HighLogic.SaveFolder, SaveMode.OVERWRITE);
 			// Keep until 3 backups of Goto
 			if (version++ > 3) version = 0;

@@ -17,6 +16,8 @@
 			}
 			else
 			{
+				int _idx = HighLogic.CurrentGame.flightState.protoVessels.FindLastIndex(pv => pv.vesselID == v.id);
+
 				if (_idx != -1)
 				{
 					FlightDriver.StartAndFocusVessel(_saveGame, _idx);


Added missing extensions to .NET Standard 1.6

--- src/Lime.Protocol/UtilExtensions.cs
+++ src/Lime.Protocol/UtilExtensions.cs
@@ -11,7 +11,7 @@
 using System.Threading.Tasks;
 using Lime.Protocol.Network;

-#if NET461
+#if !NETSTANDARD1_1
 using System.Text.RegularExpressions;
 using System.Security.Cryptography;
 using System.Security.Cryptography.X509Certificates;
@@ -171,7 +171,7 @@
             return cts.Token;
         }

-#if NET461
+#if !NETSTANDARD1_1
         /// <summary>
         /// Gets the identity value from the certificate subject.
         /// </summary>
@@ -233,7 +233,7 @@
             return values.Aggregate((a, b) => string.Format("{0},{1}", a, b)).TrimEnd(',');
         }

-#if NET461
+#if !NETSTANDARD1_1
         /// <summary>
         /// Gets a SHA1 hash for the specified string.
         /// </summary>


Comment

Comment

--- src/Miningcore/AutoMapperProfile.cs
+++ src/Miningcore/AutoMapperProfile.cs
@@ -14,6 +14,7 @@

     public AutoMapperProfile()
     {
+        // Fix for Automapper 11 which chokes on recursive objects such as JToken
         CreateMap<JToken, JToken>().ConvertUsing(x=> x);

         //////////////////////


Making all resolvers properties instead of fields

--- src/NodaTime/TimeZones/Resolvers.cs
+++ src/NodaTime/TimeZones/Resolvers.cs
@@ -45,7 +45,7 @@
         /// A <see cref="SkippedTimeResolver"/> which returns the final tick of the time zone interval
         /// before the "gap".
         /// </summary>
-        public static readonly SkippedTimeResolver ReturnEndOfIntervalBefore = (local, zone, before, after) =>
+        public static SkippedTimeResolver ReturnEndOfIntervalBefore { get; } = (local, zone, before, after) =>
         {
             Preconditions.CheckNotNull(zone, nameof(zone));
             Preconditions.CheckNotNull(before, nameof(before));
@@ -58,7 +58,7 @@
         /// A <see cref="SkippedTimeResolver"/> which returns the first tick of the time zone interval
         /// after the "gap".
         /// </summary>
-        public static readonly SkippedTimeResolver ReturnStartOfIntervalAfter = (local, zone, before, after) =>
+        public static SkippedTimeResolver ReturnStartOfIntervalAfter { get; } = (local, zone, before, after) =>
         {
             Preconditions.CheckNotNull(zone, nameof(zone));
             Preconditions.CheckNotNull(before, nameof(before));
@@ -70,7 +70,7 @@
         /// A <see cref="SkippedTimeResolver"/> which shifts values in the "gap" forward by the duration
         /// of the gap (which is usually 1 hour).
         /// </summary>
-        public static readonly SkippedTimeResolver ReturnForwardShifted = (local, zone, before, after) =>
+        public static SkippedTimeResolver ReturnForwardShifted { get; } = (local, zone, before, after) =>
         {
             Preconditions.CheckNotNull(zone, nameof(zone));
             Preconditions.CheckNotNull(before, nameof(before));
@@ -82,7 +82,7 @@
         /// <summary>
         /// A <see cref="SkippedTimeResolver"/> which simply throws a <see cref="SkippedTimeException"/>.
         /// </summary>
-        public static readonly SkippedTimeResolver ThrowWhenSkipped = (local, zone, before, after) =>
+        public static SkippedTimeResolver ThrowWhenSkipped { get; } = (local, zone, before, after) =>
         {
             Preconditions.CheckNotNull(zone, nameof(zone));
             Preconditions.CheckNotNull(before, nameof(before));