Esempio n. 1
0
 void dlg_Result(object sender, DialogEventArgs e)
 {
     if (e.Result == DialogResult.Cancel)
     {
         ExitApplication();
     }
 }
Esempio n. 2
0
    private void ReadDialog(object sender, EventArgs e)
    {
        DialogEventArgs d      = (DialogEventArgs)e;
        DialogObject    dialog = d.payload;

        StartCoroutine(HandleDialogBroadcast(dialog));
    }
Esempio n. 3
0
        private void copyMsgBox_Result(object sender, DialogEventArgs e)
        {
            //If a File is selected select the folder its in
            if (!_selectedItem.Is_Dir)
            {
                _selectedItem = _selectedItem.Parent;
            }

            Host.Cursor = Cursors.WaitCursor;

            if (e.Result == DialogResult.OK)
            {
                //copy
                if (!Form1.Instance.DropBox.CopyFile(_clipboard, _selectedItem))
                {
                    Host.Cursor = Cursors.Default;
                    MessageDialog.Show("Failed to Copy!", null, "OK");
                }
            }
            else if (e.Result == DialogResult.Cancel)
            {
                //move
                if (!Form1.Instance.DropBox.MoveFile(_clipboard, _selectedItem))
                {
                    Host.Cursor = Cursors.Default;
                    MessageDialog.Show("Failed to Move!", null, "OK");
                }
            }

            lsbDropbox.Items = ListHelpers.MakeDirList(Form1.Instance.DropBox.GetItems(_selectedItem));
            Host.Cursor      = Cursors.Default;
            _clipboard       = null;
        }
        private void UserDialog_DialogEvent(object source, DialogEventArgs e)
        {
            if (isShowUserDialog)
            {
                Form form = FindForm();
                if (form != null)
                {
                    form.Enabled = true;
                    form.Focus();

                    var dialog = e.Dialog as UserDialog;
                    if (dialog != null && dialog.DialogResult == DialogResult.OK && dialog.Users != null)
                    {
                        lbSelectedEmploees.Items.Clear();
                        foreach (
                            var item in
                            from UserInfo newUser in dialog.Users select new ComboBoxItem(newUser.ID, newUser.Name))
                        {
                            lbSelectedEmploees.Items.Add(item);
                        }
                    }
                }
            }
            isShowUserDialog = false;
        }
        private void UserDialog_DialogEvent(object source, DialogEventArgs e)
        {
            Form form = FindForm();

            if (form != null)
            {
                form.Enabled = true;
                form.Focus();

                var dialog = e.Dialog as UserDialog;
                if (dialog != null && dialog.DialogResult == DialogResult.OK && dialog.Users != null)
                {
                    var emps = new Employee[dialog.Users.Count];
                    for (int i = 0; i < dialog.Users.Count; i++)
                    {
                        var newUser = (UserInfo)dialog.Users[i];
                        emps[i] = new Employee(newUser.ID, Environment.EmpData);
                    }

                    ThrowEvent(emps);
                }

                Clear();
                SetLabel();
            }
        }
        private void personDialog_DialogEvent(object source, DialogEventArgs e)
        {
            var dialog = e.Dialog as PersonDialog;

            if (dialog == null)
            {
                return;
            }
            dialog.DialogEvent -= personDialog_DialogEvent;
            if (dialog.DialogResult == DialogResult.OK)
            {
                dialog.DialogEvent -= personDialog_DialogEvent;
                var person = (PersonInfo)dialog.Persons[0];
                PersonID   = person.ID;
                PersonName = person.Name;
                OnFindPerson();
            }
            else
            {
                PersonID = 0;
                if (IsFax)
                {
                    OnFindFax();
                }
                if (IsEmail)
                {
                    OnFindEMail();
                }
            }
        }
