/// <summary> /// Browse button was clicked by user. /// </summary> /// <param name="sender">Sender object</param> /// <param name="e">The params</param> private void OnBrowseButtonClicked(object sender, OpenDialogArgs e) { try { this.explorerPresenter.CommandHistory.Add(new Commands.ChangeProperty(this.model, "FullFileName", e.FileName)); } catch (Exception err) { this.explorerPresenter.MainPresenter.ShowError(err); } }
/// <summary> /// Browse button was clicked by user. /// </summary> private void OnBrowseButtonClicked(object sender, OpenDialogArgs e) { try { ExplorerPresenter.CommandHistory.Add(new Commands.ChangeProperty(FileCrop, "FullFileName", e.FileNames[0])); } catch (Exception err) { ExplorerPresenter.MainPresenter.ShowMessage(err.Message, Simulation.ErrorLevel.Error); } }
/// <summary> /// Shows a mod options dialog now, as if Options was used inside the Mods menu. /// </summary> /// <param name="optionsType">The type of the options to show. The mod to configure, /// configuration directory, and so forth will be retrieved from the provided type. /// This type must be the same type configured in RegisterOptions for the mod.</param> /// <param name="onClose">The method to call when the dialog is closed.</param> public static void ShowDialog(Type optionsType, Action <object> onClose = null) { var args = new OpenDialogArgs(optionsType, onClose); var allOptions = PRegistry.Instance.GetAllComponents(typeof(POptions).FullName); if (allOptions != null) { foreach (var mod in allOptions) { mod?.Process(0, args); } } }
/// <summary> /// Browse button was clicked by user. /// </summary> /// <param name="sender">Sender object</param> /// <param name="e">The params</param> private void OnBrowseButtonClicked(object sender, OpenDialogArgs e) { try { this.explorerPresenter.CommandHistory.Add(new Commands.ChangeProperty(this.model, "FullFileName", e.FileName)); //reset the start year using new SQLite file's data. InitialiseStartYear(); } catch (Exception err) { this.explorerPresenter.MainPresenter.ShowError(err); } }