Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- ToolStripPanelCell.cs
- ConstantSlot.cs
- WebPartCatalogAddVerb.cs
- SoapCommonClasses.cs
- PathFigure.cs
- DrawListViewSubItemEventArgs.cs
- HttpsChannelListener.cs
- DtrList.cs
- MergeFailedEvent.cs
- OnOperation.cs
- DecoderFallback.cs
- SoapAttributes.cs
- NamespaceInfo.cs
- _IPv4Address.cs
- MenuItemStyleCollection.cs
- SqlUtil.cs
- SuppressMessageAttribute.cs
- TransactionInterop.cs
- InkPresenterAutomationPeer.cs
- FontUnit.cs
- SQLInt32Storage.cs
- QilChoice.cs
- StringInfo.cs
- FileAuthorizationModule.cs
- RowType.cs
- PrinterUnitConvert.cs
- DateTimeFormat.cs
- Int32CollectionValueSerializer.cs
- Renderer.cs
- ElapsedEventArgs.cs
- ThreadExceptionDialog.cs
- ButtonStandardAdapter.cs
- CodeGenerator.cs
- IndicFontClient.cs
- ImportDesigner.xaml.cs
- MouseBinding.cs
- Event.cs
- Font.cs
- ObjectDesignerDataSourceView.cs
- _NetRes.cs
- DataGridColumnCollection.cs
- SyndicationFeedFormatter.cs
- TreeSet.cs
- MetadataSerializer.cs
- PowerModeChangedEventArgs.cs
- Empty.cs
- PropertyPathWorker.cs
- ConvertersCollection.cs
- AdornedElementPlaceholder.cs
- AuthenticationSchemesHelper.cs
- XamlDebuggerXmlReader.cs
- DbConnectionPoolGroupProviderInfo.cs
- LinkButton.cs
- MouseBinding.cs
- QuaternionRotation3D.cs
- RepeatInfo.cs
- SoapObjectInfo.cs
- MetadataArtifactLoader.cs
- BitmapMetadataBlob.cs
- AdobeCFFWrapper.cs
- SqlClientFactory.cs
- ResolvedKeyFrameEntry.cs
- WindowsBrush.cs
- IMembershipProvider.cs
- TdsParserSafeHandles.cs
- ExpressionConverter.cs
- Math.cs
- Viewport3DAutomationPeer.cs
- ReadOnlyDictionary.cs
- EventHandlersStore.cs
- EntityDataSourceUtil.cs
- HttpHandlerAction.cs
- ServiceOperationParameter.cs
- X509RawDataKeyIdentifierClause.cs
- TableRowsCollectionEditor.cs
- MemoryRecordBuffer.cs
- NavigationPropertyEmitter.cs
- Bezier.cs
- AggregationMinMaxHelpers.cs
- CompoundFileStorageReference.cs
- OracleLob.cs
- XmlC14NWriter.cs
- PropertyCondition.cs
- EntityDataSourceContextCreatedEventArgs.cs
- SafeHandle.cs
- DataPagerCommandEventArgs.cs
- IdentitySection.cs
- PageWrapper.cs
- ApplicationManager.cs
- PolicyException.cs
- ColorAnimationBase.cs
- coordinator.cs
- SmiEventSink_Default.cs
- ConfigDefinitionUpdates.cs
- FreezableOperations.cs
- SqlStream.cs
- HttpListenerResponse.cs
- SqlConnectionPoolProviderInfo.cs
- UndirectedGraph.cs
- FormParameter.cs