Esempio n. 7
0
        internal override void createContactDialog_DialogEvent(object source, DialogEventArgs e)
        {
            if (e.Dialog.DialogResult != DialogResult.OK)
            {
                return;
            }
            var dialog = e.Dialog as ContactDialog;

            if (dialog == null)
            {
                return;
            }

            dialog.DialogEvent -= createContactDialog_DialogEvent;
            if (dialog.ContactID <= 0)
            {
                return;
            }

            try
            {
                int conPersonID = Environment.FaxRecipientData.GetDocIntField(Environment.FaxRecipientData.PersonIDField, dialog.ContactID, -1);
                if (conPersonID > -1)
                {
                    string personStr = Environment.PersonData.GetFullPerson(conPersonID);
                    grid.SetValue(dialog.PersonID, Environment.FaxOutData.RecipField, personStr);
                }
            }
            catch (Exception ex)
            {
                Lib.Win.Data.Env.WriteToLog(ex);
            }
        }
 private void Page_Dialog(object sender, DialogEventArgs e)
 {
     if (DebugInfo)
     {
         Console.WriteLine($"Page_Dialog: {e.Dialog.DialogType}, {e.Dialog.Message}");
     }
 }
        internal override void createContactDialog_DialogEvent(object source, DialogEventArgs e)
        {
            if (e.Dialog.DialogResult != DialogResult.OK)
            {
                return;
            }
            var dialog = e.Dialog as ContactDialog;

            if (dialog == null)
            {
                return;
            }
            dialog.DialogEvent -= createContactDialog_DialogEvent;
            if (dialog.ContactID <= 0)
            {
                return;
            }
            try
            {
                object obj = Environment.FaxRecipientData.GetField(Environment.FaxRecipientData.PersonIDField, dialog.ContactID);
                if (obj is int)
                {
                    var conPersonID = (int)obj;
                }
            }
            catch (Exception ex)
            {
                Lib.Win.Data.Env.WriteToLog(ex);
            }
        }
Esempio n. 10
0
File: Main.cs Progetto: qq5013/ZKSA
        string FormDialog_OnDialog(DialogEventArgs args)
        {
            string strValue = "";

            if (InvokeRequired)
            {
                return((string)this.Invoke(new DialogEventHandler(FormDialog_OnDialog), args));
            }
            else
            {
                if (args.Message[0] == "6")//盘点
                {
                    View.CheckScan frm = new View.CheckScan(int.Parse(args.Message[0]), args.dtInfo);
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        strValue = frm.strValue;
                    }
                }
                if (args.Message[0] == "1")//盘点
                {
                    View.Dispatcher.frmInTask frm = new View.Dispatcher.frmInTask(int.Parse(args.Message[0]), args.dtInfo);
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        strValue = frm.strValue;
                    }
                }
            }
            return(strValue);
        }
        private void MLEdit_DialogEvent(object source, DialogEventArgs e)
        {
            Enabled = true;
            Focus();

            if (e.Dialog.DialogResult == DialogResult.OK)
            {
                if (modifiedItem != null)
                {
                    var ml = modifiedItem.Tag as MailingListItem;
                    if (ml != null)
                    {
                        modifiedItem.Text             = ml.Name;
                        modifiedItem.SubItems[1].Text = ml.Author;
                        modifiedItem.ImageIndex       = ml.Editable && ml.SharedEmploees.Count != 0 ? 0 : -1;
                    }

                    list.Focus();
                }
                else
                {
                    LoadMailingLists();
                }
            }
        }
Esempio n. 12
0
        private void newFolder_submit(object sender, DialogEventArgs e)
        {
            if (e.Result != DialogResult.OK)
            {
                return;
            }

            //If a File is selected select the folder its in
            if (!_selectedItem.Is_Dir)
            {
                _selectedItem = _selectedItem.Parent;
            }

            var folderName = textInputPanel.Data;

            Host.Cursor = Cursors.WaitCursor;
            var newSelected = Form1.Instance.DropBox.CreateFolder(_selectedItem, folderName);

            if (newSelected != null)
            {
                newSelected.Parent = _selectedItem;
                _selectedItem.Contents.Add(newSelected);
                _selectedItem                = newSelected;
                lsbDropbox.Items             = ListHelpers.MakeDirList(_selectedItem);
                lsbDropbox.SelectedItemIndex = -1;
                header.Title = _selectedItem.Name;
                Host.Cursor  = Cursors.Default;
            }
            else
            {
                //show error...?
                Host.Cursor = Cursors.Default;
                MessageDialog.Show("Create Folder Failed!", null, "OK");
            }
        }
Esempio n. 13
0
        private void deleteFolderMsgBox_Result(object sender, DialogEventArgs e)
        {
            if (e.Result != DialogResult.OK)
            {
                return;
            }

            //Delete Selected folder...
            Host.Cursor = Cursors.WaitCursor;
            //Delete Folder
            if (Form1.Instance.DropBox.Delete(_selectedItem))
            {
                //Now load the parent Directory
                _selectedItem                = _selectedItem.Parent;
                lsbDropbox.Items             = ListHelpers.MakeDirList(Form1.Instance.DropBox.GetItems(_selectedItem));
                lsbDropbox.SelectedItemIndex = -1;
                header.Title = _selectedItem.Name;
                Host.Cursor  = Cursors.Default;
            }
            else
            {
                Host.Cursor = Cursors.Default;
                MessageDialog.Show("Failed to Delete!", null, "OK");
            }
        }
