private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
// whenever the browser navigates to a new url, try parsing the url
// the url may be the result of OAuth 2.0 authentication.
Facebook.FacebookOAuthResult oauthResult;
if (_fb.TryParseOAuthCallbackUrl(e.Url, out oauthResult))
{
// The url is the result of OAuth 2.0 authentication.
FacebookOAuthResult = oauthResult;
DialogResult = FacebookOAuthResult.IsSuccess ? DialogResult.OK : DialogResult.No;
}
else
{
// The url is NOT the result of OAuth 2.0 authentication.
FacebookOAuthResult = null;
}
}