PageRenderTime 52ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/tools/PhyreFly/src/forms/GetWorkingDirForm.cs

https://bitbucket.org/drummertom999/phyreballs
C# | 44 lines | 39 code | 5 blank | 0 comment | 1 complexity | 5e5166f20fb229a82b8922c027b7ac26 MD5 | raw file
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.IO;
  10. namespace PhyreFly
  11. {
  12. public partial class GetWorkingDirForm : Form
  13. {
  14. public GetWorkingDirForm(string initialDir)
  15. {
  16. InitializeComponent();
  17. ui_tb_dir.Text = ui_fbd_browse.SelectedPath = initialDir;
  18. }
  19. #region Form Events
  20. private void ui_btn_browse_Click(object sender, EventArgs e)
  21. {
  22. ui_fbd_browse.ShowDialog();
  23. ui_tb_dir.Text = ui_fbd_browse.SelectedPath;
  24. }
  25. private void ui_btn_ok_Click(object sender, EventArgs e)
  26. {
  27. if (!Directory.Exists(ui_tb_dir.Text))
  28. {
  29. MessageBox.Show("Invalid Directory");
  30. return;
  31. }
  32. DialogResult = DialogResult.OK;
  33. ChosenDirectory = ui_tb_dir.Text;
  34. Close();
  35. }
  36. #endregion
  37. public string ChosenDirectory;
  38. }
  39. }