private static ContentItem GetSelectedItem(SelectionUtility selection, ProfileUser profile) { var selectedItem = selection.ParseSelectionFromRequest(); if (selectedItem == null && profile.Settings.ContainsKey("Selected")) { selectedItem = selection.ParseSelected((string)profile.Settings["Selected"]); } return(selectedItem ?? (selection.Traverse.StartPage)); }
public ProfileUser Get(string username) { var user = bridge.GetUser(username); if (user == null) return null; var profile = new ProfileUser { Name = username, Email = user.Email }; var clientSettings = user.DetailCollections["Settings"]; foreach (var setting in clientSettings.Details) profile.Settings[setting.Meta] = setting.Value; return profile; }
public void Save(ProfileUser profile) { var user = bridge.GetUser(profile.Name); if (user == null) { user = bridge.CreateUser(profile.Name, Guid.NewGuid().ToString(), profile.Email, Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), false, profile.Name); user.IsLogin = false; } user.IsProfile = true; var clientSettings = user.DetailCollections["Settings"]; clientSettings.Replace(profile.Settings); bridge.Save(user); }
public void Save(ProfileUser user) { users[user.Name] = user; }