Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Net / System / Net / Mail / AttachmentCollection.cs / 1 / AttachmentCollection.cs
using System; using System.Collections.ObjectModel; namespace System.Net.Mail { ////// Summary description for AttachmentCollection. /// public sealed class AttachmentCollection : Collection, IDisposable { bool disposed = false; internal AttachmentCollection() { } public void Dispose(){ if(disposed){ return; } foreach (Attachment attachment in this) { attachment.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, Attachment 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, Attachment 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
- Oid.cs
- LinkTarget.cs
- XhtmlTextWriter.cs
- httpapplicationstate.cs
- SignatureHelper.cs
- TypeConverterHelper.cs
- ColumnReorderedEventArgs.cs
- Registry.cs
- baseaxisquery.cs
- AffineTransform3D.cs
- SmtpSection.cs
- CommonGetThemePartSize.cs
- KeyedCollection.cs
- OutputCacheProviderCollection.cs
- ConversionContext.cs
- SoapObjectWriter.cs
- unitconverter.cs
- EventLogStatus.cs
- ItemType.cs
- ExpressionCopier.cs
- MatchAttribute.cs
- BaseUriHelper.cs
- InvariantComparer.cs
- ConfigurationPropertyAttribute.cs
- UIElementIsland.cs
- WebRequestModuleElement.cs
- PointUtil.cs
- InlinedAggregationOperator.cs
- InlinedLocationReference.cs
- DesignerCommandAdapter.cs
- DbUpdateCommandTree.cs
- ThreadWorkerController.cs
- MsmqException.cs
- MDIControlStrip.cs
- PolyLineSegmentFigureLogic.cs
- DataProtectionSecurityStateEncoder.cs
- CategoryAttribute.cs
- FixedSOMFixedBlock.cs
- InternalConfigSettingsFactory.cs
- ToolZone.cs
- SettingsPropertyValue.cs
- Win32KeyboardDevice.cs
- IfAction.cs
- DataRow.cs
- BinaryNode.cs
- XmlAttribute.cs
- ProbeDuplex11AsyncResult.cs
- DataSourceControlBuilder.cs
- _CacheStreams.cs
- HitTestParameters3D.cs
- AuthenticateEventArgs.cs
- OletxResourceManager.cs
- ComponentChangingEvent.cs
- ResXResourceWriter.cs
- WpfGeneratedKnownProperties.cs
- DivideByZeroException.cs
- ContentDisposition.cs
- MouseGestureConverter.cs
- XhtmlStyleClass.cs
- XPathDocumentBuilder.cs
- Bold.cs
- AutomationPattern.cs
- StatusBar.cs
- Pair.cs
- XmlSchemaAll.cs
- PrimitiveType.cs
- PixelShader.cs
- MemoryMappedView.cs
- CommonDialog.cs
- SharedStatics.cs
- ObjectDataSourceFilteringEventArgs.cs
- BitArray.cs
- InputScopeAttribute.cs
- ExceptionHelpers.cs
- CodeCatchClause.cs
- CompositeScriptReferenceEventArgs.cs
- OutputCacheProfile.cs
- DataRowIndexBuffer.cs
- SiteMapDataSourceView.cs
- RecordBuilder.cs
- login.cs
- ChangeDirector.cs
- MasterPage.cs
- ToolStripSystemRenderer.cs
- PageVisual.cs
- AudioSignalProblemOccurredEventArgs.cs
- xsdvalidator.cs
- CorrelationTokenInvalidatedHandler.cs
- PingReply.cs
- RemotingException.cs
- XmlTextReaderImpl.cs
- FontNameEditor.cs
- ReadOnlyMetadataCollection.cs
- EntityDataSourceStatementEditorForm.cs
- FileLevelControlBuilderAttribute.cs
- WebSysDisplayNameAttribute.cs
- PropertyOverridesDialog.cs
- odbcmetadatacolumnnames.cs
- TouchEventArgs.cs
- FormsAuthenticationModule.cs