Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Net / System / Net / Mail / LinkedResourceCollection.cs / 1 / 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); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- mediaeventargs.cs
- MethodCallTranslator.cs
- UnsafeNativeMethods.cs
- DelayedRegex.cs
- DesignerForm.cs
- DataObjectFieldAttribute.cs
- ReflectEventDescriptor.cs
- CodeAttachEventStatement.cs
- TagPrefixCollection.cs
- UseAttributeSetsAction.cs
- ButtonField.cs
- SqlEnums.cs
- DataGridBeginningEditEventArgs.cs
- ReadWriteSpinLock.cs
- XmlToDatasetMap.cs
- MobileControlsSection.cs
- DataGridTablesFactory.cs
- XmlMemberMapping.cs
- MessageQueuePermission.cs
- ListViewHitTestInfo.cs
- Opcode.cs
- ReferenceTypeElement.cs
- SqlConnectionFactory.cs
- SimpleFieldTemplateFactory.cs
- Certificate.cs
- SystemIPInterfaceProperties.cs
- PrinterUnitConvert.cs
- GlyphRunDrawing.cs
- CollectionsUtil.cs
- OletxResourceManager.cs
- ParentUndoUnit.cs
- WinFormsSpinner.cs
- ErrorWebPart.cs
- Soap12ServerProtocol.cs
- ThemeInfoAttribute.cs
- EntityProxyTypeInfo.cs
- RowToParametersTransformer.cs
- SystemWebCachingSectionGroup.cs
- EntityDataSourceSelectedEventArgs.cs
- SiteMapNodeCollection.cs
- PointF.cs
- ChangeTracker.cs
- SchemaInfo.cs
- SplashScreenNativeMethods.cs
- XamlDesignerSerializationManager.cs
- GridViewUpdatedEventArgs.cs
- TextMarkerSource.cs
- SqlFacetAttribute.cs
- Cell.cs
- GeometryGroup.cs
- PropertyNames.cs
- ResourceDisplayNameAttribute.cs
- ArgumentException.cs
- MDIControlStrip.cs
- ParentUndoUnit.cs
- ScriptResourceAttribute.cs
- DataControlField.cs
- DataKey.cs
- controlskin.cs
- SecurityTokenAuthenticator.cs
- UserNamePasswordValidator.cs
- ConfigurationManagerInternalFactory.cs
- ListBoxItemAutomationPeer.cs
- BookmarkWorkItem.cs
- Label.cs
- SourceItem.cs
- RequestCache.cs
- PrintPageEvent.cs
- NullRuntimeConfig.cs
- BaseResourcesBuildProvider.cs
- CodeVariableDeclarationStatement.cs
- BuildManagerHost.cs
- KeyPressEvent.cs
- OrderingInfo.cs
- FormsAuthenticationTicket.cs
- shaperfactoryquerycacheentry.cs
- SqlInternalConnectionTds.cs
- BasicAsyncResult.cs
- TimeZone.cs
- WindowsGraphics.cs
- ManagedCodeMarkers.cs
- Lazy.cs
- PaintEvent.cs
- NavigationWindow.cs
- HttpResponse.cs
- BindStream.cs
- Semaphore.cs
- SatelliteContractVersionAttribute.cs
- BoundPropertyEntry.cs
- ManipulationDelta.cs
- SqlEnums.cs
- StaticContext.cs
- FormView.cs
- NetworkAddressChange.cs
- RemoteWebConfigurationHostStream.cs
- CharacterMetricsDictionary.cs
- DataGridViewCheckBoxColumn.cs
- DeviceFiltersSection.cs
- Vector3DConverter.cs
- ByteKeyFrameCollection.cs