コード例 #1
0
        private void DrivesForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            StamperLiveData.OnDrivesUpdated           -= DrivesUpdated;
            StamperLiveData.OnProjectChanged          -= ProjectChanged;
            StamperLiveData.OnSessionLogChanged       -= SessionLogChanged;
            DriveStamperUI.Instance.OnActivityChanged -= ActivityChanged;

            DriveStamperUI.ShowMessage("Drive Stamper is still running.", ToolTipIcon.Info);
        }
コード例 #2
0
        public static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Instance = new DriveStamperUI();

            Application.Run(Instance);
        }
コード例 #3
0
        public void OpenProject()
        {
            // get filename
            var result = _openDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                // set filename in project
                DriveStamperUI.LoadProject(_openDialog.FileName);
            }
        }
コード例 #4
0
        public void StampDrive(DriveInfo drive)
        {
            try
            {
                if (OnActivityChanged != null)
                {
                    OnActivityChanged(eActivity.Stamping);
                }

                IEnumerable <string> failiures = null;
                bool success = false;

                string msg = "Stamping drive: " + drive.Name;
                StamperLiveData.Log(msg);
                DriveStamperUI.ShowMessage(msg, ToolTipIcon.Info);

                success = Stamper.Stamp(drive, StamperLiveData.Project, out failiures);

                if (success)
                {
                    string msgOk = "Drive stamped: " + drive.Name;
                    StamperLiveData.Log(msgOk);
                    DriveStamperUI.ShowMessage(msgOk, ToolTipIcon.Info);
                }
                else
                {
                    string msgFail = "Drive not succesfully stamped:\n" + string.Join("\n", (failiures ?? new List <string>()).ToArray());
                    StamperLiveData.Log(msgFail);
                    DriveStamperUI.ShowMessage(msgFail, ToolTipIcon.Warning);
                }
            }
            catch (Exception e)
            {
                string msgFail = "Unexpected exception:\n" + e.Message;
                StamperLiveData.Log(msgFail);
                DriveStamperUI.ShowMessage(msgFail, ToolTipIcon.Warning);
            }
            finally
            {
                UpdateDrives();
                if (OnActivityChanged != null)
                {
                    OnActivityChanged(eActivity.None);
                }
            }
        }
コード例 #5
0
 private void NewProjectButton_Click(object sender, EventArgs e)
 {
     DriveStamperUI.LoadProject(null);
 }
コード例 #6
0
 private void EditProjectButton_Click(object sender, EventArgs e)
 {
     DriveStamperUI.ShowProject();
 }