private void webBrowser_Navigated(object sender, WebBrowserNavigatedEventArgs e)
        {
            this.Text = webBrowser.DocumentTitle;

            if (this.webBrowser.Url.AbsoluteUri.StartsWith(EndUrl))
            {
                this.AuthResult = new AuthResult(this.webBrowser.Url);
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.Close();
            }
        }
        private static async Task <OneDriveClient> OnAuthComplete(LiveAuthClient authClient, AuthResult result)
        {
            if (null != result.AuthorizeCode)
            {
                try
                {
                    LiveConnectSession session = await authClient.ExchangeAuthCodeAsync(result.AuthorizeCode);

                    var OneDrive = new OneDriveClient(new LiveConnectClient(session));
                    return(OneDrive);
                }
                catch (LiveAuthException aex)
                {
                    throw;
                }
                catch (LiveConnectException cex)
                {
                    throw;
                }
            }

            return(null);;
        }
        private static async Task<OneDriveClient> OnAuthComplete(LiveAuthClient authClient, AuthResult result)
        {
            if (null != result.AuthorizeCode)
            {
                try
                {
                    LiveConnectSession session = await authClient.ExchangeAuthCodeAsync(result.AuthorizeCode);
                    var OneDrive = new OneDriveClient(new LiveConnectClient(session));
                    return OneDrive;
                }
                catch (LiveAuthException aex)
                {
                    throw;
                }
                catch (LiveConnectException cex)
                {
                    throw;
                }
            }

            return null; ;
        }