protected override void InitializeComponent() { base.InitializeComponent(); Title = "Welcome"; Label introText = new Label(); introText.Wrap = WrapMode.Word; introText.Text = "This is the first time you start Artivity. Before you can start using the app, we need you to set up your user account."; _userSettings = new UserSettingsControl(); _userSettings.NameBox.Focus(); _userSettings.NameBox.TextChanged += Validate; _agreePrivacy = new CheckBox(); _agreePrivacy.Text = "I agree to the privacy statement. (TODO: Link to document)"; _agreePrivacy.CheckedChanged += Validate; StackLayout layout = new StackLayout(); layout.Padding = new Padding(24, 0); layout.Spacing = 24; layout.Items.Add(new StackLayoutItem(introText, false)); layout.Items.Add(new StackLayoutItem(_userSettings, false)); layout.Items.Add(new StackLayoutItem(_agreePrivacy, false)); Content = layout; Buttons.Add(AbortButton); Buttons.Add(NextButton); AbortButton.Enabled = true; NextButton.Enabled = true; DefaultButton = NextButton; Validate(this, new EventArgs()); }
/// <summary> /// Page_Load runs when the control is loaded /// </summary> /// <remarks> /// </remarks> /// <history> /// [cnurse] 03/02/2006 Created /// </history> protected void Page_Load(Object sender, EventArgs e) { //Bind User Controller to PropertySettings MembershipProviderConfig config = new MembershipProviderConfig(); if (MembershipProviderConfig.CanEditProviderProperties) { ProviderSettings.EditMode = PropertyEditorMode.Edit; } else { ProviderSettings.EditMode = PropertyEditorMode.View; } ProviderSettings.LocalResourceFile = this.LocalResourceFile; ProviderSettings.DataSource = config; ProviderSettings.DataBind(); if (UserInfo.IsSuperUser) { PasswordSettings.EditMode = PropertyEditorMode.Edit; } else { PasswordSettings.EditMode = PropertyEditorMode.View; } PasswordSettings.LocalResourceFile = this.LocalResourceFile; PasswordSettings.DataSource = new PasswordConfig(); PasswordSettings.DataBind(); //Create a hashtable for the custom editors being used, using the same keys //as in the settings hashtable Hashtable editors = new Hashtable(); editors["Redirect_AfterLogin"] = EditorInfo.GetEditor("Page"); editors["Redirect_AfterLogout"] = EditorInfo.GetEditor("Page"); editors["Redirect_AfterRegistration"] = EditorInfo.GetEditor("Page"); //Create a Hashtable for the custom Visibility options Hashtable visibility = new Hashtable(); if (PortalSettings.ActiveTab.ParentId == PortalSettings.SuperTabId) { visibility["Profile_DefaultVisibility"] = false; visibility["Profile_DisplayVisibility"] = false; visibility["Profile_ManageServices"] = false; visibility["Redirect_AfterLogin"] = false; visibility["Redirect_AfterRegistration"] = false; visibility["Redirect_AfterLogout"] = false; visibility["Security_CaptchaLogin"] = false; visibility["Security_CaptchaRegister"] = false; visibility["Security_RequireValidProfile"] = false; visibility["Security_RequireValidProfileAtLogin"] = false; visibility["Security_UsersControl"] = false; } UserSettingsControl.LocalResourceFile = this.LocalResourceFile; Hashtable ht = this.Settings; UserSettingsControl.DataSource = UserModuleBase.GetSettings(ht); UserSettingsControl.CustomEditors = editors; UserSettingsControl.Visibility = visibility; UserSettingsControl.DataBind(); }