private void toolBarLogBtnDurationLogMenu_Click(object sender, EventArgs e) { if (this.comm.IsSourceDeviceOpen()) { frmLogDuration duration = new frmLogDuration(this.comm); this.comm.Log.LoggingStatusLabel = this.frmCommOpenLogStatusLabel; this.OpenLoggingFile(this.comm); duration.Show(); this.frmCommOpenUpdateLogBtnImage(); } else { MessageBox.Show("Port not open", "Error logging", MessageBoxButtons.OK, MessageBoxIcon.Hand); } }
private void CreateLogFileWin(ref PortManager target) { if (target != null) { if (!base.IsDisposed) { if (target.comm != null) { if (target.comm.Log.IsFileOpen()) { if (MessageBox.Show(string.Format("{0}: Logging in progress. Proceeding will close the current log.\n\n\t Continue?", target.comm.PortName), "Log File Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { target.comm.Log.CloseFile(); } } else { string str = target.comm.sourceDeviceName + ": Log File"; frmLogDuration duration = new frmLogDuration(target.comm); duration.Text = str; duration.ShowDialog(); } } } else { MessageBox.Show("Port not initialized!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } }