예제 #1
0
        private void LoadProjList()
        {
            currentProject = null;
            lbProjects.Items.Clear();
            AnouncementStore ss = new AnouncementStore();

            lProjects = ss.GetAnouncements();
            foreach (AnouncementData s in lProjects.Values)
            {
                lbProjects.Items.Add(s);
            }
        }
예제 #2
0
        private void llDeleteProj_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (currentProject == null)
            {
                return;
            }

            if (MessageBox.Show(this, Loc.Get("Are you sure you want to delete?"), Loc.Get("Warning"), MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                AnouncementStore ss = new AnouncementStore();
                ss.DeleteAnouncement(currentProject.name);
                this.LoadProjList();
                UpdateUI();
            }
        }
예제 #3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            #if DEMO
            new DemoVersionOnly("Save project").ShowDialog();
            #else
            AnouncementStore anouncementStore = new AnouncementStore();
            if (!proj.bSaved)
            {
                ProjSaveDlg f = new ProjSaveDlg();
                f.ValidateName += delegate(object s, CancelEventArgs ec){ ec.Cancel = anouncementStore.NameExists((string)s); };
                if (f.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                proj.data.name = f.FileName;
            }

            anouncementStore.SaveAnouncement(proj.data);
            proj.dirty  = false;
            proj.bSaved = true;
            #endif
        }