2using System.Collections.Generic;
4using System.Threading.Tasks;
40 private string contentType =
null;
41 private string name =
null;
42 private string fileName =
null;
43 private string transferEncoding =
null;
44 private string id =
null;
45 private string description =
null;
46 private byte[] raw =
null;
47 private byte[] transferDecoded =
null;
48 private object decoded =
null;
49 private int? size =
null;
50 private DateTimeOffset? creationDate =
null;
51 private DateTimeOffset? modificationDate =
null;
58 get => this.contentType;
59 set => this.contentType = value;
67 get => this.disposition;
68 set => this.disposition = value;
77 set => this.name = value;
86 set => this.fileName = value;
96 get => this.transferEncoding;
97 set => this.transferEncoding = value;
106 set => this.raw = value;
115 get => this.transferDecoded;
116 set => this.transferDecoded = value;
126 set => this.decoded = value;
135 set => this.id = value;
143 get => this.description;
144 set => this.description = value;
153 set => this.size = value;
161 get => this.creationDate;
162 set => this.creationDate = value;
170 get => this.modificationDate;
171 set => this.modificationDate = value;
177 if (!
string.IsNullOrEmpty(this.name))
179 else if (!
string.IsNullOrEmpty(this.fileName))
180 return this.fileName;
182 return base.ToString();
185 internal async Task AssertEncoded()
187 if (!(this.raw is
null))
190 if (this.transferDecoded is
null)
193 this.transferDecoded = P.Key;
194 this.contentType = P.Value;
198 if (this.raw is
null)
200 this.raw = Encoding.ASCII.GetBytes(Convert.ToBase64String(
this.transferDecoded));
201 this.transferEncoding =
"base64";
Static class managing encoding and decoding of internet content.
static Task< KeyValuePair< byte[], string > > EncodeAsync(object Object, Encoding Encoding, params string[] AcceptedContentTypes)
Encodes an object.
Represents content embedded in other content.
string FileName
Filename of embedded object.
ContentDisposition Disposition
Disposition of embedded object.
string Name
Name of embedded object.
string Description
Content-Description of embedded object, if defined.
DateTimeOffset? CreationDate
Creation-Date of content, if available.
string ContentType
Content-Type of embedded object.
object Decoded
Decoded body of embedded object. ContentType defines how TransferDecoded is transformed into Decoded.
override string ToString()
int? Size
Size of content, if available.
byte[] TransferDecoded
Transformed body of embedded object. TransferEncoding defines how Raw is transformed into TransferDec...
byte[] Raw
Raw, untrasnformed body of embedded object.
string TransferEncoding
Content Transfer Encoding of embedded object, if defined. Affects how Raw is transformed into Transfe...
string ID
Content-ID of embedded object, if defined.
DateTimeOffset? ModificationDate
Modification-Date of content, if available.
ContentDisposition
Content disposition