Example #1
0
        public static HashTableSettings LoadConfig(SplashDlg dlg, bool devSettings)
        {
            if (dlg != null)
            {
                while (!dlg.loadedForm)
                {
                    Thread.Sleep(100);
                }
            }

            HashTableSettings gSettings;

            if (dlg != null)
            {
                dlg.BeginInvoke(dlg.UpdateTextDelegate, dlg.label4, "global settings", false);
            }

            Version version = Assembly.GetExecutingAssembly().GetName().Version;

            if (dlg != null)
            {
                string text;
                if (version.Major > 0)
                {
                    text = version.ToString();
                }
                else if (version.Minor > 0)
                {
                    text = string.Format("Beta Build {0}.{1}.{2}", version.Minor, version.Build, version.Revision);
                }
                else
                {
                    text = string.Format("Alpha Build {0}.{1}", version.Build, version.Revision);
                }
                dlg.BeginInvoke(dlg.UpdateTextDelegate, dlg.label1, text, false);
            }

            // load global settings
            gSettings                     = HashTableSettings.LoadFromXml(NuGenDEMVis.Properties.Resource1.DefaultGlobalSettings, false);
            gSettings.GlobalOnly          = true;
            gSettings["Assembly.Version"] = version;
            gSettings["Base.Path"]        = Path.GetFullPath(ConfigurationManager.AppSettings[(devSettings ? "dev@" : "") + "Base.Path.Relative"].Replace("%STARTUP%", Application.StartupPath));

            if (dlg != null)
            {
                dlg.BeginInvoke(dlg.DoneLoadingDelegate);
            }

            return(gSettings);
        }
Example #2
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            ProgramArgs progArgs = new ProgramArgs(args);

            // Start splash if required
            bool devMode = progArgs.CheckSwitch("-dev");
            SplashDlg splash = null;
            if (!devMode || progArgs.CheckSwitch("-splash"))
            {
                Thread splashTh = new Thread(SplashProcess);
                splashTh.Start(splash = new SplashDlg());
            }

            // load config and feed splash if present
            HashTableSettings gSettings = SplashDlg.LoadConfig(splash, devMode);

            Application.Run(new MainWindow(gSettings, devMode));
        }
Example #3
0
        public static HashTableSettings LoadConfig(SplashDlg dlg, bool devSettings)
        {
            if (dlg != null)
            {
                while (!dlg.loadedForm)
                {
                    Thread.Sleep(100);
                }
            }

            HashTableSettings gSettings;

            if (dlg != null)
                dlg.BeginInvoke(dlg.UpdateTextDelegate, dlg.label4, "global settings", false);

            Version version = Assembly.GetExecutingAssembly().GetName().Version;
            if (dlg != null)
            {
                string text;
                if (version.Major > 0)
                    text = version.ToString();
                else if (version.Minor > 0)
                    text = string.Format("Beta Build {0}.{1}.{2}", version.Minor, version.Build, version.Revision);
                else
                    text = string.Format("Alpha Build {0}.{1}", version.Build, version.Revision);
                dlg.BeginInvoke(dlg.UpdateTextDelegate, dlg.label1, text, false);
            }

            // load global settings
            gSettings = HashTableSettings.LoadFromXml(NuGenDEMVis.Properties.Resource1.DefaultGlobalSettings, false);
            gSettings.GlobalOnly = true;
            gSettings["Assembly.Version"] = version;
            gSettings["Base.Path"] = Path.GetFullPath(ConfigurationManager.AppSettings[(devSettings ? "dev@" : "") + "Base.Path.Relative"].Replace("%STARTUP%", Application.StartupPath));

            if (dlg != null)
                dlg.BeginInvoke(dlg.DoneLoadingDelegate);

            return gSettings;
        }
Example #4
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            ProgramArgs progArgs = new ProgramArgs(args);

            // Start splash if required
            bool      devMode = progArgs.CheckSwitch("-dev");
            SplashDlg splash  = null;

            if (!devMode || progArgs.CheckSwitch("-splash"))
            {
                Thread splashTh = new Thread(SplashProcess);
                splashTh.Start(splash = new SplashDlg());
            }

            // load config and feed splash if present
            HashTableSettings gSettings = SplashDlg.LoadConfig(splash, devMode);

            Application.Run(new MainWindow(gSettings, devMode));
        }