Exemplo n.º 1
0
        public IObservable <Unit> LogOut(IRepositoryHost host)
        {
            Guard.ArgumentNotNull(host, nameof(host));

            var address  = host.Address;
            var isDotCom = HostAddress.GitHubDotComHostAddress == address;

            return(host.LogOut()
                   .ObserveOn(RxApp.MainThreadScheduler)
                   .Do(result =>
            {
                // reset the logged out host property to null
                // it'll know what to do
                if (isDotCom)
                {
                    GitHubHost = null;
                }
                else
                {
                    EnterpriseHost = null;
                }
                connectionManager.RemoveConnection(address);
                RepositoryHostFactory.Remove(host);
            }));
        }
Exemplo n.º 2
0
        public IObservable <Unit> LogOut(IRepositoryHost host)
        {
            var address  = host.Address;
            var isDotCom = HostAddress.GitHubDotComHostAddress == address;

            return(host.LogOut()
                   .Do(result =>
            {
                // reset the logged out host property to null
                // it'll know what to do
                if (isDotCom)
                {
                    GitHubHost = null;
                }
                else
                {
                    EnterpriseHost = null;
                }
                connectionManager.RemoveConnection(address);
                RepositoryHostFactory.Remove(host);
            }));
        }