private void loadToolStripMenuItem_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { ParsLogPlot.MainForm mf = new ParsLogPlot.MainForm("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + openFileDialog1.FileName); mf.MdiParent = this; mf.Text = openFileDialog1.FileName; mf.Tag = openFileDialog1.FileName; mf.Show(); } }
private void newToolStripMenuItem1_Click(object sender, EventArgs e) { if (saveFileDialog1.ShowDialog() == DialogResult.OK) { // logplotDataSet1.BeginInit using (FileStream sw = File.Create( saveFileDialog1.FileName)) { // Add some text to the file. //Application.ExecutablePath //ResourceManager rm = sw.Write(Resources.template, 0, Resources.template.Length); sw.Flush(); sw.Close(); } ParsLogPlot.MainForm mf = new ParsLogPlot.MainForm("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + saveFileDialog1.FileName); mf.MdiParent = this; mf.Text = saveFileDialog1.FileName; mf.Tag = saveFileDialog1.FileName; mf.Show(); } }
private void saveToolStripMenuItem_Click(object sender, EventArgs e) { ((ParsLogPlot.MainForm)this.ActiveMdiChild).SaveData(); if (saveFileDialog1.ShowDialog() == DialogResult.OK) try { string source = this.ActiveMdiChild.Tag.ToString(); File.Copy(source, saveFileDialog1.FileName, true); this.ActiveMdiChild.Close(); ParsLogPlot.MainForm mf = new ParsLogPlot.MainForm("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + saveFileDialog1.FileName); mf.MdiParent = this; mf.Text = saveFileDialog1.FileName; mf.Tag = saveFileDialog1.FileName; mf.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }