示例#1
0
 private void Splash_Load(object sender, EventArgs e)
 {
     // load global settings
     using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("ChemDevEnv.Resources.DefaultGlobalSettings.xml"))
     {
         globalSettings = HashTableSettings.LoadFromXml(new StreamReader(stream));
     }
     globalSettings["DeveloperMode"] = dev;
     // start fade out
     timer1.Start();
 }
示例#2
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);
        }