static void Main(string[] arguments)
        {
            Logger.Info("CodeGenerator v{0} started.".FormatString(Program.Version));

            Main main = null;
            string projectPath = null;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //Initialize
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);

            //See if a project to open was specified.
            if (arguments != null && arguments.Length > 0)
                projectPath = arguments[0];
            else if (AppDomain.CurrentDomain.SetupInformation.ActivationArguments != null && AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData != null && AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData.Length > 0)
                projectPath = new Uri(AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData[0]).LocalPath;

            //Create the main form.
            main = new Main();

            //Show the splash screen.
            using (Splash splash = new Splash(main, projectPath))
            {
                splash.ShowDialog();
            }

            //Show the main form.
            Application.Run(main);
        }
        public Splash(Main main, string projectPath)
            : this()
        {
            this.Main = main;
            this.ProjectPath = projectPath;

            versionLabel.Text = Program.Version.ToString();
            splashTimer.Enabled = true;
        }
 public void InstallUI(Main main)
 {
     main.ToolsMenu.DropDownItems.Add(new ToolStripSeparator());
     main.ToolsMenu.DropDownItems.Add(new ToolStripMenuItem(this.Name, null, new EventHandler((o, e) =>
     {
         using (Form form = new UI.Forms.Main())
         {
             form.ShowDialog();
         }
     })));
 }