Example #1
0
		static void Main(string [] args)
		{
			Thread.CurrentThread.Name = "Main Thread";
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);

			// Check for the .NET Framework 2.0 Service Pack 1
			RegistryKey regkey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v2.0.50727");
			if (regkey == null || regkey.GetValue("Increment") == null)
			{
				MessageBox.Show(
					"Tilde requires the .NET Framework 2.0 to be installed. Please install:\r\n\r\n"
					+ "\t" + "http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en" + "\r\n"
					+ "\t" + "http://www.microsoft.com/downloads/details.aspx?familyid=79BC3B77-E02C-4AD3-AACF-A7633F706BA5&displaylang=en",
					".NET Framework Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				return;
			}
			else if(Int32.Parse(regkey.GetValue("Increment").ToString()) < 1433)
			{
				MessageBox.Show(
					"Tilde requires the .NET Framework 2.0 Service Pack 1 to be installed. Please install:\r\n\r\n"
					+ "\t" + "http://www.microsoft.com/downloads/details.aspx?familyid=79BC3B77-E02C-4AD3-AACF-A7633F706BA5&displaylang=en",
					".NET Framework Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				return;
			}

			CommandLineArguments param = new CommandLineArguments(args);
			Manager manager = new Manager(param);
			MainWindow mainWindow = new MainWindow(manager);
			mainWindow.CreateToolWindows();

			Application.Run(mainWindow);
		}
Example #2
0
		public Manager(CommandLineArguments args)
		{
			mAssemblies = new List<Assembly>();
			mPlugins = new PluginCollection();
			mOpenDocuments = new List<Document>();
			mFileTypes = new Dictionary<string, Type>();
			mActiveDocument = null;

			mFileWatcher = new FileWatcher();
			mFileWatcher.FileModified += new FileModifiedEventHandler(FileWatcher_FileModified);
			mFileWatcher.FileAttributesChanged += new FileAttributesChangedEventHandler(FileWatcher_FileAttributesChanged);

			mOptionsManager = new OptionsManager(this);
			mApplicationOptions = new ApplicationOptions();
			mOptionsManager.Options.Add(mApplicationOptions);

			mAssemblies.Add(Assembly.GetExecutingAssembly());

			mPluginPath = new List<string>();
			string currentDirectory = System.IO.Directory.GetCurrentDirectory();
			string exeDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			mPluginPath.Add(currentDirectory);
			if(currentDirectory != exeDirectory)
				mPluginPath.Add(exeDirectory);

			foreach (string path in args.GetValues("--pluginFolder"))
				mPluginPath.Add(path);

			foreach (string path in mPluginPath)
			{
				FindPlugins(path);
			}

			mRegistryRoot = Registry.CurrentUser.OpenSubKey("Software\\Tantalus\\Tilde", true);
			if (mRegistryRoot == null)
				mRegistryRoot = Registry.CurrentUser.CreateSubKey("Software\\Tantalus\\Tilde");

			CreatePlugins();
		}