private void AddEntriesToCollection(JunkEmailCollection collection, string collectionName, Guid mailboxGuid, string[] entriesToAdd) { foreach (string text in entriesToAdd) { JunkEmailCollection.ValidationProblem validationProblem = collection.TryAdd(text); if (validationProblem != JunkEmailCollection.ValidationProblem.NoError && validationProblem != JunkEmailCollection.ValidationProblem.Duplicate) { throw new MailboxSettingsJunkMailErrorPermanentException(collectionName, text, validationProblem.ToString()); } } }
private MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationTuple SetListWithoutValidation(ICollection <string> addresses, JunkEmailCollection junk) { bool validating = junk.Validating; junk.Validating = false; junk.AddRange(addresses.ToArray <string>()); junk.Validating = validating; return(new MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationTuple(MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationProblem.IsGood, string.Empty)); }
private MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationTuple SetDomainsList(ICollection <string> domains, JunkEmailCollection junk) { foreach (string text in domains) { if (this.IsUsersEmailOrDomain(text, true)) { return(new MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationTuple(MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationProblem.IsUsersEmailOrDomain, text)); } } try { junk.AddRange(domains.ToArray <string>()); } catch (JunkEmailValidationException ex) { return(new MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationTuple(ex.Problem, (string)ex.StringFormatParameters[0])); } return(new MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationTuple(MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationProblem.IsGood, string.Empty)); }
private MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationTuple SetEmailsList(ICollection <string> emails, JunkEmailCollection junk) { new List <MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationTuple>(); foreach (string text in emails) { if (this.IsUsersEmailOrDomain(text, false)) { return(new MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationTuple(MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationProblem.IsUsersEmailOrDomain, text)); } if (this.IsInternalToOrganization(text)) { return(new MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationTuple(MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationProblem.IsInternalToOrganization, text)); } } try { junk.AddRange(emails.ToArray <string>()); } catch (JunkEmailValidationException ex) { return(new MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationTuple(ex.Problem, (string)ex.StringFormatParameters[0])); } return(new MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationTuple(MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationProblem.IsGood, string.Empty)); }
private MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationTuple SetDelta(string[] addresses, JunkEmailCollection junk, MailboxJunkEmailConfigurationDataProvider.JunkEmailAdditionStrategy addToRule) { HashSet <string> hashSet = new HashSet <string>(addresses, StringComparer.OrdinalIgnoreCase); hashSet.UnionWith(junk); ICollection <string> collection = this.Subtract(hashSet, addresses); ICollection <string> collection2 = this.Subtract(hashSet, junk); foreach (string item in collection) { junk.Remove(item); } if (collection2.Count == 0) { return(new MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationTuple(MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationProblem.IsGood, string.Empty)); } return(addToRule(collection2, junk)); }
private MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationTuple SetList(MultiValuedProperty <string> addresses, JunkEmailCollection junkEmails, JunkEmailCollection junkDomains) { List <string> list = new List <string>(); List <string> list2 = new List <string>(); string[] array = this.CullEmailsAndDomains(addresses, list, list2); foreach (string text in array) { if (junkEmails.Contains(text)) { list.Add(text); } else { if (!junkDomains.Contains(text)) { return(new MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationTuple(MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationProblem.IsMalformatted, text)); } list2.Add(text); } } MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationTuple result = this.SetDelta(list.ToArray(), junkEmails, new MailboxJunkEmailConfigurationDataProvider.JunkEmailAdditionStrategy(this.SetEmailsList)); if (result.Problem != MailboxJunkEmailConfigurationDataProvider.JunkEmailValidationProblem.IsGood) { return(result); } return(this.SetDelta(list2.ToArray(), junkDomains, new MailboxJunkEmailConfigurationDataProvider.JunkEmailAdditionStrategy(this.SetDomainsList))); }
// Token: 0x06000291 RID: 657 RVA: 0x00016A78 File Offset: 0x00014C78 private void RenderEmailListControlGroup(string groupId, JunkEmailCollection emails, JunkEmailCollection domains) { this.writer.Write("<table class=\"jnkTbl\" cellpadding=0 cellspacing=0><tr>"); this.writer.Write("<td><input class=\"w100 txt\" type=\"text\" id=\"txt"); this.writer.Write(groupId); this.writer.Write("\" name=\"txt"); this.writer.Write(groupId); if (this.initialInputs.ContainsKey(groupId)) { this.writer.Write("\" value=\""); Utilities.HtmlEncode(this.initialInputs[groupId], this.writer); } this.writer.Write("\" onkeypress=\"onKPIpt('"); this.writer.Write(groupId); this.writer.Write("', event)\" onfocus=\"onFcsIpt('"); this.writer.Write(groupId); this.writer.Write("')\" onblur=\"onBlrIpt('"); this.writer.Write(groupId); this.writer.Write("')\"></td>"); this.RenderButton(groupId, 292745765, "Add"); this.writer.Write("</tr><tr>"); this.writer.Write("<td class=\"sel\">"); this.writer.Write("<select size=6 class=\"w100 sel\" multiple id=\"sel"); this.writer.Write(groupId); this.writer.Write("\" name=\"sel"); this.writer.Write(groupId); this.writer.Write("\" onchange=\"onChgEmSel('"); this.writer.Write(groupId); this.writer.Write("')\" onfocus=\"onFcsEmSel('"); this.writer.Write(groupId); this.writer.Write("')\" onkeydown=\"onKDEmSel('"); this.writer.Write(groupId); this.writer.Write("', event)\" onkeypress=\"onKPEmSel('"); this.writer.Write(groupId); this.writer.Write("', event)\">"); emails.Sort(); domains.Sort(); for (int i = 0; i < emails.Count; i++) { this.writer.Write("<option value=\""); this.writer.Write(emails[i]); this.writer.Write("\">"); this.writer.Write(emails[i]); this.writer.Write("</option>"); } for (int j = 0; j < domains.Count; j++) { this.writer.Write("<option value=\""); this.writer.Write(domains[j]); this.writer.Write("\">"); this.writer.Write(domains[j]); this.writer.Write("</option>"); } this.writer.Write("</select></td>"); this.writer.Write("<td valign=\"bottom\"><table class=\"btn\" cellpadding=0 cellspacing=0>"); this.writer.Write("<tr>"); this.RenderButton(groupId, 2119799890, "Edt"); this.writer.Write("</tr>"); this.writer.Write("<tr><td class=\"w2\"></td></tr>"); this.writer.Write("<tr>"); this.RenderButton(groupId, 1388922078, "Rmv"); this.writer.Write("</tr>"); this.writer.Write("</table></td>"); this.writer.Write("</tr></table>"); }