コード例 #1
0
ファイル: DialogManager.cs プロジェクト: z-philc/UIOlymPig
    public void ShowDialog(DialogIndex index, DialogParam param = null, Action callBack = null)
    {
        BaseDialog baseDialog = dicDialog[index];

        baseDialog.ShowDialog(param, callBack);
        lsShow.Add(baseDialog);
    }
コード例 #2
0
ファイル: OptionsWizard.cs プロジェクト: landytest/Eto
        public override void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            var doc = Helpers.LoadWizardXml(replacementsDictionary);
            var ns  = Helpers.WizardNamespace;

            var model = new OptionsPageModel(doc.Root.Elements(ns + "Options").FirstOrDefault());

            var view   = new OptionsPageView(model);
            var dialog = new BaseDialog {
                Content = view, Title = model.Title
            };

            if (dialog.ShowModal(Helpers.MainWindow))
            {
                foreach (var option in model.Options)
                {
                    var selected = option.Selected;
                    if (selected != null)
                    {
                        foreach (var replacement in selected.Replacements)
                        {
                            if (replacementsDictionary.MatchesCondition(replacement.Condition))
                            {
                                replacementsDictionary[replacement.Name] = replacement.Content;
                            }
                        }
                    }
                }
            }
            else
            {
                throw new WizardBackoutException();
            }
        }
コード例 #3
0
    public T DisplayDialog <T>(string _dialogName = null) where T : BaseDialog
    {
        T result = LoadDialog <T>(_dialogName);

        if (result != null)
        {
            result.dialogFrame.gameObject.SetActive(false);

            if (activeDialog != null)
            {
                BaseDialog dialogToHide = activeDialog;
                PushDialog(dialogToHide);

                activeDialog = result;

                dialogToHide.dialogFrame.Hide(() => {
                    activeDialog.dialogFrame.Show();
                });
            }
            else
            {
                activeDialog = result;
                activeDialog.dialogFrame.Show();
            }

            SetDirty();
        }

        return(result);
    }
コード例 #4
0
ファイル: OptionsWizard.cs プロジェクト: GilbertoBotaro/Eto
		public override void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
		{
			var doc = Helpers.LoadWizardXml(replacementsDictionary);
			var ns = Helpers.WizardNamespace;

			var model = new OptionsPageModel(doc.Root.Elements(ns + "Options").FirstOrDefault());

			var view = new OptionsPageView(model);
			var dialog = new BaseDialog { Content = view, Title = model.Title };
			if (dialog.ShowModal(Helpers.MainWindow))
			{
				foreach (var option in model.Options)
				{
					var selected = option.Selected;
					if (selected != null)
					{
						foreach (var replacement in selected.Replacements)
						{
							if (replacementsDictionary.MatchesCondition(replacement.Condition))
							{
								replacementsDictionary[replacement.Name] = replacement.Content;
							}
						}
					}
				}
			}
			else
				throw new WizardBackoutException();
			
		}
コード例 #5
0
        public override void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread();
            base.RunStarted(automationObject, replacementsDictionary, runKind, customParams);

            var source = new ParameterSource(replacementsDictionary);

            var model = new ProjectWizardPageModel(source);

            if (model.SupportsAppName)
            {
                model.AppName = replacementsDictionary["$projectname$"];
            }
            if (model.RequiresInput)
            {
                var panel  = new ProjectWizardPageView(model);
                var dialog = new BaseDialog {
                    Content = panel, Title = model.Title, ClientSize = new Size(-1, 400), Style = "eto.vstheme"
                };
                if (!dialog.ShowModal(Helpers.MainWindow))
                {
                    throw new WizardBackoutException();
                }

                // super hack: Due to a bug in VS we cannot use item templates without it crashing..
                // see Microsoft.VisualStudio.TemplateEngine.Wizard.TemplateEngineWizard.PostInvocationTelemetry
                // for details on why it doesn't work...
                if (customParams[0] is string str && !str.Contains("~PC"))
                {
                    str             = str.Replace("~IC", "~PC");
                    customParams[0] = str;
                }
            }
        }
