public WebBrowserForm()
        {
            InternetExplorerVersion.ChangeEmbeddedVersion();

            InitializeComponent();
            extendedWebBrowser1.OnNavigating().Subscribe(args =>
            {
                Log.Info().WriteLine(args.Url.AbsoluteUri);
            });
        }
예제 #2
0
        /// <summary>
        ///     Constructor for an OAuth login form
        /// </summary>
        /// <param name="browserTitle">title of the form</param>
        /// <param name="size">size of the form</param>
        /// <param name="authorizationLink">Uri for the link</param>
        /// <param name="callbackUrl">Uri for the callback</param>
        public OAuthLoginForm(string browserTitle, Size size, Uri authorizationLink, string callbackUrl)
        {
            // Make sure we use the most recent version of IE
            InternetExplorerVersion.ChangeEmbeddedVersion();

            _callbackUrl = callbackUrl;
            InitializeComponent();
            ClientSize           = size;
            Text                 = browserTitle;
            _addressTextBox.Text = authorizationLink.ToString();

            // The script errors are suppressed by using the ExtendedWebBrowser
            _browser.ScriptErrorsSuppressed = false;
            _browser.DocumentCompleted     += Browser_DocumentCompleted;
            _browser.Navigated  += Browser_Navigated;
            _browser.Navigating += Browser_Navigating;
            _browser.Navigate(authorizationLink);
            Load += OAuthLoginForm_Load;
        }
 public static bool SetInternetExplorerEmulationRegistryKey(InternetExplorerVersion ieVersion)
 {
     return(SetInternetExplorerEmulationRegistryKey((ieVersion == InternetExplorerVersion.None) ? null : (int?)ieVersion));
 }