[2] | 1 | #region License Information
|
---|
| 2 | /* HeuristicLab
|
---|
| 3 | * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
| 4 | *
|
---|
| 5 | * This file is part of HeuristicLab.
|
---|
| 6 | *
|
---|
| 7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
| 8 | * it under the terms of the GNU General Public License as published by
|
---|
| 9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
| 10 | * (at your option) any later version.
|
---|
| 11 | *
|
---|
| 12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 15 | * GNU General Public License for more details.
|
---|
| 16 | *
|
---|
| 17 | * You should have received a copy of the GNU General Public License
|
---|
| 18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 19 | */
|
---|
| 20 | #endregion
|
---|
| 21 |
|
---|
| 22 | using System;
|
---|
| 23 | using System.Collections.Generic;
|
---|
| 24 | using System.Windows.Forms;
|
---|
| 25 | using System.Xml;
|
---|
| 26 | using System.Threading;
|
---|
| 27 | using HeuristicLab.PluginInfrastructure;
|
---|
| 28 |
|
---|
| 29 | namespace HeuristicLab {
|
---|
| 30 | static class Program {
|
---|
| 31 | [STAThread]
|
---|
[877] | 32 | static void Main(string[] args) {
|
---|
| 33 | if (args.Length == 0) { // normal mode
|
---|
| 34 | Application.EnableVisualStyles();
|
---|
| 35 | Application.SetCompatibleTextRenderingDefault(false);
|
---|
| 36 | Application.Run(new MainForm());
|
---|
| 37 | } else if (args.Length == 1) { // start specific application
|
---|
| 38 | PluginManager.Manager.Initialize();
|
---|
| 39 |
|
---|
| 40 | ApplicationInfo app = null;
|
---|
| 41 | foreach (ApplicationInfo info in PluginManager.Manager.InstalledApplications) {
|
---|
| 42 | if (info.Name == args[0])
|
---|
| 43 | app = info;
|
---|
| 44 | }
|
---|
| 45 | if (app == null) { // application not found
|
---|
| 46 | MessageBox.Show("Cannot start application.\nApplication " + args[0] + " is not installed.\n\nStarting HeuristicLab in normal mode ...",
|
---|
| 47 | "HeuristicLab",
|
---|
| 48 | MessageBoxButtons.OK,
|
---|
| 49 | MessageBoxIcon.Warning);
|
---|
| 50 | Application.EnableVisualStyles();
|
---|
| 51 | Application.SetCompatibleTextRenderingDefault(false);
|
---|
| 52 | Application.Run(new MainForm());
|
---|
| 53 | } else {
|
---|
| 54 | PluginManager.Manager.Run(app);
|
---|
| 55 | }
|
---|
| 56 | }
|
---|
[2] | 57 | }
|
---|
| 58 | }
|
---|
| 59 | }
|
---|