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
- MSAANativeProvider.cs
- MethodToken.cs
- SafeArchiveContext.cs
- DocumentSchemaValidator.cs
- StringResourceManager.cs
- ShapingEngine.cs
- HuffCodec.cs
- SchemaImporterExtension.cs
- Metafile.cs
- TypeSchema.cs
- RouteTable.cs
- SQLUtility.cs
- TemplatedMailWebEventProvider.cs
- UniqueIdentifierService.cs
- WizardStepBase.cs
- DirectoryNotFoundException.cs
- LocalizabilityAttribute.cs
- figurelengthconverter.cs
- PartManifestEntry.cs
- QueryCacheKey.cs
- DataGridViewCellCancelEventArgs.cs
- ConnectionManagementElementCollection.cs
- ConfigurationElementCollection.cs
- SourceFileBuildProvider.cs
- QilParameter.cs
- MsmqHostedTransportConfiguration.cs
- HttpFileCollection.cs
- InvokeProviderWrapper.cs
- ExecutionContext.cs
- MenuItemAutomationPeer.cs
- SqlClientFactory.cs
- SqlInternalConnection.cs
- BindingEntityInfo.cs
- DataRowComparer.cs
- SqlParameter.cs
- ScriptServiceAttribute.cs
- DbExpressionBuilder.cs
- PrivilegeNotHeldException.cs
- SettingsPropertyIsReadOnlyException.cs
- Filter.cs
- XmlSchemaValidator.cs
- ScaleTransform.cs
- FillErrorEventArgs.cs
- ContentIterators.cs
- CatalogPartChrome.cs
- PackagingUtilities.cs
- DataContractJsonSerializer.cs
- DiscriminatorMap.cs
- DBConcurrencyException.cs
- DataObject.cs
- ColorKeyFrameCollection.cs
- PbrsForward.cs
- TableRowGroup.cs
- MatrixStack.cs
- FormatVersion.cs
- GridViewUpdatedEventArgs.cs
- RectangleGeometry.cs
- ConnectorMovedEventArgs.cs
- WebPartDisplayModeCancelEventArgs.cs
- IdentityReference.cs
- VisualBasicExpressionConverter.cs
- ExcCanonicalXml.cs
- SamlSecurityToken.cs
- ObsoleteAttribute.cs
- EntityDataSourceMemberPath.cs
- TreeBuilderBamlTranslator.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- Directory.cs
- AnyReturnReader.cs
- PointLightBase.cs
- DesignerCatalogPartChrome.cs
- SizeKeyFrameCollection.cs
- GeometryCollection.cs
- HuffmanTree.cs
- BindingCollection.cs
- RegisteredDisposeScript.cs
- AssociatedControlConverter.cs
- DataGridViewSelectedCellCollection.cs
- PopupRoot.cs
- unitconverter.cs
- UriTemplateHelpers.cs
- HttpCookieCollection.cs
- Transform.cs
- XmlSchemaException.cs
- PageParserFilter.cs
- ModelVisual3D.cs
- Int16Converter.cs
- TreeNodeClickEventArgs.cs
- ContentElement.cs
- Config.cs
- ApplyImportsAction.cs
- ChineseLunisolarCalendar.cs
- StatusBar.cs
- DataColumn.cs
- CurrentTimeZone.cs
- Geometry.cs
- ObjectKeyFrameCollection.cs
- AllowedAudienceUriElementCollection.cs
- PackWebRequestFactory.cs
- DesignerCatalogPartChrome.cs