ServiceProviderHierarchy 类

为分层服务提供程序。

继承层次结构

System.Object
  System.Collections.Generic.SortedList<Int32, IServiceProvider>
    Microsoft.VisualStudio.Shell.ServiceProviderHierarchy

命名空间:  Microsoft.VisualStudio.Shell
程序集:  Microsoft.VisualStudio.Shell.11.0(在 Microsoft.VisualStudio.Shell.11.0.dll 中)

语法

声明
Public NotInheritable Class ServiceProviderHierarchy _
    Inherits SortedList(Of Integer, IServiceProvider) _
    Implements IServiceProvider
public sealed class ServiceProviderHierarchy : SortedList<int, IServiceProvider>, 
    IServiceProvider

ServiceProviderHierarchy 类型公开以下成员。

构造函数

  名称 说明
公共方法 ServiceProviderHierarchy 初始化 ServiceProviderHierarchy 的新实例。

页首

属性

  名称 说明
公共属性 Capacity 获取或设置 SortedList<TKey, TValue> 可包含的元素数。 (继承自 SortedList<Int32, IServiceProvider>。)
公共属性 Comparer 获取该排序列表的 IComparer<T>。 (继承自 SortedList<Int32, IServiceProvider>。)
公共属性 Count 获取包含在 SortedList<TKey, TValue> 中的键/值对的数目。 (继承自 SortedList<Int32, IServiceProvider>。)
公共属性 Item 获取或设置与指定的键相关联的值。 (继承自 SortedList<Int32, IServiceProvider>。)
公共属性 Keys 获取包含 SortedList<TKey, TValue> 中的键的集合。 (继承自 SortedList<Int32, IServiceProvider>。)
公共属性 Values 获取包含 SortedList<TKey, TValue> 中的值的集合。 (继承自 SortedList<Int32, IServiceProvider>。)

页首

方法

  名称 说明
公共方法 Add 将带有指定键和值的元素添加到 SortedList<TKey, TValue> 中。 (继承自 SortedList<Int32, IServiceProvider>。)
公共方法 Clear SortedList<TKey, TValue> 中移除所有元素。 (继承自 SortedList<Int32, IServiceProvider>。)
公共方法 ContainsKey 确定 SortedList<TKey, TValue> 是否包含特定键。 (继承自 SortedList<Int32, IServiceProvider>。)
公共方法 ContainsValue 确定 SortedList<TKey, TValue> 是否包含特定值。 (继承自 SortedList<Int32, IServiceProvider>。)
公共方法 Equals 确定指定的对象是否等于当前对象。 (继承自 Object。)
公共方法 GetEnumerator 返回循环访问 SortedList<TKey, TValue> 的枚举数。 (继承自 SortedList<Int32, IServiceProvider>。)
公共方法 GetHashCode 用作特定类型的哈希函数。 (继承自 Object。)
公共方法 GetService 获取指定类型的服务。
公共方法 GetType 获取当前实例的 Type。 (继承自 Object。)
公共方法 IndexOfKey 在整个 SortedList<TKey, TValue> 中搜索指定键并返回从零开始的索引。 (继承自 SortedList<Int32, IServiceProvider>。)
公共方法 IndexOfValue 在整个 SortedList<TKey, TValue> 中搜索指定的值,并返回第一个匹配项的从零开始的索引。 (继承自 SortedList<Int32, IServiceProvider>。)
公共方法 Remove SortedList<TKey, TValue> 中移除带有指定键的元素。 (继承自 SortedList<Int32, IServiceProvider>。)
公共方法 RemoveAt 移除 SortedList<TKey, TValue> 的指定索引处的元素。 (继承自 SortedList<Int32, IServiceProvider>。)
公共方法 ToString 返回表示当前对象的字符串。 (继承自 Object。)
公共方法 TrimExcess 如果元素数小于当前容量的 90%,将容量设置为 SortedList<TKey, TValue> 中的实际元素数。 (继承自 SortedList<Int32, IServiceProvider>。)
公共方法 TryGetValue 获取与指定的键相关联的值。 (继承自 SortedList<Int32, IServiceProvider>。)

页首

显式接口实现

  名称 说明
显式接口实现私有方法 ICollection<KeyValuePair<TKey, TValue>>.Add ICollection<T> 中添加键/值对。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有方法 IDictionary.Add IDictionary 中添加一个带有所提供的键和值的元素。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有方法 ICollection<KeyValuePair<TKey, TValue>>.Contains 确定 ICollection<T> 是否包含特定元素。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有方法 IDictionary.Contains 确定 IDictionary 是否包含具有指定键的元素。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有方法 ICollection<KeyValuePair<TKey, TValue>>.CopyTo 从特定的 Array 索引开始,将 ICollection<T> 的元素复制到一个 Array 中。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有方法 ICollection.CopyTo 从特定的 Array 索引处开始,将 ICollection 的元素复制到一个 Array 中。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有方法 IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator 返回一个循环访问集合的枚举数。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有方法 IDictionary.GetEnumerator 返回 IDictionaryIDictionaryEnumerator。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有方法 IEnumerable.GetEnumerator 返回一个循环访问集合的枚举数。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有属性 IDictionary.IsFixedSize 获取一个值,该值指示 IDictionary 是否具有固定大小。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有属性 ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly 获取一个值,该值指示 ICollection<T> 是否为只读。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有属性 IDictionary.IsReadOnly 获取一个值,该值指示 IDictionary 是否为只读。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有属性 ICollection.IsSynchronized 获取一个值,该值指示是否同步对 ICollection 的访问(线程安全)。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有属性 IDictionary.Item 获取或设置具有指定键的元素。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有属性 IDictionary<TKey, TValue>.Keys 获取包含 IDictionary<TKey, TValue> 的键的 ICollection<T>。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有属性 IDictionary.Keys 获取包含 IDictionary 的键的 ICollection。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有方法 ICollection<KeyValuePair<TKey, TValue>>.Remove ICollection<T> 中移除特定键/值对的第一个匹配项。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有方法 IDictionary.Remove IDictionary 中移除带有指定键的元素。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有属性 ICollection.SyncRoot 获取可用于同步对 ICollection 的访问的对象。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有属性 IDictionary<TKey, TValue>.Values 获取包含 IDictionary<TKey, TValue> 中的值的 ICollection<T>。 (继承自 SortedList<Int32, IServiceProvider>。)
显式接口实现私有属性 IDictionary.Values 获取包含 IDictionary 中的值的 ICollection。 (继承自 SortedList<Int32, IServiceProvider>。)

页首

备注

它在顺序检索的一个排序的字典存储 IServiceProvider 对象。当 GetService 调用检索服务时,服务提供程序以特定的顺序查询。,并在多个服务提供程序合并如 WindowPane 实现时,这会很有用。

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参见

参考

Microsoft.VisualStudio.Shell 命名空间