public ImapExtendedMultiPartBodyStructure(ImapMultiPartBodyStructure baseStructure,
                                       IDictionary<string, string> parameters,
                                       ImapBodyDisposition disposition,
                                       string[] languages,
                                       Uri location,
                                       ImapData[] extensions)
     : base(baseStructure)
 {
     this.Parameters = (parameters ?? new Dictionary<string, string>()).AsReadOnly(StringComparer.OrdinalIgnoreCase);
       this.Disposition = disposition;
       this.Languages = languages;
       this.Location = location;
       this.Extensions = extensions;
 }
 public ImapExtendedMessageRfc822BodyStructure(ImapMessageRfc822BodyStructure baseStructure,
                                           string md5,
                                           ImapBodyDisposition disposition,
                                           string[] languages,
                                           Uri location,
                                           ImapData[] extensions)
     : base(baseStructure)
 {
     this.MD5 = md5;
       this.Disposition = disposition;
       this.Languages = languages;
       this.Location = location;
       this.Extensions = extensions;
 }
Пример #3
0
        public void TestConstruct()
        {
            var disp = new ImapBodyDisposition("attachment", new Dictionary<string, string>() {
            {"filename", "test.txt"},
              });

              Assert.AreEqual("attachment", disp.Type);
              Assert.IsTrue(disp.IsAttachment);
              Assert.IsNotNull(disp.Parameters);
              Assert.AreEqual(1, disp.Parameters.Count);
              Assert.AreEqual("test.txt", disp.Filename);

              disp = new ImapBodyDisposition("inline", null);

              Assert.AreEqual("inline", disp.Type);
              Assert.IsTrue(disp.IsInline);
              Assert.IsNotNull(disp.Parameters);
              Assert.AreEqual(0, disp.Parameters.Count);
              Assert.IsNull(disp.Filename);
        }