Subversion Repositories Code-Repo

Rev

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