Esempio n. 14
0
        private void SelectDocUniversalDialog_DialogEvent(object source, DialogEventArgs e)
        {
            var dialog = e.Dialog as SelectDocUniversalDialog;

            if (dialog != null && dialog.DialogResult == DialogResult.OK)
            {
                if (dialog.DocIDs != null && dialog.DocIDs[0] != -1)
                {
                    foreach (int id in dialog.DocIDs)
                    {
                        ThrowEvent(id);
                    }
                }
                else if (dialog.DocID > 0)
                {
                    ThrowEvent(dialog.DocID);
                }
            }
            else
            {
                if (dialog != null && dialog.DialogResult == DialogResult.Retry)
                {
                    SelectDialog(dialog.XML);
                }
            }
        }
        private void SelectTypes_DialogEvent(object source, DialogEventArgs e)
        {
            if (!Enabled)
            {
                Enabled = true;
            }
            Focus();

            if (e.Dialog.DialogResult != DialogResult.OK)
            {
                return;
            }

            lbTypes.Items.Clear();
            var dialog = e.Dialog as TypesList;

            if (dialog != null && dialog.IdList.Count > 0)
            {
                foreach (
                    var item in
                    from TypesList.TypesInfo type in dialog.IdList select new ComboBoxItem(type.ID, type.Name))
                {
                    lbTypes.Items.Add(item);
                }
            }
        }
Esempio n. 16
0
 protected void OnDialogFinished(DialogEventArgs args)
 {
     if (DialogFinished != null)
     {
         DialogFinished(this, args);
     }
 }
        /// <summary>
        /// Called when [delete command].
        /// </summary>
        /// <param name="parameter">The parameter.</param>
        private void OnDeleteCommand(object parameter)
        {
            try
            {
                if (this.SelectedItemFilter != null)
                {
                    DeleteExecuteDialogViewModel deletExecuteDialogViewModel = new DeleteExecuteDialogViewModel(this.viewModelEvents, "Delete", this.etic2Model, this.selectionItemType, this.SelectedItemFilter.SelectedItem);
                    DialogEventArgs eventArgs = new DialogEventArgs(deletExecuteDialogViewModel, "Delete", 100, 300);
                    this.viewModelEvents.OnOpenDialog(this, eventArgs);

                    //inform the user, if the delete action was not sucessfull
                    if (deletExecuteDialogViewModel.ResultDeleteOperation != string.Empty)
                    {
                        this.viewModelEvents.OnUserFeedback(this, new UserFeedbackErrorEventArgs(deletExecuteDialogViewModel.ResultDeleteOperation));
                    }

                    //empty item
                    else
                    {
                        this.SelectedItemFilter = null;
                    }
                }
                else
                {
                    this.viewModelEvents.OnUserFeedback(this, new UserFeedbackErrorEventArgs("No Item is select to delete"));
                }
            }
            catch (Exception ex)
            {
                this.viewModelEvents.OnHandleError(this, new UnexpectedErrorHandlerEventArgs(ex));
            }
        }
        private void OnEditCommand(object parameter)
        {
            try
            {
                if (this.SelectedItemFilter != null)
                {
                    EditExecuteDialogViewModel editExecuteDialogViewModel = new EditExecuteDialogViewModel(this.viewModelEvents, "Save", this.etic2Model, this.selectionItemType, this.SelectedItemFilter.SelectedItem);
                    DialogEventArgs            eventArgs = new DialogEventArgs(editExecuteDialogViewModel, "Edit", 100, 300);
                    this.viewModelEvents.OnOpenDialog(this, eventArgs);

                    //set the selectionItem
                    this.ItemListFilter = this.GetItemList();
                    foreach (var item in this.ItemListFilter)
                    {
                        if (item.SelectedItem == editExecuteDialogViewModel.SelectedItem)
                        {
                            this.SelectedItemFilter = item;
                        }
                    }

                    //Reload database
                    this.viewModelEvents.OnRenameSelectionItemInDatabase();
                }
                else
                {
                    this.viewModelEvents.OnUserFeedback(this, new UserFeedbackErrorEventArgs("No Item is select to edit"));
                }
            }
            catch (Exception ex)
            {
                this.viewModelEvents.OnHandleError(this, new UnexpectedErrorHandlerEventArgs(ex));
            }
        }
