internal static object CharacterSetGetter(IPropertyBag propertyBag) { string text = (string)propertyBag[DomainContentConfigSchema.ADCharacterSet]; if (!DomainContentConfig.IsValidCharset(text)) { text = DomainContentConfig.MapCharset(text); } return(text.ToLower(CultureInfo.InvariantCulture)); }
private static void ThrowOnInvalidCharset(string inputCharset, PropertyDefinition propertyDefinition) { if (!DomainContentConfig.IsValidCharset(inputCharset)) { StringBuilder stringBuilder = new StringBuilder(512); for (int i = 0; i < DomainContentConfig.CharacterSetList.Length; i++) { if (!string.IsNullOrEmpty(DomainContentConfig.CharacterSetList[i].CharsetName)) { stringBuilder.Append(DomainContentConfig.CharacterSetList[i].CharsetName); stringBuilder.Append(", "); } } stringBuilder.Remove(stringBuilder.Length - 2, 2); throw new DataValidationException(new PropertyValidationError(DirectoryStrings.InvalidCharacterSet(inputCharset, stringBuilder.ToString()), propertyDefinition, inputCharset)); } }
public RemoteDomainEntry(DomainContentConfig domain) { this.domain = domain.DomainName; this.ByteEncoderTypeFor7BitCharsets = domain.ByteEncoderTypeFor7BitCharsets; this.CharacterSet = domain.CharacterSet; this.NonMimeCharacterSet = domain.NonMimeCharacterSet; this.AllowedOOFType = domain.AllowedOOFType; this.ContentType = domain.ContentType; this.DisplaySenderName = domain.DisplaySenderName; this.PreferredInternetCodePageForShiftJis = domain.PreferredInternetCodePageForShiftJis; this.RequiredCharsetCoverage = domain.RequiredCharsetCoverage; this.TNEFEnabled = domain.TNEFEnabled; this.LineWrapSize = domain.LineWrapSize; this.OofSettings = domain.GetOOFSettings(); this.Flags = (int)domain[EdgeDomainContentConfigSchema.Flags]; this.UseSimpleDisplayName = domain.UseSimpleDisplayName; this.MessageCountThreshold = domain.MessageCountThreshold; }
internal static void CharacterSetSetter(object value, IPropertyBag propertyBag) { DomainContentConfig.ThrowOnInvalidCharset((string)value, DomainContentConfigSchema.CharacterSet); propertyBag[DomainContentConfigSchema.ADCharacterSet] = value; }