Esempio n. 1
0
 private void loadControls()
 {
     mode = sf.cadena(System.Configuration.ConfigurationManager.AppSettings["mode"]);
     switch (mode)
     {
         case "project":
             panel1.Controls.Clear();
             myWay.userControls.projectMode uc = new myWay.userControls.projectMode();
             uc.actualProject = general.actualProject;
             panel1.Controls.Add(uc);
              uc.refreshDataWithActualProject();
            break;
         case "template":
             panel1.Controls.Clear();
             myWay.userControls.templateMode ucx = new myWay.userControls.templateMode();
             //ucx.realProject = general.actualProject;
             panel1.Controls.Add(ucx);
              ucx.refreshDataWithActualProject();
            break;
         default:
             panel1.Controls.Clear();
             myWay.userControls.projectMode uc3 = new myWay.userControls.projectMode();
             uc3.actualProject = general.actualProject;
             panel1.Controls.Add(uc3);
             uc3.refreshDataWithActualProject();
             mode = "project";
             break;
     }
 }
Esempio n. 2
0
        private void kryptonButton1_Click(object sender, EventArgs e)
        {
            switch (mode)
            {
                case "template":
                    panel1.Controls.Clear();
                    myWay.userControls.projectMode uc = new myWay.userControls.projectMode();
                    uc.actualProject = general.actualProject;
                    panel1.Controls.Add(uc);
                    uc.refreshDataWithActualProject();
                    mode="project";
                    break;

                case "project":
                    panel1.Controls.Clear();
                    myWay.userControls.templateMode ucx = new myWay.userControls.templateMode();
                 //   ucx.realProject = general.actualProject;
                    panel1.Controls.Add(ucx);
                    ucx.refreshDataWithActualProject();
                    mode = "template";
                    break;
            }
            try
            {
                // save data...
                System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
                config.AppSettings.Settings["mode"].Value = sf.cadena(mode);
                config.Save(ConfigurationSaveMode.Modified);
                ConfigurationManager.RefreshSection("appSettings");
            }
            catch (Exception ex2)
            {

                throw;
            }
        }