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
- NameTable.cs
- JsonFormatGeneratorStatics.cs
- MetaModel.cs
- ResourceManager.cs
- BrushConverter.cs
- SelectionProcessor.cs
- ProcessThread.cs
- XmlNodeWriter.cs
- CompModSwitches.cs
- BufferedWebEventProvider.cs
- MaskedTextBoxDesigner.cs
- XmlSchemaException.cs
- SqlClientWrapperSmiStream.cs
- TextElementEnumerator.cs
- FontInfo.cs
- SourceElementsCollection.cs
- LinkDescriptor.cs
- ConfigurationPermission.cs
- BindingGraph.cs
- GroupBoxRenderer.cs
- IsolationInterop.cs
- ObjectListCommandCollection.cs
- ControlPropertyNameConverter.cs
- Menu.cs
- SerializationHelper.cs
- ObjectView.cs
- KeyMatchBuilder.cs
- DefaultAsyncDataDispatcher.cs
- FeatureSupport.cs
- TaiwanLunisolarCalendar.cs
- InputDevice.cs
- ListBoxItem.cs
- SettingsPropertyValue.cs
- TimeZoneNotFoundException.cs
- TrustManagerPromptUI.cs
- WebEventTraceProvider.cs
- GPStream.cs
- AssociatedControlConverter.cs
- EventOpcode.cs
- UrlPropertyAttribute.cs
- PathParser.cs
- DeploymentSection.cs
- ToolBar.cs
- Soap.cs
- WindowsGraphicsCacheManager.cs
- ParseHttpDate.cs
- WaveHeader.cs
- UserControl.cs
- EditorZoneDesigner.cs
- UnionCodeGroup.cs
- HandlerWithFactory.cs
- DefaultTraceListener.cs
- LicenseContext.cs
- ThrowHelper.cs
- GlyphTypeface.cs
- XmlQualifiedName.cs
- FilterQuery.cs
- ContainerAction.cs
- WorkflowDefinitionDispenser.cs
- InvokeMemberBinder.cs
- CacheRequest.cs
- ProtocolsConfigurationHandler.cs
- HttpConfigurationSystem.cs
- SynchronizedInputHelper.cs
- BulletedList.cs
- URLAttribute.cs
- QuaternionAnimationUsingKeyFrames.cs
- TypeLoader.cs
- DataPointer.cs
- GetImportFileNameRequest.cs
- NativeMethods.cs
- ListViewUpdatedEventArgs.cs
- WmpBitmapEncoder.cs
- StoreAnnotationsMap.cs
- MonthCalendarDesigner.cs
- ObjectAnimationBase.cs
- AtomMaterializer.cs
- DataGridPageChangedEventArgs.cs
- WindowInteropHelper.cs
- CodeAttributeDeclaration.cs
- RevocationPoint.cs
- HeaderedItemsControl.cs
- DecoderNLS.cs
- TableCellAutomationPeer.cs
- ResXBuildProvider.cs
- ConfigurationManagerInternal.cs
- CalendarTable.cs
- Int32Rect.cs
- RefreshPropertiesAttribute.cs
- RenderDataDrawingContext.cs
- BamlRecordReader.cs
- DataTable.cs
- SignatureToken.cs
- ErrorStyle.cs
- DeriveBytes.cs
- DecoderFallback.cs
- ResizeGrip.cs
- BitArray.cs
- DataSourceIDConverter.cs
- PerformanceCounterManager.cs