private void btnHandleExistingFile_SetDefault_Click(object sender, EventArgs e) { HandleExistingFilesForm HandleFilesDialog = new HandleExistingFilesForm(HandleExistingFilesForm.FormMode.DefaultSettings, null, null, this._projectManager.ActiveProject.Settings.Common.ExisitingFiles.HandleExistingItem, this._projectManager.ActiveProject.Settings.Common.ExisitingFiles.AddTextToExistingFile, true); if (HandleFilesDialog.ShowDialog() == DialogResult.OK) { this._projectManager.ActiveProject.Settings.Common.ExisitingFiles.AddTextToExistingFile = HandleFilesDialog.ActionAddTextText; this._projectManager.ActiveProject.Settings.Common.ExisitingFiles.HandleExistingItem = HandleFilesDialog.ActionHandleExistingFiles; this.SetExistingFileTextBoxes(HandleFilesDialog); } this.ToggleSettingsChanged(sender, e); }
private void btnHandleExistingFile_SetDefault_Click(object sender, EventArgs e) { HandleExistingFilesForm HandleFilesDialog = new HandleExistingFilesForm(HandleExistingFilesForm.FormMode.DefaultSettings, null, null, (HandleExistingFiles.HowToHandleExistingItem)Settings.Default.ExistingFile_Handle, Settings.Default.ExistingFile_AddText, true); if (HandleFilesDialog.ShowDialog() == DialogResult.OK) { Settings.Default.ExistingFile_AddText = HandleFilesDialog.ActionAddTextText; Settings.Default.ExistingFile_Handle = (int)HandleFilesDialog.ActionHandleExistingFiles; Settings.Default.Save(); this.SetExistingFileTextBoxes(HandleFilesDialog); } }
/// <summary> /// Set existing file text boxes to selected actions /// </summary> /// <param name="handleFilesDialog">Referece form to get text from, if null it will be created</param> private void SetExistingFileTextBoxes(HandleExistingFilesForm handleFilesDialog) { if (handleFilesDialog is null) { handleFilesDialog = new HandleExistingFilesForm(HandleExistingFilesForm.FormMode.DefaultSettings, null, null, (HandleExistingFiles.HowToHandleExistingItem)Settings.Default.ExistingFile_Handle, Settings.Default.ExistingFile_AddText, true); } if (handleFilesDialog.ActionHandleExistingFiles == HandleExistingFiles.HowToHandleExistingItem.AddText) { this.txtAddTextToExistingFileText.Text = handleFilesDialog.ActionAddTextText; this.lblAddTextToExistingFileText.Visible = true; this.txtAddTextToExistingFileText.Visible = true; } else { this.txtAddTextToExistingFileText.Text = string.Empty; this.lblAddTextToExistingFileText.Visible = false; this.txtAddTextToExistingFileText.Visible = false; } this.txtHandleExistingFileText.Text = handleFilesDialog.GetActionAsText(handleFilesDialog.ActionHandleExistingFiles); }