static void Main(string[] args) { System.Windows.Forms.Application.EnableVisualStyles(); if (LoadConfiguration(args)) { Configuration.Environment = ExecutionEnvironment.WindowsApplication; try { ICommandLine commandLine = new CommandLine(args); MapMainForm M = new MapMainForm(); string mapPath = string.Empty; for (int i = 0; i < commandLine.ArgumentStrings.Length; i++) { if (commandLine.ArgumentStrings[i].IndexOf(".map7", StringComparison.CurrentCultureIgnoreCase) >= 0) { mapPath = commandLine.ArgumentStrings[i].Trim(); } } if (!string.IsNullOrEmpty(mapPath)) { M.SetMap(mapPath); // we can't just open the map here, like we do in the dashboard for canvas files, due to timing issues and such. } //M.SetWhiteBackground(); System.Windows.Forms.Application.Run(M); M = null; /* * * string titleArgument = commandLine.GetArgument("title"); * string projectPath = commandLine.GetArgument("project"); * string viewName = commandLine.GetArgument("view"); * * try * { * Epi.Windows.Enter.EnterMainForm M = new Epi.Windows.Enter.EnterMainForm(); * * if (!string.IsNullOrEmpty(titleArgument)) * { * M.Text = titleArgument; * } * * if (!string.IsNullOrEmpty(projectPath)) * { * Project p = new Project(projectPath); * M.FireOpenViewEvent(p.Views[viewName]); * } * else * { * if (!M.IsDisposed) * { * M.Show(); * if (M.WindowState == FormWindowState.Minimized) * { * M.WindowState = FormWindowState.Normal; * } * M.Activate(); * } * } * * * M = null;*/ } catch (Exception ex) { //MsgBox.ShowError(SharedStrings.WARNING_APPLICATION_RUNNING); MsgBox.ShowError(string.Format("Error: \n {0}", ex.ToString())); } finally { } } }
static void Main(string[] args) { System.Windows.Forms.Application.EnableVisualStyles(); if (LoadConfiguration(args)) { Configuration.Environment = ExecutionEnvironment.WindowsApplication; try { ICommandLine commandLine = new CommandLine(args); MapMainForm M = new MapMainForm(); string mapPath = string.Empty; for (int i = 0; i < commandLine.ArgumentStrings.Length; i++) { if (commandLine.ArgumentStrings[i].IndexOf(".map7", StringComparison.CurrentCultureIgnoreCase) >= 0) { mapPath = commandLine.ArgumentStrings[i].Trim(); } } if (!string.IsNullOrEmpty(mapPath)) { M.SetMap(mapPath); // we can't just open the map here, like we do in the dashboard for canvas files, due to timing issues and such. } //M.SetWhiteBackground(); System.Windows.Forms.Application.Run(M); M = null; /* string titleArgument = commandLine.GetArgument("title"); string projectPath = commandLine.GetArgument("project"); string viewName = commandLine.GetArgument("view"); try { Epi.Windows.Enter.EnterMainForm M = new Epi.Windows.Enter.EnterMainForm(); if (!string.IsNullOrEmpty(titleArgument)) { M.Text = titleArgument; } if (!string.IsNullOrEmpty(projectPath)) { Project p = new Project(projectPath); M.FireOpenViewEvent(p.Views[viewName]); } else { if (!M.IsDisposed) { M.Show(); if (M.WindowState == FormWindowState.Minimized) { M.WindowState = FormWindowState.Normal; } M.Activate(); } } M = null;*/ } catch (Exception ex) { //MsgBox.ShowError(SharedStrings.WARNING_APPLICATION_RUNNING); MsgBox.ShowError(string.Format("Error: \n {0}", ex.ToString())); } finally { } } }