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
- Rotation3DAnimationUsingKeyFrames.cs
- TableLayoutRowStyleCollection.cs
- NavigationCommands.cs
- Int32.cs
- ObjectItemLoadingSessionData.cs
- ObjectSet.cs
- ConfigurationElement.cs
- ItemsControl.cs
- PageStatePersister.cs
- XmlChildNodes.cs
- HttpModuleActionCollection.cs
- CompleteWizardStep.cs
- Single.cs
- ConfigurationSectionCollection.cs
- SequentialOutput.cs
- XmlStreamStore.cs
- ErrorHandler.cs
- SystemEvents.cs
- log.cs
- StandardOleMarshalObject.cs
- FigureParagraph.cs
- ReadOnlyPropertyMetadata.cs
- IPEndPointCollection.cs
- XmlMapping.cs
- ZoneButton.cs
- CacheRequest.cs
- TabControl.cs
- EndpointAddressMessageFilterTable.cs
- QuaternionConverter.cs
- PngBitmapDecoder.cs
- XomlSerializationHelpers.cs
- DigitShape.cs
- ActivityExecutionContext.cs
- BlurEffect.cs
- OptionalColumn.cs
- ZipIOLocalFileHeader.cs
- DataGridViewAddColumnDialog.cs
- Win32.cs
- FormViewUpdateEventArgs.cs
- JournalEntry.cs
- StructuralCache.cs
- Activation.cs
- ComplexBindingPropertiesAttribute.cs
- UInt16Converter.cs
- SecureEnvironment.cs
- ObjectDataSource.cs
- PathGradientBrush.cs
- SqlRewriteScalarSubqueries.cs
- AppSettingsSection.cs
- HtmlToClrEventProxy.cs
- ServiceNameCollection.cs
- KeyValuePair.cs
- OSFeature.cs
- ObjectDataSourceMethodEditor.cs
- Base64Decoder.cs
- FileInfo.cs
- X509CertificateTokenFactoryCredential.cs
- ButtonBaseAdapter.cs
- DynamicObjectAccessor.cs
- MetadataItemEmitter.cs
- PageResolution.cs
- TrackingParameters.cs
- RuntimeConfig.cs
- PreApplicationStartMethodAttribute.cs
- ProviderMetadataCachedInformation.cs
- WindowsPen.cs
- WindowsGraphicsCacheManager.cs
- Flattener.cs
- SourceItem.cs
- CurrentTimeZone.cs
- Int64.cs
- MonthCalendarDesigner.cs
- ConfigurationManager.cs
- CriticalHandle.cs
- RangeBase.cs
- Vars.cs
- ImageEditor.cs
- SafeCertificateContext.cs
- Error.cs
- CellNormalizer.cs
- Delay.cs
- SQLBinary.cs
- HandlerMappingMemo.cs
- StructuralComparisons.cs
- ToolStripDesigner.cs
- RubberbandSelector.cs
- TreeBuilder.cs
- ProcessHostConfigUtils.cs
- VoiceSynthesis.cs
- TdsParserHelperClasses.cs
- DataServiceException.cs
- SiteMapNode.cs
- CodeDelegateCreateExpression.cs
- HitTestFilterBehavior.cs
- DataGridBoolColumn.cs
- PrinterUnitConvert.cs
- ipaddressinformationcollection.cs
- PageContent.cs
- FormViewInsertEventArgs.cs
- UnsafeNativeMethods.cs