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); } }
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(); } }
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 }