コード例 #6
0
ファイル: DialogStack.cs プロジェクト: qucphng0205/Framework
    public bool Push(BaseDialog dialog)
    {
        if (dialog.Type == DialogType.Popup)
        {
            Debug.LogWarning("Cannot push popup into stack");
            return(false);
        }

        //get prelast
        BaseDialog preLast = null;

        if (stack.Count > 0)
        {
            preLast = stack.Peek();
        }

        //push
        dialog.Show();
        stack.Push(dialog);

        //check modal
        if (dialog.Type != DialogType.Modal && preLast != null)
        {
            preLast.Hide();
        }

        return(true);
    }
コード例 #7
0
 public void HideDialog(DialogConfig dialogConfig)
 {
     BaseDialog dialog = dialogMap[dialogConfig];
     if (!visibleDialog.Contains(dialog))
         return;
     dialog.DoHide();
 }
コード例 #8
0
ファイル: ProjectWizard.cs プロジェクト: zzlvff/Eto
        public override void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            base.RunStarted(automationObject, replacementsDictionary, runKind, customParams);

            var source = new ParameterSource(replacementsDictionary);
            var doc    = Helpers.LoadWizardXml(replacementsDictionary);
            var ns     = Helpers.WizardNamespace;

            var model = new ProjectWizardPageModel(source, doc.Root.Elements(ns + "Options").FirstOrDefault());

            if (model.SupportsAppName)
            {
                model.AppName = replacementsDictionary["$projectname$"];
            }
            if (model.RequiresInput)
            {
                var panel  = new ProjectWizardPageView(model);
                var dialog = new BaseDialog {
                    Content = panel, Title = model.Title, ClientSize = new Size(-1, 400), Style = "themed"
                };
                if (!dialog.ShowModal(Helpers.MainWindow))
                {
                    throw new WizardBackoutException();
                }
            }
        }
コード例 #9
0
        internal BaseDialogViewModel(BaseDialog dialog)
        {
            IsOpen = dialog
                     .ObserveProperty(x => x.IsOpen)
                     .ToReadOnlyReactivePropertySlim()
                     .AddTo(disposable);

            Title = dialog
                    .ObserveProperty(x => x.Title)
                    .ToReadOnlyReactivePropertySlim()
                    .AddTo(disposable);

            YesCommand = new ReactiveCommand();
            YesCommand.Subscribe(() =>
            {
                dialog.DialogResult = true;
                dialog.IsOpen       = false;
            });

            NoCommand = new ReactiveCommand();
            NoCommand.Subscribe(() =>
            {
                dialog.DialogResult = false;
                dialog.IsOpen       = false;
            });

            CancelCommand = new ReactiveCommand();
            CancelCommand.Subscribe(() =>
            {
                dialog.DialogResult = null;
                dialog.IsOpen       = false;
            });
        }
コード例 #10
0
 public void OnHideDialog(BaseDialog dialog)
 {
     dialog.OnHide();
     if (this.baseDialogs.Contains(dialog))
     {
         this.baseDialogs.Remove(dialog);
     }
 }
コード例 #11
0
ファイル: DialogStack.cs プロジェクト: qucphng0205/Framework
    public void Pop()
    {
        BaseDialog dialog = stack.Pop();

        dialog.Hide();

        stack.Peek().Show();
    }
コード例 #12
0
        public bool?ShowInfoDialog(string title, string question)
        {
            IView view = BaseDialog.ShowInfoDialog(title, question);

            view.Owner = Application.Current.MainWindow;

            return(view.ShowDialog());
        }
コード例 #13
0
        internal static Task CloseDialogAsync(BaseDialog dialog, DialogButton result)
        {
            if (dialog.Container == null)
            {
                throw new InvalidOperationException("The dialog is not in any container");
            }

            return(dialog.Container.RemoveDialogAsync(dialog));
        }
コード例 #14
0
    public void HideDialog(DialogIndex index)
    {
        BaseDialog dialog = dicDialog[index];

        dialog.HideDialog(() => {
            dialog.gameObject.SetActive(false);
            lsdialogShow.Remove(dialog);
        });
    }
