1 // -----------------------------------------------------------------------
\r
2 // Copyright (c) Microsoft Corporation. All rights reserved.
\r
3 // -----------------------------------------------------------------------
\r
5 using System.Collections.ObjectModel;
\r
6 using Microsoft.Internal;
\r
7 using Microsoft.Internal.Collections;
\r
9 namespace System.ComponentModel.Composition.Primitives
\r
11 // This proxy is needed to pretty up ComposablePartCatalog.Parts; IQueryable<T>
\r
12 // instances are not displayed in a very friendly way in the debugger.
\r
13 internal class ComposablePartCatalogDebuggerProxy
\r
15 private readonly ComposablePartCatalog _catalog;
\r
17 public ComposablePartCatalogDebuggerProxy(ComposablePartCatalog catalog)
\r
19 Requires.NotNull(catalog, "catalog");
\r
21 this._catalog = catalog;
\r
24 public ReadOnlyCollection<ComposablePartDefinition> Parts
\r
26 // NOTE: This shouldn't be cached, so that on every query of
\r
27 // the current value of the underlying catalog is respected.
\r
28 // We use ReadOnlyCollection as arrays do not have the
\r
29 // appropriate debugger display attributes applied to them.
\r
30 get { return this._catalog.Parts.ToReadOnlyCollection(); }
\r