コード例 #1
0
        private void ShowDialogLogic(ShowDialogEvent evt)
        {
            // init the dialog on first use.
            if (_basicDialog == null)
            {
                _basicDialog  = App.ContainerInstance.GetInstance <BasicDialogView>();
                CurrentDialog = new ViewDefinition {
                    ID = ViewList.Views.ShowDialog, IsOverLay = true, View = _basicDialog
                };
            }

            if (evt.Show)
            {
                _basicDialog.SetDialogAction(evt.DialogAction);
                ShowDialog = true;
            }
            else
            {
                _basicDialog.SetDialogAction(null);
                ShowDialog = false;
            }

            _eventAggregator.Publish <ShowViewEvent>(new ShowViewEvent {
                ID = Common.ViewList.Views.MainWindow
            });
        }
コード例 #2
0
ファイル: RequestManager.cs プロジェクト: killbug2004/WSProf
		DecryptResult m_encryptionUi_OnShowDialog(object formToBeShown)
		{
			bool invoked = false;
			DecryptResult decryptResult = DecryptResult.Skip;

			// For the encryption dialog to be modal we need to give it a parent window, if we are in dynamic mode this will be the protect dialog...
			IInvokeInThreadDialog parentDialog = null;
			if (m_policyClientDialog != null)
			{
				parentDialog = m_policyClientDialog;
			}
			if (m_policyClientProgressDialog != null) // ... in non-dynamic mode(or Send'n'Protect) this is the progress dialog.
			{
				parentDialog = m_policyClientProgressDialog;
			}


			if (parentDialog != null)
			{
				ShowDialogEvent dlgevent = new ShowDialogEvent(ShowExtendedPasswordDialog);
				object[] args = new object[] { formToBeShown };

				int i = 0;
				int retries = 10;

				object retval = parentDialog.InvokeInFormThread(dlgevent, args, out invoked);
				while (!invoked)
				{
					Thread.Sleep(50);
					retval = parentDialog.InvokeInFormThread(dlgevent, args, out invoked);

					if (i++ > retries)
					{
						break;
					}
				}

				if (invoked)
				{
					decryptResult = (DecryptResult) retval;
				}
				else // Was unable to invoke, meaning there is no parent dialog to use(or its not been shown yet); scenario == dynamic discovery ON and SentAndProtect used.
				{
					return ShowExtendedPasswordDialog(formToBeShown);
				}
			}

			return decryptResult;
		}
コード例 #3
0
 public void ShowDialog(object dialog)
 {
     Log.Information("Show Dialog {Type}", dialog.GetType());
     ShowDialogEvent?.Invoke(dialog);
 }
コード例 #4
0
 private static void ShowErrorMessage(string s)
 {
     ShowDialogEvent?.Invoke(s);
 }