Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WebControl.cs
- X509Utils.cs
- EncryptedHeader.cs
- DocumentSequenceHighlightLayer.cs
- WSTransactionSection.cs
- Permission.cs
- CategoryNameCollection.cs
- ImportOptions.cs
- WorkflowViewStateService.cs
- WebPartManagerInternals.cs
- StickyNote.cs
- TypeElement.cs
- CodeParameterDeclarationExpression.cs
- DiffuseMaterial.cs
- PersonalizationAdministration.cs
- VisualStyleTypesAndProperties.cs
- objectresult_tresulttype.cs
- TemplateBuilder.cs
- ForeignConstraint.cs
- XmlSyndicationContent.cs
- CellParagraph.cs
- ZipIOCentralDirectoryFileHeader.cs
- PopupEventArgs.cs
- SQLConvert.cs
- ScrollBarAutomationPeer.cs
- XmlSchemaParticle.cs
- ServerIdentity.cs
- RenderCapability.cs
- LassoSelectionBehavior.cs
- WebPartExportVerb.cs
- Size.cs
- SystemInfo.cs
- ClientRolePrincipal.cs
- CommandPlan.cs
- DebugHandleTracker.cs
- ValidationVisibilityAttribute.cs
- XmlSignificantWhitespace.cs
- KeyInstance.cs
- SplitterPanel.cs
- LambdaCompiler.Statements.cs
- GridViewColumnCollection.cs
- DataServiceHostWrapper.cs
- AccessDataSourceView.cs
- HttpDebugHandler.cs
- AppDomainProtocolHandler.cs
- SystemBrushes.cs
- DropShadowEffect.cs
- Condition.cs
- TextProperties.cs
- SchemaImporterExtension.cs
- PrintPageEvent.cs
- SqlConnectionFactory.cs
- EDesignUtil.cs
- OutOfProcStateClientManager.cs
- NamespaceTable.cs
- ipaddressinformationcollection.cs
- TargetControlTypeAttribute.cs
- RemotingException.cs
- CheckBoxFlatAdapter.cs
- DurationConverter.cs
- PixelFormats.cs
- ColumnBinding.cs
- FrameworkContentElement.cs
- ByteStreamMessageEncoder.cs
- MetadataItemEmitter.cs
- TypedAsyncResult.cs
- GenericWebPart.cs
- PKCS1MaskGenerationMethod.cs
- Dynamic.cs
- XmlSerializableWriter.cs
- WizardForm.cs
- MeasureData.cs
- EncryptedPackage.cs
- SerialPinChanges.cs
- CngProvider.cs
- CapiSafeHandles.cs
- LoginDesignerUtil.cs
- FtpRequestCacheValidator.cs
- ToolStripDropDownClosingEventArgs.cs
- Menu.cs
- WsatAdminException.cs
- ActivityDelegate.cs
- MetadataUtilsSmi.cs
- SynchronizationFilter.cs
- ParseNumbers.cs
- UnknownWrapper.cs
- ExternalException.cs
- ThreadStaticAttribute.cs
- BasicKeyConstraint.cs
- SocketException.cs
- UnsafeNativeMethods.cs
- FrameworkContentElement.cs
- ChildrenQuery.cs
- DoubleIndependentAnimationStorage.cs
- SettingsPropertyValueCollection.cs
- OneToOneMappingSerializer.cs
- NameTable.cs
- embossbitmapeffect.cs
- PrivilegeNotHeldException.cs
- DomainUpDown.cs