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
- OleDragDropHandler.cs
- KeyboardNavigation.cs
- CompileLiteralTextParser.cs
- DataTransferEventArgs.cs
- SmtpNegotiateAuthenticationModule.cs
- NullReferenceException.cs
- PanelDesigner.cs
- Baml6Assembly.cs
- AutoCompleteStringCollection.cs
- XPathNavigatorReader.cs
- TrustSection.cs
- BoundsDrawingContextWalker.cs
- PropertyOverridesTypeEditor.cs
- ContentElement.cs
- Binding.cs
- SourceChangedEventArgs.cs
- Facet.cs
- MessageDecoder.cs
- ClientOptions.cs
- LogicalTreeHelper.cs
- _CacheStreams.cs
- ExpressionContext.cs
- XmlDownloadManager.cs
- ActiveXContainer.cs
- StaticExtension.cs
- PropertyPathConverter.cs
- oledbmetadatacollectionnames.cs
- InvokerUtil.cs
- OdbcException.cs
- ContractMapping.cs
- OleDbPermission.cs
- TemplateManager.cs
- COSERVERINFO.cs
- RelationshipEndMember.cs
- DocumentCollection.cs
- PreviewControlDesigner.cs
- ZipIOLocalFileDataDescriptor.cs
- ValidationErrorEventArgs.cs
- CapabilitiesSection.cs
- OleDbError.cs
- IList.cs
- BinaryObjectWriter.cs
- SessionStateUtil.cs
- Composition.cs
- OdbcConnectionString.cs
- DataGridViewButtonColumn.cs
- HtmlShimManager.cs
- ExternalException.cs
- Int64AnimationUsingKeyFrames.cs
- AssertFilter.cs
- EpmTargetTree.cs
- ZoneMembershipCondition.cs
- FixedHighlight.cs
- WebDisplayNameAttribute.cs
- PrimitiveXmlSerializers.cs
- BamlLocalizableResourceKey.cs
- RouteItem.cs
- XmlMembersMapping.cs
- MonthChangedEventArgs.cs
- PropertyGridDesigner.cs
- ConfigurationStrings.cs
- DBConcurrencyException.cs
- AmbiguousMatchException.cs
- GeometryHitTestParameters.cs
- HttpCachePolicy.cs
- EntitySqlQueryState.cs
- VisualTreeUtils.cs
- MessageFault.cs
- ToolStripItemImageRenderEventArgs.cs
- ToolConsole.cs
- IndexerNameAttribute.cs
- DynamicILGenerator.cs
- PagesSection.cs
- AppDomainManager.cs
- InfiniteTimeSpanConverter.cs
- KnownIds.cs
- UserInitiatedNavigationPermission.cs
- LinearQuaternionKeyFrame.cs
- DataRecordInternal.cs
- StrokeNodeOperations.cs
- PauseStoryboard.cs
- DesignerSerializationVisibilityAttribute.cs
- IdentityReference.cs
- BindingMAnagerBase.cs
- ContextQuery.cs
- CacheEntry.cs
- UserMapPath.cs
- MgmtConfigurationRecord.cs
- DesignSurfaceManager.cs
- CodeAccessSecurityEngine.cs
- cookieexception.cs
- IntersectQueryOperator.cs
- LostFocusEventManager.cs
- NullableBoolConverter.cs
- ColumnWidthChangingEvent.cs
- SiteMapProvider.cs
- ComponentDispatcherThread.cs
- ButtonColumn.cs
- Translator.cs
- ComplexBindingPropertiesAttribute.cs