/tools/PhyreFly/src/forms/GetWorkingDirForm.cs
C# | 44 lines | 39 code | 5 blank | 0 comment | 1 complexity | 5e5166f20fb229a82b8922c027b7ac26 MD5 | raw file
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.IO;
-
- namespace PhyreFly
- {
- public partial class GetWorkingDirForm : Form
- {
- public GetWorkingDirForm(string initialDir)
- {
- InitializeComponent();
- ui_tb_dir.Text = ui_fbd_browse.SelectedPath = initialDir;
- }
-
- #region Form Events
- private void ui_btn_browse_Click(object sender, EventArgs e)
- {
- ui_fbd_browse.ShowDialog();
- ui_tb_dir.Text = ui_fbd_browse.SelectedPath;
- }
-
- private void ui_btn_ok_Click(object sender, EventArgs e)
- {
- if (!Directory.Exists(ui_tb_dir.Text))
- {
- MessageBox.Show("Invalid Directory");
- return;
- }
-
- DialogResult = DialogResult.OK;
- ChosenDirectory = ui_tb_dir.Text;
- Close();
- }
- #endregion
-
- public string ChosenDirectory;
- }
- }