Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- MimeMapping.cs
- IteratorFilter.cs
- ClrProviderManifest.cs
- DragCompletedEventArgs.cs
- While.cs
- Pens.cs
- RuleConditionDialog.Designer.cs
- LinkButton.cs
- XmlSchemaObjectTable.cs
- StylusPointDescription.cs
- RSACryptoServiceProvider.cs
- ComponentCollection.cs
- QilPatternVisitor.cs
- GeneralTransform3DCollection.cs
- StorageEndPropertyMapping.cs
- DataListItem.cs
- _AutoWebProxyScriptWrapper.cs
- XmlWriter.cs
- TdsEnums.cs
- BindingContext.cs
- ToolboxComponentsCreatingEventArgs.cs
- ReceiveActivityValidator.cs
- TemplatePropertyEntry.cs
- EditBehavior.cs
- Delegate.cs
- DataSourceHelper.cs
- BuildTopDownAttribute.cs
- SequentialWorkflowHeaderFooter.cs
- Events.cs
- Currency.cs
- PackWebRequest.cs
- DataGridViewDataErrorEventArgs.cs
- ComponentRenameEvent.cs
- ToolBarTray.cs
- ListBoxDesigner.cs
- SaveCardRequest.cs
- PageContentCollection.cs
- SecurityElementBase.cs
- ForEachAction.cs
- M3DUtil.cs
- XmlSchemaExporter.cs
- DynamicControl.cs
- ImageIndexConverter.cs
- WebPartEditorApplyVerb.cs
- SourceFileInfo.cs
- BamlResourceSerializer.cs
- WorkflowViewStateService.cs
- TextEditorContextMenu.cs
- SourceFileInfo.cs
- DataKeyCollection.cs
- TextParagraph.cs
- ApplicationManager.cs
- RichTextBox.cs
- PropertyEmitterBase.cs
- ValidatingReaderNodeData.cs
- Label.cs
- TableCell.cs
- HttpCachePolicyWrapper.cs
- cookieexception.cs
- DelegateBodyWriter.cs
- ModifiableIteratorCollection.cs
- BlobPersonalizationState.cs
- StatusBarPanel.cs
- arc.cs
- EntityProviderFactory.cs
- CompositeScriptReference.cs
- ParentUndoUnit.cs
- SmtpNetworkElement.cs
- ContainerControl.cs
- ScriptRef.cs
- SurrogateEncoder.cs
- StorageEndPropertyMapping.cs
- TableHeaderCell.cs
- FilteredReadOnlyMetadataCollection.cs
- HttpException.cs
- MailAddress.cs
- WarningException.cs
- GradientStopCollection.cs
- DrawingAttributes.cs
- DateTimeUtil.cs
- NativeMethods.cs
- ApplicationInfo.cs
- BasicExpandProvider.cs
- SspiWrapper.cs
- RoleService.cs
- DataTablePropertyDescriptor.cs
- ItemDragEvent.cs
- CompiledIdentityConstraint.cs
- DateTime.cs
- RotateTransform.cs
- WebServiceClientProxyGenerator.cs
- DependencyObject.cs
- CorrelationTokenTypeConvertor.cs
- CodeGenerator.cs
- HttpListenerRequestTraceRecord.cs
- XmlILStorageConverter.cs
- DetailsViewModeEventArgs.cs
- BeginStoryboard.cs
- InputLanguageSource.cs
- ScriptManagerProxy.cs