public override VizForm Clone() { SerializationHelper sh = new SerializationHelper(); sh.dataBlock = this.GetDataBlock(); sh.graph = new Graph(gd); FileDigitalVizForm avf = new FileDigitalVizForm(sh); avf.MdiParent = MdiParent; avf.Text = Text;// +Parent.childFormNumber++; avf.Init(); avf.Show(); return avf; }
override public VizForm Clone() { SerializationHelper sh = new SerializationHelper(); sh.dataBlock = this.GetDataBlock(); sh.graph = new Graph(gd); FileDigitalVizForm avf = new FileDigitalVizForm(sh); avf.MdiParent = MdiParent; avf.Text = Text;// +Parent.childFormNumber++; avf.Init(); avf.Show(); return(avf); }
private void OpenFile(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal); openFileDialog.Filter = "XML Files (*.xml)|*.xml|Text Files (*.txt)|*.txt|All Files (*.*)|*.*"; if (openFileDialog.ShowDialog(this) == DialogResult.OK) { string fileName = openFileDialog.FileName; FileStream stream = File.Open(fileName, FileMode.Open); SerializationHelper sh = SerializationHelper.LoadXML(stream); stream.Close(); VizForm childForm; if (sh.dataBlock.m_dataType == DataBlock.DATA_TYPE.ANALOG) { childForm = new FileAnalogVizForm(sh); } else if (sh.dataBlock.m_dataType == DataBlock.DATA_TYPE.DIGITAL) { childForm = new FileDigitalVizForm(sh); } else { MessageBox.Show("file not supported"); return; } // Make it a child of this MDI form before showing it. childForm.MdiParent = this; childForm.Text = fileName; childForm.Init(); childForm.Show(); childForm.WindowState = FormWindowState.Maximized; } }
private void OpenFile(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal); openFileDialog.Filter = "XML Files (*.xml)|*.xml|Text Files (*.txt)|*.txt|All Files (*.*)|*.*"; if (openFileDialog.ShowDialog(this) == DialogResult.OK) { string fileName = openFileDialog.FileName; FileStream stream = File.Open(fileName, FileMode.Open); SerializationHelper sh = SerializationHelper.LoadXML(stream); stream.Close(); VizForm childForm; if (sh.dataBlock.m_dataType == DataBlock.DATA_TYPE.ANALOG) { childForm = new FileAnalogVizForm(sh); } else if (sh.dataBlock.m_dataType == DataBlock.DATA_TYPE.DIGITAL) { childForm = new FileDigitalVizForm(sh); } else { MessageBox.Show("file not supported"); return; } // Make it a child of this MDI form before showing it. childForm.MdiParent = this; childForm.Text = fileName; childForm.Init(); childForm.Show(); childForm.WindowState = FormWindowState.Maximized; } }