public void AnimationFactoryWorker(object sender, EventArgs e) { if (!Enabled) { return; } if (CurrentNum <= MAXIMUM_TICK) { this.BackgroundImage = ThereIsConstants.Actions.RotateImage( new Bitmap(Image.FromFile(ThereIsConstants.Path.Datas_Path + ThereIsConstants.Path.DoubleSlash + MyRes.GetString(TheBackGroundNameInRes))), CurrentNum * 0.5f); CurrentNum++; } else { ClosedForRetry = true; if (IsShowingAnotherSandBox) { if (ShowingAnotherSandBox != null && !ShowingAnotherSandBox.IsDisposed) { if (ShowingAnotherSandBox is NoInternetConnectionSandBox) { ShowingAnotherSandBox.FormClosed -= ErrorSandBox_FormClosed; } ShowingAnotherSandBox.Close(); } } Close(); } }
//---------------------------------------------- protected override void OnGotFocus(EventArgs e) { if (IsShowingAnotherSandBox && ShowingAnotherSandBox != null) { ShowingAnotherSandBox.Focus(); } else { } base.OnGotFocus(e); }
public void SetTheHighestSandBox(SandBoxBase mySandBox) { if (IsShowingAnotherSandBox && ShowingAnotherSandBox != null) { Enabled = false; ShowingAnotherSandBox.Enabled = false; ShowingAnotherSandBox.SetTheHighestSandBox(mySandBox); } else { IsShowingAnotherSandBox = true; ShowingAnotherSandBox = mySandBox; mySandBox.Focus(); } }
public SandBoxBase GetTheHighestSandBox(bool WantMeToFocusThem, bool SetTheEnabledToFalse = true) { if (IsShowingAnotherSandBox && ShowingAnotherSandBox != null) { if (WantMeToFocusThem) { if (MyHallSandBox != null) { MyHallSandBox.Focus(); } Focus(); if (ShowingAnotherSandBox != null) { ShowingAnotherSandBox.Focus(); } } if (SetTheEnabledToFalse && !(ShowingAnotherSandBox is HallSandBox) && Enabled) { Enabled = false; } return(ShowingAnotherSandBox.GetTheHighestSandBox(WantMeToFocusThem)); } else { if (WantMeToFocusThem) { if (MyHallSandBox != null) { MyHallSandBox.Focus(); } Focus(); if (SetTheEnabledToFalse && Enabled) { //Enabled = false; } } return(this); } }