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
- DocobjHost.cs
- Int16Storage.cs
- Rotation3DAnimationUsingKeyFrames.cs
- Thread.cs
- TrackingCondition.cs
- DataGridViewRowPostPaintEventArgs.cs
- DbParameterHelper.cs
- KeySpline.cs
- UnsafeNativeMethods.cs
- RightsManagementPermission.cs
- validationstate.cs
- Rotation3D.cs
- DisplayMemberTemplateSelector.cs
- AssemblyAttributes.cs
- TextEffectCollection.cs
- SqlGatherProducedAliases.cs
- SqlErrorCollection.cs
- CorePropertiesFilter.cs
- TaskCanceledException.cs
- StrongNameKeyPair.cs
- DependencyPropertyValueSerializer.cs
- OleDbErrorCollection.cs
- OdbcStatementHandle.cs
- TableMethodGenerator.cs
- Span.cs
- Point.cs
- TextEditor.cs
- Run.cs
- AnnotationHighlightLayer.cs
- SqlUdtInfo.cs
- ClusterSafeNativeMethods.cs
- FormClosingEvent.cs
- OlePropertyStructs.cs
- XmlUtil.cs
- ComponentEditorPage.cs
- UnorderedHashRepartitionStream.cs
- EnumConverter.cs
- LogSwitch.cs
- Assembly.cs
- CustomTokenProvider.cs
- DropDownList.cs
- SharedStream.cs
- StateBag.cs
- MethodImplAttribute.cs
- FileDialog_Vista.cs
- AlphabeticalEnumConverter.cs
- Vector.cs
- ProofTokenCryptoHandle.cs
- UTF8Encoding.cs
- CompilerParameters.cs
- PreviewPageInfo.cs
- BaseParser.cs
- RawStylusSystemGestureInputReport.cs
- IndexedString.cs
- SessionIDManager.cs
- ColorComboBox.cs
- WebZone.cs
- COM2FontConverter.cs
- IsolatedStorage.cs
- Vector3DCollection.cs
- PromptStyle.cs
- WindowsSpinner.cs
- MemberDomainMap.cs
- ListMarkerSourceInfo.cs
- ConcurrentStack.cs
- Viewport3DAutomationPeer.cs
- GlyphRunDrawing.cs
- CodeGenerator.cs
- MsmqAppDomainProtocolHandler.cs
- SiteMapDataSourceView.cs
- StorageScalarPropertyMapping.cs
- DataGridViewColumnEventArgs.cs
- CryptoApi.cs
- Message.cs
- HMACMD5.cs
- CompiledQueryCacheEntry.cs
- WinEventWrap.cs
- EventProviderWriter.cs
- TextEffectCollection.cs
- ConnectionsZone.cs
- SpellerStatusTable.cs
- RadioButton.cs
- ViewValidator.cs
- RegexInterpreter.cs
- EntityDataSourceStatementEditorForm.cs
- DependencyObject.cs
- QilParameter.cs
- StagingAreaInputItem.cs
- BindingList.cs
- DllHostedComPlusServiceHost.cs
- PageCatalogPart.cs
- XmlSchemaAnnotated.cs
- tooltip.cs
- SByteConverter.cs
- NativeMethods.cs
- Icon.cs
- LoginCancelEventArgs.cs
- PenCursorManager.cs
- CacheManager.cs
- ModelPerspective.cs