コード例 #1
0
        // Token: 0x060004A5 RID: 1189 RVA: 0x0001A840 File Offset: 0x00018A40
        public MimeStringList Clone()
        {
            MimeStringList result = default(MimeStringList);

            result.first = this.first;
            if (this.overflow != null && this.overflow[0].HeaderCount > 1)
            {
                result.overflow = new MimeStringList.ListEntry[this.overflow.Length];
                int length = Math.Min(this.Count, 4096);
                Array.Copy(this.overflow, 0, result.overflow, 0, length);
                if (this.Count > 4096)
                {
                    int num = 4096;
                    int i   = 4096;
                    while (i < this.Count)
                    {
                        result.overflow[num].Secondary = new MimeString[4096];
                        length = Math.Min(this.Count - i, 4096);
                        Array.Copy(this.overflow[num].Secondary, 0, result.overflow[num].Secondary, 0, length);
                        i += 4096;
                        num++;
                    }
                }
            }
            return(result);
        }
コード例 #2
0
ファイル: ValueParser.cs プロジェクト: YHZX2013/exchange_diff
        public void ParseSkipToNextDelimiterByte(byte delimiter)
        {
            MimeStringList mimeStringList = default(MimeStringList);

            for (;;)
            {
                if (this.position != this.end)
                {
                    byte b = this.bytes[this.position];
                    if (b == delimiter)
                    {
                        break;
                    }
                    if (b == 34)
                    {
                        this.ParseQString(false, ref mimeStringList, true);
                    }
                    else if (b == 40)
                    {
                        this.ParseComment(false, false, ref mimeStringList, true);
                    }
                    else
                    {
                        this.position++;
                        this.ParseCFWS(false, ref mimeStringList, true);
                        int num = 0;
                        this.position += MimeScan.FindEndOf(MimeScan.Token.Atom, this.bytes, this.position, this.end - this.position, out num, this.allowUTF8);
                    }
                }
                else if (!this.ParseNextLine())
                {
                    return;
                }
            }
        }
コード例 #3
0
        // Token: 0x0600018E RID: 398 RVA: 0x000071C0 File Offset: 0x000053C0
        internal override void CheckChildrenLimit(int countLimit, int bytesLimit)
        {
            if (this.parser == null)
            {
                this.parser = new MimeAddressParser();
            }
            if (!this.parser.Initialized)
            {
                DecodingOptions headerDecodingOptions = base.GetHeaderDecodingOptions();
                this.parser.Initialize(base.Lines, false, false, headerDecodingOptions.AllowUTF8);
            }
            int i;

            for (i = 0; i <= countLimit; i++)
            {
                MimeStringList mimeStringList  = default(MimeStringList);
                MimeStringList mimeStringList2 = default(MimeStringList);
                if (AddressParserResult.End == this.parser.ParseNextMailbox(ref mimeStringList, ref mimeStringList2))
                {
                    this.parser.Reset();
                    return;
                }
                if (mimeStringList.Length > bytesLimit)
                {
                    throw new MimeException(Strings.TooManyTextValueBytes(mimeStringList.Length, bytesLimit));
                }
            }
            throw new MimeException(Strings.TooManyAddressItems(i, countLimit));
        }
コード例 #4
0
ファイル: ValueParser.cs プロジェクト: YHZX2013/exchange_diff
        private void ParseEscapedString(bool save, ref MimeStringList outStr, out bool singleByte)
        {
            bool flag = this.bytes[this.position] == 27;

            if (save)
            {
                outStr.AppendFragment(new MimeString(this.bytes, this.position, 1, 536870912U));
            }
            this.position++;
            if (flag && !this.ParseEscapeSequence(save, ref outStr))
            {
                singleByte = true;
                return;
            }
            singleByte = false;
            do
            {
                int num = MimeScan.ScanJISString(this.bytes, this.position, this.end - this.position, ref singleByte);
                if (save && num != 0)
                {
                    outStr.AppendFragment(new MimeString(this.bytes, this.position, num, 536870912U));
                }
                this.position += num;
            }while (!singleByte && this.ParseNextLine());
            if (!flag && this.position != this.end && this.bytes[this.position] == 15)
            {
                if (save)
                {
                    outStr.AppendFragment(new MimeString(this.bytes, this.position, 1, 536870912U));
                }
                this.position++;
            }
        }
