private void openFileButton_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = appTexts.ParameterName(102); if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { EventlogViewerForm elvf = new EventlogViewerForm(ofd.FileName, appTexts); elvf.Show(); loadEventButton.Enabled = true; } }
private void loadSensorPanelBtn_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); // ofd.Filter = appTexts.ParameterName(102); if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { List <ushort[]> loadEventDataPanel = new List <ushort[]>(); FileStream fs = new FileStream(ofd.FileName, FileMode.Open); StreamReader sr = new StreamReader(fs); try { for (int i1 = 0; i1 < systemConfiguration.EventCount; i1++) { ushort[] us = new ushort[systemConfiguration.EventBlockCount * 32]; for (int i2 = 0; i2 < us.Length; i2++) { us[i2] = (ushort)ConvertFuncs.StrToShort(sr.ReadLine()); } loadEventDataPanel.Add(us); } fs.Close(); sr.Close(); } catch { MessageBox.Show(appTexts.ParameterName(110), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } SaveFileDialog sfd = new SaveFileDialog(); sfd.DefaultExt = "*.xml"; sfd.Filter = appTexts.ParameterName(102); sfd.FileName = DateTime.Now.Day.ToString("D2") + "." + DateTime.Now.Month.ToString("D2") + "." + DateTime.Now.Year.ToString("D4") + " " + DateTime.Now.Hour.ToString("D2") + "." + DateTime.Now.Minute.ToString("D2") + "." + DateTime.Now.Second.ToString("D2") + " (" + appTexts.ParameterName(99) + ")"; if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { EventLogFile eventLogFile = new EventLogFile(systemConfiguration, appTexts, loadEventDataPanel); eventLogFile.CreateEventlogXMLFile(sfd.FileName); EventlogViewerForm elvf = new EventlogViewerForm(sfd.FileName, appTexts); elvf.Show(); } } }
private void LoadingComplete(bool Result) { if (Result) { if (!this.Visible) { return; } EventLogFile eventLogFile = new EventLogFile(systemConfiguration, appTexts, eventLogLoader.EventData); eventLogFile.CreateEventlogXMLFile(fileName); EventlogViewerForm elvf = new EventlogViewerForm(fileName, appTexts); elvf.Show(); loadEventButton.Enabled = true; } else { MessageBox.Show(appTexts.ParameterName(101), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); loadEventButton.Enabled = true; } }