6 namespace System.Net.Mail
8 public class AlternateView : AttachmentBase
10 private LinkedResourceCollection linkedResources;
12 internal AlternateView()
16 public AlternateView(string fileName) :
20 public AlternateView(string fileName, string mediaType) :
21 base(fileName, mediaType)
24 public AlternateView(string fileName, ContentType contentType) :
25 base(fileName, contentType)
28 public AlternateView(Stream contentStream) :
32 public AlternateView(Stream contentStream, string mediaType) :
33 base(contentStream, mediaType)
36 public AlternateView(Stream contentStream, ContentType contentType) :
37 base(contentStream, contentType)
40 public LinkedResourceCollection LinkedResources
45 throw new ObjectDisposedException(this.GetType().FullName);
49 if (linkedResources == null)
51 linkedResources = new LinkedResourceCollection();
53 return linkedResources;
61 return ContentLocation;
66 ContentLocation = value;
70 public static AlternateView CreateAlternateViewFromString(string content){
71 AlternateView a = new AlternateView();
72 a.SetContentFromString(content, null, String.Empty);
76 public static AlternateView CreateAlternateViewFromString(string content, Encoding contentEncoding, string mediaType){
77 AlternateView a = new AlternateView();
78 a.SetContentFromString(content, contentEncoding, mediaType);
82 public static AlternateView CreateAlternateViewFromString(string content, ContentType contentType){
83 AlternateView a = new AlternateView();
84 a.SetContentFromString(content, contentType);
88 protected override void Dispose(bool disposing)
94 if (disposing && linkedResources != null)
96 linkedResources.Dispose();
98 base.Dispose(disposing);