示例#1
0
        public void ShowDialogTest()
        {
            DialogProviderMock    mock     = new DialogProviderMock();
            Action <DialogResult> callback = result => { };

            ModalDialogManager.Initialize(mock);
            ModalDialogManager.ShowDialog("title", "text", DialogButtons.OkayCancel, callback);
            Assert.AreEqual("title", mock.Title);
            Assert.AreEqual("text", mock.Text);
            Assert.AreEqual(DialogButtons.OkayCancel, mock.Buttons);
            Assert.AreSame(callback, mock.Callback);
        }
        ///<inheritdoc/>
        public override async void ExecuteCommand(object param = null)
        {
            TEntity entity = param is TEntity ? param as TEntity : Entity;

            IsEnabled = false;
            if (ShowDeleteDialog)
            {
                string text = DeleteDialogTextFactory != null?DeleteDialogTextFactory.Invoke(entity) : DeleteDialogText;

                ModalDialogManager.ShowDialog(DeleteDialogTitle, text, DialogButtons.YesNo, async(result) =>
                {
                    if (result == DialogResult.Yes)
                    {
                        await DeleteCoreAsync(entity);
                    }
                });
            }
            else
            {
                await DeleteCoreAsync(entity);
            }
        }
示例#3
0
 private void CreateInvisibleDialog()
 {
     invisibleDlg = new GameObject("InvisibleDialog");
     dialogMgr.ShowDialog(invisibleDlg);
 }