Esempio n. 19
0
 public void OnOpenDialog(object sender, DialogEventArgs dialogEventArgs)
 {
     if (this.OpenDialog != null)
     {
         this.OpenDialog(sender, dialogEventArgs);
     }
 }
Esempio n. 20
0
        private void SelectTypeDialog_DialogEvent(object source, DialogEventArgs e)
        {
            if (!keyLocker.Contains(Keys.Return))
            {
                keyLocker.Add(Keys.Return);
                try
                {
                    Form form = FindForm();
                    if (form != null)
                    {
                        form.Enabled = true;
                        form.Focus();
                    }

                    var dialog = e.Dialog as SelectTypeDialog;
                    if (dialog != null && (dialog.DialogResult == DialogResult.OK && dialog.TypeID > 0))
                    {
                        ThrowEvent(dialog.TypeID, dialog.Type);
                        text.SelectAll();
                    }
                    else
                    {
                        ID = 0;
                    }
                }
                catch (Exception ex)
                {
                    Data.Env.WriteToLog(ex);
                }
                finally
                {
                    keyLocker.Remove(Keys.Return);
                }
            }
        }
Esempio n. 21
0
        private void ccDialog_DialogEvent(object source, DialogEventArgs e)
        {
            var ccDialog = e.Dialog as ContactDialog;

            ccDialog.DialogEvent -= ccDialog_DialogEvent;
            ReloadContact();
        }
Esempio n. 22
0
 private void Settings_DialogFinished(object sender, DialogEventArgs e)
 {
     if (e.ExitMode == SettingsDialog.SAVE)
     {
         MessageDialog.ShowMessage(this.Surface, "Settings saved!", false);
     }
 }
Esempio n. 23
0
File: Main.cs Progetto: 0000duck/XN
        string FormDialog_OnDialog(DialogEventArgs args)
        {
            string strValue = "";

            if (InvokeRequired)
            {
                return((string)this.Invoke(new DialogEventHandler(FormDialog_OnDialog), args));
            }
            else
            {
                if (args.Message[0] == "1")//出库
                {
                    View.Dispatcher.frmOutView frm = new View.Dispatcher.frmOutView(int.Parse(args.Message[0]), args.dtInfo, context);
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        strValue = frm.strValue;
                        //bool tt = context.ProcessDispatcher.WriteToService("CarPLC2", "PickFinished", 1);
                    }
                }
                if (args.Message[0] == "2")//盘点
                {
                    View.Dispatcher.frmScan frm = new View.Dispatcher.frmScan(int.Parse(args.Message[0]), args.dtInfo);
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        strValue = frm.strValue;
                    }
                }
            }
            return(strValue);
        }
 protected void OnClosingRequest(DialogEventArgs e)
 {
     if (this.ClosingRequest != null)
     {
         this.ClosingRequest(this, e);
     }
 }
Esempio n. 25
0
        private void SelectTypeDialog_DialogEvent(object source, DialogEventArgs e)
        {
            Show();
            Enabled = true;
            var dialog = (SelectTypeDialog)e.Dialog;

            if (dialog.DialogResult != DialogResult.OK || dialog.TypeID <= 0)
            {
                return;
            }

            string id = dialog.TypeID.ToString() +
                        (dialog.SimilarChecked ? "S" : "") +
                        (dialog.SubTypesChecked ? "C" : "");

            id = Data.DALC.Documents.Search.Document.“ипƒокумента.NormalizeS(id);

            foreach (string x in Regex.Replace(id, "C", "", RegexOptions.IgnoreCase).Split(','))
            {
                src = Regex.Replace(src, x + "[C]{0,1}", "");
            }
            src  = Regex.Replace(src, "[,]+", ",");
            src  = Regex.Replace(src, "^,|,$", "");
            src += (src.Length > 0 ? "," : "") + id;
            lv_Refresh();
        }
