Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Mail / LinkedResourceCollection.cs / 1305376 / LinkedResourceCollection.cs
using System; using System.Collections.ObjectModel; namespace System.Net.Mail { public sealed class LinkedResourceCollection : Collection, IDisposable { bool disposed = false; internal LinkedResourceCollection() { } public void Dispose() { if(disposed){ return; } foreach (LinkedResource resource in this) { resource.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, LinkedResource 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, LinkedResource 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
- UIElementHelper.cs
- NameScopePropertyAttribute.cs
- DBPropSet.cs
- _AutoWebProxyScriptEngine.cs
- Renderer.cs
- PersonalizationProvider.cs
- SqlWorkflowInstanceStoreLock.cs
- InstanceDescriptor.cs
- DesignTimeParseData.cs
- ServiceNotStartedException.cs
- ListView.cs
- ParsedAttributeCollection.cs
- CodeSubDirectoriesCollection.cs
- datacache.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- DeliveryStrategy.cs
- ServiceContractListItemList.cs
- SqlRemoveConstantOrderBy.cs
- ProcessHostServerConfig.cs
- BinaryParser.cs
- NavigationPropertyEmitter.cs
- IndexerNameAttribute.cs
- SerializationException.cs
- ToolStripHighContrastRenderer.cs
- UrlPath.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- ItemPager.cs
- OutputCacheModule.cs
- TileModeValidation.cs
- XamlInterfaces.cs
- FaultFormatter.cs
- TextWriter.cs
- EventWaitHandle.cs
- XmlNodeComparer.cs
- LongAverageAggregationOperator.cs
- ProjectionNode.cs
- RelationshipDetailsRow.cs
- PrivilegedConfigurationManager.cs
- SelectionRange.cs
- HebrewCalendar.cs
- GradientBrush.cs
- ReferenceSchema.cs
- MsmqInputChannelBase.cs
- DecryptRequest.cs
- JapaneseCalendar.cs
- EventQueueState.cs
- MemoryStream.cs
- MarshalDirectiveException.cs
- ListViewItem.cs
- Path.cs
- XamlPointCollectionSerializer.cs
- CalendarDateChangedEventArgs.cs
- ProtocolElement.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- XmlAttributeCache.cs
- WebRequestModuleElement.cs
- PropertyChangedEventArgs.cs
- Rect.cs
- FrameSecurityDescriptor.cs
- DebugTraceHelper.cs
- XomlCompiler.cs
- ControlEvent.cs
- WmfPlaceableFileHeader.cs
- UnSafeCharBuffer.cs
- ScrollChrome.cs
- DefaultMemberAttribute.cs
- VisualStates.cs
- ISFTagAndGuidCache.cs
- WindowsClaimSet.cs
- HybridWebProxyFinder.cs
- LoadGrammarCompletedEventArgs.cs
- TripleDES.cs
- DATA_BLOB.cs
- BufferedStream.cs
- XmlStreamStore.cs
- AppendHelper.cs
- TextServicesDisplayAttribute.cs
- Environment.cs
- FormViewDeletedEventArgs.cs
- BindingCompleteEventArgs.cs
- SQLBinary.cs
- Imaging.cs
- Win32.cs
- DataPager.cs
- Preprocessor.cs
- MouseGestureValueSerializer.cs
- TextServicesManager.cs
- ObjectItemLoadingSessionData.cs
- Point4D.cs
- ConfigXmlElement.cs
- IUnknownConstantAttribute.cs
- SR.cs
- SystemParameters.cs
- AssociationSetEnd.cs
- PersonalizationEntry.cs
- XmlWrappingReader.cs
- ResourceSet.cs
- MembershipPasswordException.cs
- TextEncodedRawTextWriter.cs
- EventWaitHandle.cs