public override void Finish(bool result) { OnClose.SafeInvoke(result); OnClose = null; Close(); base.Finish(result); }
private void Open(PopupViewType popupViewType, Action <bool> onClose) { OnClose.SafeInvoke(false); OnClose = null; var viewNeedsAuthentication = popupViewType == PopupViewType.PublishView; if (viewNeedsAuthentication) { Client.GetCurrentUser(user => { OpenInternal(popupViewType, onClose); shouldCloseOnFinish = true; }, exception => { authenticationView.Initialize(exception); OpenInternal(PopupViewType.AuthenticationView, completedAuthentication => { if (completedAuthentication) { Open(popupViewType, onClose); } }); shouldCloseOnFinish = false; }); } else { OpenInternal(popupViewType, onClose); shouldCloseOnFinish = true; } }
private void Open(PopupViewType popupViewType, Action <bool> onClose) { OnClose.SafeInvoke(false); OnClose = null; var viewNeedsAuthentication = popupViewType == PopupViewType.PublishView; if (viewNeedsAuthentication) { var userHasAuthentication = false; foreach (var keychainConnection in Platform.Keychain.Connections.OrderByDescending(HostAddress.IsGitHubDotCom)) { var apiClient = new ApiClient(Platform.Keychain, Platform.ProcessManager, TaskManager, Environment, keychainConnection.Host); try { apiClient.EnsureValidCredentials(); userHasAuthentication = true; break; } catch (Exception ex) { Logger.Trace(ex, "Exception validating host {0}", keychainConnection.Host); } } if (userHasAuthentication) { OpenInternal(popupViewType, onClose); shouldCloseOnFinish = true; } else { authenticationView.Initialize(null); OpenInternal(PopupViewType.AuthenticationView, completedAuthentication => { if (completedAuthentication) { Open(popupViewType, onClose); } }); shouldCloseOnFinish = false; } } else { OpenInternal(popupViewType, onClose); shouldCloseOnFinish = true; } }
public override void Finish(bool result) { OnClose.SafeInvoke(result); OnClose = null; if (shouldCloseOnFinish) { shouldCloseOnFinish = false; Close(); } base.Finish(result); }
private void Open(PopupViewType popupViewType, Action <bool> onClose) { OnClose.SafeInvoke(false); OnClose = null; //Logger.Trace("OpenView: {0}", popupViewType.ToString()); var viewNeedsAuthentication = popupViewType == PopupViewType.PublishView; if (viewNeedsAuthentication) { //Logger.Trace("Validating to open view"); Client.ValidateCurrentUser(() => { //Logger.Trace("User validated opening view"); OpenInternal(popupViewType, onClose); shouldCloseOnFinish = true; }, exception => { //Logger.Trace("User required validation opening AuthenticationView"); authenticationView.Initialize(exception); OpenInternal(PopupViewType.AuthenticationView, completedAuthentication => { if (completedAuthentication) { //Logger.Trace("User completed validation opening view: {0}", popupViewType.ToString()); Open(popupViewType, onClose); } }); shouldCloseOnFinish = false; }); } else { OpenInternal(popupViewType, onClose); shouldCloseOnFinish = true; } }
public override void OnDestroy() { base.OnDestroy(); OnClose.SafeInvoke(false); OnClose = null; }
protected void RaiseOnClose(bool result) { OnClose.SafeInvoke(result); }