Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- Aggregates.cs
- PtsHost.cs
- DataBinder.cs
- SspiHelper.cs
- StylusPlugin.cs
- AutoFocusStyle.xaml.cs
- BindingExpression.cs
- ToolConsole.cs
- RSAPKCS1KeyExchangeFormatter.cs
- MultiPropertyDescriptorGridEntry.cs
- VirtualPath.cs
- ControlBuilderAttribute.cs
- CompilerScope.Storage.cs
- RouteItem.cs
- XMLSyntaxException.cs
- WebPartConnectionsConfigureVerb.cs
- DataGridViewIntLinkedList.cs
- CatalogPart.cs
- SchemaContext.cs
- CollectionEditor.cs
- FormatSettings.cs
- DataGridViewCellCancelEventArgs.cs
- SystemIcmpV4Statistics.cs
- ScriptManagerProxy.cs
- RootAction.cs
- ProxyWebPartConnectionCollection.cs
- EntityProviderFactory.cs
- DataGridViewRowsAddedEventArgs.cs
- TransformPatternIdentifiers.cs
- FaultHandlingFilter.cs
- TextTreeTextElementNode.cs
- TextFindEngine.cs
- SessionStateModule.cs
- NameSpaceEvent.cs
- WSDualHttpSecurityMode.cs
- TableLayoutSettingsTypeConverter.cs
- DbProviderSpecificTypePropertyAttribute.cs
- MetadataCacheItem.cs
- ProxyWebPart.cs
- TreeViewImageGenerator.cs
- StrokeFIndices.cs
- LinqDataSourceContextEventArgs.cs
- SwitchCase.cs
- UIntPtr.cs
- SafeThemeHandle.cs
- PersistenceTypeAttribute.cs
- CodeExpressionRuleDeclaration.cs
- VirtualPathExtension.cs
- ThrowHelper.cs
- DifferencingCollection.cs
- ContextMenuStripGroup.cs
- VerticalConnector.xaml.cs
- TypeBuilderInstantiation.cs
- RecordBuilder.cs
- CapacityStreamGeometryContext.cs
- storepermission.cs
- DescriptionAttribute.cs
- Directory.cs
- Int32.cs
- ColorContext.cs
- VBCodeProvider.cs
- keycontainerpermission.cs
- XamlClipboardData.cs
- SvcMapFileLoader.cs
- EncodingTable.cs
- Form.cs
- EraserBehavior.cs
- FilteredReadOnlyMetadataCollection.cs
- PropertyMapper.cs
- ContractUtils.cs
- FaultDesigner.cs
- ObservableDictionary.cs
- TimelineGroup.cs
- ObfuscateAssemblyAttribute.cs
- RelationshipNavigation.cs
- EnterpriseServicesHelper.cs
- SafeHGlobalHandleCritical.cs
- NavigationCommands.cs
- OleDbCommand.cs
- ServiceDescription.cs
- DependsOnAttribute.cs
- SynchronousChannel.cs
- CellParagraph.cs
- ThrowHelper.cs
- Util.cs
- DetailsViewUpdateEventArgs.cs
- EntityClientCacheKey.cs
- SqlDataSourceSelectingEventArgs.cs
- CTreeGenerator.cs
- EventWaitHandle.cs
- TextDecorationCollection.cs
- OleDbDataAdapter.cs
- BitVector32.cs
- Splitter.cs
- CatalogZone.cs
- OdbcPermission.cs
- clipboard.cs
- ControlBuilder.cs
- ListViewAutomationPeer.cs
- NavigateEvent.cs