Esempio n. 1
0
        void btnDeleteTask_Click(object sender, EventArgs e)
        {
            Button btnDelete = sender as Button;
            Program.p.currentTask = tasks[int.Parse(btnDelete.Tag.ToString())];
            FormDeleteConformTask frm = new FormDeleteConformTask();
            DialogResult dr = frm.ShowDialog(this);
            if (dr == DialogResult.Cancel)
            {
                frm.Close();
            }
            else if (dr == DialogResult.OK)
            {
                frm.Close();
                try
                {
                    DirectoryInfo dir = new DirectoryInfo(@"modules\" + Program.p.currentModule._filename + @"\" + Program.p.currentTask._name);
                    dir.Delete(true);
                }
                catch (NullReferenceException)
                {
                    DirectoryInfo dir = new DirectoryInfo(@"modules\" + Program.p.currentModuleFilename + @"\" + Program.p.currentTaskFilename);
                    dir.Delete(true);
                }

                Program.InitWindow(Forms.fEditTask);
                Program.fEditTask.Show();
                this.Hide();
            }
        }
Esempio n. 2
0
 public static void InitWindow(Forms form)
 {
     switch (form)
     {
         case Forms.fLogin:
             fLogin = new FormLogin();
             break;
         case Forms.fModules:
             fModules = new FormModule();
             break;
         case Forms.fTasks:
             fTasks = new FormTasks();
             break;
         case Forms.fTask:
             fTask = new FormTask();
             break;
         case Forms.fPhenomenas:
             fPhenomenas = new FormPhenomenas();
             break;
         case Forms.fAllIdeas:
             fAllIdeas = new FormAllIdeas();
             break;
         case Forms.fAboutCreativeSchool:
             fAboutCreativeSchool = new FormAboutCreativeThinking();
             break;
         case Forms.fAboutEducation:
             fAboutEducation = new FormAboutEducation();
             break;
         case Forms.fReg:
             fReg = new FormRegistration();
             break;
         case Forms.fAboutProgramm:
             fAboutProgramm = new FormAboutProgramm();
             break;
         case Forms.fMailSender:
             fMailSender = new FormMailSender();
             break;
         case Forms.fShowAllIdeas:
             fShowAllIdeas = new FormShowAllIdeas();
             break;
         case Forms.fEditIdea:
             fEditIdea = new FormEditOrAddIdea();
             break;
         case Forms.fNewModule:
             fNewModule = new FormNewModule();
             break;
         case Forms.fEditModule:
             fEditModule = new FormEditModule();
             break;
         case Forms.fNewTask:
             fNewTask = new FormNewTask();
             break;
         case Forms.fEditTask:
             fEditTask = new FormEditTask();
             break;
         case Forms.fDeleteConform:
             fDeleteConform = new FormDeleteConform();
             break;
         case Forms.fEditModuleEntity:
             fEditModuleEntity = new FormEditModuleEntity();
             break;
         case Forms.fEditTaskEntity:
             fEditTaskEntity = new FormEditTaskEntity();
             break;
         case Forms.fDeleteConformTask:
             fDeleteConformTask = new FormDeleteConformTask();
             break;
         case Forms.fFullImage:
             fFullImage = new FormFullImage();
             break;
         case Forms.fPhenomenasEditor:
             fPhenomenasEditor = new FormPhenomenasEditor();
             break;
         default:
             break;
     }
 }