Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NamedPipeHostedTransportConfiguration.cs
- ThreadInterruptedException.cs
- tooltip.cs
- ExpressionContext.cs
- RegexWriter.cs
- PersistenceException.cs
- HttpProfileBase.cs
- CodeMemberEvent.cs
- XmlSignificantWhitespace.cs
- CultureTable.cs
- RequestQueue.cs
- SessionStateItemCollection.cs
- SemanticAnalyzer.cs
- HwndSourceParameters.cs
- RewritingPass.cs
- SqlCaseSimplifier.cs
- WindowsGraphics.cs
- LayoutSettings.cs
- XmlSchemaSimpleTypeRestriction.cs
- EnlistmentState.cs
- KnownIds.cs
- SystemNetworkInterface.cs
- Schema.cs
- UpdateException.cs
- ImplicitInputBrush.cs
- FontSource.cs
- BitmapEffectGeneralTransform.cs
- CodeDomComponentSerializationService.cs
- DataTableNewRowEvent.cs
- base64Transforms.cs
- DeviceContext2.cs
- UnsafeNativeMethods.cs
- CodeTypeDeclaration.cs
- CodeGenerator.cs
- DbModificationClause.cs
- WaveHeader.cs
- TaiwanLunisolarCalendar.cs
- DispatcherExceptionEventArgs.cs
- PtsCache.cs
- _NestedSingleAsyncResult.cs
- XmlILTrace.cs
- BufferedGraphics.cs
- And.cs
- UInt32.cs
- TableHeaderCell.cs
- DbConnectionPool.cs
- RecognitionResult.cs
- AvtEvent.cs
- DbParameterHelper.cs
- ScrollViewerAutomationPeer.cs
- BindingBase.cs
- QuestionEventArgs.cs
- HeaderPanel.cs
- CacheVirtualItemsEvent.cs
- GiveFeedbackEvent.cs
- FormViewUpdateEventArgs.cs
- RandomNumberGenerator.cs
- MainMenu.cs
- GrammarBuilderBase.cs
- SapiAttributeParser.cs
- CodeStatementCollection.cs
- ListChangedEventArgs.cs
- _DomainName.cs
- CancelRequestedQuery.cs
- MasterPageBuildProvider.cs
- EventsTab.cs
- ToolbarAUtomationPeer.cs
- AutomationTextAttribute.cs
- ExchangeUtilities.cs
- ViewKeyConstraint.cs
- UrlAuthorizationModule.cs
- ConnectionStringsExpressionBuilder.cs
- ButtonBaseDesigner.cs
- ResourceSet.cs
- EntityTemplateUserControl.cs
- ConnectionConsumerAttribute.cs
- DesignerView.xaml.cs
- Base64WriteStateInfo.cs
- XmlMapping.cs
- BindableAttribute.cs
- _BufferOffsetSize.cs
- ZipIOCentralDirectoryFileHeader.cs
- BaseCodeDomTreeGenerator.cs
- DbConvert.cs
- ServiceTimeoutsBehavior.cs
- BitmapEffectGroup.cs
- IdnElement.cs
- BasicViewGenerator.cs
- BaseServiceProvider.cs
- EventHandlersStore.cs
- Stackframe.cs
- QueryStringParameter.cs
- TdsParserStateObject.cs
- UnsafeNativeMethods.cs
- AssertHelper.cs
- ListenerElementsCollection.cs
- EntityDataSourceQueryBuilder.cs
- XmlDataSourceView.cs
- ListControl.cs
- QilList.cs