Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Net / System / Net / Mail / AlternateView.cs / 1 / AlternateView.cs
using System; using System.IO; using System.Net.Mime; using System.Text; namespace System.Net.Mail { public class AlternateView : AttachmentBase { private LinkedResourceCollection linkedResources; internal AlternateView() { } public AlternateView(string fileName) : base(fileName) { } public AlternateView(string fileName, string mediaType) : base(fileName, mediaType) { } public AlternateView(string fileName, ContentType contentType) : base(fileName, contentType) { } public AlternateView(Stream contentStream) : base(contentStream) { } public AlternateView(Stream contentStream, string mediaType) : base(contentStream, mediaType) { } public AlternateView(Stream contentStream, ContentType contentType) : base(contentStream, contentType) { } public LinkedResourceCollection LinkedResources { get { if (disposed) { throw new ObjectDisposedException(this.GetType().FullName); } if (linkedResources == null) { linkedResources = new LinkedResourceCollection(); } return linkedResources; } } public Uri BaseUri { get { return ContentLocation; } set { ContentLocation = value; } } public static AlternateView CreateAlternateViewFromString(string content){ AlternateView a = new AlternateView(); a.SetContentFromString(content, null, String.Empty); return a; } public static AlternateView CreateAlternateViewFromString(string content, Encoding contentEncoding, string mediaType){ AlternateView a = new AlternateView(); a.SetContentFromString(content, contentEncoding, mediaType); return a; } public static AlternateView CreateAlternateViewFromString(string content, ContentType contentType){ AlternateView a = new AlternateView(); a.SetContentFromString(content, contentType); return a; } protected override void Dispose(bool disposing) { if(disposed){ return; } if (disposing && linkedResources != null) { linkedResources.Dispose(); } base.Dispose(disposing); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.IO; using System.Net.Mime; using System.Text; namespace System.Net.Mail { public class AlternateView : AttachmentBase { private LinkedResourceCollection linkedResources; internal AlternateView() { } public AlternateView(string fileName) : base(fileName) { } public AlternateView(string fileName, string mediaType) : base(fileName, mediaType) { } public AlternateView(string fileName, ContentType contentType) : base(fileName, contentType) { } public AlternateView(Stream contentStream) : base(contentStream) { } public AlternateView(Stream contentStream, string mediaType) : base(contentStream, mediaType) { } public AlternateView(Stream contentStream, ContentType contentType) : base(contentStream, contentType) { } public LinkedResourceCollection LinkedResources { get { if (disposed) { throw new ObjectDisposedException(this.GetType().FullName); } if (linkedResources == null) { linkedResources = new LinkedResourceCollection(); } return linkedResources; } } public Uri BaseUri { get { return ContentLocation; } set { ContentLocation = value; } } public static AlternateView CreateAlternateViewFromString(string content){ AlternateView a = new AlternateView(); a.SetContentFromString(content, null, String.Empty); return a; } public static AlternateView CreateAlternateViewFromString(string content, Encoding contentEncoding, string mediaType){ AlternateView a = new AlternateView(); a.SetContentFromString(content, contentEncoding, mediaType); return a; } public static AlternateView CreateAlternateViewFromString(string content, ContentType contentType){ AlternateView a = new AlternateView(); a.SetContentFromString(content, contentType); return a; } protected override void Dispose(bool disposing) { if(disposed){ return; } if (disposing && linkedResources != null) { linkedResources.Dispose(); } base.Dispose(disposing); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SqlStream.cs
- SamlAdvice.cs
- WebPart.cs
- SystemColorTracker.cs
- ChineseLunisolarCalendar.cs
- AuthenticateEventArgs.cs
- Stylus.cs
- HostAdapter.cs
- InputReport.cs
- BufferedReadStream.cs
- EventSourceCreationData.cs
- Base64Stream.cs
- Aggregates.cs
- _FtpDataStream.cs
- GregorianCalendar.cs
- EntityDesignerBuildProvider.cs
- TextSimpleMarkerProperties.cs
- PersistChildrenAttribute.cs
- InfocardChannelParameter.cs
- Ops.cs
- LineGeometry.cs
- XamlReader.cs
- FixedTextContainer.cs
- SudsWriter.cs
- SafeProcessHandle.cs
- LabelLiteral.cs
- ByteConverter.cs
- AssociationSetEnd.cs
- MarkupProperty.cs
- HttpStaticObjectsCollectionBase.cs
- XmlTextReaderImpl.cs
- __TransparentProxy.cs
- X509CertificateClaimSet.cs
- WebZone.cs
- InvalidEnumArgumentException.cs
- OleDbPropertySetGuid.cs
- SettingsAttributeDictionary.cs
- FlowLayoutSettings.cs
- SymDocumentType.cs
- SmiEventSink_Default.cs
- UpdatePanelTrigger.cs
- CollectionViewProxy.cs
- DataRowChangeEvent.cs
- LabelLiteral.cs
- WeakHashtable.cs
- RewritingValidator.cs
- GB18030Encoding.cs
- CacheMemory.cs
- PolicyValidationException.cs
- DataGridViewLinkColumn.cs
- NoClickablePointException.cs
- SqlTypeSystemProvider.cs
- SortQuery.cs
- sqlstateclientmanager.cs
- SmiGettersStream.cs
- ListViewCancelEventArgs.cs
- Button.cs
- TypeElement.cs
- TransactionalPackage.cs
- XPathAxisIterator.cs
- WindowsScrollBarBits.cs
- XamlRtfConverter.cs
- FillErrorEventArgs.cs
- DurableInstanceProvider.cs
- validation.cs
- KeySplineConverter.cs
- NameValueCollection.cs
- ObjectDataSourceView.cs
- SettingsPropertyNotFoundException.cs
- FormatControl.cs
- TransactionInterop.cs
- activationcontext.cs
- httpserverutility.cs
- AttributeProviderAttribute.cs
- TrustLevelCollection.cs
- GeometryDrawing.cs
- UrlMappingsSection.cs
- CharacterBuffer.cs
- ConfigurationSectionHelper.cs
- EmptyEnumerator.cs
- CodeNamespaceCollection.cs
- Size3DConverter.cs
- SqlReferenceCollection.cs
- TextBoxLine.cs
- SqlBooleanizer.cs
- ConstructorNeedsTagAttribute.cs
- XsdSchemaFileEditor.cs
- PDBReader.cs
- XmlSchemaChoice.cs
- ConnectionPointCookie.cs
- ControlEvent.cs
- MSG.cs
- ProtocolElement.cs
- SByteStorage.cs
- ParamArrayAttribute.cs
- CodeTypeDelegate.cs
- Dump.cs
- SharedDp.cs
- LicenseContext.cs
- Path.cs