示例#1
0
        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);
        }
示例#2
0
 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);
 }
示例#3
0
 void ICoreItem.GetCharsetDetectionData(StringBuilder stringBuilder, CharsetDetectionDataFlags flags)
 {
     this.CoreItem.GetCharsetDetectionData(stringBuilder, flags);
 }
示例#4
0
 public void GetContextCharsetDetectionData(StringBuilder stringBuilder, CharsetDetectionDataFlags flags)
 {
     Util.ThrowOnNullArgument(stringBuilder, "stringBuilder");
     EnumValidator.ThrowIfInvalid <CharsetDetectionDataFlags>(flags, "flags");
 }