private void newWindowToolStripMenuItem_Click(object sender, EventArgs e) { MainWindow mw = new MainWindow(); mw.Init(null, false); mw.Show(); }
private static void createAndShowGUI() { bool dump = false, stream = false; System.String loadfn = null; int i = 0; while (i < args.Length) { if (args[i][0] == '-') { if (String.CompareOrdinal(args[i], "-h") == 0 || String.CompareOrdinal(args[i], "--help") == 0) { dump = true; break; } if (String.CompareOrdinal(args[i], "-v") == 0 || String.CompareOrdinal(args[i], "--version") == 0) { dump = true; break; } if (String.CompareOrdinal(args[i], "-s") == 0 || String.CompareOrdinal(args[i], "--stream") == 0) { stream = true; i++; } } else { if (loadfn != null) { dump = true; System.Console.Out.WriteLine("Unexpected parameter: " + args[i]); break; } System.IO.FileInfo f = new System.IO.FileInfo(args[i]); bool tmpBool; if (System.IO.File.Exists(f.FullName)) tmpBool = true; else tmpBool = System.IO.Directory.Exists(f.FullName); if (!tmpBool) { dump = true; System.Console.Out.WriteLine("Expected filename, does not exist: " + args[i]); break; } loadfn = args[i]; i++; } } if (dump) { System.Console.Out.WriteLine("SketchEl: Molecular drawing tool"); System.Console.Out.WriteLine(" Version " + VERSION + " © 2005 Dr. Alex M. Clark"); System.Console.Out.WriteLine(" Open source, released under the Gnu Public License (GPL),"); System.Console.Out.WriteLine(" see www.gnu.org. For home page and documentation, see"); System.Console.Out.WriteLine(" http://sketchel.sf.net\n"); System.Console.Out.WriteLine("Command line parameters:"); System.Console.Out.WriteLine(" -h|--help|-v|--version Show parameters and summary info"); System.Console.Out.WriteLine(" -s|--stream Read from <stdin> at startup, write to"); System.Console.Out.WriteLine(" <stdout> on quit."); System.Console.Out.WriteLine(" filename Open filename on startup."); } else { //UPGRADE_TODO: Method 'java.awt.Component.setVisible' was converted to 'System.Windows.Forms.Control.Visible' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtComponentsetVisible_boolean'" //UPGRADE_TODO: 'System.Windows.Forms.Application.Run' must be called to start a main form. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1135'" MainWindow wnd = new MainWindow(); wnd.Init(loadfn, stream); wnd.Visible = true; } }
//UPGRADE_NOTE: Synchronized keyword was removed from method 'OpenMolecule'. Lock expression was added. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1027'" internal virtual void OpenMolecule(int N) { lock (this) { try { Molecule mol = loader.Get(N); MainWindow mw = new MainWindow(); mw.Init(null, false); mw.SetMolecule(mol); //UPGRADE_TODO: Method 'java.awt.Component.setVisible' was converted to 'System.Windows.Forms.Control.Visible' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtComponentsetVisible_boolean'" //UPGRADE_TODO: 'System.Windows.Forms.Application.Run' must be called to start a main form. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1135'" mw.Visible = true; } catch (System.Exception e) { SupportClass.WriteStackTrace(e, Console.Error); } } }