private void btnOK_Click(object sender, EventArgs e)
{
if ((txtImportPath.Text.Length > 0) &&
(!System.IO.Directory.Exists(txtImportPath.Text)))
{
MessageBox.Show("The directory you have selected for import does not exist. Please enter a valid directory.", "Invalid directory", MessageBoxButtons.OK, MessageBoxIcon.Warning);
this.DialogResult = DialogResult.None;
return;
}
if ((radPaintProgram.Checked) &&
(txtPaintProgram.Text.Length > 0) &&
(!System.IO.File.Exists(txtPaintProgram.Text)))
{
MessageBox.Show("The paint program you have selected does not exist. Please select a valid application.", "Invalid file", MessageBoxButtons.OK, MessageBoxIcon.Warning);
this.DialogResult = DialogResult.None;
return;
}
_preferences.TabSize = Convert.ToInt32(udTabWidth.Value);
_preferences.TestGameStyle = (TestGameWindowStyle)cmbTestGameStyle.SelectedIndex;
_preferences.StartupPane = (EditorStartupPane)cmbEditorStartup.SelectedIndex;
_preferences.DefaultImportPath = (radGamePath.Checked ? string.Empty : txtImportPath.Text);
_preferences.MessageBoxOnCompileErrors = (MessageBoxOnCompile)cmbMessageOnCompile.SelectedIndex;
_preferences.IndentUsingTabs = (cmbIndentStyle.SelectedIndex == 1);
_preferences.ShowViewPreviewByDefault = chkAlwaysShowViewPreview.Checked;
_preferences.PaintProgramPath = (radDefaultPaintProgram.Checked ? string.Empty : txtPaintProgram.Text);
_preferences.DefaultSpriteImportTransparency = (SpriteImportMethod)cmbSpriteImportTransparency.SelectedIndex;
_preferences.ExplicitNewGamePath = (radNewGameMyDocs.Checked ? string.Empty : txtNewGamePath.Text);
_preferences.SendAnonymousStats = chkUsageInfo.Checked;
_preferences.BackupWarningInterval = (chkBackupReminders.Checked ? (int)udBackupInterval.Value : 0);
_preferences.RemapPalettizedBackgrounds = chkRemapBgImport.Checked;
_preferences.KeepHelpOnTop = chkKeepHelpOnTop.Checked;
_preferences.DialogOnMultibleTabsClose = chkPromptDialogOnTabsClose.Checked;
}