protected internal override void CreateChildControls () { Controls.Clear (); ITemplate cpTemplate = ChangePasswordTemplate; if (cpTemplate == null) cpTemplate = new ChangePasswordDeafultTemplate (this); ((ChangePasswordContainer) ChangePasswordTemplateContainer).InstantiateTemplate (cpTemplate); ITemplate sTemplate = SuccessTemplate; if (sTemplate == null) sTemplate = new SuccessDefaultTemplate (this); ((SuccessContainer) SuccessTemplateContainer).InstantiateTemplate (sTemplate); Controls.AddAt (0, ChangePasswordTemplateContainer); Controls.AddAt (1, SuccessTemplateContainer); IEditableTextControl editable; ChangePasswordContainer container = (ChangePasswordContainer) ChangePasswordTemplateContainer; if (DisplayUserName) { editable = container.UserNameTextBox; if (editable != null) editable.TextChanged += new EventHandler (UserName_TextChanged); } editable = container.CurrentPasswordTextBox; if (editable != null) editable.TextChanged += new EventHandler (CurrentPassword_TextChanged); editable = container.NewPasswordTextBox; if (editable != null) editable.TextChanged += new EventHandler (NewPassword_TextChanged); editable = container.ConfirmNewPasswordTextBox; if (editable != null) editable.TextChanged += new EventHandler (NewPasswordConfirm_TextChanged); }
protected internal override void CreateChildControls () { ITemplate userNameTemplate = UserNameTemplate; if (userNameTemplate == null) { userNameTemplate = new UserNameDefaultTemplate (this); ((UserNameContainer) UserNameTemplateContainer).InstantiateTemplate (userNameTemplate); } ITemplate questionTemplate = QuestionTemplate; if (questionTemplate == null) { questionTemplate = new QuestionDefaultTemplate (this); ((QuestionContainer) QuestionTemplateContainer).InstantiateTemplate (questionTemplate); } ITemplate successTemplate = SuccessTemplate; if (successTemplate == null) { successTemplate = new SuccessDefaultTemplate (this); ((SuccessContainer) SuccessTemplateContainer).InstantiateTemplate (successTemplate); } Controls.AddAt (0, UserNameTemplateContainer); Controls.AddAt (1, QuestionTemplateContainer); Controls.AddAt (2, SuccessTemplateContainer); IEditableTextControl editable; editable = ((UserNameContainer) UserNameTemplateContainer).UserNameTextBox; if (editable != null) editable.TextChanged += new EventHandler (UserName_TextChanged); editable = ((QuestionContainer) QuestionTemplateContainer).AnswerTextBox; if (editable != null) editable.TextChanged += new EventHandler (Answer_TextChanged); }