Esempio n. 26
0
 private void CreateContactDialog_DialogEvent(object source, DialogEventArgs e)
 {
     if (e.Dialog.DialogResult != DialogResult.OK)
     {
         return;
     }
     try
     {
         var dialog = e.Dialog as ContactDialog;
         if (dialog == null)
         {
             return;
         }
         dialog.DialogEvent -= CreateContactDialog_DialogEvent;
         if (dialog.ContactID <= 0)
         {
             return;
         }
         DataRow dr = Environment.FaxRecipientData.GetPersonContact(dialog.ContactID);
         if (dr != null)
         {
             DataRow fdr = Environment.FaxInData.GetFaxIn(dialog.PersonID);
             OnFaxInContactCreated(new NogeIdEventArgs((int)fdr[Environment.FaxData.FolderFaxIDField]));
         }
     }
     catch
     {
     }
 }
Esempio n. 27
0
 private void OnDialogEnded(object sender, DialogEventArgs args)
 {
     if (args.dialogFile == "06Mag.txt")
     {
         saveManager.Save();
         SceneManager.LoadScene("08-Flat");
     }
 }
        protected void OnClosingRequest(DialogEventArgs e)
        {
            if (this.ClosingRequest != null)
            {

                this.ClosingRequest(this, e);
            }
        }
        private void OnDialogResultEvent(DialogEventArgs e)
        {
            var dialogResultEvent = DialogResultEvent;

            if (dialogResultEvent != null)
            {
                dialogResultEvent(this, e);
            }
        }
        private void linkTypeDialog_DialogEvent(object source, DialogEventArgs e)
        {
            var dialog = e.Dialog as LinkTypeDialog;

            if (dialog != null && dialog.DialogResult == DialogResult.OK)
            {
                AddDoc(dialog.TwoID, !dialog.Basic, false);
            }
        }
 private void dlg_DialogEvent(object source, DialogEventArgs e)
 {
     if (e.Dialog.DialogResult == DialogResult.OK)
     {
         LoadStamps();
     }
     listViewStamps.Select();
     listViewStamps.Focus();
 }
Esempio n. 32
0
 public IEnumerable<IResult> SchedulerDialogClosing(object sender, DialogEventArgs e)
 {
     // DialogResult is false if cancel was clicked.
     if (((CloseDialogEventArgs)e).DialogResult == false) {
         if (SchedulerEditingId != Guid.Empty) {
             this.SchedulerIsBusy = true;
             ReleaseLockRequest releaseLockRequest = new ReleaseLockRequest(ModelNamesEnum.Appointment, SchedulerEditingId.ToString());
             yield return releaseLockRequest;
             if (releaseLockRequest.Error != null) {
                 yield return new HandleExceptionResult(releaseLockRequest.Error);
                 this.SchedulerIsBusy = false;
                 yield break;
             }
             this.SchedulerEditingId = Guid.Empty;
             this.SchedulerIsBusy = false;
         }
     }
     yield break;
 }
Esempio n. 33
0
 void dialog_OnResponse(object sender, DialogEventArgs<Bid?> e)
 {
     MainApp.client.MakeBidAsync(e.Value);
 }
Esempio n. 34
0
 void dialog_OnResponse(object sender, DialogEventArgs<bool> e)
 {
     exchangedCardRecieved = true;
     if (bidRequested)
     {
         DialogBidClass dialog = new DialogBidClass();
         dialog.OnResponse += new EventHandler<DialogEventArgs<Bid?>>(dialog_OnResponse);
         dialog.Show(DialogStyle.Modal);
     }
 }
Esempio n. 35
0
        private bool TryRequestConfigName(ref string configName)
        {
            var vm = new RequestConfigNameViewModel(this.configManager, configName);
            var args = new DialogEventArgs<RequestConfigNameViewModel>(vm);

            OnRequestingConfigName(args);

            if (args.Update && vm.IsConfigNameValid)
            {
                configName = vm.ConfigName;
                return true;
            }
            else
            {
                configName = null;
                return false;
            }
        }
Esempio n. 36
0
 protected void OnRequestingConfigPath(DialogEventArgs<RequestConfigPathViewModel> e)
 {
     if (this.RequestingConfigPath != null)
     {
         RequestingConfigPath(this, e);
     }
 }
Esempio n. 37
0
 protected void OnRequestingConfigName(DialogEventArgs<RequestConfigNameViewModel> e)
 {
     if (this.RequestingConfigName != null)
     {
         RequestingConfigName(this, e);
     }
 }
Esempio n. 38
0
 void dialog_OnResponse(object sender, DialogEventArgs<int> e)
 {
     MainApp.client.MakeContractAsync(e.Value);
 }