Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- __ConsoleStream.cs
- CurrencyWrapper.cs
- ThreadStartException.cs
- SystemInfo.cs
- XmlQueryType.cs
- DataGridViewButtonCell.cs
- EpmCustomContentDeSerializer.cs
- IriParsingElement.cs
- NetworkAddressChange.cs
- CompilerErrorCollection.cs
- Base64Encoding.cs
- FileDialog_Vista_Interop.cs
- ColumnWidthChangingEvent.cs
- MembershipValidatePasswordEventArgs.cs
- RuleInfoComparer.cs
- FeatureSupport.cs
- CollectionDataContractAttribute.cs
- RootDesignerSerializerAttribute.cs
- ViewValidator.cs
- OutputCacheProfileCollection.cs
- smtppermission.cs
- DataTableExtensions.cs
- ApplicationSecurityInfo.cs
- Bitmap.cs
- SerialPinChanges.cs
- PopupRoot.cs
- FramingEncoders.cs
- PenContext.cs
- AnnouncementInnerClientCD1.cs
- EventRouteFactory.cs
- RoleProviderPrincipal.cs
- ReflectPropertyDescriptor.cs
- PartitionedDataSource.cs
- PageThemeBuildProvider.cs
- ResourceExpressionEditorSheet.cs
- _UncName.cs
- MetadataItemCollectionFactory.cs
- Exceptions.cs
- NativeObjectSecurity.cs
- ChtmlFormAdapter.cs
- DefaultBindingPropertyAttribute.cs
- TailPinnedEventArgs.cs
- SQLDoubleStorage.cs
- DataGridViewCellStyle.cs
- Table.cs
- XmlQueryType.cs
- QilNode.cs
- InfoCardClaimCollection.cs
- ValidationEventArgs.cs
- BindableTemplateBuilder.cs
- DropAnimation.xaml.cs
- XmlSchemaImporter.cs
- smtpconnection.cs
- MediaContextNotificationWindow.cs
- TreeNodeCollection.cs
- DocumentViewerAutomationPeer.cs
- DynamicVirtualDiscoSearcher.cs
- AddInServer.cs
- ProtectedConfigurationSection.cs
- UnsafePeerToPeerMethods.cs
- cookie.cs
- AutomationPropertyInfo.cs
- DispatcherTimer.cs
- UInt16.cs
- TextBlock.cs
- HyperLink.cs
- DataSvcMapFileSerializer.cs
- HtmlTable.cs
- ArrayConverter.cs
- BuildManagerHost.cs
- OracleCommand.cs
- FunctionNode.cs
- DelegateHelpers.cs
- ProcessHost.cs
- IdentityManager.cs
- ApplicationSecurityInfo.cs
- ToolStripItemImageRenderEventArgs.cs
- DispatcherExceptionFilterEventArgs.cs
- DesignerTransaction.cs
- XsltFunctions.cs
- TouchPoint.cs
- PolicyValidator.cs
- ClientEventManager.cs
- WindowShowOrOpenTracker.cs
- TextTreeText.cs
- RuleSetBrowserDialog.cs
- HttpListenerPrefixCollection.cs
- DecimalKeyFrameCollection.cs
- ApplicationHost.cs
- LayoutTable.cs
- StatusBarPanelClickEvent.cs
- EncoderBestFitFallback.cs
- IdnMapping.cs
- METAHEADER.cs
- BitmapFrameDecode.cs
- FrameworkContentElement.cs
- HttpCapabilitiesEvaluator.cs
- StringExpressionSet.cs
- FixedSOMFixedBlock.cs
- TreeWalkHelper.cs