예제 #1
0
        /// <summary>
        /// Ensures that the child controls have been built, but doesn't set control
        /// properties that require executing <see cref="Control.EnsureID"/> in order to avoid
        /// certain initialization order problems.
        /// </summary>
        /// <remarks>
        /// We don't just call EnsureChildControls() and then set the property on
        /// this.textBox itself because (apparently) setting this property in the ASPX
        /// page and thus calling this EnsureID() via EnsureChildControls() this early
        /// results in no ID.
        /// </remarks>
        protected virtual void EnsureChildControlsAreCreatedSafe()
        {
            // If we've already created the child controls, this method is a no-op.
            if (this.textBox != null)
            {
                return;
            }

            var selectorButton = this.Buttons.OfType <SelectorInfoCardButton>().FirstOrDefault();

            if (selectorButton != null)
            {
                var selector = selectorButton.InfoCardSelector;
                selector.ClaimsRequested.Add(new ClaimType {
                    Name = ClaimTypes.PPID
                });
                selector.ImageSize             = InfoCardImageSize.Size60x42;
                selector.ReceivedToken        += this.InfoCardSelector_ReceivedToken;
                selector.TokenProcessingError += this.InfoCardSelector_TokenProcessingError;
                this.Controls.Add(selector);
            }

            this.textBox                         = new OpenIdAjaxTextBox();
            this.textBox.ID                      = "openid_identifier";
            this.textBox.HookFormSubmit          = false;
            this.textBox.ShowLogOnPostBackButton = true;

            this.positiveAssertionField = new HiddenField();
        }
예제 #2
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            this.EnsureID();
            ErrorUtilities.VerifyInternal(!string.IsNullOrEmpty(this.UniqueID), "Control.EnsureID() failed to give us a unique ID.  Try setting an ID on the OpenIdSelector control.  But please also file this bug with the project owners.");

            var selectorButton = this.Buttons.OfType <SelectorInfoCardButton>().FirstOrDefault();

            if (selectorButton != null)
            {
                var selector = selectorButton.InfoCardSelector;
                selector.ClaimsRequested.Add(new ClaimType {
                    Name = ClaimTypes.PPID
                });
                selector.ImageSize             = InfoCardImageSize.Size60x42;
                selector.ReceivedToken        += this.InfoCardSelector_ReceivedToken;
                selector.TokenProcessingError += this.InfoCardSelector_TokenProcessingError;
                this.Controls.Add(selector);
            }

            this.textBox                         = new OpenIdAjaxTextBox();
            this.textBox.ID                      = "openid_identifier";
            this.textBox.HookFormSubmit          = false;
            this.textBox.ShowLogOnPostBackButton = true;
            this.textBox.DownloadYahooUILibrary  = this.downloadYuiLibrary;
            this.Controls.Add(this.textBox);

            this.positiveAssertionField    = new HiddenField();
            this.positiveAssertionField.ID = this.ID + AuthDataFormKeySuffix;
            this.Controls.Add(this.positiveAssertionField);
        }
예제 #3
0
        /// <summary>
        /// Ensures that the child controls have been built, but doesn't set control
        /// properties that require executing <see cref="Control.EnsureID"/> in order to avoid
        /// certain initialization order problems.
        /// </summary>
        /// <remarks>
        /// We don't just call EnsureChildControls() and then set the property on
        /// this.textBox itself because (apparently) setting this property in the ASPX
        /// page and thus calling this EnsureID() via EnsureChildControls() this early
        /// results in no ID.
        /// </remarks>
        protected virtual void EnsureChildControlsAreCreatedSafe()
        {
            // If we've already created the child controls, this method is a no-op.
            if (this.textBox != null)
            {
                return;
            }

            this.textBox                         = new OpenIdAjaxTextBox();
            this.textBox.ID                      = "openid_identifier";
            this.textBox.HookFormSubmit          = false;
            this.textBox.ShowLogOnPostBackButton = true;

            this.positiveAssertionField = new HiddenField();
        }
