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
- Convert.cs
- InvokeGenerator.cs
- CombinedTcpChannel.cs
- RemoteWebConfigurationHostStream.cs
- SiteMembershipCondition.cs
- FormViewUpdatedEventArgs.cs
- ListBoxItem.cs
- SimpleMailWebEventProvider.cs
- ExceptionNotification.cs
- EntityClassGenerator.cs
- SeparatorAutomationPeer.cs
- AccessibleObject.cs
- KerberosSecurityTokenParameters.cs
- BookmarkUndoUnit.cs
- XPathExpr.cs
- CompleteWizardStep.cs
- BitVec.cs
- HtmlHistory.cs
- RuntimeUtils.cs
- X509AsymmetricSecurityKey.cs
- BindingMAnagerBase.cs
- shaperfactoryquerycacheentry.cs
- CommentAction.cs
- UpWmlPageAdapter.cs
- ToolboxComponentsCreatingEventArgs.cs
- ThreadAbortException.cs
- GridItemPatternIdentifiers.cs
- WmpBitmapDecoder.cs
- DataSourceConverter.cs
- Matrix3DConverter.cs
- ImageBrush.cs
- WebPartEditorOkVerb.cs
- OdbcCommandBuilder.cs
- IdnMapping.cs
- ResourceExpressionEditorSheet.cs
- Pkcs9Attribute.cs
- ToolStripEditorManager.cs
- Italic.cs
- ExtractedStateEntry.cs
- TemplateFactory.cs
- AuthStoreRoleProvider.cs
- GridViewSelectEventArgs.cs
- SQLByte.cs
- FullTextState.cs
- Error.cs
- StylusPointPropertyInfo.cs
- Exception.cs
- CommandConverter.cs
- RegisteredScript.cs
- Single.cs
- Pkcs7Recipient.cs
- UpdateProgress.cs
- DeobfuscatingStream.cs
- NotConverter.cs
- GeometryConverter.cs
- MetadataItem_Static.cs
- FixedSOMSemanticBox.cs
- AssemblyCache.cs
- DetailsViewUpdateEventArgs.cs
- SystemMulticastIPAddressInformation.cs
- ZipIOCentralDirectoryBlock.cs
- HTTPNotFoundHandler.cs
- HtmlSelect.cs
- HostSecurityManager.cs
- XmlElementAttribute.cs
- SignatureTargetIdManager.cs
- SelectionService.cs
- JsonDeserializer.cs
- PopupEventArgs.cs
- MasterPageParser.cs
- OdbcDataAdapter.cs
- OracleCommandBuilder.cs
- DebugTrace.cs
- CheckBoxFlatAdapter.cs
- ListSurrogate.cs
- PcmConverter.cs
- AncillaryOps.cs
- OleDbError.cs
- SafeCryptHandles.cs
- WebServiceResponseDesigner.cs
- HttpListenerElement.cs
- SmiGettersStream.cs
- WorkflowCommandExtensionItem.cs
- DriveNotFoundException.cs
- WindowsGraphicsWrapper.cs
- StorageEndPropertyMapping.cs
- MapPathBasedVirtualPathProvider.cs
- StyleBamlTreeBuilder.cs
- ListBase.cs
- AnimationClockResource.cs
- ThreadPool.cs
- DeferredReference.cs
- GeometryGroup.cs
- FrameworkContentElement.cs
- XPathBinder.cs
- WebPartEventArgs.cs
- ByteAnimationBase.cs
- ApplicationServicesHostFactory.cs
- WorkflowOperationContext.cs
- XmlNamespaceManager.cs