ReadOnlyCollection 泛型类的实例总是只读的。只读集合只是一个具有用于防止修改的包装的集合;因此,如果更改基础集合,则只读集合将反映那些更改。
using System; using System.Collections.Generic; using System.Collections.ObjectModel; public class Example {