private async Task ExecuteDeleteFormCommand(object _itemToDelete) { if (IsBusy) { return; } DeleteFormCommand.ChangeCanExecute(); var item = _itemToDelete as FormItem; var res = await page.DisplayAlert("Delete Item ", item.FirstName + "?", "OK", "Cancel"); if (res) { IsBusy = true; var _deleted = await App.azureService.DeleteForm(item); if (_deleted == "SUCCESS") { FormList.Remove(item); } else { await page.DisplayAlert("Oh No!", "Could not delete item, please check your connection", "OK"); } IsBusy = false; } }
/* * private void frmChild_FormClosing(object sender, FormClosingEventArgs e) * { * if (e.CloseReason != CloseReason.MdiFormClosing) * { * e.Cancel = true; * } * } */ #endregion #endregion /// <summary> /// 弹出选择单位帮助处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonEditDW_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { //MessageBox.Show("1asdf"); FormDW frm = new FormDW(); frm.StartPosition = FormStartPosition.CenterScreen; var dg = frm.ShowDialog(); if (dg.Equals(DialogResult.OK)) { //MessageBox.Show(frm.strName); CurDWMC = buttonEditDW.Text = frm.strName; CurDWBH = frm.strKey; //切换单位关闭所有的窗体 foreach (Form f in this.MdiChildren) { if (f.Tag.ToString() == "main") { continue; } FormList.Remove(f.Tag.ToString()); f.Close(); } frmLogin.setCookie("GSDWBH", CurDWBH, CurDWMC); } }
protected override void OnFormClosed(FormClosedEventArgs e) { base.OnFormClosed(e); if (FormList.Contains(this)) { FormList.Remove(this); } FlushMemory(); }
private void mdiManager1_PageRemoved(object sender, MdiTabPageEventArgs e) { XtraMdiTabPage page = e.Page; if (page != null) { //if (page.MdiChild.Tag.ToString() == "main") return; FormList.Remove(page.MdiChild.Tag.ToString()); } }
private void biCloseAll_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { foreach (Form f in this.MdiChildren) { //if (f.Tag.ToString() == "main") continue; FormList.Remove(f.Tag.ToString()); f.Close(); } }
private void biClose_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { XtraMdiTabPage page = mdiManager1.SelectedPage; if (page != null) { if (page.MdiChild.Tag.ToString() == "main") { return; } page.MdiChild.Close(); FormList.Remove(page.MdiChild.Tag.ToString()); } }
private void biCloseAllExcept_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { XtraMdiTabPage page = mdiManager1.SelectedPage; foreach (Form f in this.MdiChildren) { if (f != page.MdiChild) { if (f.Tag.ToString() == "main") { continue; } FormList.Remove(f.Tag.ToString()); f.Close(); f.Dispose(); } } }
private void button1_Click(object sender, EventArgs e) { FormList.Remove(this); this.Close(); }