Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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; } } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HttpDictionary.cs
- ZipPackage.cs
- OdbcConnectionString.cs
- MessageBox.cs
- InputReferenceExpression.cs
- ToolStripItemBehavior.cs
- TextTreeTextElementNode.cs
- CqlBlock.cs
- ProfileSection.cs
- TabControl.cs
- SafeCryptContextHandle.cs
- EncodingDataItem.cs
- CodeObject.cs
- ProgressBarBrushConverter.cs
- ContentElementAutomationPeer.cs
- DataPagerFieldItem.cs
- PropertyTab.cs
- SQLBytes.cs
- HelpEvent.cs
- SystemException.cs
- Column.cs
- DataServiceQuery.cs
- XmlDataLoader.cs
- HtmlProps.cs
- ToolStripItemEventArgs.cs
- DSACryptoServiceProvider.cs
- RequestCachePolicyConverter.cs
- SecurityRuntime.cs
- SqlDataSourceCommandEventArgs.cs
- CompilerErrorCollection.cs
- UniqueConstraint.cs
- SqlColumnizer.cs
- basecomparevalidator.cs
- HostingEnvironmentException.cs
- RTLAwareMessageBox.cs
- ConfigXmlCDataSection.cs
- bidPrivateBase.cs
- RefreshResponseInfo.cs
- SortDescription.cs
- FixedPosition.cs
- ActivityCodeDomSerializationManager.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- HTTPNotFoundHandler.cs
- SByteStorage.cs
- ValueSerializer.cs
- DefinitionBase.cs
- WindowsComboBox.cs
- StringPropertyBuilder.cs
- WmlControlAdapter.cs
- ButtonBase.cs
- StatusBarItemAutomationPeer.cs
- SQLString.cs
- XmlWhitespace.cs
- TaskForm.cs
- XmlTypeAttribute.cs
- WebConvert.cs
- ContextMarshalException.cs
- Control.cs
- HtmlEmptyTagControlBuilder.cs
- PerformanceCounterNameAttribute.cs
- BrowserDefinition.cs
- RelationshipNavigation.cs
- PresentationTraceSources.cs
- DefaultPropertyAttribute.cs
- CacheChildrenQuery.cs
- ComponentEditorForm.cs
- FaultException.cs
- WebPartTracker.cs
- DataObjectFieldAttribute.cs
- StateItem.cs
- RoutedEventConverter.cs
- Pkcs7Signer.cs
- StreamingContext.cs
- ObjectPersistData.cs
- PlaceHolder.cs
- XmlDataSourceView.cs
- Version.cs
- AuthorizationRule.cs
- MeasurementDCInfo.cs
- NumberFormatInfo.cs
- WindowsEditBoxRange.cs
- MsmqException.cs
- HeaderPanel.cs
- TheQuery.cs
- XmlKeywords.cs
- SystemWebExtensionsSectionGroup.cs
- QueryAccessibilityHelpEvent.cs
- DiagnosticsConfiguration.cs
- WebPartConnectVerb.cs
- ExpressionServices.cs
- TextDpi.cs
- PathSegmentCollection.cs
- VirtualPathUtility.cs
- ComponentEditorForm.cs
- Config.cs
- XslCompiledTransform.cs
- DiscoveryServerProtocol.cs
- List.cs
- SafeFileMapViewHandle.cs
- BamlWriter.cs