Example #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;
            }
        }
Example #2
0
 private void WebView_Navigating(object sender, WebBrowserNavigatingEventArgs e)
 {
     LoadingPanel.ResetLoading();
     LoadingPanel.Show();
     WebViewLayout.Hide();
     Height = m_initialHeight;
 }
Example #3
0
        private void WebView_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            var code = WebView.Document.GetElementsByTagName("code");

            if (code.Count > 0)
            {
                LoadingPanel.ResetLoading();
                LoadingPanel.Show();
                WebViewLayout.Hide();
                Height = m_initialHeight;

                AuthorizationVerifierWorker.RunWorkerAsync(code[0].InnerText);
            }
            else
            {
                LoadingPanel.Hide();
                LoadingPanel.ResetLoading();
                WebViewLayout.Show();
                WebViewLayout.BringToFront();

                Height = WebView.Document.Body.ScrollRectangle.Height;
            }
        }