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
- MsmqReceiveParameters.cs
- RegexRunnerFactory.cs
- TextRunTypographyProperties.cs
- NominalTypeEliminator.cs
- UntypedNullExpression.cs
- SchemaImporter.cs
- DoubleLinkList.cs
- ServiceX509SecurityTokenProvider.cs
- dtdvalidator.cs
- XmlTypeAttribute.cs
- HelpInfo.cs
- CannotUnloadAppDomainException.cs
- AspCompat.cs
- PrintDialog.cs
- CodeVariableDeclarationStatement.cs
- MenuItemStyle.cs
- UIElement.cs
- XappLauncher.cs
- QueryReaderSettings.cs
- ScriptManager.cs
- Transform.cs
- RIPEMD160.cs
- EncoderReplacementFallback.cs
- SafeNativeMethods.cs
- Part.cs
- ParserContext.cs
- AutoCompleteStringCollection.cs
- WmlListAdapter.cs
- Clock.cs
- StateValidator.cs
- BindingBase.cs
- ThicknessKeyFrameCollection.cs
- SqlErrorCollection.cs
- ThrowHelper.cs
- Rfc4050KeyFormatter.cs
- CheckBoxAutomationPeer.cs
- Internal.cs
- StorageSetMapping.cs
- CodeGeneratorOptions.cs
- RegisteredHiddenField.cs
- ZipIOExtraFieldZip64Element.cs
- SQLDecimalStorage.cs
- TimeStampChecker.cs
- ForeignKeyConstraint.cs
- FormViewInsertedEventArgs.cs
- DesignerFrame.cs
- RepeaterItem.cs
- EtwTrackingBehaviorElement.cs
- FontStyle.cs
- FunctionDescription.cs
- StyleCollectionEditor.cs
- ValidatingCollection.cs
- TypeDependencyAttribute.cs
- Update.cs
- NetworkInterface.cs
- Region.cs
- TemplateControlCodeDomTreeGenerator.cs
- DelegateTypeInfo.cs
- InvokeMemberBinder.cs
- CounterSample.cs
- ThicknessKeyFrameCollection.cs
- sqlinternaltransaction.cs
- AutomationElementIdentifiers.cs
- XmlLanguage.cs
- SqlParameterizer.cs
- WebRequestModuleElementCollection.cs
- FixedDocumentPaginator.cs
- InvokeMethodActivityDesigner.cs
- XmlMtomReader.cs
- NoPersistHandle.cs
- CollectionBuilder.cs
- LookupBindingPropertiesAttribute.cs
- unitconverter.cs
- TextDecoration.cs
- TreeViewItem.cs
- DataTableTypeConverter.cs
- IndexedString.cs
- NativeMethods.cs
- UIElement3D.cs
- DataGridItem.cs
- ResolveDuplexCD1AsyncResult.cs
- StructuredType.cs
- ArrayWithOffset.cs
- SqlDependencyListener.cs
- FormsAuthenticationUserCollection.cs
- ValidationSummary.cs
- PipelineModuleStepContainer.cs
- ProtocolsSection.cs
- PartialList.cs
- InternalDuplexChannelListener.cs
- FixedTextSelectionProcessor.cs
- SqlDataAdapter.cs
- ButtonFieldBase.cs
- XmlAggregates.cs
- RequestQueue.cs
- UpdateCommand.cs
- SafeNativeMethods.cs
- FileSecurity.cs
- XmlMembersMapping.cs
- PiiTraceSource.cs