Code:
/ 4.0 / 4.0 / 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. 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
- OdbcDataAdapter.cs
- PropertyEmitterBase.cs
- HealthMonitoringSectionHelper.cs
- SendActivityDesignerTheme.cs
- HtmlInputPassword.cs
- LinkArea.cs
- SqlAliaser.cs
- HandlerBase.cs
- TextSearch.cs
- SpinLock.cs
- WindowsComboBox.cs
- BamlWriter.cs
- formatter.cs
- Baml6Assembly.cs
- XDRSchema.cs
- ProviderSettings.cs
- ReaderWriterLock.cs
- NavigateEvent.cs
- DisplayMemberTemplateSelector.cs
- ContainerTracking.cs
- SafeTokenHandle.cs
- TypeSystem.cs
- CalculatedColumn.cs
- RequestTimeoutManager.cs
- panel.cs
- ISFTagAndGuidCache.cs
- CapabilitiesUse.cs
- RijndaelCryptoServiceProvider.cs
- EntitySetBase.cs
- DesignerActionVerbItem.cs
- BuildProviderUtils.cs
- AccessDataSource.cs
- ColumnResult.cs
- AnimationLayer.cs
- SmiGettersStream.cs
- CngAlgorithm.cs
- ProfileGroupSettings.cs
- TextPointer.cs
- RegexCompilationInfo.cs
- shaperfactoryquerycacheentry.cs
- ConfigurationProperty.cs
- BufferBuilder.cs
- DmlSqlGenerator.cs
- InternalEnumValidatorAttribute.cs
- BindingCollection.cs
- PasswordDeriveBytes.cs
- iisPickupDirectory.cs
- XmlCharCheckingReader.cs
- CacheDependency.cs
- WebPartsPersonalization.cs
- Descriptor.cs
- HeaderUtility.cs
- WorkflowDesignerMessageFilter.cs
- NullableLongMinMaxAggregationOperator.cs
- AttachInfo.cs
- ConvertersCollection.cs
- SafeFileMappingHandle.cs
- COM2IProvidePropertyBuilderHandler.cs
- StateItem.cs
- ElapsedEventArgs.cs
- QueryContinueDragEvent.cs
- _AuthenticationState.cs
- URIFormatException.cs
- DesignerActionItem.cs
- CopyNodeSetAction.cs
- WindowsStartMenu.cs
- IApplicationTrustManager.cs
- RadioButtonBaseAdapter.cs
- SafeCancelMibChangeNotify.cs
- InfoCardService.cs
- DiscoveryMessageSequence11.cs
- Material.cs
- XmlSchemaValidator.cs
- basecomparevalidator.cs
- CurrentTimeZone.cs
- ChannelServices.cs
- PixelShader.cs
- LexicalChunk.cs
- CustomErrorsSectionWrapper.cs
- DataGridViewButtonColumn.cs
- MasterPageBuildProvider.cs
- StatusBarPanel.cs
- DtrList.cs
- ToolStripItemClickedEventArgs.cs
- VScrollProperties.cs
- ImageAnimator.cs
- PerformanceCounterNameAttribute.cs
- HtmlInputCheckBox.cs
- WebUtil.cs
- Tokenizer.cs
- WindowsPen.cs
- DataSourceView.cs
- IndependentAnimationStorage.cs
- SafeBitVector32.cs
- HttpPostProtocolImporter.cs
- TimelineGroup.cs
- ConnectionInterfaceCollection.cs
- CustomGrammar.cs
- ProcessModuleCollection.cs
- CommentAction.cs