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
- WindowsEditBox.cs
- StringDictionaryEditor.cs
- X509ChainPolicy.cs
- Semaphore.cs
- TypeUtils.cs
- ControlAdapter.cs
- XmlSchemaAnnotation.cs
- DataGridViewTextBoxCell.cs
- ReadOnlyHierarchicalDataSource.cs
- ValidationRule.cs
- WindowsListViewItemCheckBox.cs
- AppLevelCompilationSectionCache.cs
- HtmlLink.cs
- ArithmeticException.cs
- MarkedHighlightComponent.cs
- ProcessInfo.cs
- DataServiceKeyAttribute.cs
- xmlglyphRunInfo.cs
- XmlSchemaObjectCollection.cs
- ExtendedProperty.cs
- ControlValuePropertyAttribute.cs
- DialogDivider.cs
- odbcmetadatacolumnnames.cs
- IntSecurity.cs
- RSAOAEPKeyExchangeFormatter.cs
- ConsumerConnectionPoint.cs
- Properties.cs
- JapaneseLunisolarCalendar.cs
- DoubleLinkListEnumerator.cs
- XmlRawWriterWrapper.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- Resources.Designer.cs
- SspiSecurityTokenParameters.cs
- MultiByteCodec.cs
- Logging.cs
- RawAppCommandInputReport.cs
- HtmlTextArea.cs
- __Filters.cs
- HtmlTableCell.cs
- XmlWriter.cs
- ObjectStateFormatter.cs
- ConfigurationErrorsException.cs
- AggregationMinMaxHelpers.cs
- FolderLevelBuildProviderCollection.cs
- CollectionMarkupSerializer.cs
- FilterableAttribute.cs
- HtmlInputImage.cs
- ConfigurationSectionHelper.cs
- ExtensionFile.cs
- MetafileHeaderWmf.cs
- ValidationRuleCollection.cs
- documentsequencetextview.cs
- SafeLibraryHandle.cs
- HyperLink.cs
- TextEditorContextMenu.cs
- CacheVirtualItemsEvent.cs
- PolicyImporterElementCollection.cs
- ApplicationActivator.cs
- IssuedTokenServiceCredential.cs
- MessageBuffer.cs
- SchemaImporterExtensionElementCollection.cs
- MbpInfo.cs
- TrustManagerMoreInformation.cs
- ParamArrayAttribute.cs
- TransportSecurityProtocolFactory.cs
- SqlDataSourceQueryEditorForm.cs
- ProtocolViolationException.cs
- AlternateViewCollection.cs
- RemotingAttributes.cs
- SqlUtil.cs
- Point3DValueSerializer.cs
- HttpDebugHandler.cs
- ApplicationSecurityManager.cs
- SpellerError.cs
- ClientConfigPaths.cs
- UnsafeNativeMethodsMilCoreApi.cs
- Variant.cs
- ThreadSafeList.cs
- EntityCollection.cs
- CompilerCollection.cs
- DrawingContextWalker.cs
- DataGridViewBand.cs
- ScrollBar.cs
- PagePropertiesChangingEventArgs.cs
- RegexInterpreter.cs
- _ShellExpression.cs
- MULTI_QI.cs
- BinaryParser.cs
- SessionStateItemCollection.cs
- HttpRawResponse.cs
- UserControl.cs
- EntityFrameworkVersions.cs
- Claim.cs
- DataBoundControlParameterTarget.cs
- ScriptControl.cs
- FontEmbeddingManager.cs
- RichTextBox.cs
- HyperLinkDataBindingHandler.cs
- MimeAnyImporter.cs
- HttpWriter.cs