Пример #1
0
        private void WebView_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            var urlQuery = e.Url.ParseQueryStringToNameValue(true);

            if (urlQuery.AllKeys.Contains("error"))
            {
                LoadingPanel.ResetLoading();
                LoadingPanel.Show();
                WebViewLayout.Hide();
                ReturnToPanel();

                Height = m_initialHeight;
            }
            else if (urlQuery.AllKeys.Contains("access_token"))
            {
                LoadingPanel.ResetLoading();
                LoadingPanel.Show();
                WebViewLayout.Hide();

                FacebookApi.Token = new OAuthCryptoSet(urlQuery.Get("access_token"));
                FacebookApi.Code  = urlQuery.Get("code");

                Height = m_initialHeight;
                UserDataWorker.RunWorkerAsync();
            }
            else
            {
                LoadingPanel.Hide();
                WebViewLayout.Show();
                WebViewLayout.BringToFront();

                Height = (Int32)(WebView.Document.Body.ScrollRectangle.Height * 1.3) + WebViewNoticeLabel.Height;
            }
        }
Пример #2
0
 private void AuthorizationVerifyWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         if (e.Result == null)
         {
             throw new OAuthUnexpectedResponse();
         }
         else
         {
             UserDataWorker.RunWorkerAsync();
         }
     }
     else
     {
         throw e.Error;
     }
 }