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
- RtfControls.cs
- Calendar.cs
- HtmlValidationSummaryAdapter.cs
- PackageProperties.cs
- MissingMemberException.cs
- EntityDesignerBuildProvider.cs
- CallbackValidatorAttribute.cs
- FontFamily.cs
- AutomationPeer.cs
- SspiNegotiationTokenProvider.cs
- _ContextAwareResult.cs
- Crc32Helper.cs
- ContentDisposition.cs
- SqlFileStream.cs
- WebPartRestoreVerb.cs
- RichTextBox.cs
- SystemWebCachingSectionGroup.cs
- ApplicationManager.cs
- ValueSerializerAttribute.cs
- TextEditorMouse.cs
- FileBasedResourceGroveler.cs
- SQLInt32Storage.cs
- DbConnectionOptions.cs
- PlatformCulture.cs
- MessageBox.cs
- RenamedEventArgs.cs
- TreeNodeConverter.cs
- AnnotationAdorner.cs
- AssertSection.cs
- OutOfProcStateClientManager.cs
- Clause.cs
- WeakReadOnlyCollection.cs
- BuildDependencySet.cs
- CheckedListBox.cs
- __TransparentProxy.cs
- ContainerControl.cs
- DisplayNameAttribute.cs
- ResourceContainer.cs
- CompilerScope.cs
- KeyboardNavigation.cs
- SafeReversePInvokeHandle.cs
- ThrowOnMultipleAssignment.cs
- SemaphoreSecurity.cs
- TypeContext.cs
- SecurityPolicySection.cs
- EtwProvider.cs
- CompModSwitches.cs
- NavigationExpr.cs
- SocketElement.cs
- CalendarDay.cs
- _ListenerRequestStream.cs
- GuidTagList.cs
- UpDownBase.cs
- AnimationClock.cs
- PeerTransportSecurityElement.cs
- Debug.cs
- GifBitmapEncoder.cs
- ScopeElement.cs
- CaseCqlBlock.cs
- StrongName.cs
- SkewTransform.cs
- ReverseInheritProperty.cs
- ComponentCollection.cs
- Baml6ConstructorInfo.cs
- MetafileHeader.cs
- Reference.cs
- AssociationType.cs
- DocumentPageViewAutomationPeer.cs
- SyntaxCheck.cs
- TextChangedEventArgs.cs
- CurrentChangingEventManager.cs
- TypeReference.cs
- SqlBuilder.cs
- ValidationErrorInfo.cs
- DbProviderFactory.cs
- ControlParameter.cs
- SessionStateSection.cs
- DataGridCommandEventArgs.cs
- ExtensibleClassFactory.cs
- ApplicationDirectory.cs
- BindToObject.cs
- SafeNativeMethodsCLR.cs
- InvokeBinder.cs
- IssuanceTokenProviderState.cs
- DataGridCellItemAutomationPeer.cs
- XmlSchemaImporter.cs
- SingleObjectCollection.cs
- GridItemPattern.cs
- CategoryAttribute.cs
- StagingAreaInputItem.cs
- LinkConverter.cs
- DifferencingCollection.cs
- PrefixHandle.cs
- TreeIterators.cs
- WebHttpBindingCollectionElement.cs
- WebPartDisplayModeEventArgs.cs
- ErrorTableItemStyle.cs
- IListConverters.cs
- EmptyStringExpandableObjectConverter.cs
- RecordConverter.cs