예제 #1
0
        public async Task <IAuthStatus> AuthorizeUserAsync(string password)
        {
            IAuthStatus          status = null;
            WebTransferException webEx  = null;

            try
            {
                IsBusy = true;
                status = await HockeyClient.Current.AsInternal().AuthorizeUserAsync(this.Email, password ?? "");

                if (status.IsAuthorized)
                {
                    await AuthManager.Current.UpdateAuthStatusAsync(status);
                }
            }
            catch (WebTransferException wte)
            {
                webEx = wte;
            }

            finally
            {
                IsBusy = false;
            }
            if (webEx != null)
            {
                await HandleNetworkError(webEx);
            }
            return(status);
        }
예제 #2
0
        public async Task <IAuthStatus> IdentifyUserAsync()
        {
            IAuthStatus          status = null;
            WebTransferException webEx  = null;

            try
            {
                IsBusy = true;
                status = await HockeyClient.Current.AsInternal().IdentifyUserAsync(this.Email, this.AppSecret);

                if (status.IsIdentified)
                {
                    await AuthManager.Current.UpdateAuthStatusAsync(status);
                }
            }
            catch (WebTransferException wte)
            {
                webEx = wte;
            }
            finally
            {
                IsBusy = false;
            }
            if (webEx != null)
            {
                await HandleNetworkError(webEx);
            }
            return(status);
        }
예제 #3
0
 internal void HandleNetworkError(WebTransferException wte)
 {
     MessageBox.Show(LocalizedStrings.LocalizedResources.AuthNoInternet);
 }
예제 #4
0
 internal async Task HandleNetworkError(WebTransferException wte)
 {
     await new MessageDialog(LocalizedStrings.LocalizedResources.AuthNoInternet).ShowAsync();
 }