ServiceProviders 類別

定義

提供 IServiceProvider 介面的實作,其方法可啟用加入服務。Provides an implementation for the IServiceProvider interface with methods that enable adding services.

public ref class ServiceProviders : IServiceProvider
[System.ComponentModel.Browsable(false)]
public class ServiceProviders : IServiceProvider
[<System.ComponentModel.Browsable(false)>]
type ServiceProviders = class
    interface IServiceProvider
Public Class ServiceProviders
Implements IServiceProvider
繼承
ServiceProviders
衍生
屬性
實作

備註

這是將內容序列化時使用的公用程式類別。This is a utility class for use when serializing content. 此類別基本上是一個僅限輸入的字典,用於儲存以其服務類型做為索引鍵的服務,以 IServiceProvider 供稍後從相同字典抓取。The class is basically an input-only dictionary for storing services keyed by their service type, which implements IServiceProvider for later retrieval from the same dictionary. 使用字典可避免重複查詢相同的服務。Using the dictionary avoids querying for the same service repeatedly. 這個類別是的基類,也 XamlDesignerSerializationManager 就是用於 ShouldSerialize WPF 其他部分中的方法的服務。This class is the base class of XamlDesignerSerializationManager, which is the service used for ShouldSerialize method implementations in other parts of WPF.

使用這個類別需要參考 WPF 元件,它並不適用于一般 .NET Framework XAML 服務案例。Using this class requires referencing WPF assemblies, it is not intended for general .NET Framework XAML Services scenarios. 此處的案例是要在序列化期間,針對需要大量服務的功能進行 WPF 內部執行,例如處理特定類型的執行時 ShouldSerializeThe scenario here is for WPF internal implementation of service-intensive features during serialization, such as when processing the ShouldSerialize implementations of certain types. 此案例中牽涉到的實體類別是衍生的類別 XamlDesignerSerializationManagerThe practical class involved in this scenario is the derived class XamlDesignerSerializationManager.

建構函式

ServiceProviders()

初始化 ServiceProviders 類別的新執行個體。Initializes a new instance of the ServiceProviders class.

方法

AddService(Type, Object)

將服務加入至清單。Adds a service to the list.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetService(Type)

取得指定類型的服務物件。Gets the service object of the specified type.

GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於