Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Mail / AlternateView.cs / 1305376 / 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
- WebPartVerbCollection.cs
- SQLDecimalStorage.cs
- StringFormat.cs
- ToolBar.cs
- XmlWriter.cs
- DesignerTransactionCloseEvent.cs
- AcceptorSessionSymmetricTransportSecurityProtocol.cs
- HttpRuntimeSection.cs
- VectorCollectionValueSerializer.cs
- FontSourceCollection.cs
- ControlIdConverter.cs
- DataGridCommandEventArgs.cs
- WebHttpBindingCollectionElement.cs
- DelegateSerializationHolder.cs
- SecurityTokenInclusionMode.cs
- HwndStylusInputProvider.cs
- MethodExpr.cs
- AttachedAnnotationChangedEventArgs.cs
- SoapSchemaExporter.cs
- StringFormat.cs
- SharedStream.cs
- HMACMD5.cs
- SimplePropertyEntry.cs
- GridView.cs
- OdbcConnectionOpen.cs
- ReadOnlyHierarchicalDataSource.cs
- XXXOnTypeBuilderInstantiation.cs
- DrawListViewColumnHeaderEventArgs.cs
- ObjectPersistData.cs
- MemoryStream.cs
- WebPartDeleteVerb.cs
- CodeSubDirectory.cs
- ActivityTypeResolver.xaml.cs
- AutomationPeer.cs
- SoapClientProtocol.cs
- WindowsStatusBar.cs
- ControlCollection.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- PropertyToken.cs
- CalloutQueueItem.cs
- PerformanceCounters.cs
- CharacterShapingProperties.cs
- EntityProviderFactory.cs
- AttachmentService.cs
- SHA512.cs
- QuadTree.cs
- ReferencedCollectionType.cs
- IdentityHolder.cs
- BlurEffect.cs
- MaskedTextBox.cs
- PathBox.cs
- CodeDelegateCreateExpression.cs
- input.cs
- XmlSchemaAppInfo.cs
- DirectoryNotFoundException.cs
- DiscoveryMessageSequence11.cs
- XmlText.cs
- ProgressChangedEventArgs.cs
- IntSecurity.cs
- SelectionRange.cs
- DeliveryStrategy.cs
- ServiceRouteHandler.cs
- SQLBinaryStorage.cs
- ListControlDesigner.cs
- Script.cs
- BeginSelectCardRequest.cs
- SiteMap.cs
- FrameworkRichTextComposition.cs
- Activator.cs
- Mouse.cs
- StateMachine.cs
- Stacktrace.cs
- XLinq.cs
- ScriptReference.cs
- StateDesigner.Helpers.cs
- MessageQueueInstaller.cs
- MembershipSection.cs
- SafeNativeMethodsOther.cs
- EqualityComparer.cs
- CodeGenerationManager.cs
- StringBlob.cs
- WebSysDisplayNameAttribute.cs
- HealthMonitoringSectionHelper.cs
- PageThemeParser.cs
- PropVariant.cs
- Compensation.cs
- PathFigureCollectionConverter.cs
- RoutedEventHandlerInfo.cs
- ComponentDispatcher.cs
- OdbcUtils.cs
- PerformanceCounterLib.cs
- AutomationElement.cs
- Attributes.cs
- TextCollapsingProperties.cs
- AnnotationComponentChooser.cs
- ConfigurationException.cs
- XhtmlConformanceSection.cs
- DiscoveryMessageSequenceCD1.cs
- FormViewUpdateEventArgs.cs
- NotSupportedException.cs