예제 #4
0
		/// <summary>
		/// Ensures that the child controls have been built, but doesn't set control
		/// properties that require executing <see cref="Control.EnsureID"/> in order to avoid
		/// certain initialization order problems.
		/// </summary>
		/// <remarks>
		/// We don't just call EnsureChildControls() and then set the property on
		/// this.textBox itself because (apparently) setting this property in the ASPX
		/// page and thus calling this EnsureID() via EnsureChildControls() this early
		/// results in no ID.
		/// </remarks>
		protected virtual void EnsureChildControlsAreCreatedSafe() {
			// If we've already created the child controls, this method is a no-op.
			if (this.textBox != null) {
				return;
			}

			this.textBox = new OpenIdAjaxTextBox();
			this.textBox.ID = "openid_identifier";
			this.textBox.HookFormSubmit = false;
			this.textBox.ShowLogOnPostBackButton = true;

			this.positiveAssertionField = new HiddenField();
		}
예제 #5
0
		/// <summary>
		/// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
		/// </summary>
		protected override void CreateChildControls() {
			base.CreateChildControls();
			this.EnsureID();
			ErrorUtilities.VerifyInternal(!string.IsNullOrEmpty(this.UniqueID), "Control.EnsureID() failed to give us a unique ID.  Try setting an ID on the OpenIdSelector control.  But please also file this bug with the project owners.");

			var selectorButton = this.Buttons.OfType<SelectorInfoCardButton>().FirstOrDefault();
			if (selectorButton != null) {
				var selector = selectorButton.InfoCardSelector;
				selector.ClaimsRequested.Add(new ClaimType { Name = ClaimTypes.PPID });
				selector.ImageSize = InfoCardImageSize.Size60x42;
				selector.ReceivedToken += this.InfoCardSelector_ReceivedToken;
				selector.TokenProcessingError += this.InfoCardSelector_TokenProcessingError;
				this.Controls.Add(selector);
			}

			this.textBox = new OpenIdAjaxTextBox();
			this.textBox.ID = "openid_identifier";
			this.textBox.HookFormSubmit = false;
			this.textBox.ShowLogOnPostBackButton = true;
			this.textBox.DownloadYahooUILibrary = this.downloadYuiLibrary;
			this.Controls.Add(this.textBox);

			this.positiveAssertionField = new HiddenField();
			this.positiveAssertionField.ID = this.ID + AuthDataFormKeySuffix;
			this.Controls.Add(this.positiveAssertionField);
		}
예제 #6
0
		/// <summary>
		/// Ensures that the child controls have been built, but doesn't set control
		/// properties that require executing <see cref="Control.EnsureID"/> in order to avoid
		/// certain initialization order problems.
		/// </summary>
		/// <remarks>
		/// We don't just call EnsureChildControls() and then set the property on
		/// this.textBox itself because (apparently) setting this property in the ASPX
		/// page and thus calling this EnsureID() via EnsureChildControls() this early
		/// results in no ID.
		/// </remarks>
		protected virtual void EnsureChildControlsAreCreatedSafe() {
			// If we've already created the child controls, this method is a no-op.
			if (this.textBox != null) {
				return;
			}

			var selectorButton = this.Buttons.OfType<SelectorInfoCardButton>().FirstOrDefault();
			if (selectorButton != null) {
				var selector = selectorButton.InfoCardSelector;
				selector.ClaimsRequested.Add(new ClaimType { Name = ClaimTypes.PPID });
				selector.ImageSize = InfoCardImageSize.Size60x42;
				selector.ReceivedToken += this.InfoCardSelector_ReceivedToken;
				selector.TokenProcessingError += this.InfoCardSelector_TokenProcessingError;
				this.Controls.Add(selector);
			}

			this.textBox = new OpenIdAjaxTextBox();
			this.textBox.ID = "openid_identifier";
			this.textBox.HookFormSubmit = false;
			this.textBox.ShowLogOnPostBackButton = true;

			this.positiveAssertionField = new HiddenField();
		}