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
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WebBrowserEvent.cs
- SignedXml.cs
- ParameterSubsegment.cs
- PerformanceCounterManager.cs
- HtmlWindowCollection.cs
- ProcessStartInfo.cs
- GeometryValueSerializer.cs
- BinaryObjectReader.cs
- assemblycache.cs
- HitTestParameters3D.cs
- TraceSection.cs
- RequestReplyCorrelator.cs
- SqlAggregateChecker.cs
- ArithmeticLiteral.cs
- Error.cs
- XmlResolver.cs
- PersonalizationProviderHelper.cs
- GlyphsSerializer.cs
- ToolStripOverflow.cs
- FileDataSourceCache.cs
- ConfigXmlWhitespace.cs
- TextLineResult.cs
- NullableBoolConverter.cs
- SessionViewState.cs
- WinEventQueueItem.cs
- Stylesheet.cs
- CmsInterop.cs
- BamlVersionHeader.cs
- Visual3D.cs
- TraceHandler.cs
- MarshalDirectiveException.cs
- PropertyCollection.cs
- _BaseOverlappedAsyncResult.cs
- UrlPropertyAttribute.cs
- Certificate.cs
- Rules.cs
- WindowsListViewGroupSubsetLink.cs
- HtmlMeta.cs
- RoleManagerEventArgs.cs
- _emptywebproxy.cs
- TextTreeTextElementNode.cs
- ArrayHelper.cs
- MachineKeySection.cs
- CryptographicAttribute.cs
- _ConnectOverlappedAsyncResult.cs
- NamedPipeConnectionPoolSettings.cs
- HttpRequestBase.cs
- AccessibleObject.cs
- ParsedAttributeCollection.cs
- LOSFormatter.cs
- EnlistmentTraceIdentifier.cs
- InputManager.cs
- InternalBufferOverflowException.cs
- BaseComponentEditor.cs
- ToolTipAutomationPeer.cs
- RuntimeEnvironment.cs
- GridView.cs
- RsaKeyIdentifierClause.cs
- ObjectDataSourceMethodEventArgs.cs
- _emptywebproxy.cs
- IQueryable.cs
- CreateParams.cs
- SmiMetaData.cs
- StrokeCollection2.cs
- ErrorFormatterPage.cs
- ResourceAttributes.cs
- ListSurrogate.cs
- RectConverter.cs
- ConnectionStringSettings.cs
- XPathQilFactory.cs
- RecordConverter.cs
- DeferredSelectedIndexReference.cs
- BuildResult.cs
- XmlSchemaIdentityConstraint.cs
- DropShadowEffect.cs
- AsmxEndpointPickerExtension.cs
- MultipleViewPattern.cs
- ScriptRef.cs
- EventlogProvider.cs
- CellParaClient.cs
- DataGridPageChangedEventArgs.cs
- FixedSchema.cs
- XhtmlBasicPageAdapter.cs
- HttpConfigurationSystem.cs
- DataControlPagerLinkButton.cs
- InvokeGenerator.cs
- FactoryGenerator.cs
- ListViewDeletedEventArgs.cs
- TimeSpanConverter.cs
- DbReferenceCollection.cs
- CircleHotSpot.cs
- LinqDataSourceHelper.cs
- Descriptor.cs
- TypeBrowser.xaml.cs
- Timeline.cs
- PublisherIdentityPermission.cs
- SizeValueSerializer.cs
- TextRange.cs
- StoragePropertyMapping.cs
- SharedConnectionWorkflowTransactionService.cs