private void OnAddNoteClick(object sender, EventArgs e) { Invoke((MethodInvoker) delegate { AddRemoveView view = new AddRemoveView(AddRemoveView.Type.AddNote, data.Id); view.Show(); view.FormClosed += async delegate { await Resync(true); }; }); }
private void OnAddAssignmentClick(object sender, EventArgs e) { if (addBtn != null) { MessageBox.Show("You cannot have 2 instanced of this window open at the same time!", "DispatchSystem", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } (addBtn = new AddRemoveView(AddRemoveView.Type.AddAssignment)).Show(); addBtn.FormClosed += async delegate { addBtn = null; await SyncAssignments(); Invoke((MethodInvoker)UpdateAssignmentInformation); }; }
private void OnCreateNewAssignment(object sender, EventArgs e) { if (addBtn != null) { MessageBox.Show("You cannot have 2 instanced of this window open at the same time!", "DispatchSystem", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } Invoke((MethodInvoker) delegate { (addBtn = new AddRemoveView(AddRemoveView.Type.AddAssignment)).Show(); addBtn.FormClosed += async delegate { await Program.Client.Peer.RemoteCallbacks.Events["AddOfficerAssignment"] .Invoke(addBtn.LastGuid, ofc.Id); addBtn = null; await Resync(true); }; }); }