private void Form1_Load(object sender, EventArgs e)
        {
            bool         HasVersionFile = true;
            VersionCheck version        = new VersionCheck(HasVersionFile);

            if (HasVersionFile)
            {
                Runtime.ProgramVersion = version.ProgramVersion;
                Runtime.CommitInfo     = version.CommitInfo;
                Runtime.CompileDate    = version.CompileDate;
            }
            else
            {
                version.SaveVersionInfo();
            }

            ThreadStart t      = new ThreadStart(UpdateProgram.CheckLatest);
            Thread      thread = new Thread(t);

            thread.Start();

            Application.Idle += Application_Idle;

            if (Runtime.UseOpenGL)
            {
                ShaderTools.executableDir = Runtime.ExecutableDir;

                OpenTKSharedResources.InitializeSharedResources();

                Runtime.OpenTKInitialized = true;

                Runtime.renderer      = GL.GetString(StringName.Renderer);
                Runtime.openGLVersion = GL.GetString(StringName.Version);
                Runtime.GLSLVersion   = GL.GetString(StringName.ShadingLanguageVersion);
                ParseGLVersion();
            }

            LoadPLugins();
            UpdateToolbar(HasVersionFile);
            Reload();
            LoadMDITheme();
            LoadRecentList();
            LoadPluginFileContextMenus();

            foreach (string file in openedFiles)
            {
                if (File.Exists(file))
                {
                    OpenFile(file);
                }
            }

            openedFiles.Clear();

            if (Runtime.UseDebugDomainExceptionHandler)
            {
                AppDomain currentDomain = AppDomain.CurrentDomain;
                currentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyHandler);
            }
        }
Example #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Runtime.MainForm = this;
            compressionToolStripMenuItem.DropDownItems.AddRange(CompressionMenus.GetMenuItems().ToArray());

            //Redo setting this since designer keeps resetting this
            tabForms.myBackColor = FormThemes.BaseTheme.FormBackColor;

            OnMdiWindowClosed();
            ResetMenus();

            bool         HasVersionFile = true;
            VersionCheck version        = new VersionCheck(HasVersionFile);

            if (HasVersionFile)
            {
                Runtime.ProgramVersion = version.ProgramVersion;
                Runtime.CommitInfo     = version.CommitInfo;
                Runtime.CompileDate    = version.CompileDate;
            }
            else
            {
                version.SaveVersionInfo();
            }

            ThreadStart t      = new ThreadStart(UpdateProgram.CheckLatest);
            Thread      thread = new Thread(t);

            thread.Start();

            Application.Idle += Application_Idle;

            if (Runtime.UseOpenGL)
            {
                ShaderTools.executableDir = Runtime.ExecutableDir;

                OpenTKSharedResources.InitializeSharedResources();

                if (OpenTKSharedResources.SetupStatus == OpenTKSharedResources.SharedResourceStatus.Initialized)
                {
                    Runtime.OpenTKInitialized = true;
                    Runtime.renderer          = GL.GetString(StringName.Renderer);
                    Runtime.openGLVersion     = GL.GetString(StringName.Version);
                    Runtime.GLSLVersion       = GL.GetString(StringName.ShadingLanguageVersion);
                    ParseGLVersion();
                }
            }

            LoadPLugins();
            UpdateToolbar(HasVersionFile);
            LoadMDITheme();
            LoadRecentList();
            ReloadFiles();
            LoadPluginFileContextMenus();
            WindowsExplorer.ExplorerContextMenu.LoadMenus();

            foreach (string file in OpenedFiles)
            {
                if (File.Exists(file))
                {
                    OpenFile(file);
                }
            }

            OpenedFiles.Clear();

            if (Runtime.UseDebugDomainExceptionHandler)
            {
                AppDomain currentDomain = AppDomain.CurrentDomain;
                currentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyHandler);
            }
        }