Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / CompMod / System / Collections / Generic / DebugView.cs / 1 / DebugView.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================================== ** ** ** ** Purpose: DebugView class for generic collections ** ** Date: Mar 09, 2004 ** =============================================================================*/ namespace System.Collections.Generic { using System; using System.Security.Permissions; using System.Diagnostics; internal sealed class System_CollectionDebugView{ private ICollection collection; public System_CollectionDebugView(ICollection collection) { if (collection == null) { throw new ArgumentNullException("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 System_QueueDebugView { private Queue queue; public System_QueueDebugView(Queue queue) { if (queue == null) { throw new ArgumentNullException("queue"); } this.queue = queue; } [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] public T[] Items { get { return queue.ToArray(); } } } internal sealed class System_StackDebugView { private Stack stack; public System_StackDebugView(Stack stack) { if (stack == null) { throw new ArgumentNullException("stack"); } this.stack = stack; } [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] public T[] Items { get { return stack.ToArray(); } } } internal sealed class System_DictionaryDebugView { private IDictionary dict; public System_DictionaryDebugView(IDictionary dictionary) { if (dictionary == null) throw new ArgumentNullException("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 System_DictionaryKeyCollectionDebugView { private ICollection collection; public System_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 System_DictionaryValueCollectionDebugView { private ICollection collection; public System_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; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================================== ** ** ** ** Purpose: DebugView class for generic collections ** ** Date: Mar 09, 2004 ** =============================================================================*/ namespace System.Collections.Generic { using System; using System.Security.Permissions; using System.Diagnostics; internal sealed class System_CollectionDebugView { private ICollection collection; public System_CollectionDebugView(ICollection collection) { if (collection == null) { throw new ArgumentNullException("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 System_QueueDebugView { private Queue queue; public System_QueueDebugView(Queue queue) { if (queue == null) { throw new ArgumentNullException("queue"); } this.queue = queue; } [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] public T[] Items { get { return queue.ToArray(); } } } internal sealed class System_StackDebugView { private Stack stack; public System_StackDebugView(Stack stack) { if (stack == null) { throw new ArgumentNullException("stack"); } this.stack = stack; } [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] public T[] Items { get { return stack.ToArray(); } } } internal sealed class System_DictionaryDebugView { private IDictionary dict; public System_DictionaryDebugView(IDictionary dictionary) { if (dictionary == null) throw new ArgumentNullException("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 System_DictionaryKeyCollectionDebugView { private ICollection collection; public System_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 System_DictionaryValueCollectionDebugView { private ICollection collection; public System_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; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BackoffTimeoutHelper.cs
- CountAggregationOperator.cs
- QueryAccessibilityHelpEvent.cs
- FrameworkContextData.cs
- PageParser.cs
- DataPointer.cs
- GridItemProviderWrapper.cs
- ZipFileInfo.cs
- DataGridViewLinkCell.cs
- ActivityWithResultConverter.cs
- UnmanagedMarshal.cs
- XmlQueryRuntime.cs
- BlockCollection.cs
- DelegatingTypeDescriptionProvider.cs
- ParameterCollection.cs
- EventListenerClientSide.cs
- AvTrace.cs
- RadioButtonPopupAdapter.cs
- EmulateRecognizeCompletedEventArgs.cs
- ObjectStorage.cs
- MaterialCollection.cs
- DocumentReferenceCollection.cs
- PersonalizableAttribute.cs
- CodeDomExtensionMethods.cs
- MetadataCollection.cs
- CursorInteropHelper.cs
- ImpersonateTokenRef.cs
- DesignerOptionService.cs
- ToolBarPanel.cs
- CodeVariableDeclarationStatement.cs
- VariantWrapper.cs
- DataObjectMethodAttribute.cs
- Splitter.cs
- IpcChannelHelper.cs
- CancellationTokenRegistration.cs
- HotSpotCollection.cs
- TiffBitmapDecoder.cs
- SqlTopReducer.cs
- RestHandlerFactory.cs
- CodeNamespace.cs
- ClientSideProviderDescription.cs
- CopyOfAction.cs
- MasterPageCodeDomTreeGenerator.cs
- TransactionTable.cs
- MetafileHeader.cs
- RotateTransform.cs
- TPLETWProvider.cs
- TypeDependencyAttribute.cs
- _FtpDataStream.cs
- StringHandle.cs
- LayeredChannelListener.cs
- MouseButtonEventArgs.cs
- ToolStripArrowRenderEventArgs.cs
- ClientViaElement.cs
- SQLConvert.cs
- CounterCreationDataCollection.cs
- SmiMetaData.cs
- Guid.cs
- BoundField.cs
- MailAddressCollection.cs
- SmiEventSink.cs
- PackUriHelper.cs
- AssemblyResourceLoader.cs
- ShaperBuffers.cs
- HtmlInputSubmit.cs
- TextRunProperties.cs
- TransformValueSerializer.cs
- DocumentPageHost.cs
- ProtectedConfigurationSection.cs
- FlowDecision.cs
- AmbiguousMatchException.cs
- CellNormalizer.cs
- PlatformCulture.cs
- SpeechSynthesizer.cs
- MasterPageCodeDomTreeGenerator.cs
- SafeLibraryHandle.cs
- DNS.cs
- TokenBasedSetEnumerator.cs
- DataGridCaption.cs
- DataSourceCache.cs
- SqlFunctionAttribute.cs
- ObsoleteAttribute.cs
- AssemblyInfo.cs
- VisualBrush.cs
- ManifestBasedResourceGroveler.cs
- CompilationUtil.cs
- MemoryFailPoint.cs
- StyleCollectionEditor.cs
- LineGeometry.cs
- CategoryAttribute.cs
- TargetControlTypeAttribute.cs
- StatusBarPanelClickEvent.cs
- X509ServiceCertificateAuthenticationElement.cs
- TranslateTransform.cs
- KeyEventArgs.cs
- Grid.cs
- ParserExtension.cs
- RoutedEventArgs.cs
- UnauthorizedAccessException.cs
- ParallelTimeline.cs