コード例 #5
0
ファイル: ValueParser.cs プロジェクト: YHZX2013/exchange_diff
        public MimeString ParseToken(MimeScan.Token token)
        {
            MimeStringList mimeStringList = default(MimeStringList);

            while (this.position != this.end || this.ParseNextLine())
            {
                int num  = 0;
                int num2 = MimeScan.FindEndOf(token, this.bytes, this.position, this.end - this.position, out num, this.allowUTF8);
                if (num2 == 0)
                {
                    break;
                }
                mimeStringList.AppendFragment(new MimeString(this.bytes, this.position, num2));
                this.position += num2;
            }
            if (mimeStringList.Count == 0)
            {
                return(default(MimeString));
            }
            if (mimeStringList.Count == 1)
            {
                return(mimeStringList[0]);
            }
            byte[] sz = mimeStringList.GetSz();
            return(new MimeString(sz, 0, sz.Length));
        }
コード例 #6
0
        internal override long WriteTo(Stream stream, EncodingOptions encodingOptions, MimeOutputFilter filter, ref MimeStringLength currentLineLength, ref byte[] scratchBuffer)
        {
            long num = this.WriteName(stream, ref scratchBuffer);

            currentLineLength.IncrementBy((int)num);
            bool flag = false;

            if (!this.IsDirty && this.RawLength != 0)
            {
                if (this.IsProtected)
                {
                    num += Header.WriteLines(this.lines, stream);
                    currentLineLength.SetAs(0);
                    return(num);
                }
                if (!this.IsHeaderLineTooLong(num, out flag))
                {
                    num += Header.WriteLines(this.lines, stream);
                    currentLineLength.SetAs(0);
                    return(num);
                }
            }
            MimeStringList fragments = this.lines;

            if (flag)
            {
                fragments = Header.MergeLines(fragments);
            }
            num += Header.QuoteAndFold(stream, fragments, 4026531840U, false, fragments.Length > 0, encodingOptions.AllowUTF8, 0, ref currentLineLength, ref scratchBuffer);
            return(num + Header.WriteLineEnd(stream, ref currentLineLength));
        }
コード例 #7
0
        internal static long WriteLines(MimeStringList lines, Stream stream)
        {
            if (lines.Count == 0)
            {
                MimeStringLength mimeStringLength = new MimeStringLength(0);
                return(Header.WriteLineEnd(stream, ref mimeStringLength));
            }
            long num = 0L;

            for (int i = 0; i < lines.Count; i++)
            {
                int    num2;
                int    num3;
                byte[] data = lines[i].GetData(out num2, out num3);
                if (num3 != 0)
                {
                    if (!MimeScan.IsLWSP(data[num2]))
                    {
                        stream.Write(MimeString.Space, 0, MimeString.Space.Length);
                        num += (long)MimeString.Space.Length;
                    }
                    stream.Write(data, num2, num3);
                    num += (long)num3;
                }
                MimeStringLength mimeStringLength2 = new MimeStringLength(0);
                num += Header.WriteLineEnd(stream, ref mimeStringLength2);
            }
            return(num);
        }
コード例 #8
0
 // Token: 0x06000247 RID: 583 RVA: 0x0000A5D6 File Offset: 0x000087D6
 public void Initialize(MimeStringList lines, bool ignoreComments, bool useSquareBrackets, bool allowUTF8)
 {
     this.Reset();
     this.ignoreComments    = ignoreComments;
     this.useSquareBrackets = useSquareBrackets;
     this.valueParser       = new ValueParser(lines, allowUTF8);
     this.parserInit        = true;
 }
