Esempio n. 1
0
        private void ParseValue()
        {
            if (base.Value == "1.0")
            {
                this.version = "1.0";
                return;
            }
            int num = 0;

            if (!MailBnfHelper.SkipCFWS(base.Value, ref num))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new FormatException(SR.GetString("MimeVersionHeaderInvalid", new object[0])));
            }
            StringBuilder stringBuilder = new StringBuilder();

            MailBnfHelper.ReadDigits(base.Value, ref num, stringBuilder);
            if (!MailBnfHelper.SkipCFWS(base.Value, ref num) || num >= base.Value.Length || base.Value[num++] != '.' || !MailBnfHelper.SkipCFWS(base.Value, ref num))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new FormatException(SR.GetString("MimeVersionHeaderInvalid", new object[0])));
            }
            stringBuilder.Append('.');
            MailBnfHelper.ReadDigits(base.Value, ref num, stringBuilder);
            this.version = stringBuilder.ToString();
        }
Esempio n. 2
0
 private void ParseValue()
 {
     if (this.contentTransferEncodingValue == null)
     {
         int num = 0;
         this.contentTransferEncodingValue = ((base.Value.Length == 0) ? base.Value : ((base.Value[0] == '"') ? MailBnfHelper.ReadQuotedString(base.Value, ref num, null) : MailBnfHelper.ReadToken(base.Value, ref num, null)));
         string a;
         if ((a = this.contentTransferEncodingValue) != null)
         {
             if (a == "7bit")
             {
                 this.contentTransferEncoding = ContentTransferEncoding.SevenBit;
                 return;
             }
             if (a == "8bit")
             {
                 this.contentTransferEncoding = ContentTransferEncoding.EightBit;
                 return;
             }
             if (a == "binary")
             {
                 this.contentTransferEncoding = ContentTransferEncoding.Binary;
                 return;
             }
         }
         this.contentTransferEncoding = ContentTransferEncoding.Other;
     }
 }