using System; using System.IO; using System.Net.Mime; using System.Text; namespace System.Net.Mail { /// Represents the format to view an email message. // Token: 0x02000135 RID: 309 public class AlternateView : AttachmentBase { /// Initializes a new instance of with the specified file name. /// The name of the file that contains the content for this alternate view. /// /// is null. /// The caller does not have the required permission. /// An I/O error occurred, such as a disk error. /// The access requested is not permitted by the operating system for the specified file handle, such as when access is Write or ReadWrite and the file handle is set for read-only access. // Token: 0x06000A82 RID: 2690 RVA: 0x0001DA6C File Offset: 0x0001BC6C public AlternateView(string fileName) : base(fileName) { if (fileName == null) { throw new ArgumentNullException(); } } /// Initializes a new instance of with the specified file name and content type. /// The name of the file that contains the content for this alternate view. /// The type of the content. /// /// is null. /// /// is not a valid value. /// The caller does not have the required permission. /// An I/O error occurred, such as a disk error. /// The access requested is not permitted by the operating system for the specified file handle, such as when access is Write or ReadWrite and the file handle is set for read-only access. // Token: 0x06000A83 RID: 2691 RVA: 0x0001DA8C File Offset: 0x0001BC8C public AlternateView(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 name of the file that contains the content for this alternate view. /// The MIME media type of the content. /// /// is null. /// /// is not a valid value. /// The caller does not have the required permission. /// An I/O error occurred, such as a disk error. /// The access requested is not permitted by the operating system for the specified file handle, such as when access is Write or ReadWrite and the file handle is set for read-only access. // Token: 0x06000A84 RID: 2692 RVA: 0x0001DAB0 File Offset: 0x0001BCB0 public AlternateView(string fileName, string mediaType) : base(fileName, mediaType) { if (fileName == null) { throw new ArgumentNullException(); } } /// Initializes a new instance of with the specified . /// A stream that contains the content for this view. /// /// is null. // Token: 0x06000A85 RID: 2693 RVA: 0x0001DAD4 File Offset: 0x0001BCD4 public AlternateView(Stream contentStream) : base(contentStream) { } /// Initializes a new instance of with the specified and media type. /// A stream that contains the content for this attachment. /// The MIME media type of the content. /// /// is null. /// /// is not a valid value. // Token: 0x06000A86 RID: 2694 RVA: 0x0001DAE8 File Offset: 0x0001BCE8 public AlternateView(Stream contentStream, string mediaType) : base(contentStream, mediaType) { } /// Initializes a new instance of with the specified and . /// A stream that contains the content for this attachment. /// The type of the content. /// /// is null. /// /// is not a valid value. // Token: 0x06000A87 RID: 2695 RVA: 0x0001DB00 File Offset: 0x0001BD00 public AlternateView(Stream contentStream, global::System.Net.Mime.ContentType contentType) : base(contentStream, contentType) { } /// Gets or sets the Base URI to use for resolving relative URIs in the . /// A . // Token: 0x170002AB RID: 683 // (get) Token: 0x06000A88 RID: 2696 RVA: 0x0001DB18 File Offset: 0x0001BD18 // (set) Token: 0x06000A89 RID: 2697 RVA: 0x0001DB20 File Offset: 0x0001BD20 public global::System.Uri BaseUri { get { return this.baseUri; } set { this.baseUri = value; } } /// Gets the set of embedded resources referred to by this attachment. /// A object that stores the collection of linked resources to be sent as part of an e-mail message. // Token: 0x170002AC RID: 684 // (get) Token: 0x06000A8A RID: 2698 RVA: 0x0001DB2C File Offset: 0x0001BD2C public LinkedResourceCollection LinkedResources { get { return this.linkedResources; } } /// Creates a of an email message using the content specified in a . /// An object that represents an alternate view of an email message. /// The that contains the content of the email message. /// /// is null. // Token: 0x06000A8B RID: 2699 RVA: 0x0001DB34 File Offset: 0x0001BD34 public static AlternateView CreateAlternateViewFromString(string content) { if (content == null) { throw new ArgumentNullException(); } MemoryStream memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(content)); return new AlternateView(memoryStream) { TransferEncoding = global::System.Net.Mime.TransferEncoding.QuotedPrintable }; } /// Creates an of an email message using the content specified in a and the specified MIME media type of the content. /// An object that represents an alternate view of an email message. /// A that contains the content for this attachment. /// A that describes the data in . /// /// is null. // Token: 0x06000A8C RID: 2700 RVA: 0x0001DB70 File Offset: 0x0001BD70 public static AlternateView CreateAlternateViewFromString(string content, global::System.Net.Mime.ContentType contentType) { if (content == null) { throw new ArgumentNullException("content"); } Encoding encoding = ((contentType.CharSet == null) ? Encoding.UTF8 : Encoding.GetEncoding(contentType.CharSet)); MemoryStream memoryStream = new MemoryStream(encoding.GetBytes(content)); return new AlternateView(memoryStream, contentType) { TransferEncoding = global::System.Net.Mime.TransferEncoding.QuotedPrintable }; } /// Creates an of an email message using the content specified in a , the specified text encoding, and MIME media type of the content. /// An object that represents an alternate view of an email message. /// A that contains the content for this attachment. /// An . This value can be null. /// The MIME media type of the content. /// /// is null. // Token: 0x06000A8D RID: 2701 RVA: 0x0001DBCC File Offset: 0x0001BDCC public static AlternateView CreateAlternateViewFromString(string content, Encoding encoding, string mediaType) { if (content == null) { throw new ArgumentNullException("content"); } if (encoding == null) { encoding = Encoding.UTF8; } MemoryStream memoryStream = new MemoryStream(encoding.GetBytes(content)); return new AlternateView(memoryStream, new global::System.Net.Mime.ContentType { MediaType = mediaType, CharSet = encoding.HeaderName }) { TransferEncoding = global::System.Net.Mime.TransferEncoding.QuotedPrintable }; } /// Releases the unmanaged resources used by the and optionally releases the managed resources. /// true to release both managed and unmanaged resources; false to release only unmanaged resources. // Token: 0x06000A8E RID: 2702 RVA: 0x0001DC30 File Offset: 0x0001BE30 protected override void Dispose(bool disposing) { if (disposing) { foreach (LinkedResource linkedResource in this.linkedResources) { linkedResource.Dispose(); } } base.Dispose(disposing); } // Token: 0x04000AF7 RID: 2807 private global::System.Uri baseUri; // Token: 0x04000AF8 RID: 2808 private LinkedResourceCollection linkedResources = new LinkedResourceCollection(); } }