public LoginData() { username = "******" + DateTime.Now.Minute; password = "******" + DateTime.Now.Minute; optionalAttrs = new List <OptionalAttr>(); OptionalAttr _OptionalAttr = new OptionalAttr(); _OptionalAttr.attrName = "string"; _OptionalAttr.attrValue = "string"; optionalAttrs.Add(_OptionalAttr); privacySettings = new List <PrivacySetting>(); PrivacySetting _PrivacySetting = new PrivacySetting(); _PrivacySetting.settingName = "string"; _PrivacySetting.settingValue = "string"; privacySettings.Add(_PrivacySetting); requiredAttrs = new List <RequiredAttr>(); RequiredAttr _RequiredAttr = new RequiredAttr(); _RequiredAttr.attrName = "role"; _RequiredAttr.attrValue = "Gaslini - Tutor"; requiredAttrs.Add(_RequiredAttr); }
public void ChangePrivacySetting(PrivacySetting setting, Perm value) { List <byte> bts = new List <byte>(); bts.AddRange(BitConverter.GetBytes((int)setting)); bts.AddRange(BitConverter.GetBytes((int)value)); SendCommand(new Command(Command.CommandType.ChangeUserPrivacy, bts.ToArray())); }
protected override void ProcessHTML() { if (HtmlDoc != null && HtmlDoc.HasData) { string firstItem = string.Empty; List <PrivacySetting> items = new List <PrivacySetting>(); List <ParseDataItem> components = null; IEnumerable <ParseDataItem> htmlItems = HtmlDoc.Items.Where(x => !x.Header.ToUpper().Contains("DEFINITION")); IEnumerable <ParseDataItem> toSearch = htmlItems.Count() > 1 ? htmlItems : htmlItems.ElementAt(0).Children; if (toSearch != null && toSearch.Any()) { foreach (ParseDataItem item in toSearch) { if (string.IsNullOrEmpty(firstItem)) { firstItem = item.Header; } if (item.Header.Equals(firstItem) && components != null && components.Any()) { PrivacySetting newItem = new PrivacySetting(Logger, DisplaySectionName, components); if (newItem.HasData) { items.Add(newItem); } components = null; } if (components == null) { components = new List <ParseDataItem>(); } components.Add(item); } if (components != null && components.Any()) { PrivacySetting newItem = new PrivacySetting(Logger, DisplaySectionName, components); if (newItem.HasData) { items.Add(newItem); } } if (items.Count == 0) { throw new SectionEmptyException(DisplaySectionName); } Items = items; } } if (!HasData) { throw new SectionEmptyException(DisplaySectionName); } }
public async Task <IActionResult> EditPrivacy(EditPrivacyViewModel viewModel) { User currentUser = await userManager.GetUserAsync(HttpContext.User); PrivacySetting privacySettings = context.PrivacySettings.Where(s => s.User == currentUser).Single(); privacySettings.ShowProfileToFriends = viewModel.ShowProfileToFriends; privacySettings.ShowProfileToWorld = viewModel.ShowProfileToWorld; await context.SaveChangesAsync(); return(RedirectToAction("Edit", new { option = "Privacy" })); }
public void CreatePrivacy(int userId) { PrivacySetting privacy = new PrivacySetting(); privacy.User = GetUser(userId); privacy.Notification = 0; privacy.ReceiveEmail = true; privacy.ChatPrivacy = ChatPrivacyEnum.Friend; privacy.SendRequest = FriendRequestEnum.Everyone; _dal.Repository <PrivacySetting>().Insert(privacy); _dal.Save(); }
public bool Equals(DestinyProfileTransitoryJoinability input) { if (input == null) { return(false); } return (( OpenSlots == input.OpenSlots || (OpenSlots.Equals(input.OpenSlots)) ) && ( PrivacySetting == input.PrivacySetting || (PrivacySetting != null && PrivacySetting.Equals(input.PrivacySetting)) ) && ( ClosedReasons == input.ClosedReasons || (ClosedReasons != null && ClosedReasons.Equals(input.ClosedReasons)) )); }
public async Task <IActionResult> Edit(string option) { ViewData["option"] = option; // Work with database only if necessary. if (option == "Notifications" || option == null) { User currentUser = await userManager.GetUserAsync(HttpContext.User); NotificationsSetting notificationsSettings = context.NotificationSettings.Where(s => s.User == currentUser).Single(); ViewData["notificationSettings"] = notificationsSettings; } else if (option == "Privacy") { User currentUser = await userManager.GetUserAsync(HttpContext.User); PrivacySetting privacySettings = context.PrivacySettings.Where(s => s.User == currentUser).Single(); ViewData["privacySettings"] = privacySettings; } ViewBag.Message = TempData["message"]; return(View()); }
void SetPrivacySettingInner(PrivacySetting setting, string value) { if (value == String.Empty) privacySettings.Remove(setting); else if (!privacySettings.ContainsKey(setting)) privacySettings.Add(setting, value); else privacySettings[setting] = value; }
string GetPrivacySettingInner(PrivacySetting setting) { if (privacySettings.ContainsKey(setting)) return privacySettings[setting]; return string.Empty; }
public string GetPrivacySetting(PrivacySetting setting) { return GetPrivacySettingInner(setting); }
public async Task SetPrivacySettingAsync(PrivacySetting setting, string value) { if (setting == PrivacySetting.AcceptInvitations && value != AcceptInvitationsFromAllUsers && value != AcceptInvitationsFromAllowedUsersOnly) throw new ArgumentException("Invalid value for property"); if (setting == PrivacySetting.AddUsers && value != AddUsersAutomatically && value != AddUsersWithPrompt) throw new ArgumentException("Invalid value for property"); await @lock.ReaderLockAsync(); try { if (closed) throw new ObjectDisposedException(GetType().Name); if (!IsLoggedIn) throw new NotLoggedInException(); if (privacySettings[setting] == value) throw new ArgumentException("This value is already set."); var cmd = new PrivacySettingCommand(PrivacySettingToString(setting), value); await responseTracker.GetResponseAsync<PrivacySettingCommand>(cmd, defaultTimeout); privacySettings[setting] = value; OnPrivacySettingChanged(new PrivacySettingEventArgs(setting, value, false)); } finally { @lock.ReaderRelease(); } }
static string PrivacySettingToString(PrivacySetting setting) { switch (setting) { case PrivacySetting.AddUsers: return "GTC"; case PrivacySetting.AcceptInvitations: return "BLP"; default: throw new NotSupportedException(); } }
/// <summary> /// Sets the session's privacy setting sent by the server in SNAC(13,06) /// </summary> /// <param name="ps">One of the <see cref="PrivacySetting"/> enumeration members</param> protected internal void SetPrivacyFromServer(PrivacySetting ps) { _privacy = ps; }
/// <summary> /// Create a new OSCAR session /// </summary> /// <param name="screenname">The screenname to log in</param> /// <param name="password">The password associated with the screenname</param> /// <exception cref="ArgumentException">Thrown when <paramref name="screenname"/> is not /// a valid AIM or ICQ screenname.</exception> public Session(string screenname, string password) { // Check to make sure the screenname is something valid if (!ScreennameVerifier.IsValidAIM(screenname) && !ScreennameVerifier.IsValidICQ(screenname)) { throw new ArgumentException(screenname + " is not a valid AIM or ICQ screenname", "screenname"); } // Save parameter values _screenname = screenname; _password = password; connectionManager = new ConnectionManager(this); serviceManager = new ServiceManager(this); ssiManager = new SSIManager(this); icqManager = new IcqManager(this); messageManager = new MessageManager(this); statusManager = new StatusManager(this); chatRoomManager = new ChatRoomManager(this); graphicsManager = new GraphicsManager(this); authManager = new AuthorizationManager(this); searchManager = new SearchManager(this); rateManager = new RateClassManager(this); statsManager = new UsageStatsManager(this); connectionManager.CreateNewConnection(0x0017); // Create a default set of capabilities for this session SetDefaultIdentification(); // Set up some default values for public properties _publicidletime = true; // Set initial values for internal properties _loggedin = false; _privacy = PrivacySetting.AllowAllUsers; _parametercount = 0; }
internal PrivacySettingEventArgs(PrivacySetting privacySetting, string value, bool loginEvent) { PrivacySetting = privacySetting; Value = value; LoginEvent = LoginEvent; }