Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Mail / AttachmentCollection.cs / 1305376 / 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XhtmlBasicCommandAdapter.cs
- LinqDataSourceDisposeEventArgs.cs
- BlurBitmapEffect.cs
- NativeMethodsOther.cs
- DynamicUpdateCommand.cs
- SpellerError.cs
- GcSettings.cs
- RolePrincipal.cs
- WebContext.cs
- XmlIncludeAttribute.cs
- SchemaType.cs
- GroupByExpressionRewriter.cs
- SessionIDManager.cs
- XmlSerializationWriter.cs
- coordinatorscratchpad.cs
- ListViewGroupItemCollection.cs
- DbDataAdapter.cs
- RijndaelManaged.cs
- ShellProvider.cs
- DefaultWorkflowSchedulerService.cs
- CodeTypeDeclaration.cs
- WindowsTab.cs
- SHA256Managed.cs
- DataGridViewMethods.cs
- DbProviderSpecificTypePropertyAttribute.cs
- WebPartEditVerb.cs
- TimeZone.cs
- InternalConfigHost.cs
- HandlerFactoryWrapper.cs
- CapiNative.cs
- BeginEvent.cs
- FunctionImportMapping.cs
- FlowNode.cs
- TextEditorMouse.cs
- PolicyConversionContext.cs
- EventLogEntry.cs
- UnSafeCharBuffer.cs
- Dispatcher.cs
- LineSegment.cs
- BinaryParser.cs
- IISMapPath.cs
- HttpCookiesSection.cs
- LogEntryDeserializer.cs
- MouseOverProperty.cs
- VisualProxy.cs
- SignedXml.cs
- VectorCollectionConverter.cs
- MailSettingsSection.cs
- OdbcErrorCollection.cs
- ControlParser.cs
- ProxyFragment.cs
- DataControlFieldCollection.cs
- CompoundFileIOPermission.cs
- QuaternionAnimationBase.cs
- WindowsFormsLinkLabel.cs
- Separator.cs
- Debugger.cs
- StringWriter.cs
- DataGridViewMethods.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- PowerModeChangedEventArgs.cs
- ProcessHostServerConfig.cs
- SamlSubjectStatement.cs
- JpegBitmapDecoder.cs
- ItemList.cs
- MethodInfo.cs
- Deflater.cs
- SparseMemoryStream.cs
- PrimaryKeyTypeConverter.cs
- DefaultBinder.cs
- RoutedPropertyChangedEventArgs.cs
- ChangePassword.cs
- Library.cs
- SystemIcmpV6Statistics.cs
- XmlSchemaSimpleContent.cs
- WebColorConverter.cs
- Bezier.cs
- SqlUDTStorage.cs
- CallContext.cs
- Rect3DValueSerializer.cs
- DispatcherHooks.cs
- WebPartCatalogCloseVerb.cs
- HuffmanTree.cs
- ImageUrlEditor.cs
- ToolStripPanelRow.cs
- ToolStripContainerDesigner.cs
- WebHeaderCollection.cs
- DataGridHelper.cs
- DataGridViewCellCollection.cs
- DrawingVisualDrawingContext.cs
- CommandLibraryHelper.cs
- QualifierSet.cs
- ProjectionCamera.cs
- ObjectHandle.cs
- Triplet.cs
- WebPartTracker.cs
- SearchExpression.cs
- DockPattern.cs
- GenerateHelper.cs
- ResourceReferenceKeyNotFoundException.cs