Code:
/ DotNET / DotNET / 8.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
- HwndStylusInputProvider.cs
- SafeProcessHandle.cs
- ListDictionary.cs
- ZipArchive.cs
- Int32Rect.cs
- TrustLevelCollection.cs
- SQLGuid.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- ExceptionHandlersDesigner.cs
- ListMarkerLine.cs
- Int16AnimationBase.cs
- Types.cs
- X509CertificateRecipientClientCredential.cs
- TypeExtensionConverter.cs
- KeyConverter.cs
- DataKey.cs
- SqlDataSourceRefreshSchemaForm.cs
- BuildProviderUtils.cs
- ManipulationCompletedEventArgs.cs
- Util.cs
- ToolStripLocationCancelEventArgs.cs
- DataIdProcessor.cs
- ObjectStorage.cs
- ChildDocumentBlock.cs
- CommandDevice.cs
- AmbientProperties.cs
- PointLight.cs
- ModulesEntry.cs
- CategoryNameCollection.cs
- ScaleTransform3D.cs
- ManifestResourceInfo.cs
- ToolStripItemTextRenderEventArgs.cs
- TextElementCollection.cs
- ChildrenQuery.cs
- IpcChannelHelper.cs
- CoTaskMemHandle.cs
- SymDocumentType.cs
- VBCodeProvider.cs
- DSASignatureFormatter.cs
- Animatable.cs
- ScriptReferenceBase.cs
- FileDialogCustomPlace.cs
- DataShape.cs
- MouseGesture.cs
- TransformDescriptor.cs
- SerializationException.cs
- SerializationIncompleteException.cs
- CustomExpression.cs
- Tuple.cs
- PageRouteHandler.cs
- ClientApiGenerator.cs
- GCHandleCookieTable.cs
- SerializationInfoEnumerator.cs
- FormsAuthenticationUser.cs
- IssuanceLicense.cs
- HttpProfileGroupBase.cs
- CatalogPartDesigner.cs
- StreamBodyWriter.cs
- ClipboardData.cs
- Config.cs
- CodeTypeReferenceExpression.cs
- TypeNameConverter.cs
- Classification.cs
- DetailsViewUpdateEventArgs.cs
- ProfessionalColorTable.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- SpecularMaterial.cs
- NativeMethods.cs
- DataGridViewToolTip.cs
- EntityDesignerDataSourceView.cs
- SingleStorage.cs
- GorillaCodec.cs
- Aggregates.cs
- Point4D.cs
- TextParaLineResult.cs
- XmlReader.cs
- DispatcherProcessingDisabled.cs
- XsdBuildProvider.cs
- DataGridTable.cs
- XmlAttributeProperties.cs
- OracleCommandBuilder.cs
- DesignerAttributeInfo.cs
- DrawingImage.cs
- RealProxy.cs
- CultureInfoConverter.cs
- ScriptReferenceEventArgs.cs
- UserControl.cs
- DbParameterCollection.cs
- XmlHierarchicalEnumerable.cs
- ProtectedConfiguration.cs
- TCPClient.cs
- Types.cs
- WebUtil.cs
- Speller.cs
- StatusBarAutomationPeer.cs
- MobileCapabilities.cs
- TableLayoutPanel.cs
- MenuItemStyleCollectionEditor.cs
- ASCIIEncoding.cs
- XslTransform.cs