private void onDeleteConfigTemplateYes(object sender, EventArgs e) { if (sender is AskDeleteObject) { AskDeleteObject d = sender as AskDeleteObject; GCConfigRatedManager.DeleteConfiguration(d.Tag as GCConfigRatedEvents); InitListConfigs(); } }
private void d_OnButtonYes(object sender, EventArgs e) { if (sender is AskDeleteObject) { AskDeleteObject d = sender as AskDeleteObject; if (d.Tag is GCConfigRatedMargin) { RatedEvent.DeleteMargin(d.Tag as GCConfigRatedMargin); InitListbox(RatedEvent); } } }
/// <summary> /// Deleting related event and hiding dialog /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void askDeleteEvent1_OnButtonYes(object sender, EventArgs e) { if (sender is AskDeleteObject) { AskDeleteObject d = sender as AskDeleteObject; if (d != null && d.Tag != null && (d.Tag is GCFestivalBase)) { EventObject.Remove(d.Tag as GCFestivalBase); } } FillRelativeEvents(); }
private void buttonDelete_Click(object sender, EventArgs e) { GCConfigRatedMargin sel = SelectedSubevent; if (sel != null) { AskDeleteObject d = new AskDeleteObject(); d.InitialLabel = "Delete rated subevent?"; d.DetailLabel = sel.Title; d.Tag = sel; d.OnButtonYes += new TBButtonPressed(d_OnButtonYes); AskDeleteObjectController dc = new AskDeleteObjectController(d); dc.ShowInContainer(Controller.ViewContainer, GVControlAlign.Center); } }
/// <summary> /// Delete Event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button3_Click(object sender, EventArgs e) { GCListBoxEntry item = GetSelectedItem(); if (item != null && item.Tag != null && Controller.ViewContainer != null) { AskDeleteObject dlg = new AskDeleteObject(); AskDeleteObjectController dlgCtrl = new AskDeleteObjectController(dlg); dlg.Tag = item.Tag; dlg.InitialLabel = "Are you sure to remove following event?"; dlg.DetailLabel = (item.Tag as GCFestivalBase).Text; dlg.OnButtonYes += new TBButtonPressed(onDeleteEvent); dlgCtrl.ShowInContainer(Controller.ViewContainer, GVControlAlign.Fill); } }
private void onDeleteEvent(object sender, EventArgs e) { if (sender is AskDeleteObject) { AskDeleteObject dlg = sender as AskDeleteObject; GCFestivalBase fb = dlg.Tag as GCFestivalBase; if (fb != null) { GCFestivalBook book = GCFestivalBookCollection.getSafeBook(fb.BookID); book.Remove(fb); onNonDeleteEvent(sender, e); RemoveItemFromListBox(fb); } } }
private void toolStripButtonDelete_Click(object sender, EventArgs e) { if (GCConfigRatedManager.Configurations.Count < 2) { return; } GCConfigRatedEvents ev = SelectedTemplateConfig; if (ev != null) { // ask for confirmation AskDeleteObject d = new AskDeleteObject(); d.InitialLabel = "Are you sure to delete following configuration?"; d.DetailLabel = ev.Title; d.OnButtonYes += new TBButtonPressed(onDeleteConfigTemplateYes); d.Tag = ev; AskDeleteObjectController dc = new AskDeleteObjectController(d); dc.ShowInContainer(Controller.ViewContainer, GVControlAlign.Fill); } }
/// <summary> /// User interface handler for DELETE related event button /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonDelete_Click(object sender, EventArgs e) { if (listBox1.SelectedIndex >= 0 && listBox1.SelectedIndex < listBox1.Items.Count) { GCListBoxEntry lbe = listBox1.Items[listBox1.SelectedIndex] as GCListBoxEntry; if (lbe != null && lbe.Tag != null) { AskDeleteObject d = new AskDeleteObject(); d.Tag = lbe.Tag; d.InitialLabel = "Are you sure to remove following event?"; d.DetailLabel = (lbe.Tag as GCFestivalBase).Text; AskDeleteObjectController dc = new AskDeleteObjectController(d); d.OnButtonYes += new TBButtonPressed(askDeleteEvent1_OnButtonYes); if (ViewContainer != null) { ViewContainer.AddControl(dc, GVControlAlign.Fill); } } } }
public AskDeleteObjectController(AskDeleteObject v) { View = v; v.Controller = this; }