Пример #1
0
		public static CreateUserWizard CreateTestControl (Page p)
		{
			LiteralControl lcb = new LiteralControl (HtmlDiff.BEGIN_TAG);
			LiteralControl lce = new LiteralControl (HtmlDiff.END_TAG);

			CreateUserWizard w = new CreateUserWizard ();
			w.ID = "CreateUserWizard1";

			CreateUserWizardStep step1 = new CreateUserWizardStep ();
			CompleteWizardStep step2 = new CompleteWizardStep ();

			w.MembershipProvider = "FakeProvider";
			w.WizardSteps.Add (step1);
			w.WizardSteps.Add (step2);

			p.Form.Controls.Add (lcb);
			p.Form.Controls.Add (w);
			p.Form.Controls.Add (lce);

			//p.ClientScript.RegisterForEventValidation (w.ID);

			return w;
		}
		void InstantiateCreateUserWizardStep (CreateUserWizardStep step)
		{
			CreateUserStepContainer contentTemplateContainer = new CreateUserStepContainer (this);
			if (step.ContentTemplate != null) {
				step.ContentTemplate.InstantiateIn (contentTemplateContainer.InnerCell);
			}
			else {
				new CreateUserStepTemplate (this).InstantiateIn (contentTemplateContainer.InnerCell);
				contentTemplateContainer.ConfirmDefaultTemplate ();
				contentTemplateContainer.EnsureValidatorsState ();
			}

			step.ContentTemplateContainer = contentTemplateContainer;
			step.Controls.Clear ();
			step.Controls.Add (contentTemplateContainer);

			CreateUserNavigationContainer customNavigationTemplateContainer = new CreateUserNavigationContainer (this);
			if (step.CustomNavigationTemplate != null) {
				step.CustomNavigationTemplate.InstantiateIn (customNavigationTemplateContainer);
			}
			else {
				new CreateUserStepNavigationTemplate (this).InstantiateIn (customNavigationTemplateContainer);
				customNavigationTemplateContainer.ConfirmDefaultTemplate ();
			}
			RegisterCustomNavigation (step, customNavigationTemplateContainer);

			step.CustomNavigationTemplateContainer = customNavigationTemplateContainer;
		}
 private void EnsureCreateUserSteps()
 {
     bool flag = false;
     bool flag2 = false;
     foreach (WizardStepBase base2 in this.WizardSteps)
     {
         CreateUserWizardStep step = base2 as CreateUserWizardStep;
         if (step != null)
         {
             if (flag)
             {
                 throw new HttpException(System.Web.SR.GetString("CreateUserWizard_DuplicateCreateUserWizardStep"));
             }
             flag = true;
             this._createUserStep = step;
         }
         else
         {
             CompleteWizardStep step2 = base2 as CompleteWizardStep;
             if (step2 != null)
             {
                 if (flag2)
                 {
                     throw new HttpException(System.Web.SR.GetString("CreateUserWizard_DuplicateCompleteWizardStep"));
                 }
                 flag2 = true;
                 this._completeStep = step2;
             }
         }
     }
     if (!flag)
     {
         this._createUserStep = new CreateUserWizardStep();
         this._createUserStep.ApplyStyleSheetSkin(this.Page);
         this.WizardSteps.AddAt(0, this._createUserStep);
         this._createUserStep.Active = true;
     }
     if (!flag2)
     {
         this._completeStep = new CompleteWizardStep();
         this._completeStep.ApplyStyleSheetSkin(this.Page);
         this.WizardSteps.Add(this._completeStep);
     }
     if (this.ActiveStepIndex == -1)
     {
         this.ActiveStepIndex = 0;
     }
 }
 protected internal override void CreateChildControls()
 {
     this._createUserStep = null;
     this._completeStep = null;
     base.CreateChildControls();
     this.UpdateValidators();
 }
        /// <devdoc>
        ///     Creates the default steps if they were not specified declaritively
        /// </devdoc>
        private void EnsureCreateUserSteps() {
            bool foundCreate = false;
            bool foundComplete = false;
            foreach (WizardStepBase step in WizardSteps) {
                var createUserStep = step as CreateUserWizardStep;
                if (createUserStep != null) {
                    if (foundCreate) {
                        throw new HttpException(SR.GetString(SR.CreateUserWizard_DuplicateCreateUserWizardStep));
                    }

                    foundCreate = true;
                    _createUserStep = createUserStep;
                } else {
                    var completeStep = step as CompleteWizardStep;
                    if (completeStep != null) {
                        if (foundComplete) {
                            throw new HttpException(SR.GetString(SR.CreateUserWizard_DuplicateCompleteWizardStep));
                        }

                        foundComplete = true;
                        _completeStep = completeStep;
                    }
                }
            }
            if (!foundCreate) {
                // This default step cannot disable ViewState, otherwise AllowReturn will not work properly.
                // VSWhidbey 459041
                _createUserStep = new CreateUserWizardStep();
                // Internally created control needs to be themed as well. VSWhidbey 377952
                _createUserStep.ApplyStyleSheetSkin(Page);
                WizardSteps.AddAt(0, _createUserStep);
                _createUserStep.Active = true;
            }
            if (!foundComplete) {
                // This default step cannot disable ViewState, otherwise AllowReturn will not work properly.
                // VSWhidbey 459041
                _completeStep = new CompleteWizardStep();
                // Internally created control needs to be themed as well. VSWhidbey 377952
                _completeStep.ApplyStyleSheetSkin(Page);
                WizardSteps.Add(_completeStep);
            }
            if (ActiveStepIndex == -1) ActiveStepIndex = 0;
        }
Пример #6
0
		public void CreateUserWizardStep_StepType_Set () {
			CreateUserWizardStep step = new CreateUserWizardStep ();
			step.StepType = WizardStepType.Start;
		}
Пример #7
0
		public void CreateUserWizardStep_StepType_Get () {
			CreateUserWizardStep step = new CreateUserWizardStep ();
			Assert.AreEqual (WizardStepType.Auto, step.StepType, "CreateUserWizardStep_StepType_Get");
		}