コード例 #15
0
        /// <summary>
        /// 退费操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bBi_refund_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int rowHandle;

            string s_billType = string.Empty;
            string s_fa001    = string.Empty;

            if (tabPane1.SelectedPageIndex == 0)
            {
                return;
            }
            else if (tabPane1.SelectedPageIndex == 1)
            {
                rowHandle  = gridView3.FocusedRowHandle;
                s_billType = gridView3.GetRowCellValue(rowHandle, "BILLTYPE").ToString();
                s_fa001    = gridView3.GetRowCellValue(rowHandle, "FA001").ToString();
                string s_fa002 = SqlAssist.ExecuteScalar("select fa002 from fa01 where fa001='" + s_fa001 + "'").ToString();

                //检查与开票所在工作站是否一致!!!
                if (MiscAction.CheckWorkStationCompare(s_fa001, Envior.WORKSTATIONID, s_billType) == "0")
                {
                    XtraMessageBox.Show("此笔收费发票不是在当前工作站开具,不能继续!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }


                //if(s_fa002 == "2")
                //{
                //	XtraMessageBox.Show("此收费记录不能退费!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //	return;
                //}
                if (MiscAction.HaveRefund(s_fa001))
                {
                    XtraMessageBox.Show("此收费记录已经有退费记录,不能再次退费!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
            }

            BaseDialog frm_1 = null;

            if (s_billType == "F")
            {
                frm_1 = new Frm_refund_select();
            }
            else
            {
                frm_1 = new Frm_refund_select2();
            }

            frm_1.swapdata["SA010"] = s_fa001;                  //结算流水号
            frm_1.swapdata["SA020"] = s_billType;               //票别
            if (frm_1.ShowDialog() == DialogResult.OK)
            {
                this.RefreshData();
            }
            frm_1.Dispose();
        }
コード例 #16
0
ファイル: Find.cs プロジェクト: uvbs/FullSource
        private void buttonX1_Click(object sender, EventArgs e) // 输入查找的id
        {
            if (!this.radioDoodad.Checked && !this.radioItem.Checked && !this.radioNPC.Checked && !this.radioArmor.Checked && !this.radioTrinket.Checked && !this.radioWeapon.Checked)
            {
                MessageBox.Show("请先选择一种查找依据。");
                return;
            }

            string strCnName = string.Empty;

            if (this.radioNPC.Checked)
            {
                strCnName = "NPC编辑器";
            }
            else if (this.radioDoodad.Checked)
            {
                strCnName = "Doodad编辑器";
            }
            else if (this.radioItem.Checked)
            {
                strCnName = "道具(Other.tab)";
            }
            else if (this.radioArmor.Checked)
            {
                strCnName = "装备-防具";
            }
            else if (this.radioTrinket.Checked)
            {
                strCnName = "装备-饰品";
            }
            else if (this.radioWeapon.Checked)
            {
                strCnName = "装备-武器";
            }
            else
            {
                return;
            }
            this.WindowState = FormWindowState.Minimized;
            BaseDialog dlg = BaseForm.ShowModelInDialog_Static(strCnName);

            this.WindowState = FormWindowState.Normal;
            string strID   = string.Empty;
            string strName = string.Empty;

            if (dlg == null)
            {
                return;
            }

            strID   = dlg.GetPropertyValue("id").ToString();
            strName = dlg.GetPropertyValue("name").ToString();

            this.textBoxX1.Text = string.Format("[{0}] {1}", strID, strName);
            this.ActiveControl  = this.textBoxX1;
        }
コード例 #17
0
ファイル: BaseController.cs プロジェクト: aftnwinds/Utility
        /// <summary>
        /// 订阅对话框关闭事件
        /// </summary>
        /// <param name="view">对话框视图</param>
        /// <param name="confirm">是否订阅确定按钮默认事件</param>
        protected void SubCloseEvent(BaseDialog view, bool confirm)
        {
            SubCloseEvent(view);
            if (!confirm)
            {
                return;
            }

            view.Confirm.Click += (sender, args) => CloseDialog(view);
        }
コード例 #18
0
ファイル: BaseController.cs プロジェクト: aftnwinds/Utility
        /// <summary>
        /// 关闭对话框
        /// </summary>
        /// <param name="view">对话框视图</param>
        protected void CloseDialog(BaseDialog view)
        {
            view.Confirm.Click -= (sender, args) => CloseDialog(view);
            view.Cancel.Click  -= (sender, args) => view.Close();
            view.Closing       -= (sender, args) => DialogClosing(view, args);
            view.Closed        -= (sender, args) => view.Dispose();

            view.DialogResult = DialogResult.OK;
            view.Close();
        }
コード例 #19
0
 public void ShowDialog(DialogConfig dialogConfig,DialogParams dialogParams = null)
 {
     BaseDialog dialog = dialogMap[dialogConfig];
     if (visibleDialog.Contains(dialog))
         return;
    
     visibleDialog.Add(dialog);
     dialog.SetUp(dialogParams);
     dialog.DoShow();
 }
コード例 #20
0
        private async void QEButtonClicked(object sender, EventArgs e)
        {
            _calcTimer.Change(Timeout.Infinite, Timeout.Infinite);

            var dialog = new BaseDialog(AppResources.BountySimpleEditDialog_Title, new RealmFriendshipSimpleEdit());

            dialog.OnClose += delegate { _calcTimer.Change(TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(1)); };

            await PopupNavigation.Instance.PushAsync(dialog);
        }
コード例 #21
0
    private BaseDialog PopDialog()
    {
        BaseDialog result = null;

        if (dialogStack != null && dialogStack.Count > 0)
        {
            result = dialogStack.Pop();
        }

        return(result);
    }
コード例 #22
0
    public void OnShowDialog(DialogIndex index, DialogParam param = null, Action <BaseDialog> callback = null)
    {
        BaseDialog dialog = dicDialog[index];

        dialog.gameObject.SetActive(true);
        dialog.transform.SetAsLastSibling();
        dialog.ShowDialog(param, () => {
            callback?.Invoke(dialog);
        });
        lsdialogShow.Add(dialog);
    }
コード例 #23
0
 public override void OnAwake()
 {
     foreach (DialogIndex e in DialogConfig.DialogIndices)
     {
         GameObject dialogObject = Instantiate(Resources.Load("Dialog/" + e.ToString(), typeof(GameObject))) as GameObject;
         dialogObject.transform.SetParent(anchorDialog, false);
         BaseDialog dialog = dialogObject.GetComponent <BaseDialog>();
         dicDialog.Add(dialog.dialogIndex, dialog);
         dialogObject.SetActive(false);
     }
 }
コード例 #24
0
    public void TryCloseDialog(BaseDialog _dialog)
    {
        if (_dialog != null)
        {
            if (activeDialog != null)
            {
                if (_dialog == activeDialog)
                {
                    activeDialog = PopDialog();
                    if (activeDialog != null)
                    {
                        activeDialog.dialogFrame.gameObject.SetActive(false);
                    }

                    _dialog.dialogFrame.Hide(() => {
                        GameObjectHelper.Destroy(_dialog.dialogFrame.gameObject, 0.25f);
                        if (activeDialog != null)
                        {
                            activeDialog.dialogFrame.Show();
                        }
                    });

                    SetDirty();
                }
                else
                {
                    LogHelper.LogError("Cannot close dialog "
                                       + _dialog.GetType()
                                       + " "
                                       + _dialog.name
                                       + "; "
                                       + nameof(activeDialog)
                                       + " and "
                                       + nameof(_dialog)
                                       + " are not the same",
                                       this
                                       );
                }
            }
            else
            {
                LogHelper.LogError("Cannot close dialog "
                                   + _dialog.GetType().Name
                                   + " "
                                   + _dialog.name
                                   + "; "
                                   + nameof(activeDialog)
                                   + " is not set",
                                   this
                                   );
            }
        }
    }
コード例 #25
0
    private void PushDialog(BaseDialog _dialog)
    {
        if (_dialog != null)
        {
            if (dialogStack == null)
            {
                dialogStack = new Stack <BaseDialog>();
            }

            dialogStack.Push(_dialog);
        }
    }
コード例 #26
0
 protected async Task ForwardToDialog(IDialogContext context,
                                      IMessageActivity message, BaseDialog dialog)
 {
     DialogForwarded = true;
     await context.Forward(dialog, (dialogContext, result) =>
     {
         // Dialog resume callback
         // this method gets called when the child dialog calls context.Done()
         DialogForwarded = false;
         return(Task.CompletedTask);
     }, message);
 }
コード例 #27
0
    /// <summary>
    /// Shows the given tree. Use only for debugging.
    /// </summary>
    /// <param name="treeName">Name of the file containing the tree.</param>
    /// <returns>Human readable string containing all of the tree's nodes.</returns>
    public string showTree(string treeName)
    {
        BaseDialog dialog = registeredDialogs["Dialogs/Trees/" + treeName];
        string     result = "";

        while (dialog != null)
        {
            result += showNode(dialog, out dialog) + "\n";
        }

        return(result);
    }
コード例 #28
0
ファイル: DialogService.cs プロジェクト: Wolfteam/TimeIt
        public async Task <bool> ShowConfirmationDialogAsync(string title, string message, string okButtonText, string cancelButtonText)
        {
            var dialog = new ConfirmationDialog(title, message, okButtonText, cancelButtonText);
            var popup  = new BaseDialog <bool>(dialog);

            await PopupNavigation.Instance.PushAsync(popup);

            var(result, isDismissed) = await popup.PageClosedTask;

            await PopupNavigation.Instance.PopAsync();

            return(isDismissed ? false : result);
        }
コード例 #29
0
    private void DisplayBaseDialog(string _label, BaseDialog _dialog)
    {
        if (_dialog != null)
        {
            _label = string.Format("{0} : {1} ({2})",
                                   _label,
                                   _dialog.name,
                                   _dialog.GetType().Name
                                   );
        }

        EditorGUILayout.LabelField(_label);
    }
コード例 #30
0
    public void Close()
    {
        this.baseDialog   = null;
        this.dialogIsShow = false;
        if (screneCanvas != null)
        {
            screneCanvas.alpha = 1.0f;
//			screneCanvas.transform.localPosition = Vector3.zero;
            screneCanvas.transform.DOLocalMoveZ(0f, 0.2f);
            maskObj.SetActive(false);
        }
        screneCanvas = null;
    }
コード例 #31
0
 public void LoadDialog()
 {
     int dialogCount = (int)DialogConfig.COUNT;
     for (int i=0;i<dialogCount;++i)
     {
         DialogConfig dialogConfig = (DialogConfig)i;
         BaseDialog dialog = Resources.Load<BaseDialog>("Dialogs/" + dialogConfig.ToString());
         BaseDialog dialogInstance = Instantiate(dialog, this.transform);
         dialogInstance.gameObject.SetActive(false);
         dialogMap.Add(dialogConfig, dialogInstance);
         //Resources.UnloadAsset(dialog);
     }
 }
コード例 #32
0
ファイル: ProjectWizard.cs プロジェクト: GilbertoBotaro/Eto
		public override void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
		{
			base.RunStarted(automationObject, replacementsDictionary, runKind, customParams);

			var source = new ParameterSource(replacementsDictionary);
			var model = new ProjectWizardPageModel(source);
			model.AppName = replacementsDictionary["$projectname$"];
			if (model.RequiresInput)
			{
				var panel = new ProjectWizardPageView(model);
				var dialog = new BaseDialog { Content = panel, Title = model.Title };
				if (!dialog.ShowModal(Helpers.MainWindow))
					throw new WizardBackoutException();
			}
		}
コード例 #33
0
ファイル: ProjectWizard.cs プロジェクト: mhusen/Eto
		public override void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
		{
			base.RunStarted(automationObject, replacementsDictionary, runKind, customParams);

			var source = new ParameterSource(replacementsDictionary);
			var doc = Helpers.LoadWizardXml(replacementsDictionary);
			var ns = Helpers.WizardNamespace;

			var model = new ProjectWizardPageModel(source, doc.Root.Elements(ns + "Options").FirstOrDefault());
			model.AppName = replacementsDictionary["$projectname$"];
			if (model.RequiresInput)
			{
				var panel = new ProjectWizardPageView(model);
				var dialog = new BaseDialog { Content = panel, Title = model.Title, ClientSize = new Size(-1, 400) };
				if (!dialog.ShowModal(Helpers.MainWindow))
					throw new WizardBackoutException();
			}
		}