Subversion Repositories Code-Repo

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
9 Kevin 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
 
10
namespace SWAT_Office_App
11
{
12
    public partial class Menu1_Main : Form
13
    {
14
        public Menu1_Main()
15
        {
16
            InitializeComponent();
17
            Settings_Form.ImportSettings();
15 Kevin 18
            this.KeyPress += new KeyPressEventHandler(Menu1_Main_KeyPress);
9 Kevin 19
        }
15 Kevin 20
 
21
        void Menu1_Main_KeyPress(object sender, KeyPressEventArgs e)
22
        {
23
            switch (e.KeyChar)
24
            {
25
                case '1':
41 Kevin 26
                    ManageUserAccounts_Form user_Mgmt = new ManageUserAccounts_Form();
27
                    user_Mgmt.ShowDialog();
28
                    break;
29
                case '2':
30
                    if (!DriveLogger_Form.instanceAlreadyRunning)
31
                    {
32
                        DriveLogger_Form driveForm = new DriveLogger_Form();
33
                        driveForm.Show();
34
                    }
35
                    else
36
                    {
37
                        MessageBox.Show("An instance of DriveLogger is already running");
38
                    }
39
                    break;
40
                case '3':
41
                    if (!Reimage_USB_Drives.threadsRunning)
15 Kevin 42
                        Reimage_USB_Drives.reimageUSBDrives();
43
                    else
44
                    {
45
                        MessageBox.Show("Another file copy operation is currently in progress.\n" +
46
                                        "Please wait for transfer to finish before starting another");
47
                    }
48
                    break;
41 Kevin 49
                case '4':
15 Kevin 50
                    SettingsVerify_Form settingsForm = new SettingsVerify_Form();
51
                    settingsForm.ShowDialog();
52
                    break;
53
                case '?':
54
                    AboutBox aboutForm = new AboutBox();
55
                    aboutForm.ShowDialog();
56
                    break;
57
            }
58
        }
9 Kevin 59
        private void btn_Main_UserMgmt_Click(object sender, EventArgs e)
60
        {
15 Kevin 61
            ManageUserAccounts_Form userMgmtForm = new ManageUserAccounts_Form();
62
            userMgmtForm.ShowDialog();
9 Kevin 63
        }
41 Kevin 64
        private void btn_DriveLogger_Click(object sender, EventArgs e)
65
        {
66
            if (!DriveLogger_Form.instanceAlreadyRunning)
67
            {
68
                DriveLogger_Form driveForm = new DriveLogger_Form();
69
                driveForm.Show();
70
            }
71
            else
72
            {
73
                MessageBox.Show("An instance of DriveLogger is already running");
74
            }
75
        }
9 Kevin 76
        private void btn_Main_Settings_Click(object sender, EventArgs e)
77
        {
15 Kevin 78
            SettingsVerify_Form settingsForm = new SettingsVerify_Form();
79
            settingsForm.ShowDialog();
9 Kevin 80
        }
81
        private void btn_Reimage_USB_Drives_Click(object sender, EventArgs e)
82
        {
41 Kevin 83
            if (!DriveLogger_Form.instanceAlreadyRunning)
9 Kevin 84
                Reimage_USB_Drives.reimageUSBDrives();
85
            else
86
            {
87
                MessageBox.Show("Another file copy operation is currently in progress.\n" +
88
                                "Please wait for transfer to finish before starting another");
89
            }
90
        }
91
    }
92
}