| 0: | // Main.cs | |
| 1: | // Copyright (c) 2001 Mike Krueger | |
| 2: | // | |
| 3: | // This program is free software; you can redistribute it and/or modify | |
| 4: | // it under the terms of the GNU General Public License as published by | |
| 5: | // the Free Software Foundation; either version 2 of the License, or | |
| 6: | // (at your option) any later version. | |
| 7: | // | |
| 8: | // This program is distributed in the hope that it will be useful, | |
| 9: | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 10: | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 11: | // GNU General Public License for more details. | |
| 12: | // | |
| 13: | // You should have received a copy of the GNU General Public License | |
| 14: | // along with this program; if not, write to the Free Software | |
| 15: | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 16: | ||
| 17: | using System.Drawing; | |
| 18: | using System; | |
| 19: | using System.Windows.Forms; | |
| 20: | using System.Diagnostics; | |
| 21: | using System.Xml; | |
| 22: | using System.Globalization; | |
| 23: | using System.Threading; | |
| 24: | using System.Reflection; | |
| 25: | using SharpDevelop.Tool.Data; | |
| 26: | using SharpDevelop.Tool.Function; | |
| 27: | using SharpDevelop.Gui; | |
| 28: | using SharpDevelop.Actions.Edit; | |
| 29: | using SharpDevelop.Actions.Menu; | |
| 30: | using SharpDevelop.Internal.Text; | |
| 31: | using SharpDevelop.Internal.Project; | |
| 32: | using SharpDevelop.Internal.Modules; | |
| 33: | using SharpDevelop.Internal.Templates; | |
| 34: | using SharpDevelop.Gui.ErrorDialogs; | |
| 35: | using SharpDevelop.Internal.Messages; | |
| 36: | using SharpDevelop.Internal.Messages.Standard; | |
| 37: | using SharpDevelop.Gui.Edit.Text.CodeCompletion; | |
| 38: | ||
| 39: | namespace SharpDevelop { | |
| 40: | ||
| 41: | /// <summary> | |
| 42: | /// This Class is the SharpDevelop main class, it starts the program. | |
| 43: | /// </summary> | |
| 44: | public class SharpDevelopMain | |
| 45: | { | |
| 46: | public const string VERSION = "0.85"; | |
| 47: | public const string BUILD = "09:08 12/01/2001"; | |
| 48: | ||
| 49: | public static EventHandler InitComplete; | |
| 50: | ||
| 51: | [STAThreadAttribute] | |
| 52: | public static void Main(string[] args) | |
| 53: | { | |
| 54: | MainWindow mainwindow = null; | |
| 55: | ||
| 56: | try { | |
| 57: | // load some stuff | |
| 58: | Options.LoadOptions(); | |
| 59: | ToolLoader.LoadTools(); | |
| 60: | ||
| 61: | TextTemplate.LoadTextTemplates(); | |
| 62: | CodeTemplateLoader.LoadTemplates(); | |
| 63: | ProjectTemplate.LoadProjectTemplates(); | |
| 64: | FileTemplate.LoadFileTemplates(); | |
| 65: | LanguageDefinition.LoadLanguageDefinitions(); | |
| 66: | ||
| 67: | EditActionLoader.LoadEditActions(); | |
| 68: | Syntax.LoadSyntaxDefinitions(); | |
| 69: | FontContainer.LoadFonts(); | |
| 70: | ModuleManager.LoadModules(); | |
| 71: | FileUtility.LoadImageList(); // ProjectManager MUST load the language information before the fileutility can load | |
| 72: | ClassBrowserIcons.InitIcons(); | |
| 73: | ||
| 74: | AssemblyCompletion.AddAssembly("mscorlib"); | |
| 75: | AssemblyCompletion.AddAssembly("Microsoft.JScript"); | |
| 76: | AssemblyCompletion.AddAssembly("Microsoft.VisualBasic"); | |
| 77: | AssemblyCompletion.AddAssembly("System.Configuration.Install"); | |
| 78: | AssemblyCompletion.AddAssembly("System.Data"); | |
| 79: | AssemblyCompletion.AddAssembly("System.Design"); | |
| 80: | AssemblyCompletion.AddAssembly("System.DirectoryServices"); | |
| 81: | AssemblyCompletion.AddAssembly("System"); | |
| 82: | AssemblyCompletion.AddAssembly("System.Drawing.Design"); | |
| 83: | AssemblyCompletion.AddAssembly("System.Drawing"); | |
| 84: | AssemblyCompletion.AddAssembly("System.EnterpriseServices"); | |
| 85: | AssemblyCompletion.AddAssembly("System.Management"); | |
| 86: | AssemblyCompletion.AddAssembly("System.Messaging"); | |
| 87: | AssemblyCompletion.AddAssembly("System.Runtime.Remoting"); | |
| 88: | AssemblyCompletion.AddAssembly("System.Runtime.Serialization.Formatters.Soap"); | |
| 89: | AssemblyCompletion.AddAssembly("System.Security"); | |
| 90: | AssemblyCompletion.AddAssembly("System.ServiceProcess"); | |
| 91: | AssemblyCompletion.AddAssembly("System.Web"); | |
| 92: | AssemblyCompletion.AddAssembly("System.Web.RegularExpressions"); | |
| 93: | AssemblyCompletion.AddAssembly("System.Web.Services"); | |
| 94: | AssemblyCompletion.AddAssembly("System.Windows.Forms"); | |
| 95: | AssemblyCompletion.AddAssembly("System.XML"); | |
| 96: | ||
| 97: | mainwindow = new MainWindow(); | |
| 98: | mainwindow.Show(); | |
| 99: | ||
| 100: | // set the old form start position | |
| 101: | MainWindowState state = (MainWindowState)Options.GetProperty("SharpDevelop.Gui.MainWindow.WindowState", new MainWindowState()); | |
| 102: | ||
| 103: | mainwindow.Bounds = state.Bounds; | |
| 104: | mainwindow.WindowState = state.WindowState; | |
| 105: | ||
| 106: | foreach (string file in args) { | |
| 107: | switch (System.IO.Path.GetExtension(file).ToUpper()) { | |
| 108: | case ".CMBX": | |
| 109: | case ".PRJX": | |
| 110: | mainwindow.ProjectBrowser.OpenProject(file); | |
| 111: | break; | |
| 112: | default: | |
| 113: | mainwindow.OpenWindow(file); | |
| 114: | break; | |
| 115: | } | |
| 116: | } | |
| 117: | // show tip of the day | |
| 118: | if (Boolean.Parse(Options.GetProperty("SharpDevelop.Gui.Dialog.TipOfTheDayView.ShowTipsAtStartup", true).ToString())) { | |
| 119: | ViewTipOfTheDay dview = new ViewTipOfTheDay(); | |
| 120: | dview.Execute(mainwindow); | |
| 121: | } | |
| 122: | } catch (Exception e) { | |
| 123: | new LoadingError(e).ShowDialog(); | |
| 124: | Application.Exit(); | |
| 125: | return; | |
| 126: | } | |
| 127: | ||
| 128: | Messenger.SendMessage(new IDEMessage(IDEMessage.MSGStarted)); | |
| 129: | Application.Run(mainwindow); | |
| 130: | Messenger.SendMessage(new IDEMessage(IDEMessage.MSGClosed)); | |
| 131: | ||
| 132: | FileUtility.DisposeImageList(); | |
| 133: | CodeTemplateLoader.SaveTemplates(); | |
| 134: | ToolLoader.SaveTools(); | |
| 135: | Options.SaveOptions(); | |
| 136: | } | |
| 137: | } | |
| 138: | } |
This page was automatically generated by SharpDevelop.