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); }
public static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Instance = new DriveStamperUI(); Application.Run(Instance); }
public void OpenProject() { // get filename var result = _openDialog.ShowDialog(); if (result == DialogResult.OK) { // set filename in project DriveStamperUI.LoadProject(_openDialog.FileName); } }
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); } } }
private void NewProjectButton_Click(object sender, EventArgs e) { DriveStamperUI.LoadProject(null); }
private void EditProjectButton_Click(object sender, EventArgs e) { DriveStamperUI.ShowProject(); }