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
- DbConnectionPoolCounters.cs
- GeometryGroup.cs
- CancellationToken.cs
- ToolStripPanelCell.cs
- XmlSchemaChoice.cs
- ReadOnlyMetadataCollection.cs
- WebDescriptionAttribute.cs
- ChannelManager.cs
- UICuesEvent.cs
- Matrix3DValueSerializer.cs
- SqlTypesSchemaImporter.cs
- ProcessHostServerConfig.cs
- TargetException.cs
- RoleManagerEventArgs.cs
- SafeRightsManagementHandle.cs
- DbCommandTree.cs
- LicenseContext.cs
- VerificationAttribute.cs
- DbConnectionPoolIdentity.cs
- ItemCollection.cs
- InkCanvas.cs
- TagMapCollection.cs
- StreamWithDictionary.cs
- SmiEventStream.cs
- XmlSchemaAnyAttribute.cs
- XmlAttributeCache.cs
- SafeTimerHandle.cs
- BitmapCodecInfo.cs
- OperatorExpressions.cs
- ConstraintStruct.cs
- PenCursorManager.cs
- IPEndPointCollection.cs
- SerializationException.cs
- TdsEnums.cs
- TypefaceMap.cs
- ReferenceService.cs
- XmlSerializationReader.cs
- InputProcessorProfilesLoader.cs
- PropertyPathWorker.cs
- ToolStripOverflow.cs
- AsyncCompletedEventArgs.cs
- LinqDataSourceSelectEventArgs.cs
- BaseDataBoundControl.cs
- SectionRecord.cs
- ProfileParameter.cs
- Triangle.cs
- StyleXamlTreeBuilder.cs
- CompositionAdorner.cs
- Sentence.cs
- KeyValuePairs.cs
- DataGridViewRowPostPaintEventArgs.cs
- ListenerSingletonConnectionReader.cs
- IISUnsafeMethods.cs
- FileLogRecordStream.cs
- PrimitiveSchema.cs
- CommandExpr.cs
- QilInvokeEarlyBound.cs
- QilInvokeEarlyBound.cs
- ColorDialog.cs
- PassportAuthenticationEventArgs.cs
- DynamicActivity.cs
- _ProxyChain.cs
- WebHttpSecurityElement.cs
- IMembershipProvider.cs
- PolygonHotSpot.cs
- COM2AboutBoxPropertyDescriptor.cs
- SecurityResources.cs
- XmlSchemaValidator.cs
- SendMailErrorEventArgs.cs
- PersonalizableTypeEntry.cs
- InternalTypeHelper.cs
- GridSplitterAutomationPeer.cs
- XmlWriterTraceListener.cs
- StaticFileHandler.cs
- WindowsListView.cs
- CodeCatchClauseCollection.cs
- TableChangeProcessor.cs
- CommandPlan.cs
- AnnouncementEndpoint.cs
- EncryptedKeyIdentifierClause.cs
- StreamReader.cs
- PermissionAttributes.cs
- RuleProcessor.cs
- SafeHandles.cs
- ZipIOLocalFileBlock.cs
- InputReferenceExpression.cs
- Environment.cs
- DecodeHelper.cs
- ParallelEnumerable.cs
- MatchNoneMessageFilter.cs
- EntityType.cs
- TransformerConfigurationWizardBase.cs
- DataRowView.cs
- ContractMapping.cs
- State.cs
- OutputScopeManager.cs
- ReversePositionQuery.cs
- ClosureBinding.cs
- RelationshipConverter.cs
- StylusPointPropertyInfoDefaults.cs