Esempio n. 1
0
        public void SetDialogConfirm(IGitCredential gitCredential, bool isConfirmed)
        {
            try
            {
                CredentialsDialog credentialsDialog = (gitCredential as GitCredential)?.Dialog;

                if (credentialsDialog == null)
                {
                    return;
                }

                if (!isConfirmed)
                {
                    // Provided credentials where not valid
                    Track.Event("CredentialsDialog-Denied");
                    credentialsDialog.Confirm(false);
                    bool isDeleted = credentialsDialog.Delete();
                    Log.Debug($"Deleted: {isDeleted}");
                }
                else if (credentialsDialog.SaveChecked)
                {
                    // Provided credentials where valid and user want them to be cached
                    Track.Event("CredentialsDialog-Confirmed");
                    credentialsDialog.Confirm(true);
                }
                else
                {
                    // User did not want valid credentials to be cached
                    Track.Event("CredentialsDialog-NotCached");
                }
            }
            catch (ApplicationException e)
            {
                Log.Exception(e, "");
            }
        }