Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Mail / AlternateView.cs / 1305376 / 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
- CharacterBuffer.cs
- MetadataProperty.cs
- RowToFieldTransformer.cs
- ToolZone.cs
- TextTreePropertyUndoUnit.cs
- DataGridViewCellFormattingEventArgs.cs
- NumberFunctions.cs
- MinimizableAttributeTypeConverter.cs
- CompositeCollection.cs
- ColumnResizeUndoUnit.cs
- NameTable.cs
- IHttpResponseInternal.cs
- ComAdminWrapper.cs
- MatrixTransform.cs
- IChannel.cs
- AppSecurityManager.cs
- DelegatingTypeDescriptionProvider.cs
- DataViewSetting.cs
- SqlDataSourceCommandEventArgs.cs
- AppSecurityManager.cs
- DataGridViewAdvancedBorderStyle.cs
- GcSettings.cs
- EnumUnknown.cs
- BufferModeSettings.cs
- GregorianCalendarHelper.cs
- ObjectHandle.cs
- ResolveMatchesMessage11.cs
- ApplicationDirectory.cs
- XmlSchemaSimpleTypeUnion.cs
- SqlClientWrapperSmiStream.cs
- ElementProxy.cs
- AspNetSynchronizationContext.cs
- __FastResourceComparer.cs
- ValueUtilsSmi.cs
- X509Certificate2.cs
- ToolStripItem.cs
- StreamGeometryContext.cs
- DataGridViewRowStateChangedEventArgs.cs
- TextSerializer.cs
- RenderData.cs
- EncoderFallback.cs
- BStrWrapper.cs
- Style.cs
- DataSourceListEditor.cs
- AnchoredBlock.cs
- AccessDataSourceView.cs
- ExpressionNode.cs
- OnOperation.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- TraceSection.cs
- ToolStripItemTextRenderEventArgs.cs
- RewritingValidator.cs
- EdmRelationshipRoleAttribute.cs
- TreeNodeStyleCollection.cs
- CompressStream.cs
- invalidudtexception.cs
- CommonDialog.cs
- InputLanguageCollection.cs
- UnsafeNativeMethods.cs
- DynamicDocumentPaginator.cs
- SchemaMapping.cs
- ProvideValueServiceProvider.cs
- CombinedGeometry.cs
- ByteConverter.cs
- WorkflowApplicationTerminatedException.cs
- CallContext.cs
- MDIWindowDialog.cs
- Pair.cs
- EntityReference.cs
- XmlWriterSettings.cs
- StrongNameIdentityPermission.cs
- WebPartMenu.cs
- PropertyValueUIItem.cs
- UrlPath.cs
- WebResponse.cs
- Validator.cs
- DataGridColumnCollection.cs
- RSAPKCS1KeyExchangeFormatter.cs
- XmlUtil.cs
- HwndKeyboardInputProvider.cs
- PagePropertiesChangingEventArgs.cs
- Int32CAMarshaler.cs
- Pointer.cs
- Stopwatch.cs
- SystemUnicastIPAddressInformation.cs
- OracleCommand.cs
- ExpandCollapseProviderWrapper.cs
- BamlLocalizableResource.cs
- TextUtf8RawTextWriter.cs
- Substitution.cs
- ModifierKeysValueSerializer.cs
- AnimationException.cs
- RotateTransform.cs
- SystemUdpStatistics.cs
- ConfigurationSettings.cs
- TypeCacheManager.cs
- TextTreeRootNode.cs
- InputBindingCollection.cs
- TrackingRecord.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs