Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / System / Collections / Generic / DebugView.cs / 1 / DebugView.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
/*==============================================================================
**
**
**
** Purpose: DebugView class for generic collections
**
**
=============================================================================*/
namespace System.Collections.Generic {
using System;
using System.Collections.ObjectModel;
using System.Security.Permissions;
using System.Diagnostics;
//
// VS IDE can't differentiate between types with the same name from different
// assembly. So we need to use different names for collection debug view for
// collections in mscorlib.dll and system.dll.
//
internal sealed class Mscorlib_CollectionDebugView {
private ICollection collection;
public Mscorlib_CollectionDebugView(ICollection collection) {
if (collection == null)
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.collection);
this.collection = collection;
}
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public T[] Items {
get {
T[] items = new T[collection.Count];
collection.CopyTo(items, 0);
return items;
}
}
}
internal sealed class Mscorlib_DictionaryKeyCollectionDebugView {
private ICollection collection;
public Mscorlib_DictionaryKeyCollectionDebugView(ICollection collection) {
if (collection == null)
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.collection);
this.collection = collection;
}
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public TKey[] Items {
get {
TKey[] items = new TKey[collection.Count];
collection.CopyTo(items, 0);
return items;
}
}
}
internal sealed class Mscorlib_DictionaryValueCollectionDebugView {
private ICollection collection;
public Mscorlib_DictionaryValueCollectionDebugView(ICollection collection) {
if (collection == null)
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.collection);
this.collection = collection;
}
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public TValue[] Items {
get {
TValue[] items = new TValue[collection.Count];
collection.CopyTo(items, 0);
return items;
}
}
}
internal sealed class Mscorlib_DictionaryDebugView {
private IDictionary dict;
public Mscorlib_DictionaryDebugView(IDictionary dictionary) {
if (dictionary == null)
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.dictionary);
this.dict = dictionary;
}
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public KeyValuePair[] Items {
get {
KeyValuePair[] items = new KeyValuePair[dict.Count];
dict.CopyTo(items, 0);
return items;
}
}
}
internal sealed class Mscorlib_KeyedCollectionDebugView {
private KeyedCollection kc;
public Mscorlib_KeyedCollectionDebugView(KeyedCollection keyedCollection) {
if (keyedCollection == null) {
throw new ArgumentNullException("keyedCollection");
}
kc = keyedCollection;
}
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
public T[] Items {
get {
T[] items = new T[kc.Count];
kc.CopyTo(items, 0);
return items;
}
}
}
}
// 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
- ConnectionConsumerAttribute.cs
- LineGeometry.cs
- _SSPISessionCache.cs
- RawAppCommandInputReport.cs
- TextServicesCompartmentContext.cs
- HtmlContainerControl.cs
- ToolStripArrowRenderEventArgs.cs
- MemberHolder.cs
- CqlLexerHelpers.cs
- DbParameterHelper.cs
- PairComparer.cs
- ToolStripItemBehavior.cs
- ColumnHeader.cs
- ObjectListSelectEventArgs.cs
- ProjectionNode.cs
- EdgeProfileValidation.cs
- PriorityQueue.cs
- AnimationStorage.cs
- RestrictedTransactionalPackage.cs
- login.cs
- securestring.cs
- ResourceDictionary.cs
- DecoratedNameAttribute.cs
- OleCmdHelper.cs
- TemplateControl.cs
- StructuredTypeEmitter.cs
- TransactionManager.cs
- ToolStripSeparator.cs
- Typeface.cs
- OrthographicCamera.cs
- IntSecurity.cs
- EvidenceTypeDescriptor.cs
- FixedSOMGroup.cs
- ObjectDesignerDataSourceView.cs
- LineServices.cs
- SystemWebSectionGroup.cs
- TrustLevelCollection.cs
- ComponentChangedEvent.cs
- PrefixHandle.cs
- ThemeDirectoryCompiler.cs
- XslVisitor.cs
- OrderByBuilder.cs
- LogFlushAsyncResult.cs
- TemplateControlBuildProvider.cs
- SmiContext.cs
- HuffCodec.cs
- HttpProxyCredentialType.cs
- WebPartCancelEventArgs.cs
- safePerfProviderHandle.cs
- NewExpression.cs
- InputScopeConverter.cs
- ContextProperty.cs
- SystemResourceHost.cs
- WebPartConnectionsEventArgs.cs
- QuaternionRotation3D.cs
- SynchronizationLockException.cs
- BooleanToVisibilityConverter.cs
- Condition.cs
- ThicknessConverter.cs
- BitmapEffectState.cs
- PartialCachingAttribute.cs
- UInt16.cs
- ThreadInterruptedException.cs
- VideoDrawing.cs
- EmptyStringExpandableObjectConverter.cs
- EventListenerClientSide.cs
- DynamicPhysicalDiscoSearcher.cs
- TextBoxView.cs
- altserialization.cs
- SafeNativeMethods.cs
- IisTraceWebEventProvider.cs
- DataFormats.cs
- PointConverter.cs
- SpecialNameAttribute.cs
- TreeViewImageKeyConverter.cs
- ObjectDataSourceStatusEventArgs.cs
- AdornedElementPlaceholder.cs
- DocumentApplicationJournalEntry.cs
- XMLSchema.cs
- ProfilePropertySettings.cs
- MachineKeySection.cs
- Utils.cs
- Point.cs
- SqlCachedBuffer.cs
- SafeCoTaskMem.cs
- ReferentialConstraint.cs
- RNGCryptoServiceProvider.cs
- ScrollItemProviderWrapper.cs
- WebPartConnectionsDisconnectVerb.cs
- Operators.cs
- TextPointer.cs
- CroppedBitmap.cs
- NativeMethods.cs
- MemberHolder.cs
- SignedPkcs7.cs
- RoutedEventArgs.cs
- ProtectedProviderSettings.cs
- ProjectionPruner.cs
- unsafenativemethodstextservices.cs
- SSmlParser.cs