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 }); }
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; }
public void ShowDialog(object dialog) { Log.Information("Show Dialog {Type}", dialog.GetType()); ShowDialogEvent?.Invoke(dialog); }
private static void ShowErrorMessage(string s) { ShowDialogEvent?.Invoke(s); }