/// <summary> /// Invokes the command. /// </summary> public override void Invoke() { OnInvoking(); ClientApplication client = ClientApplication.Instance; this.optionsControl = client.GetControl(typeof(IOptionsControl)) as IOptionsControl; this.optionsControl.Closed += new EventHandler <ControlClosedEventArgs>(OptionsControlClosed); this.optionsControl.ShowSimilizationControl(); }
void fillSettings() { foreach (XtraTabPage tabPage in xtraTabControl1.TabPages) { IOptionsControl ctrl = tabPage.Controls[0] as IOptionsControl; if (ctrl != null) { ctrl.Fill(); } } }
public void AddOptionsControl(IOptionsControl control) { XtraTabPage tabPage = new XtraTabPage(); tabPage.Text = control.Title; tabPage.Image = control.Image; Control ctrl = (Control)control; ctrl.Dock = DockStyle.Fill; tabPage.Controls.Add(ctrl); xtraTabControl1.TabPages.Add(tabPage); }
void fillSettings() { foreach (ImageSourceListItem <IOptionsControl> tabPage in xtraTabControl1.Items) { IOptionsControl ctrl = tabPage.Value as IOptionsControl; if (ctrl != null) { ctrl.Fill(); } } if (xtraTabControl1.Items.Count > 0) { xtraTabControl1.SelectedIndex = 0; } }
public void AddOptionsControl(IOptionsControl control) { //FIX: strange bug but this solves it var parent = ((Control)control).Parent as ContentControl; if (parent != null) { parent.Content = null; } //end fix var tabItem = new ImageSourceListItem <IOptionsControl>(); tabItem.Text = control.Title; tabItem.Value = control; tabItem.Image = control.Image; xtraTabControl1.Items.Add(tabItem); }
private void okButton1_Click(object sender, EventArgs e) { bool restartRequired = false; foreach (XtraTabPage tabPage in xtraTabControl1.TabPages) { IOptionsControl optionsControl = (IOptionsControl)tabPage.Controls[0]; optionsControl.Save(); if (optionsControl.RestartRequired) { restartRequired = true; } } UserContext.Settings.GuiState.Save(); if (restartRequired) { FMMessageBox.ShowInfo(ApplicationStrings.OptionsRestartRequiredMsg); } }
private void btnOK_Click(object sender, RoutedEventArgs e) { bool restartRequired = false; foreach (ImageSourceListItem <IOptionsControl> tabPage in xtraTabControl1.Items) { IOptionsControl optionsControl = tabPage.Value; optionsControl.Save(); if (optionsControl.RestartRequired) { restartRequired = true; } } UserContext.Current.Settings.GuiState.Save(); if (restartRequired) { BAMessageBox.ShowInfo(Strings.OptionsRestartRequiredMsg); } DialogResult = true; Close(); }