コード例 #9
0
 // Token: 0x06000242 RID: 578 RVA: 0x00009EE8 File Offset: 0x000080E8
 public MimeAddressParser(MimeStringList lines, MimeAddressParser source)
 {
     this.parserInit        = source.parserInit;
     this.ignoreComments    = source.ignoreComments;
     this.useSquareBrackets = source.useSquareBrackets;
     this.valueParser       = new ValueParser(lines, source.valueParser);
     this.groupInProgress   = source.groupInProgress;
 }
コード例 #10
0
 internal void SetRawValue(MimeStringList newLines, bool markDirty)
 {
     this.RawValueAboutToChange();
     this.lines = newLines;
     if (markDirty)
     {
         this.SetDirty();
     }
 }
コード例 #11
0
        // Token: 0x060001DD RID: 477 RVA: 0x000085B4 File Offset: 0x000067B4
        internal override void ParseValue(ValueParser parser, bool storeValue)
        {
            MimeStringList empty = MimeStringList.Empty;

            parser.ParseCFWS(false, ref empty, true);
            MimeString mimeString  = parser.ParseToken();
            MimeString mimeString2 = MimeString.Empty;

            parser.ParseCFWS(false, ref empty, true);
            byte b = parser.ParseGet();

            if (b == 47)
            {
                parser.ParseCFWS(false, ref empty, true);
                mimeString2 = parser.ParseToken();
            }
            else if (b != 0)
            {
                parser.ParseUnget();
            }
            if (storeValue)
            {
                if (mimeString.Length == 0)
                {
                    this.type = "text";
                }
                else
                {
                    this.type = Header.NormalizeString(mimeString.Data, mimeString.Offset, mimeString.Length, false);
                }
                if (mimeString2.Length == 0)
                {
                    if (this.type == "multipart")
                    {
                        this.subType = "mixed";
                    }
                    else if (this.type == "text")
                    {
                        this.subType = "plain";
                    }
                    else
                    {
                        this.type    = "application";
                        this.subType = "octet-stream";
                    }
                }
                else
                {
                    this.subType = Header.NormalizeString(mimeString2.Data, mimeString2.Offset, mimeString2.Length, false);
                }
                this.value = ContentTypeHeader.ComposeContentTypeValue(this.type, this.subType);
            }
            if (this.type == "multipart")
            {
                this.handleISO2022 = false;
            }
        }
コード例 #12
0
ファイル: ValueParser.cs プロジェクト: YHZX2013/exchange_diff
 public void ParseAppendSpace(ref MimeStringList phrase)
 {
     if (this.position == this.start || this.bytes[this.position - 1] != 32)
     {
         phrase.AppendFragment(ValueParser.SpaceLine);
         return;
     }
     phrase.AppendFragment(new MimeString(this.bytes, this.position - 1, 1));
 }
