File: System\Text\RegularExpressions\CollectionDebuggerProxy.cs
Web Access
Project: src\src\libraries\System.Text.RegularExpressions\src\System.Text.RegularExpressions.csproj (System.Text.RegularExpressions)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
 
using System.Collections.Generic;
using System.Diagnostics;
 
namespace System.Text.RegularExpressions
{
    internal sealed class CollectionDebuggerProxy<T>
    {
        private readonly ICollection<T> _collection;
 
        public CollectionDebuggerProxy(ICollection<T> collection)
        {
            ArgumentNullException.ThrowIfNull(collection);
            _collection = collection;
        }
 
        [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
        public T[] Items
        {
            get
            {
                var items = new T[_collection.Count];
                _collection.CopyTo(items, 0);
                return items;
            }
        }
    }
}