Exemplo n.º 1
0
 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);
         };
     });
 }
Exemplo n.º 2
0
        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);
            };
        }
Exemplo n.º 3
0
        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);
                };
            });
        }