Ejemplo n.º 1
0
        public ContentDisposition ReadDisposition()
        {
            ContentDisposition disp = new ContentDisposition();
            char c;
            char[] last = new char[3];
            while ((c = (char)Read()) != '(')
            {
                last[0] = last[1];
                last[1] = last[2];
                last[2] = c;
                if ((new string(last)) == "NIL")
                {
                    return disp;
                }
            }

            string type = ReadWord();
            disp.ContentType = ContentDispositionTypeMap.FromString(type);
            disp.Attributes = ReadList();
            ReadUntil(')');

            if (disp.Attributes.ContainsKey("FileName"))
            {
                disp.FileName = disp.Attributes["FileName"];
            }

            return disp;
        }
Ejemplo n.º 2
0
 internal Bodypart(string partNumber)
 {
     PartNumber = partNumber;
     ContentType = ContentType.Other;
     Subtype = Id = Description = MD5 = Language = Location = string.Empty;
     Parameters = new Dictionary<string, string>();
     Disposition = new ContentDisposition();
     Encoding = ContentTransferEncoding.Unknown;
     Size = Lines = 0;
 }