Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Net / System / Net / Mail / AlternateViewCollection.cs / 1 / AlternateViewCollection.cs
using System; using System.Collections.ObjectModel; namespace System.Net.Mail { public sealed class AlternateViewCollection : Collection, IDisposable { bool disposed = false; internal AlternateViewCollection() { } public void Dispose() { if (disposed) { return; } foreach (AlternateView view in this) { view.Dispose(); } Clear(); disposed = true; } protected override void RemoveItem(int index){ if (disposed) { throw new ObjectDisposedException(this.GetType().FullName); } base.RemoveItem(index); } protected override void ClearItems(){ if (disposed) { throw new ObjectDisposedException(this.GetType().FullName); } base.ClearItems(); } protected override void SetItem(int index, AlternateView item){ if (disposed) { throw new ObjectDisposedException(this.GetType().FullName); } if(item==null) { throw new ArgumentNullException("item"); } base.SetItem(index,item); } protected override void InsertItem(int index, AlternateView item){ if (disposed) { throw new ObjectDisposedException(this.GetType().FullName); } if(item==null){ throw new ArgumentNullException("item"); } base.InsertItem(index,item); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Collections.ObjectModel; namespace System.Net.Mail { public sealed class AlternateViewCollection : Collection , IDisposable { bool disposed = false; internal AlternateViewCollection() { } public void Dispose() { if (disposed) { return; } foreach (AlternateView view in this) { view.Dispose(); } Clear(); disposed = true; } protected override void RemoveItem(int index){ if (disposed) { throw new ObjectDisposedException(this.GetType().FullName); } base.RemoveItem(index); } protected override void ClearItems(){ if (disposed) { throw new ObjectDisposedException(this.GetType().FullName); } base.ClearItems(); } protected override void SetItem(int index, AlternateView item){ if (disposed) { throw new ObjectDisposedException(this.GetType().FullName); } if(item==null) { throw new ArgumentNullException("item"); } base.SetItem(index,item); } protected override void InsertItem(int index, AlternateView item){ if (disposed) { throw new ObjectDisposedException(this.GetType().FullName); } if(item==null){ throw new ArgumentNullException("item"); } base.InsertItem(index,item); } } } // 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
- AuthenticodeSignatureInformation.cs
- FamilyMapCollection.cs
- TextDecorations.cs
- VBIdentifierDesigner.xaml.cs
- GPStream.cs
- GlobalizationSection.cs
- WorkflowStateRollbackService.cs
- WebConvert.cs
- MapPathBasedVirtualPathProvider.cs
- MenuItemStyle.cs
- ComIntegrationManifestGenerator.cs
- InputLangChangeEvent.cs
- UInt64.cs
- ContainsSearchOperator.cs
- GroupItem.cs
- SizeAnimationClockResource.cs
- MultiBindingExpression.cs
- cookieexception.cs
- SemanticTag.cs
- InProcStateClientManager.cs
- SynchronizationLockException.cs
- CellTreeNodeVisitors.cs
- Win32.cs
- ImageFormatConverter.cs
- DataGridViewCellPaintingEventArgs.cs
- ProgressChangedEventArgs.cs
- ExpressionConverter.cs
- CompositeControl.cs
- DES.cs
- Deflater.cs
- Collection.cs
- TextEditorCharacters.cs
- CodeArgumentReferenceExpression.cs
- CalendarDay.cs
- ManagementNamedValueCollection.cs
- _OverlappedAsyncResult.cs
- BaseAsyncResult.cs
- SiteMapNodeItem.cs
- EventListener.cs
- TemplateInstanceAttribute.cs
- IApplicationTrustManager.cs
- XmlILAnnotation.cs
- CheckBoxBaseAdapter.cs
- AuthenticationManager.cs
- DataViewListener.cs
- ProfilePropertySettings.cs
- WebHeaderCollection.cs
- CorePropertiesFilter.cs
- Vector3DAnimationUsingKeyFrames.cs
- IOThreadScheduler.cs
- XmlUnspecifiedAttribute.cs
- ImageMetadata.cs
- UInt32.cs
- ServiceHostingEnvironment.cs
- MsmqChannelFactoryBase.cs
- SafeNativeMethods.cs
- StateChangeEvent.cs
- DoubleAnimationUsingKeyFrames.cs
- ConnectionPointCookie.cs
- StickyNoteContentControl.cs
- LocalizableResourceBuilder.cs
- EventQueueState.cs
- LinkTarget.cs
- Mutex.cs
- PrintController.cs
- TableRowCollection.cs
- XmlSchemaComplexContentExtension.cs
- FileSystemInfo.cs
- XmlSchemaComplexContentExtension.cs
- AudioException.cs
- DataRelationCollection.cs
- IdentityNotMappedException.cs
- SqlDataAdapter.cs
- LogFlushAsyncResult.cs
- MsmqQueue.cs
- XmlSchemaDatatype.cs
- PropertyEntry.cs
- WebPartDisplayModeCancelEventArgs.cs
- ContentTextAutomationPeer.cs
- ProxyAttribute.cs
- Compilation.cs
- XmlSchemaExporter.cs
- SafeRightsManagementPubHandle.cs
- ResourceDictionary.cs
- AnonymousIdentificationModule.cs
- HttpRuntimeSection.cs
- ConfigXmlElement.cs
- CalendarTable.cs
- MonthChangedEventArgs.cs
- ExtensionFile.cs
- IntAverageAggregationOperator.cs
- ResourceManagerWrapper.cs
- DataTableClearEvent.cs
- WebPartDescription.cs
- SynchronizingStream.cs
- IndexedString.cs
- ReaderWriterLock.cs
- SqlRowUpdatingEvent.cs
- InputManager.cs
- RuntimeHelpers.cs