Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Net / System / Net / Mail / AlternateViewCollection.cs / 1 / AlternateViewCollection.cs
using System; using System.Collections.ObjectModel; namespace System.Net.Mail { public sealed class AlternateViewCollection : Collection, IDisposable { bool disposed = false; internal AlternateViewCollection() { } public void Dispose() { if (disposed) { return; } foreach (AlternateView view in this) { view.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, AlternateView 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, AlternateView 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. using System; using System.Collections.ObjectModel; namespace System.Net.Mail { public sealed class AlternateViewCollection : Collection , IDisposable { bool disposed = false; internal AlternateViewCollection() { } public void Dispose() { if (disposed) { return; } foreach (AlternateView view in this) { view.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, AlternateView 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, AlternateView 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
- OdbcConnectionHandle.cs
- DetailsViewRow.cs
- connectionpool.cs
- DataControlPagerLinkButton.cs
- EntityModelBuildProvider.cs
- IChannel.cs
- DecimalConverter.cs
- TargetInvocationException.cs
- SupportingTokenChannel.cs
- WindowClosedEventArgs.cs
- MailBnfHelper.cs
- Msec.cs
- NamespaceQuery.cs
- SafePointer.cs
- ProxyWebPart.cs
- CompiledRegexRunnerFactory.cs
- TextTreeTextBlock.cs
- IUnknownConstantAttribute.cs
- SettingsPropertyIsReadOnlyException.cs
- FtpCachePolicyElement.cs
- DecryptedHeader.cs
- RuntimeWrappedException.cs
- Exceptions.cs
- BasicHttpMessageSecurityElement.cs
- XamlWriter.cs
- BasicViewGenerator.cs
- TransformProviderWrapper.cs
- ApplicationBuildProvider.cs
- SoapProtocolReflector.cs
- ZipPackagePart.cs
- CheckBoxPopupAdapter.cs
- EntityViewGenerationAttribute.cs
- StateBag.cs
- AnnouncementInnerClient11.cs
- LayoutTable.cs
- RelatedImageListAttribute.cs
- ConnectionPointCookie.cs
- OdbcRowUpdatingEvent.cs
- DesignerSerializerAttribute.cs
- Transactions.cs
- ConnectionStringSettingsCollection.cs
- followingsibling.cs
- CategoryAttribute.cs
- PathSegment.cs
- FormsAuthentication.cs
- SecurityDescriptor.cs
- ServiceSecurityAuditBehavior.cs
- ProviderBase.cs
- ValidationRuleCollection.cs
- ExternalFile.cs
- EntityDataSourceMemberPath.cs
- XmlSchemaParticle.cs
- CorrelationManager.cs
- ListViewItemSelectionChangedEvent.cs
- BodyGlyph.cs
- UrlMappingsSection.cs
- AmbientProperties.cs
- dataprotectionpermission.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- IriParsingElement.cs
- RegexTree.cs
- XmlDocumentFieldSchema.cs
- HttpInputStream.cs
- EntityTemplateFactory.cs
- pingexception.cs
- XmlSchemaSequence.cs
- RequestSecurityTokenSerializer.cs
- ResourceDescriptionAttribute.cs
- ExpressionEditorSheet.cs
- StaticSiteMapProvider.cs
- PermissionAttributes.cs
- ChangeToolStripParentVerb.cs
- HttpFileCollection.cs
- ReadWriteObjectLock.cs
- ToggleProviderWrapper.cs
- CompilerHelpers.cs
- ProtocolsConfiguration.cs
- PageMediaType.cs
- DecoderExceptionFallback.cs
- IndexedGlyphRun.cs
- CodeMemberMethod.cs
- GraphicsContainer.cs
- GridViewRowCollection.cs
- XmlImplementation.cs
- StateMachine.cs
- WorkerRequest.cs
- ExcCanonicalXml.cs
- AssertSection.cs
- Process.cs
- ipaddressinformationcollection.cs
- MessageQueuePermission.cs
- AnnotationAdorner.cs
- Shared.cs
- FormsAuthenticationUserCollection.cs
- Unit.cs
- CharacterMetrics.cs
- Drawing.cs
- TakeOrSkipQueryOperator.cs
- CSharpCodeProvider.cs
- XmlSerializerSection.cs