public void InputFileOpenDialogClicked(Object sender, EventArgs e) { if (openFileDialog == null) { openFileDialog = new OpenFileDialog(); openFileDialog.RestoreDirectory = true; if (String.IsNullOrEmpty(name)) { openFileDialog.Title = "Select Input File"; } else { openFileDialog.Title = "Select " + name; } } { String dir = ParameterGuiUtil.FindDirectory(text.Text); if (dir != null) { openFileDialog.InitialDirectory = dir; } } if (openFileDialog.ShowDialog() == DialogResult.OK) { text.Text = openFileDialog.FileName; } }
public override void GenerateTypeControls(TableLayoutPanel tablePanel, Int32 rowIndex) { Label label = new Label(); if (String.IsNullOrEmpty(name)) { label.Text = enumDefinition.Name + ":"; } else { label.Text = name + ":"; } label.TextAlign = ContentAlignment.MiddleRight; tablePanel.Controls.Add(label, 1, rowIndex); comboBox = new ComboBox(); comboBox.DataSource = ParameterGuiUtil.GetEnumStrings(enumDefinition); comboBox.Dock = DockStyle.Fill; tablePanel.Controls.Add(comboBox, 3, rowIndex); if (optionalCheckBox != null) { comboBox.Enabled = false; } }
public void SelectDirectoryDialogClicked(Object sender, EventArgs e) { if (openFileDialog == null) { openFileDialog = new OpenFileDialog(); openFileDialog.RestoreDirectory = true; if (String.IsNullOrEmpty(name)) { openFileDialog.Title = "Select Output Directory"; } else { openFileDialog.Title = "Select " + name; } openFileDialog.ValidateNames = false; openFileDialog.CheckFileExists = false; openFileDialog.CheckPathExists = false; } { String dir = ParameterGuiUtil.FindDirectory(text.Text); if (dir != null) { openFileDialog.InitialDirectory = dir; } } openFileDialog.FileName = SelectFolder; if (openFileDialog.ShowDialog() == DialogResult.OK) { String textString = openFileDialog.FileName; if (textString.EndsWith(SelectFolder)) { text.Text = textString.Remove(textString.Length - 1 - SelectFolder.Length); } else { text.Text = textString; } } }