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
- PrivilegedConfigurationManager.cs
- BitmapCache.cs
- NativeMethods.cs
- CollectionViewGroupRoot.cs
- GenericParameterDataContract.cs
- MatrixTransform.cs
- SafeNativeMethods.cs
- ExpanderAutomationPeer.cs
- ItemCheckEvent.cs
- BmpBitmapEncoder.cs
- PropertyEmitterBase.cs
- HtmlTableCellCollection.cs
- UidPropertyAttribute.cs
- InlineUIContainer.cs
- rsa.cs
- CroppedBitmap.cs
- GifBitmapDecoder.cs
- AutoGeneratedField.cs
- SqlInfoMessageEvent.cs
- DataRowComparer.cs
- Adorner.cs
- PtsPage.cs
- RemotingAttributes.cs
- ActiveDocumentEvent.cs
- PropertyChangedEventManager.cs
- NumberEdit.cs
- Error.cs
- LoginUtil.cs
- DesignerToolStripControlHost.cs
- RegistrySecurity.cs
- AssociativeAggregationOperator.cs
- CodePageUtils.cs
- Signature.cs
- DataGridCellAutomationPeer.cs
- MsmqException.cs
- Span.cs
- ExtenderControl.cs
- Hex.cs
- PersonalizablePropertyEntry.cs
- IfJoinedCondition.cs
- CustomGrammar.cs
- NotConverter.cs
- _OSSOCK.cs
- DependencyPropertyKind.cs
- Main.cs
- BevelBitmapEffect.cs
- TableLayoutSettings.cs
- GenerateTemporaryTargetAssembly.cs
- ClientReliableChannelBinder.cs
- DataControlField.cs
- SymbolTable.cs
- HttpModuleCollection.cs
- AutoGeneratedFieldProperties.cs
- SQLMembershipProvider.cs
- RayMeshGeometry3DHitTestResult.cs
- SignatureToken.cs
- CacheSection.cs
- FileDetails.cs
- StandardRuntimeEnumValidator.cs
- RecognitionResult.cs
- Script.cs
- ContentElement.cs
- KoreanLunisolarCalendar.cs
- WindowsRebar.cs
- FrameworkObject.cs
- CellCreator.cs
- DataTableCollection.cs
- KeyBinding.cs
- IListConverters.cs
- Converter.cs
- SqlTriggerAttribute.cs
- SettingsProviderCollection.cs
- SevenBitStream.cs
- DSACryptoServiceProvider.cs
- BatchServiceHost.cs
- SectionInput.cs
- CreateParams.cs
- EncodingTable.cs
- DbConnectionHelper.cs
- Schema.cs
- IsolatedStorageFileStream.cs
- FigureParaClient.cs
- Group.cs
- ButtonBase.cs
- BasePattern.cs
- TrackingMemoryStreamFactory.cs
- InfoCardConstants.cs
- PrinterResolution.cs
- EventMappingSettings.cs
- SQLSingle.cs
- EntityTemplateFactory.cs
- RtType.cs
- PersistenceTypeAttribute.cs
- XmlLanguage.cs
- EmptyEnumerator.cs
- RangeValuePattern.cs
- Automation.cs
- CharEnumerator.cs
- ISCIIEncoding.cs
- SQLInt16.cs