public BrowserMiniForm(string url, int downloadOptions, WinInetCredentialsContext credentialsContext)
        {
            // record url to navigate to
            _url = url;

            // standard "flyout" form behavior
            DismissOnDeactivate = true;

            // dock inset for drawing of border
            DockPadding.All = 1;

            // background color is white to minimize flashing problem when dismissing
            BackColor = Color.White;

            // initialize browser control
            _explorerBrowserControl      = new ExplorerBrowserControl();
            _explorerBrowserControl.Dock = DockStyle.Fill;
            Controls.Add(_explorerBrowserControl);

            // install download options if requested
            if (downloadOptions > 0)
            {
                _explorerBrowserControl.DownloadOptions = downloadOptions;
            }

            // install network credential if requested
            if (credentialsContext != null)
            {
                if (credentialsContext.NetworkCredential != null)
                {
                    _explorerBrowserControl.NetworkCredential = credentialsContext.NetworkCredential;
                }

                if (credentialsContext.CookieString != null)
                {
                    _explorerBrowserControl.SetCookies(credentialsContext.CookieString.Url, credentialsContext.CookieString.Cookies);
                }
            }

            // other options
            _explorerBrowserControl.Silent = true;

            // Navigate to about:blank for installation of ui customizations. Note that this step is CRITICAL
            // to ensuring that not only our custom ui hooks get installed but also to ensure that our DLCTL
            // options (which control security) are registered prior to the fectching of the content.
            _explorerBrowserControl.DocumentComplete += new BrowserDocumentEventHandler(_explorerBrowserControl_AboutBlankDocumentComplete);
            _explorerBrowserControl.Navigate("about:blank");
        }
        public BrowserMiniForm(string url, int downloadOptions, WinInetCredentialsContext credentialsContext)
        {
            // record url to navigate to
            _url = url;

            // standard "flyout" form behavior
            DismissOnDeactivate = true;

            // dock inset for drawing of border
            DockPadding.All = 1;

            // background color is white to minimize flashing problem when dismissing
            BackColor = Color.White;

            // initialize browser control
            _explorerBrowserControl = new ExplorerBrowserControl();
            _explorerBrowserControl.Dock = DockStyle.Fill;
            Controls.Add(_explorerBrowserControl);

            // install download options if requested
            if (downloadOptions > 0)
            {
                _explorerBrowserControl.DownloadOptions = downloadOptions;
            }

            // install network credential if requested
            if (credentialsContext != null)
            {
                if (credentialsContext.NetworkCredential != null)
                    _explorerBrowserControl.NetworkCredential = credentialsContext.NetworkCredential;

                if (credentialsContext.CookieString != null)
                    _explorerBrowserControl.SetCookies(credentialsContext.CookieString.Url, credentialsContext.CookieString.Cookies);
            }

            // other options
            _explorerBrowserControl.Silent = true;

            // Navigate to about:blank for installation of ui customizations. Note that this step is CRITICAL
            // to ensuring that not only our custom ui hooks get installed but also to ensure that our DLCTL
            // options (which control security) are registered prior to the fectching of the content.
            _explorerBrowserControl.DocumentComplete += new BrowserDocumentEventHandler(_explorerBrowserControl_AboutBlankDocumentComplete);
            _explorerBrowserControl.Navigate("about:blank");
        }