Code:
/ FX-1434 / FX-1434 / 1.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
- OutputCacheSection.cs
- MemoryMappedView.cs
- TreeViewAutomationPeer.cs
- FrameworkRichTextComposition.cs
- Variant.cs
- SmuggledIUnknown.cs
- ServiceDebugElement.cs
- CommentEmitter.cs
- SqlSupersetValidator.cs
- FormatConvertedBitmap.cs
- PropertyGrid.cs
- SelectorItemAutomationPeer.cs
- XmlAnyAttributeAttribute.cs
- TextReader.cs
- HideDisabledControlAdapter.cs
- MetadataArtifactLoaderComposite.cs
- Misc.cs
- SafeSystemMetrics.cs
- MatchSingleFxEngineOpcode.cs
- GPRECTF.cs
- WorkflowRuntimeBehavior.cs
- __ComObject.cs
- ResumeStoryboard.cs
- TraceAsyncResult.cs
- InvalidateEvent.cs
- DataBindingExpressionBuilder.cs
- TimeZone.cs
- SoapSchemaMember.cs
- TypedElement.cs
- PrinterUnitConvert.cs
- FixedSOMPageElement.cs
- MatchAttribute.cs
- BlurBitmapEffect.cs
- HtmlInputImage.cs
- OdbcHandle.cs
- OverrideMode.cs
- ParameterCollection.cs
- ShadowGlyph.cs
- StrongNameHelpers.cs
- MultipleViewPattern.cs
- WebResourceUtil.cs
- CompositeActivityValidator.cs
- ConfigurationSection.cs
- FrameworkElementFactory.cs
- ExpressionUtilities.cs
- BitmapEffectrendercontext.cs
- BindingSource.cs
- RequestCachePolicyConverter.cs
- DbRetry.cs
- GlyphingCache.cs
- ObjectQueryExecutionPlan.cs
- PassportAuthenticationEventArgs.cs
- SByte.cs
- CodeRegionDirective.cs
- ImageField.cs
- VisualStyleInformation.cs
- AdPostCacheSubstitution.cs
- DispatcherExceptionFilterEventArgs.cs
- MD5CryptoServiceProvider.cs
- UrlMapping.cs
- mansign.cs
- KerberosReceiverSecurityToken.cs
- GeneralTransform3DTo2D.cs
- ScriptControlDescriptor.cs
- PropertyNames.cs
- StickyNote.cs
- XmlTextReader.cs
- ContextDataSourceView.cs
- SqlBuilder.cs
- FixedPageProcessor.cs
- IDataContractSurrogate.cs
- DataGridRelationshipRow.cs
- ClaimSet.cs
- Cell.cs
- SqlTrackingQuery.cs
- SingleSelectRootGridEntry.cs
- InputProcessorProfilesLoader.cs
- WebOperationContext.cs
- IntSecurity.cs
- UIElementHelper.cs
- Compiler.cs
- UInt16Storage.cs
- TemplateBindingExpressionConverter.cs
- TrackingLocation.cs
- ValueConversionAttribute.cs
- SafeViewOfFileHandle.cs
- TemplateControlParser.cs
- ColumnResizeUndoUnit.cs
- PrincipalPermission.cs
- XPathChildIterator.cs
- DataObject.cs
- FixedSOMElement.cs
- ErrorFormatter.cs
- VScrollProperties.cs
- SizeAnimation.cs
- SoapSchemaImporter.cs
- WorkflowMarkupSerializationException.cs
- MessageBox.cs
- DataGridViewColumnEventArgs.cs
- FamilyTypeface.cs