Пример #1
0
 private void OnAddNoteClick(object sender, EventArgs e)
 {
     Invoke((MethodInvoker) delegate
     {
         AddRemoveView view;
         (view = new AddRemoveView(AddRemoveView.Type.AddNote, data.First, data.Last)).Show();
         view.FormClosed += async delegate
         {
             await Resync(true);
         };
     });
 }
Пример #2
0
        private void OnAddBoloClick(object sender, EventArgs e)
        {
            new Task(delegate
            {
                AddRemoveView window = null;

                Invoke((MethodInvoker) delegate
                {
                    (window = new AddRemoveView(AddRemoveView.Type.AddBolo)).Show();
                });
                window.FormClosed += async delegate
                {
                    await Resync(true);
                };
            }).Start();
        }
Пример #3
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;
            }

            Invoke((MethodInvoker) delegate
            {
                (addBtn = new AddRemoveView(AddRemoveView.Type.AddAssignment)).Show();
                addBtn.FormClosed += async delegate
                {
                    addBtn = null;
                    await Resync(true);
                };
            });
        }
Пример #4
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.TriggerNetEvent("AddOfficerAssignment", addBtn.LastGuid, ofc.Id);

                    addBtn = null;
                    await Resync(true);
                };
            });
        }