Beispiel #1
0
        private void Button_Click_4(object sender, RoutedEventArgs e)
        {
            String datafolder = System.Configuration.ConfigurationManager.AppSettings["DataFolder"];

            if (!Directory.Exists(datafolder) && !File.Exists(datafolder + "\\config.xml") && ApplicationDeployment.IsNetworkDeployed)
                datafolder = ApplicationDeployment.CurrentDeployment.DataDirectory + "\\" + datafolder;
        
            UIConfig cfg = new UIConfig(true, datafolder+"\\config.xml");
            cfg.Show();
        }
Beispiel #2
0
        private void loadconfig()
        {
            if (System.Configuration.ConfigurationManager.AppSettings.AllKeys.Contains("DEBUG"))
                System.Diagnostics.Debugger.Launch();
       
            try
            {
                String datafolder = System.Configuration.ConfigurationManager.AppSettings["DataFolder"];
                    
                if (!Directory.Exists(datafolder) && !File.Exists(datafolder + "\\config.xml") && ApplicationDeployment.IsNetworkDeployed)
                    datafolder = ApplicationDeployment.CurrentDeployment.DataDirectory + "\\" + datafolder;
                String cf = datafolder + "config.xml";
                if (!File.Exists(cf))
                {
                    MessageBox.Show("You can download a demo show at www.ebulabs.org.", "First run");
                    
                    UIConfig uicfg = new UIConfig(false, cf);
                    uicfg.ShowDialog();
                    
                }
                
                
                CMSConfig.load(cf);
                
            }
            catch (FileNotFoundException e)
            {
                MessageBox.Show("File " + System.Configuration.ConfigurationManager.AppSettings["DataFolder"] + "config.xml not found");
                Environment.Exit(1);
            }
            



        }