IExtension<T> 介面
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
使物件能透過聚合擴展另一個物件。
generic <typename T>
where T : IExtensibleObject<T>public interface class IExtension
public interface IExtension<T> where T : IExtensibleObject<T>
type IExtension<'T (requires 'T :> IExtensibleObject<'T>)> = interface
Public Interface IExtension(Of T)
類型參數
- T
參與自訂行為的物件。
- 衍生
備註
WCF 允許你透過可擴充的物件模式,新增一個狀態或行為來擴充 System.ServiceModel.IExtensibleObject<T> 物件(如 System.ServiceModel.IContextChannel、 System.ServiceModel.ServiceHost、 System.ServiceModel.InstanceContext和 System.ServiceModel.OperationContext 類別)。 可擴充物件模式在 WCF 中用於擴充現有執行時類別以新功能,或為物件新增狀態特性。
方法
| 名稱 | Description |
|---|---|
| Attach(T) |
使擴充物件能夠查詢何時被聚合。 當擴展機加入 Extensions 物業時會被呼叫。 |
| Detach(T) |
讓物件能得知何時不再被聚合。 當分機從物業移除 Extensions 時會被呼叫。 |