Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlException.cs
- ImplicitInputBrush.cs
- InputReport.cs
- ConnectionPoolManager.cs
- OpCopier.cs
- CngProvider.cs
- XmlDownloadManager.cs
- TypeDelegator.cs
- ApplicationProxyInternal.cs
- metadatamappinghashervisitor.cs
- DispatchChannelSink.cs
- NativeMethodsOther.cs
- LinearGradientBrush.cs
- PropertyTabAttribute.cs
- EntityContainerAssociationSetEnd.cs
- IDQuery.cs
- DesigntimeLicenseContextSerializer.cs
- StreamWriter.cs
- EditingScopeUndoUnit.cs
- ServerValidateEventArgs.cs
- HttpValueCollection.cs
- Hex.cs
- Parser.cs
- RangeValidator.cs
- ToolboxItem.cs
- DatePickerAutomationPeer.cs
- InstanceLockException.cs
- BinHexDecoder.cs
- CqlErrorHelper.cs
- MatrixCamera.cs
- SizeAnimationUsingKeyFrames.cs
- OdbcConnectionFactory.cs
- ReplyChannelAcceptor.cs
- InputLangChangeEvent.cs
- XslCompiledTransform.cs
- RouteData.cs
- AnnotationService.cs
- ConsoleKeyInfo.cs
- ChangeProcessor.cs
- CurrentTimeZone.cs
- CompensationDesigner.cs
- XmlName.cs
- PathSegmentCollection.cs
- DocumentApplicationJournalEntry.cs
- GroupLabel.cs
- WebSysDisplayNameAttribute.cs
- ToolBarButtonClickEvent.cs
- Context.cs
- GridViewSortEventArgs.cs
- UnaryNode.cs
- XmlNodeChangedEventArgs.cs
- URLMembershipCondition.cs
- ActivityFunc.cs
- StreamGeometry.cs
- ToolStripItemTextRenderEventArgs.cs
- OleDbDataAdapter.cs
- XslNumber.cs
- LineGeometry.cs
- DriveInfo.cs
- NamespaceList.cs
- Cell.cs
- CollectionView.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- ComponentResourceKey.cs
- CTreeGenerator.cs
- userdatakeys.cs
- ObjectRef.cs
- ArrayWithOffset.cs
- PerformanceCounterManager.cs
- ToolBar.cs
- DLinqColumnProvider.cs
- WindowsSysHeader.cs
- Figure.cs
- UIElement3DAutomationPeer.cs
- CodeTypeDeclarationCollection.cs
- XmlParserContext.cs
- XamlNamespaceHelper.cs
- XmlNodeList.cs
- TreeNodeEventArgs.cs
- UserPreferenceChangingEventArgs.cs
- FormatterConverter.cs
- SerializationSectionGroup.cs
- RandomNumberGenerator.cs
- PrintDialogException.cs
- SqlServices.cs
- Effect.cs
- StaticContext.cs
- BaseTemplatedMobileComponentEditor.cs
- TreeView.cs
- OutputChannelBinder.cs
- HttpsChannelFactory.cs
- RegistryPermission.cs
- WebPartConnectionsCloseVerb.cs
- Matrix3DValueSerializer.cs
- SoapIncludeAttribute.cs
- Section.cs
- EdmProviderManifest.cs
- PageCatalogPart.cs
- AnyAllSearchOperator.cs
- SoapSchemaImporter.cs