コード例 #13
0
        // Token: 0x06000544 RID: 1348 RVA: 0x0001CD90 File Offset: 0x0001AF90
        internal override long WriteTo(Stream stream, EncodingOptions encodingOptions, MimeOutputFilter filter, ref MimeStringLength currentLineLength, ref byte[] scratchBuffer)
        {
            MimeStringList displayNameToWrite = base.GetDisplayNameToWrite(encodingOptions);
            long           num  = 0L;
            int            num2 = 0;

            if (base.NextSibling != null)
            {
                num2++;
            }
            else if (base.Parent is MimeGroup)
            {
                num2++;
                if (base.Parent.NextSibling != null)
                {
                    num2++;
                }
            }
            byte[] sz   = this.emailAddressFragments.GetSz();
            int    num3 = ByteString.BytesToCharCount(sz, encodingOptions.AllowUTF8);

            if (displayNameToWrite.GetLength(4026531839U) != 0)
            {
                num += Header.QuoteAndFold(stream, displayNameToWrite, 4026531839U, base.IsQuotingRequired(displayNameToWrite, encodingOptions.AllowUTF8), true, encodingOptions.AllowUTF8, (num3 == 0) ? num2 : 0, ref currentLineLength, ref scratchBuffer);
            }
            if (num3 != 0)
            {
                int num4 = (1 < currentLineLength.InChars) ? 1 : 0;
                if (1 < currentLineLength.InChars)
                {
                    if (currentLineLength.InChars + num3 + 2 + num2 + num4 > 78)
                    {
                        num += Header.WriteLineEnd(stream, ref currentLineLength);
                        stream.Write(Header.LineStartWhitespace, 0, Header.LineStartWhitespace.Length);
                        num += (long)Header.LineStartWhitespace.Length;
                        currentLineLength.IncrementBy(Header.LineStartWhitespace.Length);
                    }
                    else
                    {
                        stream.Write(MimeString.Space, 0, MimeString.Space.Length);
                        num += (long)MimeString.Space.Length;
                        currentLineLength.IncrementBy(MimeString.Space.Length);
                    }
                }
                stream.Write(MimeString.LessThan, 0, MimeString.LessThan.Length);
                num += (long)MimeString.LessThan.Length;
                currentLineLength.IncrementBy(MimeString.LessThan.Length);
                stream.Write(sz, 0, sz.Length);
                num += (long)sz.Length;
                currentLineLength.IncrementBy(num3, sz.Length);
                stream.Write(MimeString.GreaterThan, 0, MimeString.GreaterThan.Length);
                num += (long)MimeString.GreaterThan.Length;
                currentLineLength.IncrementBy(MimeString.GreaterThan.Length);
            }
            return(num);
        }
コード例 #14
0
ファイル: ValueParser.cs プロジェクト: YHZX2013/exchange_diff
        public void ParseParameterValue(ref MimeStringList value, ref bool goodValue, bool handleISO2022)
        {
            MimeStringList mimeStringList = default(MimeStringList);

            goodValue = true;
            while (this.position != this.end || this.ParseNextLine())
            {
                byte b = this.bytes[this.position];
                if (b == 34)
                {
                    value.Reset();
                    mimeStringList.Reset();
                    this.ParseQString(true, ref value, handleISO2022);
                    return;
                }
                if (b == 40 || MimeScan.IsLWSP(b))
                {
                    this.ParseCFWS(true, ref mimeStringList, handleISO2022);
                }
                else
                {
                    if (b == 59)
                    {
                        return;
                    }
                    int num = this.position;
                    do
                    {
                        int num2 = 1;
                        if (!MimeScan.IsToken(b))
                        {
                            if (this.allowUTF8 && b >= 128)
                            {
                                if (!MimeScan.IsUTF8NonASCII(this.bytes, this.position, this.end, out num2))
                                {
                                    num2      = 1;
                                    goodValue = false;
                                }
                            }
                            else
                            {
                                goodValue = false;
                            }
                        }
                        this.position += num2;
                        if (this.position == this.end)
                        {
                            break;
                        }
                        b = this.bytes[this.position];
                    }while (b != 59 && b != 40 && !MimeScan.IsLWSP(b));
                    value.TakeOverAppend(ref mimeStringList);
                    value.AppendFragment(new MimeString(this.bytes, num, this.position - num));
                }
            }
        }
