using System; using System.IO; using System.Net.Mime; using System.Text; namespace System.Net.Mail { /// Represents an embedded external resource in an email attachment, such as an image in an HTML attachment. // Token: 0x0200013C RID: 316 public class LinkedResource : AttachmentBase { /// Initializes a new instance of using the specified file name. /// The file name holding the content for this embedded resource. /// /// is null. // Token: 0x06000ABC RID: 2748 RVA: 0x000203B4 File Offset: 0x0001E5B4 public LinkedResource(string fileName) : base(fileName) { if (fileName == null) { throw new ArgumentNullException(); } } /// Initializes a new instance of with the specified file name and content type. /// The file name that holds the content for this embedded resource. /// The type of the content. /// /// is null. /// /// is not a valid value. // Token: 0x06000ABD RID: 2749 RVA: 0x000203CC File Offset: 0x0001E5CC public LinkedResource(string fileName, global::System.Net.Mime.ContentType contentType) : base(fileName, contentType) { if (fileName == null) { throw new ArgumentNullException(); } } /// Initializes a new instance of with the specified file name and media type. /// The file name that holds the content for this embedded resource. /// The MIME media type of the content. /// /// is null. /// /// is not a valid value. // Token: 0x06000ABE RID: 2750 RVA: 0x000203E4 File Offset: 0x0001E5E4 public LinkedResource(string fileName, string mediaType) : base(fileName, mediaType) { if (fileName == null) { throw new ArgumentNullException(); } } /// Initializes a new instance of using the supplied . /// A stream that contains the content for this embedded resource. /// /// is null. // Token: 0x06000ABF RID: 2751 RVA: 0x000203FC File Offset: 0x0001E5FC public LinkedResource(Stream contentStream) : base(contentStream) { if (contentStream == null) { throw new ArgumentNullException(); } } /// Initializes a new instance of with the values supplied by and . /// A stream that contains the content for this embedded resource. /// The type of the content. /// /// is null. /// /// is not a valid value. // Token: 0x06000AC0 RID: 2752 RVA: 0x00020414 File Offset: 0x0001E614 public LinkedResource(Stream contentStream, global::System.Net.Mime.ContentType contentType) : base(contentStream, contentType) { if (contentStream == null) { throw new ArgumentNullException(); } } /// Initializes a new instance of with the specified and media type. /// A stream that contains the content for this embedded resource. /// The MIME media type of the content. /// /// is null. /// /// is not a valid value. // Token: 0x06000AC1 RID: 2753 RVA: 0x0002042C File Offset: 0x0001E62C public LinkedResource(Stream contentStream, string mediaType) : base(contentStream, mediaType) { if (contentStream == null) { throw new ArgumentNullException(); } } /// Gets or sets a URI that the resource must match. /// If is a relative URI, the recipient of the message must resolve it. // Token: 0x170002B4 RID: 692 // (get) Token: 0x06000AC2 RID: 2754 RVA: 0x00020444 File Offset: 0x0001E644 // (set) Token: 0x06000AC3 RID: 2755 RVA: 0x0002044C File Offset: 0x0001E64C public global::System.Uri ContentLink { get { return this.contentLink; } set { this.contentLink = value; } } /// Creates a object from a string to be included in an email attachment as an embedded resource. The default media type is plain text, and the default content type is ASCII. /// A object that contains the embedded resource to be included in the email attachment. /// A string that contains the embedded resource to be included in the email attachment. /// The specified content string is null. // Token: 0x06000AC4 RID: 2756 RVA: 0x00020458 File Offset: 0x0001E658 public static LinkedResource CreateLinkedResourceFromString(string content) { if (content == null) { throw new ArgumentNullException(); } MemoryStream memoryStream = new MemoryStream(Encoding.Default.GetBytes(content)); return new LinkedResource(memoryStream) { TransferEncoding = global::System.Net.Mime.TransferEncoding.QuotedPrintable }; } /// Creates a object from a string to be included in an email attachment as an embedded resource, with the specified content type, and media type as plain text. /// A object that contains the embedded resource to be included in the email attachment. /// A string that contains the embedded resource to be included in the email attachment. /// The type of the content. /// The specified content string is null. // Token: 0x06000AC5 RID: 2757 RVA: 0x00020494 File Offset: 0x0001E694 public static LinkedResource CreateLinkedResourceFromString(string content, global::System.Net.Mime.ContentType contentType) { if (content == null) { throw new ArgumentNullException(); } MemoryStream memoryStream = new MemoryStream(Encoding.Default.GetBytes(content)); return new LinkedResource(memoryStream, contentType) { TransferEncoding = global::System.Net.Mime.TransferEncoding.QuotedPrintable }; } /// Creates a object from a string to be included in an email attachment as an embedded resource, with the specified content type, and media type. /// A object that contains the embedded resource to be included in the email attachment. /// A string that contains the embedded resource to be included in the email attachment. /// The type of the content. /// The MIME media type of the content. /// The specified content string is null. // Token: 0x06000AC6 RID: 2758 RVA: 0x000204D0 File Offset: 0x0001E6D0 public static LinkedResource CreateLinkedResourceFromString(string content, Encoding contentEncoding, string mediaType) { if (content == null) { throw new ArgumentNullException(); } MemoryStream memoryStream = new MemoryStream(contentEncoding.GetBytes(content)); return new LinkedResource(memoryStream, mediaType) { TransferEncoding = global::System.Net.Mime.TransferEncoding.QuotedPrintable }; } // Token: 0x04000B06 RID: 2822 private global::System.Uri contentLink; } }