SECI  1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
AddAssoc.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections;
3 using System.Collections.Generic;
4 using System.ComponentModel;
5 using System.Data;
6 using System.Drawing;
7 using System.Text;
8 using System.Windows.Forms;
9 
10 namespace SeciUserInterface.Dialogs.AssocFiles
11 {
12  public partial class AddFile : Form
13  {
14 
15  public AddFile()
16  {
17  InitializeComponent();
18 
19  }
20 
21  private void btnBrowse_Click(object sender, EventArgs e)
22  {
23  browseDialog.InitialDirectory = Seci.Definitions.Status.LabViewDir;
24  if (browseDialog.ShowDialog() == DialogResult.OK)
25  {
26  txtExe.Text = browseDialog.FileName;
27  }
28  }
29 
30  private void btnAdd_Click(object sender, EventArgs e)
31  {
32  if (!String.IsNullOrEmpty(txtExe.Text))
33  {
34  btnAdd.Enabled = false;
35 
36  if (Seci.Managers.AssocFileMgr.IsDuplicate(txtExe.Text))
37  {
38  MessageBox.Show("The name needs to be unique; a file with this name already exists!", "Not Unique!", MessageBoxButtons.OK, MessageBoxIcon.Error);
39  btnAdd.Enabled = true;
40  }
41  else
42  {
43  Seci.Managers.AssocFileMgr.AddFile(txtExe.Text);
44  DialogResult = DialogResult.OK;
45  Close();
46  }
47  }
48  else
49  {
50  MessageBox.Show("Please enter a name and the path of the file", "Missing Values!", MessageBoxButtons.OK, MessageBoxIcon.Error);
51  }
52  }
53 
54 
55  }
56 }
void btnBrowse_Click(object sender, EventArgs e)
Definition: AddAssoc.cs:21
void btnAdd_Click(object sender, EventArgs e)
Definition: AddAssoc.cs:30