コード例 #15
0
ファイル: ValueParser.cs プロジェクト: YHZX2013/exchange_diff
        public void ParseQString(bool save, ref MimeStringList phrase, bool handleISO2022)
        {
            bool flag = false;

            if (save)
            {
                phrase.AppendFragment(new MimeString(this.bytes, this.position, 1, 268435456U));
            }
            this.position++;
            bool flag2 = true;

            for (;;)
            {
                int num = MimeScan.ScanQuotedString(this.bytes, this.position, this.end - this.position, handleISO2022, ref flag);
                if (num != 0)
                {
                    if (save)
                    {
                        phrase.AppendFragment(new MimeString(this.bytes, this.position, num));
                    }
                    this.position += num;
                }
                if (this.position != this.end)
                {
                    if (this.bytes[this.position] == 14 || this.bytes[this.position] == 27)
                    {
                        this.ParseEscapedString(save, ref phrase, out flag2);
                    }
                    else
                    {
                        if (save)
                        {
                            phrase.AppendFragment(new MimeString(this.bytes, this.position, 1, 268435456U));
                        }
                        this.position++;
                        if (this.bytes[this.position - 1] == 34)
                        {
                            break;
                        }
                        flag = true;
                    }
                }
                else if (!this.ParseNextLine())
                {
                    goto Block_8;
                }
            }
            return;

Block_8:
            if (save && flag2)
            {
                phrase.AppendFragment(new MimeString(MimeString.DoubleQuote, 0, MimeString.DoubleQuote.Length, 268435456U));
            }
        }
コード例 #16
0
ファイル: ValueParser.cs プロジェクト: YHZX2013/exchange_diff
 public ValueParser(MimeStringList lines, bool allowUTF8)
 {
     this.lines     = lines;
     this.allowUTF8 = allowUTF8;
     this.nextLine  = 0;
     this.bytes     = null;
     this.start     = 0;
     this.end       = 0;
     this.position  = 0;
     this.ParseNextLine();
 }
