Example #1
0
        CertOperationResult GetUserResponse(
            string title, string message, PlasticCertInfo serverCertificate)
        {
            GuiMessage.GuiMessageResponseButton result =
                GuiMessage.GuiMessageResponseButton.Third;

            GUIActionRunner.RunGUIAction(delegate {
                result = GuiMessage.ShowQuestion(
                    title, GetCertificateMessageString(message, serverCertificate),
                    PlasticLocalization.GetString(PlasticLocalization.Name.YesButton),
                    PlasticLocalization.GetString(PlasticLocalization.Name.NoButton),
                    PlasticLocalization.GetString(PlasticLocalization.Name.CancelButton),
                    true);
            });

            switch (result)
            {
            case GuiMessage.GuiMessageResponseButton.First:
                return(CertOperationResult.AddToStore);

            case GuiMessage.GuiMessageResponseButton.Second:
                return(CertOperationResult.DoNotAddToStore);

            case GuiMessage.GuiMessageResponseButton.Third:
                return(CertOperationResult.Cancel);

            default:
                return(CertOperationResult.Cancel);
            }
        }
Example #2
0
        static void HandleLog(string logString, string stackTrace, LogType type)
        {
            if (type != LogType.Exception)
            {
                return;
            }

            if (!IsPlasticStackTrace(stackTrace))
            {
                return;
            }

            GUIActionRunner.RunGUIAction(delegate {
                mLog.ErrorFormat("[HandleLog] Unexpected error: {0}", logString);
                mLog.DebugFormat("Stack trace: {0}", stackTrace);

                string message = logString;
                if (ExceptionsHandler.DumpStackTrace())
                {
                    message += Environment.NewLine + stackTrace;
                }

                GuiMessage.ShowError(message);
            });
        }
Example #3
0
 void AskCredentialsToUser.IGui.ShowSaveProfileErrorMessage(string message)
 {
     GUIActionRunner.RunGUIAction(delegate
     {
         GuiMessage.ShowError(string.Format(
                                  PlasticLocalization.GetString(
                                      PlasticLocalization.Name.CredentialsErrorSavingProfile),
                                  message));
     });
 }
Example #4
0
        public string GetEncryptionEncryptedPassword(string server)
        {
            string result = null;

            GUIActionRunner.RunGUIAction(delegate
            {
                result = AskForEncryptionPassword(server);
            });

            return(result);
        }
Example #5
0
        AskCredentialsToUser.DialogData AskCredentialsToUser.IGui.AskUserForSSOCredentials(string cloudServer)
        {
            AskCredentialsToUser.DialogData result = null;

            // Check SSO auto login here
            GUIActionRunner.RunGUIAction(delegate
            {
                result = RunCredentialsRequest(cloudServer);
            });

            return(result);
        }
Example #6
0
        AskCredentialsToUser.DialogData AskCredentialsToUser.IGui.AskUserForCredentials(string servername)
        {
            AskCredentialsToUser.DialogData result = null;

            GUIActionRunner.RunGUIAction(delegate
            {
                result = CredentialsDialog.RequestCredentials(
                    servername, ParentWindow.Get());
            });

            return(result);
        }
        string ClientEncryptionServiceProvider.IEncryptioPasswordProvider
        .GetEncryptionEncryptedPassword(string server)
        {
            string result = null;

            GUIActionRunner.RunGUIAction(delegate
            {
                result = AskForEncryptionPassword(server);
            });

            return(result);
        }
        AskCredentialsToUser.DialogData AskCredentialsToUser.IGui.AskUserForSSOCredentials(string cloudServer)
        {
            AskCredentialsToUser.DialogData result = null;

            GUIActionRunner.RunGUIAction(delegate
            {
                result = SSOCredentialsDialog.RequestCredentials(
                    cloudServer, mParentWindow);
            });

            return(result);
        }
Example #9
0
        CredentialsDialogData ICredentialsUI.AskUserForCredentials(string servername)
        {
            CredentialsDialogData result = null;

            GUIActionRunner.RunGUIAction(delegate
            {
                result = CredentialsDialog.RequestCredentials(
                    servername, mParentWindow);
            });

            return(result);
        }
Example #10
0
        static void HandleUnhandledException(object sender, UnhandledExceptionEventArgs args)
        {
            Exception ex = (Exception)args.ExceptionObject;

            if (IsExitGUIException(ex) ||
                !IsPlasticStackTrace(ex.StackTrace))
            {
                return;
            }

            GUIActionRunner.RunGUIAction(delegate {
                ExceptionsHandler.HandleException("HandleUnhandledException", ex);
            });
        }
Example #11
0
        public bool ContinueWithPendingChanges()
        {
            bool result = false;

            GUIActionRunner.RunGUIAction(() =>
            {
                result = ConfirmContinueWithPendingChangesDialog.ConfirmContinue(
                    mTitle,
                    mExplanation,
                    mViewSwitcher,
                    mParentWindow);
            });

            return(result);
        }
Example #12
0
        public bool AcceptInvalidHostname(string certHostname, string serverHostname)
        {
            bool result = false;

            GUIActionRunner.RunGUIAction(delegate {
                result = GuiMessage.ShowQuestion(
                    PlasticLocalization.GetString(
                        PlasticLocalization.Name.InvalidCertificateHostnameTitle),
                    PlasticLocalization.GetString(
                        PlasticLocalization.Name.InvalidCertificateHostnameMessage,
                        certHostname, serverHostname),
                    PlasticLocalization.GetString(PlasticLocalization.Name.YesButton));
            });

            return(result);
        }
Example #13
0
        bool IChannelCertificateUI.AcceptInvalidHostname(string certHostname, string serverHostname)
        {
            bool result = false;

            GUIActionRunner.RunGUIAction(delegate {
                result = EditorUtility.DisplayDialog(
                    PlasticLocalization.GetString(
                        PlasticLocalization.Name.InvalidCertificateHostnameTitle),
                    PlasticLocalization.GetString(
                        PlasticLocalization.Name.InvalidCertificateHostnameMessage,
                        certHostname, serverHostname),
                    PlasticLocalization.GetString(PlasticLocalization.Name.YesButton),
                    PlasticLocalization.GetString(PlasticLocalization.Name.NoButton));
            });

            return(result);
        }