private OutboundCodePageDetector BuildCodePageDetector(out MemoryStream cachedHtmlBody) { cachedHtmlBody = null; OutboundCodePageDetector outboundCodePageDetector = new OutboundCodePageDetector(); StringBuilder stringBuilder = new StringBuilder(); CharsetDetectionDataFlags charsetDetectionDataFlags = CharsetDetectionDataFlags.Complete; if (this.coreItem.CharsetDetector.NoMessageDecoding && ItemBuilder.ReadStoreObjectTypeFromPropertyBag(this.coreItem.PropertyBag) == StoreObjectType.RightsManagedMessage) { charsetDetectionDataFlags |= CharsetDetectionDataFlags.NoMessageDecoding; } this.coreItem.GetCharsetDetectionData(stringBuilder, charsetDetectionDataFlags); outboundCodePageDetector.AddText(stringBuilder.ToString()); if (this.cachedBodyData == null) { this.cachedBodyData = this.LoadCachedBodyData(out cachedHtmlBody); } if (this.cachedBodyData != null) { outboundCodePageDetector.AddText(this.cachedBodyData); } return(outboundCodePageDetector); }
protected override void InternalGetContextCharsetDetectionData(StringBuilder stringBuilder, CharsetDetectionDataFlags flags) { base.InternalGetContextCharsetDetectionData(stringBuilder, flags); if (this.charsetDetectionStringForProtectedData != null) { stringBuilder.Append(this.charsetDetectionStringForProtectedData.ToString()); return; } if (this.decodedItem == null && ((flags & CharsetDetectionDataFlags.Complete) != CharsetDetectionDataFlags.Complete || (flags & CharsetDetectionDataFlags.NoMessageDecoding) == CharsetDetectionDataFlags.NoMessageDecoding || base.AttachmentCollection.IsDirty)) { return; } this.GetCharsetDetectionStringFromProtectedData(stringBuilder); }
void ICoreItem.GetCharsetDetectionData(StringBuilder stringBuilder, CharsetDetectionDataFlags flags) { this.CoreItem.GetCharsetDetectionData(stringBuilder, flags); }
public void GetContextCharsetDetectionData(StringBuilder stringBuilder, CharsetDetectionDataFlags flags) { Util.ThrowOnNullArgument(stringBuilder, "stringBuilder"); EnumValidator.ThrowIfInvalid <CharsetDetectionDataFlags>(flags, "flags"); }