private void button_findDateRange_Click(object sender, EventArgs e) { GetOperLogFilenameDlg dlg = new GetOperLogFilenameDlg(); MainForm.SetControlFont(dlg, this.Font, false); dlg.Text = "请指定日志起止日期范围"; dlg.DateRange = this.textBox_dateRange.Text; Program.MainForm.AppInfo.LinkFormState(dlg, "RecoverRecordDialog_state"); dlg.ShowDialog(this); if (dlg.DialogResult == System.Windows.Forms.DialogResult.Cancel) { return; } this.textBox_dateRange.Text = dlg.DateRange; }
private void button_getSingleLogFilename_Click(object sender, EventArgs e) { GetOperLogFilenameDlg dlg = new GetOperLogFilenameDlg(); MainForm.SetControlFont(dlg, this.Font, false); if (String.IsNullOrEmpty(this.textBox_logFileName.Text) == false) dlg.OperLogFilenames.Add(this.textBox_logFileName.Text); dlg.SingleMode = true; dlg.ShowDialog(this); if (dlg.DialogResult != DialogResult.OK) return; // string strText = ""; if (dlg.OperLogFilenames.Count == 1) textBox_logFileName.Text = dlg.OperLogFilenames[0]; else { Debug.Assert(false, ""); } }
// 获得日志文件名 private void button_loadFilenams_Click(object sender, EventArgs e) { int x = 0; int y = 0; API.GetEditCurrentCaretPos( this.textBox_filenames, out x, out y); string strLine = ""; if (this.textBox_filenames.Lines.Length > 0) strLine = this.textBox_filenames.Lines[y]; GetOperLogFilenameDlg dlg = new GetOperLogFilenameDlg(); MainForm.SetControlFont(dlg, this.Font, false); if (String.IsNullOrEmpty(strLine) == false) dlg.OperLogFilenames.Add(strLine); dlg.ShowDialog(this); if (dlg.DialogResult != DialogResult.OK) return; string strText = ""; if (dlg.OperLogFilenames.Count == 1) strText = dlg.OperLogFilenames[0]; else { for (int i = 0; i < dlg.OperLogFilenames.Count; i++) { if (i != 0) strText += "\r\n"; strText += dlg.OperLogFilenames[i]; } } Global.SetLineText(this.textBox_filenames, y, strText); this.textBox_filenames.Focus(); // API.PostMessage(this.Handle, WM_SETCARETPOS, x, y); }
private void button_operLog_setDateRange_Click(object sender, EventArgs e) { GetOperLogFilenameDlg dlg = new GetOperLogFilenameDlg(); MainForm.SetControlFont(dlg, this.Font, false); dlg.Text = "请指定日志起止日期范围"; dlg.DateRange = this.textBox_operLog_dateRange.Text; this.MainForm.AppInfo.LinkFormState(dlg, "GetOperLogFilenameDlg_state"); dlg.ShowDialog(this); if (dlg.DialogResult == System.Windows.Forms.DialogResult.Cancel) return; this.textBox_operLog_dateRange.Text = dlg.DateRange; }