Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- DivideByZeroException.cs
- AccessDataSourceView.cs
- ActivitySurrogateSelector.cs
- SmtpReplyReader.cs
- StringKeyFrameCollection.cs
- DateTimeParse.cs
- VirtualStackFrame.cs
- BindingSource.cs
- EncoderBestFitFallback.cs
- XmlSchemaObject.cs
- __Filters.cs
- LinqDataSourceEditData.cs
- AddInProcess.cs
- PtsContext.cs
- DataGridViewRowsRemovedEventArgs.cs
- Bits.cs
- CompilerResults.cs
- TableChangeProcessor.cs
- Freezable.cs
- TimeZoneInfo.cs
- Region.cs
- CodeDomComponentSerializationService.cs
- FontUnitConverter.cs
- DataGridViewHitTestInfo.cs
- WindowsRegion.cs
- WebPartCatalogAddVerb.cs
- TreeNodeStyleCollection.cs
- DataGrid.cs
- XmlCharType.cs
- RelatedPropertyManager.cs
- TemplateBamlRecordReader.cs
- PasswordBoxAutomationPeer.cs
- Compensation.cs
- DataGridViewColumnEventArgs.cs
- Privilege.cs
- SqlDataSourceView.cs
- ImageSource.cs
- Deserializer.cs
- InputBinder.cs
- ResXDataNode.cs
- InProcStateClientManager.cs
- DataStreamFromComStream.cs
- ComplusEndpointConfigContainer.cs
- CheckBoxStandardAdapter.cs
- PropertyChangeTracker.cs
- CaseStatementSlot.cs
- XmlLangPropertyAttribute.cs
- NewItemsContextMenuStrip.cs
- FontFamilyConverter.cs
- HtmlControlDesigner.cs
- TextRangeEditLists.cs
- UnsafeCollabNativeMethods.cs
- SqlCrossApplyToCrossJoin.cs
- ToggleButtonAutomationPeer.cs
- WorkflowDefinitionContext.cs
- ChangePassword.cs
- Debug.cs
- Command.cs
- UriTemplateMatch.cs
- DataSourceSelectArguments.cs
- Selection.cs
- SrgsRulesCollection.cs
- HtmlFormWrapper.cs
- MdImport.cs
- TrackingProfileDeserializationException.cs
- Expression.cs
- ImagingCache.cs
- _LocalDataStore.cs
- XmlSchemaException.cs
- SendKeys.cs
- OdbcConnectionOpen.cs
- SByte.cs
- GridViewRowCollection.cs
- ModelProperty.cs
- BamlTreeMap.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- XPathConvert.cs
- COSERVERINFO.cs
- SeverityFilter.cs
- DataColumn.cs
- SoapObjectReader.cs
- BuildManagerHost.cs
- NameTable.cs
- EnterpriseServicesHelper.cs
- BaseParser.cs
- SqlBulkCopyColumnMappingCollection.cs
- ComponentEditorForm.cs
- DataContractAttribute.cs
- NavigationPropertySingletonExpression.cs
- XmlExtensionFunction.cs
- DotAtomReader.cs
- MsmqIntegrationBindingElement.cs
- TypedTableBase.cs
- CanonicalXml.cs
- StrokeNode.cs
- TokenBasedSet.cs
- MDIClient.cs
- SelectionListDesigner.cs
- GraphicsContext.cs
- AssemblyResourceLoader.cs