Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Mail / AlternateViewCollection.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ImageBrush.cs
- AdapterUtil.cs
- DBCommand.cs
- TickBar.cs
- ScriptResourceInfo.cs
- XmlNodeList.cs
- ProviderCollection.cs
- Exceptions.cs
- GeometryCombineModeValidation.cs
- FragmentQueryKB.cs
- ParallelEnumerable.cs
- CheckedPointers.cs
- ViewSimplifier.cs
- MimePart.cs
- MethodCallConverter.cs
- ReflectionServiceProvider.cs
- RedistVersionInfo.cs
- TagMapInfo.cs
- ConnectionConsumerAttribute.cs
- WsatAdminException.cs
- AssemblyAssociatedContentFileAttribute.cs
- DataServiceExpressionVisitor.cs
- ColorPalette.cs
- CatalogZone.cs
- PackagingUtilities.cs
- ThreadSafeList.cs
- SlotInfo.cs
- PrintController.cs
- MultiTrigger.cs
- FlowLayout.cs
- TableLayoutPanel.cs
- WSHttpBindingCollectionElement.cs
- XmlSerializationGeneratedCode.cs
- securestring.cs
- QilIterator.cs
- DependencyPropertyValueSerializer.cs
- ColumnResizeAdorner.cs
- XmlTextReaderImplHelpers.cs
- OptionUsage.cs
- NullableFloatSumAggregationOperator.cs
- EncodingFallbackAwareXmlTextWriter.cs
- DataChangedEventManager.cs
- ExtensionWindowResizeGrip.cs
- BulletChrome.cs
- DateTimeOffsetAdapter.cs
- DataControlFieldHeaderCell.cs
- SqlDataSourceStatusEventArgs.cs
- CatalogZoneBase.cs
- WindowsSpinner.cs
- PeerNameRegistration.cs
- Native.cs
- Win32SafeHandles.cs
- DayRenderEvent.cs
- DataSourceSelectArguments.cs
- Path.cs
- Baml2006ReaderSettings.cs
- Variable.cs
- ObjectCloneHelper.cs
- PDBReader.cs
- UnsafeNativeMethods.cs
- SapiRecoContext.cs
- GcSettings.cs
- ObjectNavigationPropertyMapping.cs
- ControlEvent.cs
- SoapServerMessage.cs
- KeyedHashAlgorithm.cs
- Application.cs
- CompileLiteralTextParser.cs
- TextServicesCompartmentContext.cs
- EnumerableRowCollection.cs
- ScaleTransform3D.cs
- FixUp.cs
- StaticSiteMapProvider.cs
- RangeContentEnumerator.cs
- XmlNodeReader.cs
- NewExpression.cs
- PermissionToken.cs
- ToolTipService.cs
- Inflater.cs
- DependencyObject.cs
- ConfigurationException.cs
- OptimisticConcurrencyException.cs
- FlowDocumentReaderAutomationPeer.cs
- MonthCalendar.cs
- SchemaLookupTable.cs
- SupportsPreviewControlAttribute.cs
- QuotaExceededException.cs
- HttpCookieCollection.cs
- ProcessManager.cs
- IsolatedStorageFilePermission.cs
- LinkDescriptor.cs
- embossbitmapeffect.cs
- AesCryptoServiceProvider.cs
- Localizer.cs
- CharStorage.cs
- CompositeFontParser.cs
- AuthenticationSection.cs
- MappingMetadataHelper.cs
- NullableIntAverageAggregationOperator.cs
- ValueQuery.cs