コード例 #1
0
        /// <summary>
        /// Initializes the authentication manager.
        /// </summary>
        /// <remarks>
        /// Once the authentication manager is initialized it takes control of the embedded
        /// webbrowser of the widget.
        /// </remarks>
        /// <param name="widget"></param>
        public void Initialize(IAuthenticationWidget widget)
        {
            _widgetHtml     = GetWidgetHtml(widget);
            _widget         = widget;
            _originalHeight = widget.Height;
            _originalWidth  = widget.Width;

            ConnectEvents();
            _widget.WebBrowser.LoadURL(LocalhostWidgetUrl);
        }
コード例 #2
0
        /// <summary>
        /// Retrieves the base widget html from the embedded resource and builds
        /// rest of the html from the widget configuration.
        /// </summary>
        /// <param name="widget"></param>
        /// <returns></returns>
        private string GetWidgetHtml(IAuthenticationWidget widget)
        {
            string htmlFormatString = _baseWidgetHtml;

            if (string.IsNullOrEmpty(htmlFormatString))
            {
                throw new InvalidOperationException("html resource missing!");
            }

            string forceReauth = widget.ForceReauth.ToString(CultureInfo.InvariantCulture).ToLower();

            return(string.Format(htmlFormatString, widget.ApplicationName, LocalhostWidgetUrl, forceReauth));
        }
コード例 #3
0
        public void Dispose()
        {
            if (_widget != null && _widget.WebBrowser != null)
            {
                DisconnectEvents();
            }
            _widget = null;

            if (_docCompleteTimer != null)
            {
                if (_docCompleteTimer.Enabled)
                {
                    _docCompleteTimer.Stop();
                }

                _docCompleteTimer.Dispose();
            }
        }