public static frmFileConversion GetChildInstance(ConversionType fileType) { if (m_SChildform == null) { m_SChildform = new frmFileConversion(fileType); } return m_SChildform; }
private void CreateFileConversionWindow(ConversionType type) { switch (type) { case ConversionType.GP2ToGPS: gP2GPSToolStripMenuItem.Enabled = true; binGPSToolStripMenuItem.Enabled = false; gPSNMEAToolStripMenuItem.Enabled = false; NMEAtoGPStoolStripMenuItem.Enabled = false; gPSToKMLToolStripMenuItem.Enabled = false; break; case ConversionType.BinToGPS_GP2: gP2GPSToolStripMenuItem.Enabled = false; binGPSToolStripMenuItem.Enabled = true; gPSNMEAToolStripMenuItem.Enabled = false; NMEAtoGPStoolStripMenuItem.Enabled = false; gPSToKMLToolStripMenuItem.Enabled = false; break; case ConversionType.GPSToNMEA: gP2GPSToolStripMenuItem.Enabled = false; binGPSToolStripMenuItem.Enabled = false; gPSNMEAToolStripMenuItem.Enabled = true; NMEAtoGPStoolStripMenuItem.Enabled = false; gPSToKMLToolStripMenuItem.Enabled = false; break; case ConversionType.GPSToKML: gP2GPSToolStripMenuItem.Enabled = false; binGPSToolStripMenuItem.Enabled = false; gPSNMEAToolStripMenuItem.Enabled = false; NMEAtoGPStoolStripMenuItem.Enabled = false; gPSToKMLToolStripMenuItem.Enabled = true; break; case ConversionType.NMEAToGPS: gP2GPSToolStripMenuItem.Enabled = false; binGPSToolStripMenuItem.Enabled = false; gPSNMEAToolStripMenuItem.Enabled = false; NMEAtoGPStoolStripMenuItem.Enabled = true; gPSToKMLToolStripMenuItem.Enabled = false; break; default: gP2GPSToolStripMenuItem.Enabled = true; binGPSToolStripMenuItem.Enabled = true; gPSNMEAToolStripMenuItem.Enabled = true; NMEAtoGPStoolStripMenuItem.Enabled = true; gPSToKMLToolStripMenuItem.Enabled = true; break; } frmFileConversion childInstance = null; childInstance = frmFileConversion.GetChildInstance(type); if (childInstance.IsDisposed) { childInstance = new frmFileConversion(type); } childInstance.BringToFront(); childInstance.updateParent += new frmFileConversion.updateParentEventHandler(updateFileCovAvail); childInstance.MdiParent = this; childInstance.Show(); }
private void fileConversionClosing() { this._abort = true; this._conversionStatus = false; m_SChildform = null; this.saveNExit(); }