internal CustomUIEventArgs(UIMode uiMode, SerializableException exception, Report report) { UIMode = uiMode; Report = report; Exception = exception; Result = new UIDialogResult(ExecutionFlow.BreakExecution, SendReport.DoNotSend); }
public UIDialogResult CheckHit(int x, int y) { UIDialogResult code = UIDialogResult.None; switch (Type) { case UIDialogType.Confirm: if (btnYes.CheckHit(x, y)) { code = UIDialogResult.Yes; } else if (btnNo.CheckHit(x, y)) { code = UIDialogResult.No; } btnYes.Visible = btnNo.Visible = false; break; case UIDialogType.Message: if (btnOk.CheckHit(x, y)) { code = UIDialogResult.Ok; } btnOk.Visible = false; break; } return(code); }
private void SendAndQuitButton_Click(object sender, EventArgs e) { if (DialogResult.No == MessageBox.Show(this, @"Give as much as information as possible please to help the developers solve this issue. Otherwise, your issue ticket may be closed without any follow-up from the developers. Because of this, make sure to fill in all the fields in the report template please. Send report anyway?", "Error Report", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2)) { return; } string url = UrlBuilder.Build("https://github.com/gitextensions/gitextensions/issues/new", _lastException.OriginalException, descriptionTextBox.Text); Process.Start(url); _uiDialogResult = new UIDialogResult(ExecutionFlow.BreakExecution, SendReport.DoNotSend); Close(); }
private void QuitButton_Click(object sender, EventArgs e) { this.uiDialogResult = new UIDialogResult(ExecutionFlow.BreakExecution, SendReport.Send); this.Close(); }
private void QuitButton_Click(object sender, EventArgs e) { _uiDialogResult = new UIDialogResult(ExecutionFlow.BreakExecution, true); Close(); }
private void ContinueButton_Click(object sender, EventArgs e) { _uiDialogResult = new UIDialogResult(ExecutionFlow.ContinueExecution, true); Close(); }
public void CheckHit(int x, int y) { if (confirmDialog.Visible) { UIDialogResult resultCode = confirmDialog.CheckHit(x, y); if (resultCode == UIDialogResult.None) { return; } if (resultCode == UIDialogResult.Yes) { _scheduledCommand = confirmDialog.CommandCode; SlideDown(); } confirmDialog.FadeOut(); return; } _scheduledCommand = COMMAND_NONE; btnReset.Active = btnSolution.Active = btnAbandon.Active = btnMain.Active = false; if (_state != QuickMenuState.Show) { return; } if (recMusic.Contains(x, y)) { SoundController.GetInstance().ToggleMusic(); return; } if (recSound.Contains(x, y)) { SoundController.GetInstance().ToggleSound(); return; } if (btnReset.CheckHit(x, y)) { _scheduledCommand = COMMAND_RESET; SlideDown(); return; } if (btnSolution.CheckHit(x, y)) { if (_parent.HintPoint - PlayScene.SOLUTION_COST < 0) { confirmDialog.Title = Localize.Instance.SolutionWarning; confirmDialog.Content = string.Format(Localize.Instance.SolutionWarningDescription, _parent.HintPoint, PlayScene.SOLUTION_COST); btnSolution.Active = false; confirmDialog.FadeIn(UIDialogType.Message); } else { confirmDialog.Title = Localize.Instance.SolutionConfirm; confirmDialog.Content = string.Format(Localize.Instance.SolutionConfirmDescription, _parent.HintPoint, PlayScene.SOLUTION_COST); confirmDialog.CommandCode = COMMAND_SOLUTION; confirmDialog.FadeIn(UIDialogType.Confirm); } return; } if (btnAbandon.CheckHit(x, y)) { confirmDialog.Title = Localize.Instance.AbandonConfirm; confirmDialog.Content = Localize.Instance.AbandonConfirmDescription; confirmDialog.CommandCode = COMMAND_ABANDON; confirmDialog.FadeIn(UIDialogType.Confirm); return; } if (btnMain.CheckHit(x, y)) { _scheduledCommand = COMMAND_MAIN; SlideDown(); return; } }
private void SendAndQuitButton_Click(object sender, EventArgs e) { this.uiDialogResult = new UIDialogResult(ExecutionFlow.BreakExecution, SendReport.Send); this.Close(); }
private void ContinueButton_Click(object sender, EventArgs e) { this.uiDialogResult = new UIDialogResult(ExecutionFlow.ContinueExecution, SendReport.Send); this.Close(); }
protected override void pointerReleased(int x, int y) { if (uiDialog.Visible) { UIDialogResult returnCode = uiDialog.CheckHit(x, y); if ((short)returnCode > -1) { uiDialog.FadeOut(); } return; } switch (State) { case LeaderboardState.Fill: if (State == LeaderboardState.Fill) { btnSubmit.Active = false; if (btnSubmit.CheckHit(x, y)) { if (_username.Length < 3 || _username.Length > 14 || _username == DEFAULT_NAME) { uiDialog.Title = Localize.Instance.InvalidName; uiDialog.Content = Localize.Instance.InvalidNameDescription; uiDialog.FadeIn(UIDialogType.Message); } else { State = LeaderboardState.Submit; Leaderboard.SubmitScore(_score, _username, this); } return; } } break; case LeaderboardState.View: if (leftTouching) { if (vtView7.Y > 134 || view7Height < 340) { vTargetLeft = 134; } else if (vtView7.Y < 490 - view7Height) { vTargetLeft = 490 - view7Height; } } else if (rightTouching) { if (vtViewAll.Y > 134 || viewAllHeight < 340) { vTargetRight = 134; } else if (vtViewAll.Y < 490 - viewAllHeight) { vTargetRight = 490 - viewAllHeight; } } leftTouching = rightTouching = false; break; } }
public DummyUserInterface(UIDialogResult awaitedResult) { _awaitedResult = awaitedResult; }
private void Full_Closing(object sender, System.ComponentModel.CancelEventArgs e) { this.uiDialogResult = new UIDialogResult(ExecutionFlow.BreakExecution, SendReport.Send); }
protected override void pointerReleased(int x, int y) { if (confirmDialog.Visible) { UIDialogResult returnCode = confirmDialog.CheckHit(x, y); if ((short)returnCode > -1) { confirmDialog.FadeOut(); switch (confirmDialog.CommandCode) { case COMMAND_QUICKPLAY: gameMode = (returnCode == UIDialogResult.Yes) ? GameMode.Tutorial : GameMode.Classic; _returnMenuAfterTutorial = false; switchState(MenuState.Game); break; case COMMAND_ADVENTURE: case COMMAND_LEADERBOARD: #if WINDOWS_PHONE if (returnCode == UIDialogResult.Yes) { MarketplaceReviewTask marketplace = new MarketplaceReviewTask(); marketplace.Show(); } #endif switchFlag(FLAG_MAIN); break; } } return; } if (recMusic.Contains(x, y)) { SoundController.GetInstance().ToggleMusic(); return; } if (recSound.Contains(x, y)) { SoundController.GetInstance().ToggleSound(); return; } if (_state != MenuState.Active) { return; } foreach (MenuItem menuItem in menuItems) { menuItem.Active = false; } _commandScheduled = COMMAND_NONE; switch (_flag) { case FLAG_MAIN: if (menuItems[0].CheckHit(x, y)) { _commandScheduled = COMMAND_QUICKPLAY; switchState(MenuState.FadeOut); return; } if (menuItems[1].CheckHit(x, y)) { _commandScheduled = COMMAND_ADVENTURE; switchState(MenuState.FadeOut); return; } if (menuItems[2].CheckHit(x, y)) { _commandScheduled = COMMAND_INSTRUCTION; switchState(MenuState.FadeOut); return; } if (menuItems[3].CheckHit(x, y)) { _commandScheduled = COMMAND_LEADERBOARD; switchState(MenuState.FadeOut); return; } break; case FLAG_INSTRUCTION: if (menuItems[0].CheckHit(x, y)) { _commandScheduled = COMMAND_HOWTO; switchState(MenuState.FadeOut); return; } if (menuItems[1].CheckHit(x, y)) { _commandScheduled = COMMAND_TUTORIAL; switchState(MenuState.FadeOut); return; } if (menuItems[2].CheckHit(x, y)) { _commandScheduled = COMMAND_ABOUT; switchState(MenuState.FadeOut); return; } if (menuItems[3].CheckHit(x, y)) { _commandScheduled = COMMAND_MOREAPP; switchState(MenuState.FadeOut); return; } break; } }
protected override void pointerReleased(int x, int y) { if (uiDialog.Visible) { UIDialogResult returnCode = uiDialog.CheckHit(x, y); if ((short)returnCode > -1) { uiDialog.FadeOut(); switch (uiDialog.CommandCode) { case COMMAND_EXIT: if (returnCode == UIDialogResult.Yes) { #if ANDROID if (!Main.IsPremium) { (Main.Activity as MainActivity).DisplayAd(); } SettingHelper.SaveSetting(); Main.Instance.Exit(); #endif #if WINDOWS_PHONE && SILVERLIGHT SettingHelper.SaveSetting(); SoundController.GetInstance().FadeOut(); GamePage.Instance.GotoExitPage(); #endif #if WINDOWS || (WINDOWS_PHONE && !SILVERLIGHT) SettingHelper.SaveSetting(); Main.Instance.Exit(); #endif } break; case COMMAND_BUY: #if WP8 GamePage.Instance.RemoveAd(); #endif #if ANDROID (Main.Activity as MainActivity).RemoveAd(); #endif break; } } return; } if (recMusic.Contains(x, y)) { SoundController.GetInstance().ToggleMusic(); return; } if (recSound.Contains(x, y)) { SoundController.GetInstance().ToggleSound(); return; } if (_flag == FLAG_PRESS) { SwitchFlag(FLAG_MENU); } }