コード例 #17
0
 // Token: 0x060001A0 RID: 416 RVA: 0x00007640 File Offset: 0x00005840
 internal bool IsQuotingRequired(MimeStringList displayNameFragments, bool allowUTF8)
 {
     for (int num = 0; num != displayNameFragments.Count; num++)
     {
         MimeString mimeStr = displayNameFragments[num];
         if ((mimeStr.Mask & 4026531839U) != 0U && this.IsQuotingRequired(mimeStr, allowUTF8))
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #18
0
        // Token: 0x06000542 RID: 1346 RVA: 0x0001CD50 File Offset: 0x0001AF50
        internal static void ConvertDisplayNameBack(AddressItem addressItem, MimeStringList displayNameFragments, bool allowUTF8)
        {
            byte[] sz = displayNameFragments.GetSz(4026531839U);
            if (sz == null)
            {
                addressItem.DecodedDisplayName = null;
                return;
            }
            string decodedDisplayName = ByteString.BytesToString(sz, allowUTF8);

            addressItem.DecodedDisplayName = decodedDisplayName;
        }
コード例 #19
0
ファイル: ValueParser.cs プロジェクト: YHZX2013/exchange_diff
 public void ParseToEnd(ref MimeStringList phrase)
 {
     if (this.position != this.end)
     {
         phrase.AppendFragment(new MimeString(this.bytes, this.position, this.end - this.position));
         this.position = this.end;
     }
     while (this.ParseNextLine())
     {
         phrase.AppendFragment(new MimeString(this.bytes, this.start, this.end - this.start));
         this.position = this.end;
     }
 }
コード例 #20
0
 // Token: 0x0600049C RID: 1180 RVA: 0x0001A4B4 File Offset: 0x000186B4
 public void TakeOver(ref MimeStringList list, uint mask)
 {
     if (mask == 4026531840U)
     {
         this.first    = list.first;
         this.overflow = list.overflow;
         list.first    = default(MimeString);
         list.overflow = null;
         return;
     }
     this.Reset();
     this.TakeOverAppend(ref list, mask);
 }
コード例 #21
0
 private void FinishClause(ref MimeString param, ref MimeStringList value, bool allowUTF8)
 {
     if (param.Length != 0)
     {
         byte[] sz   = value.GetSz();
         string text = (sz == null) ? null : ByteString.BytesToString(sz, allowUTF8);
         uint   num  = param.ComputeCrcI();
         if (num <= 2556329580U)
         {
             if (num != 271896810U)
             {
                 if (num != 2115158205U)
                 {
                     if (num == 2556329580U)
                     {
                         this.fromValue = text;
                     }
                 }
                 else
                 {
                     this.byValue = text;
                 }
             }
             else
             {
                 this.forValue = text;
             }
         }
         else if (num != 3117694226U)
         {
             if (num != 3740702146U)
             {
                 if (num == 4276123055U)
                 {
                     this.idValue = text;
                 }
             }
             else
             {
                 this.viaValue = text;
             }
         }
         else
         {
             this.withValue = text;
         }
         value.Reset();
         param = MimeString.Empty;
     }
 }
コード例 #22
0
ファイル: MimeString.cs プロジェクト: YHZX2013/exchange_diff
        public static bool IsPureASCII(MimeStringList str)
        {
            bool result = true;

            for (int i = 0; i < str.Count; i++)
            {
                MimeString str2 = str[i];
                if (!MimeString.IsPureASCII(str2))
                {
                    result = false;
                    break;
                }
            }
            return(result);
        }
コード例 #23
0
        // Token: 0x0600053D RID: 1341 RVA: 0x0001CC64 File Offset: 0x0001AE64
        public static MimeRecipient Parse(string address, AddressParserFlags flags)
        {
            MimeRecipient mimeRecipient = new MimeRecipient();

            if (!string.IsNullOrEmpty(address))
            {
                byte[]            array             = ByteString.StringToBytes(address, true);
                MimeAddressParser mimeAddressParser = new MimeAddressParser();
                mimeAddressParser.Initialize(new MimeStringList(array, 0, array.Length), AddressParserFlags.None != (flags & AddressParserFlags.IgnoreComments), AddressParserFlags.None != (flags & AddressParserFlags.AllowSquareBrackets), true);
                MimeStringList displayNameFragments = default(MimeStringList);
                mimeAddressParser.ParseNextMailbox(ref displayNameFragments, ref mimeRecipient.emailAddressFragments);
                MimeRecipient.ConvertDisplayNameBack(mimeRecipient, displayNameFragments, true);
            }
            return(mimeRecipient);
        }
コード例 #24
0
 // Token: 0x0600049E RID: 1182 RVA: 0x0001A514 File Offset: 0x00018714
 public void TakeOverAppend(ref MimeStringList list, uint mask)
 {
     if (this.Count == 0 && mask == 4026531840U)
     {
         this.TakeOver(ref list, mask);
         return;
     }
     for (int i = 0; i < list.Count; i++)
     {
         MimeString refLine = list[i];
         if (mask == 4026531840U || (refLine.Mask & mask) != 0U)
         {
             this.AppendFragment(refLine);
         }
     }
     list.Reset();
 }
コード例 #25
0
 internal static MimeStringList MergeLines(MimeStringList lines)
 {
     if (lines.Length != 0)
     {
         byte[] array = new byte[lines.Length];
         int    num   = 0;
         for (int i = 0; i < lines.Count; i++)
         {
             MimeString mimeString = lines[i];
             mimeString.CopyTo(array, num);
             num += mimeString.Length;
         }
         MimeStringList result = new MimeStringList(array);
         return(result);
     }
     return(lines);
 }
コード例 #26
0
        internal override void ParseValue(ValueParser parser, bool storeValue)
        {
            MimeStringList mimeStringList = default(MimeStringList);

            parser.ParseCFWS(false, ref mimeStringList, true);
            MimeString mimeString = parser.ParseToken();

            if (storeValue)
            {
                if (mimeString.Length == 0)
                {
                    this.disp = string.Empty;
                    return;
                }
                this.disp = Header.NormalizeString(mimeString.Data, mimeString.Offset, mimeString.Length, false);
            }
        }
コード例 #27
0
        internal static DateTime ParseDateHeaderValue(string value)
        {
            byte[] array;
            if (value != null)
            {
                array = ByteString.StringToBytes(value, false);
            }
            else
            {
                array = MimeString.EmptyByteArray;
            }
            MimeStringList list = new MimeStringList(array, 0, array.Length);
            DateTime       result;
            TimeSpan       timeSpan;

            DateHeader.ParseValue(list, out result, out timeSpan);
            return(result);
        }
コード例 #28
0
 public ValueIterator(MimeStringList lines, uint linesMask, ValuePosition startPosition, ValuePosition endPosition)
 {
     this.lines         = lines;
     this.linesMask     = linesMask;
     this.currentLine   = startPosition.Line;
     this.currentOffset = startPosition.Offset;
     this.endLine       = endPosition.Line;
     this.endOffset     = endPosition.Offset;
     if (startPosition != endPosition)
     {
         int num;
         this.lineBytes = this.lines[this.currentLine].GetData(out this.lineStart, out num);
         this.lineEnd   = ((this.currentLine == this.endLine) ? this.endOffset : (this.lineStart + num));
         return;
     }
     this.lineStart = (this.lineEnd = this.currentOffset);
     this.lineBytes = null;
 }
コード例 #29
0
        // Token: 0x0600024C RID: 588 RVA: 0x0000AD74 File Offset: 0x00008F74
        internal static bool TryDecodeValue(MimeStringList lines, uint linesMask, DecodingOptions decodingOptions, out DecodingResults decodingResults, out string value)
        {
            decodingResults = default(DecodingResults);
            if (lines.GetLength(linesMask) == 0)
            {
                value = string.Empty;
                return(true);
            }
            DecodingFlags decodingFlags          = decodingOptions.DecodingFlags;
            bool          flag                   = DecodingFlags.None != (DecodingFlags.FallbackToRaw & decodingFlags);
            bool          allowControlCharacters = DecodingFlags.None != (DecodingFlags.AllowControlCharacters & decodingFlags);
            bool          enable                 = false;
            bool          enableJisDetection     = false;
            bool          enableUtf8Detection    = false;
            bool          enableDbcsDetection    = false;
            Charset       defaultCharset         = null;
            ValueDecoder  valueDecoder           = new ValueDecoder(lines, linesMask);

            if ((decodingFlags & DecodingFlags.AllEncodings) == DecodingFlags.None)
            {
                if (!flag)
                {
                    defaultCharset = Charset.ASCII;
                }
            }
            else
            {
                enable              = (DecodingFlags.None != (DecodingFlags.Rfc2047 & decodingFlags));
                enableJisDetection  = (DecodingFlags.None != (DecodingFlags.Jis & decodingFlags));
                enableUtf8Detection = (DecodingFlags.None != (DecodingFlags.Utf8 & decodingFlags));
                enableDbcsDetection = (DecodingFlags.None != (DecodingFlags.Dbcs & decodingFlags));
                defaultCharset      = decodingOptions.Charset;
            }
            string         charsetName;
            string         cultureName;
            EncodingScheme encodingScheme;
            bool           flag2 = valueDecoder.TryDecodeValue(defaultCharset, flag, allowControlCharacters, enable, enableJisDetection, enableUtf8Detection, enableDbcsDetection, out charsetName, out cultureName, out encodingScheme, out value);

            decodingResults.EncodingScheme = encodingScheme;
            decodingResults.CharsetName    = charsetName;
            decodingResults.CultureName    = cultureName;
            decodingResults.DecodingFailed = !flag2;
            return(flag2);
        }
コード例 #30
0
ファイル: ValueParser.cs プロジェクト: YHZX2013/exchange_diff
 public ValueParser(MimeStringList lines, ValueParser valueParser)
 {
     this.lines     = lines;
     this.allowUTF8 = valueParser.allowUTF8;
     this.nextLine  = valueParser.nextLine;
     if (this.nextLine > 0 && this.nextLine <= this.lines.Count)
     {
         int num;
         this.bytes    = this.lines[this.nextLine - 1].GetData(out this.start, out num);
         this.start    = valueParser.start;
         this.position = valueParser.position;
         this.end      = valueParser.end;
         return;
     }
     this.bytes    = null;
     this.start    = 0;
     this.end      = 0;
     this.position = 0;
 }