/// <summary> /// When the selected page changes, we update the buttons. Only occurs for suppression. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void rootMultiPanel_SelectionChange(object sender, MultiPanelSelectionChangeEventArgs args) { // When there are useless prereqs, we offer the user to remove them on a second page. // When there aren't any, we just have one page. // Guess whether we're on the final page (2/2 or 1/1) bool isFinal = false; if (rootMultiPanel.SelectedPage == uselessPrereqsSuppressionPage) { isFinal = true; } else { isFinal = (m_operation.RemovablePrerequisites.Count == 0); } // Final page ? if (isFinal) { nextButton.Text = "OK"; nextButton.DialogResult = DialogResult.OK; previousButton.Enabled = true; } else { nextButton.Text = "&Next >"; nextButton.DialogResult = DialogResult.None; previousButton.Enabled = false; } }
/// <summary> /// When the selected page changes, we may have to update the warning about full key. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> void multiPanel_SelectionChange(object sender, MultiPanelSelectionChangeEventArgs e) { if (e.NewPage == null) { return; } // Hides or shows the full key warning. UpdateWarningLabel(); // Stores the setting m_character.UISettings.SelectedPage = e.NewPage.Text; // Update the buttons visibility. toggleSkillsIcon.Visible = (e.NewPage == skillsPage); searchTextBox.Visible = (e.NewPage == ordersPage); ordersGroupMenu.Visible = (e.NewPage == ordersPage); preferencesMenu.Visible = (e.NewPage == ordersPage); }
/// <summary> /// When we switch panels, we update the "next", "previous" and "cancel" buttons. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> void multiPanel_SelectionChange(object sender, MultiPanelSelectionChangeEventArgs args) { if (args.NewPage == credentialsPage) { previousButton.Enabled = false; nextButton.Enabled = true; nextButton.Text = "&Next >"; } else if (args.NewPage == waitingPage) { previousButton.Enabled = true; nextButton.Enabled = false; nextButton.Text = "&Next >"; } else { nextButton.Enabled = !errorGuideLabel.Visible; previousButton.Enabled = true; nextButton.Text = (m_updateMode ? "Update" : "Import"); } }
/// <summary> /// When we switch panels, we update the "next", "previous" and "cancel" buttons. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void MultiPanel_SelectionChange(object sender, MultiPanelSelectionChangeEventArgs args) { if (args.NewPage == CredentialsPage) { ButtonPrevious.Enabled = false; ButtonNext.Enabled = true; ButtonNext.Text = "&Next >"; } else if (args.NewPage == WaitingPage) { ButtonPrevious.Enabled = true; ButtonNext.Enabled = false; ButtonNext.Text = "&Next >"; } else { ButtonPrevious.Enabled = true; ButtonNext.Enabled = ResultsMultiPanel.SelectedPage == CharacterPage; ButtonNext.Text = "&Import"; ButtonNext.Focus(); } }
/// <summary> /// When we switch panels, we update the "next", "previous" and "cancel" buttons. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void MultiPanel_SelectionChange(object sender, MultiPanelSelectionChangeEventArgs args) { UpdateButtons(args?.NewPage ?? MultiPanel.SelectedPage); }
/// <summary> /// When the panel's selection change, notify to the designer the property changed. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> void OnPanelSelectionChange(object sender, MultiPanelSelectionChangeEventArgs args) { RaiseComponentChanging(TypeDescriptor.GetProperties(Control)["SelectedPage"]); RaiseComponentChanged(TypeDescriptor.GetProperties(Control)["SelectedPage"], args.OldPage, args.NewPage); }