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
- ArraySet.cs
- AsyncInvokeContext.cs
- DSACryptoServiceProvider.cs
- basenumberconverter.cs
- SettingsPropertyCollection.cs
- XmlObjectSerializerWriteContextComplex.cs
- TextChangedEventArgs.cs
- SrgsGrammar.cs
- EncryptedXml.cs
- RoutingService.cs
- RotationValidation.cs
- RegexMatchCollection.cs
- NullRuntimeConfig.cs
- ToolBarButtonClickEvent.cs
- IOException.cs
- PrintPreviewControl.cs
- MailAddressCollection.cs
- ActivityUtilities.cs
- ComponentChangingEvent.cs
- NamespaceCollection.cs
- Menu.cs
- TagNameToTypeMapper.cs
- Filter.cs
- DataRowIndexBuffer.cs
- ObjectTag.cs
- MenuItemBindingCollection.cs
- ColorComboBox.cs
- CatalogPartChrome.cs
- SoapExtensionTypeElementCollection.cs
- UriScheme.cs
- KeyNotFoundException.cs
- DataGridViewCellStateChangedEventArgs.cs
- TdsEnums.cs
- RandomNumberGenerator.cs
- TextBlock.cs
- FormViewUpdateEventArgs.cs
- HttpRequestCacheValidator.cs
- SystemWebCachingSectionGroup.cs
- PlatformCulture.cs
- URLMembershipCondition.cs
- RtfFormatStack.cs
- FontFamily.cs
- NativeMethods.cs
- ExtensionWindowResizeGrip.cs
- ButtonChrome.cs
- ChooseAction.cs
- FormsAuthenticationConfiguration.cs
- Cursors.cs
- OleDbConnection.cs
- TransformGroup.cs
- _NestedSingleAsyncResult.cs
- AllowedAudienceUriElement.cs
- Scheduler.cs
- CodePageUtils.cs
- BindingsCollection.cs
- CodeDefaultValueExpression.cs
- Hex.cs
- TextInfo.cs
- DropDownHolder.cs
- Process.cs
- XPathDescendantIterator.cs
- FontCacheLogic.cs
- SchemaTypeEmitter.cs
- SoapSchemaExporter.cs
- UIElementCollection.cs
- WpfKnownType.cs
- RectValueSerializer.cs
- EncoderNLS.cs
- TrackingProfileCache.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- BackStopAuthenticationModule.cs
- BinHexDecoder.cs
- WebDisplayNameAttribute.cs
- InvalidComObjectException.cs
- IHttpResponseInternal.cs
- HttpListenerException.cs
- DataGridViewAutoSizeModeEventArgs.cs
- TraceListener.cs
- CompositeScriptReferenceEventArgs.cs
- DesignerForm.cs
- CookieParameter.cs
- Button.cs
- ValidatorCompatibilityHelper.cs
- ResourceSet.cs
- FillBehavior.cs
- Misc.cs
- BaseEntityWrapper.cs
- XmlUtf8RawTextWriter.cs
- PowerStatus.cs
- ToolStripItemImageRenderEventArgs.cs
- TypeProvider.cs
- ByteAnimation.cs
- AppSettingsExpressionBuilder.cs
- DBDataPermissionAttribute.cs
- SmiGettersStream.cs
- SystemInfo.cs
- ActivationServices.cs
- assertwrapper.cs
- Vector3DConverter.cs
- DateTimePicker.cs