Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Mail / AlternateViewCollection.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RegexRunner.cs
- RangeContentEnumerator.cs
- BulletChrome.cs
- ManipulationDeltaEventArgs.cs
- GridLength.cs
- SocketInformation.cs
- CatalogPartCollection.cs
- TypeLoadException.cs
- Pkcs7Signer.cs
- HtmlInputCheckBox.cs
- ObjectTokenCategory.cs
- LogConverter.cs
- AbsoluteQuery.cs
- ManagementObjectSearcher.cs
- WarningException.cs
- WebServiceEnumData.cs
- OracleRowUpdatedEventArgs.cs
- GeometryConverter.cs
- WindowsClientElement.cs
- WebConvert.cs
- ConfigurationElementProperty.cs
- ByteAnimation.cs
- SettingsAttributes.cs
- Splitter.cs
- CounterSampleCalculator.cs
- PersianCalendar.cs
- XPathBuilder.cs
- TransformedBitmap.cs
- GreenMethods.cs
- SecurityStandardsManager.cs
- GorillaCodec.cs
- BinaryMessageFormatter.cs
- errorpatternmatcher.cs
- ColumnHeader.cs
- RoleManagerSection.cs
- FindCriteriaCD1.cs
- DataTableMapping.cs
- RadioButtonBaseAdapter.cs
- WindowsListViewItemCheckBox.cs
- oledbconnectionstring.cs
- SmtpNtlmAuthenticationModule.cs
- XmlNavigatorStack.cs
- NativeMethods.cs
- HttpPostedFile.cs
- CustomValidator.cs
- SessionPageStateSection.cs
- SqlGenericUtil.cs
- MetadataStore.cs
- ErrorFormatter.cs
- SQLDecimalStorage.cs
- CodeSubDirectory.cs
- CacheForPrimitiveTypes.cs
- XComponentModel.cs
- UrlMappingCollection.cs
- XmlSecureResolver.cs
- MetadataSerializer.cs
- HostingMessageProperty.cs
- HostingEnvironmentWrapper.cs
- RewritingProcessor.cs
- TiffBitmapEncoder.cs
- XmlAttributeProperties.cs
- HandleExceptionArgs.cs
- ExtendedProtectionPolicyElement.cs
- BreakRecordTable.cs
- ContextMenuAutomationPeer.cs
- ProcessHostFactoryHelper.cs
- QilGenerator.cs
- KeyTime.cs
- HtmlTextArea.cs
- ValidationErrorCollection.cs
- TeredoHelper.cs
- CellParaClient.cs
- CheckBox.cs
- ToolStripSplitButton.cs
- DigestTraceRecordHelper.cs
- DataGridViewRowPrePaintEventArgs.cs
- XmlLinkedNode.cs
- HtmlInputReset.cs
- PersistenceTypeAttribute.cs
- WindowsFont.cs
- BrowserInteropHelper.cs
- CodeTypeMemberCollection.cs
- X509SecurityTokenParameters.cs
- LineSegment.cs
- FormViewDesigner.cs
- DataDocumentXPathNavigator.cs
- InputDevice.cs
- XMLSyntaxException.cs
- HtmlTableCellCollection.cs
- SecurityKeyType.cs
- AssemblyResourceLoader.cs
- Light.cs
- SmtpLoginAuthenticationModule.cs
- HttpCacheVaryByContentEncodings.cs
- BaseTemplateParser.cs
- MouseActionConverter.cs
- ProvideValueServiceProvider.cs
- TimeSpanValidatorAttribute.cs
- FormsAuthentication.cs
- SqlUserDefinedTypeAttribute.cs