語言

ComponentRegistration 類別

定義

警告

Use BotComponent for new components.

ComponentRegistration 是用來探索元件資產的簽章類別。

[System.Obsolete("Use `BotComponent` for new components.")]
public class ComponentRegistration
[<System.Obsolete("Use `BotComponent` for new components.")>]
type ComponentRegistration = class
Public Class ComponentRegistration
繼承
ComponentRegistration
衍生
屬性

備註

為了讓系統能使用你的元件,你可以從 ComponentRegistration 衍生出來,並實作適當的介面來暫存功能。 這些元件接著會由需要這些元件的系統在適當的位置取用。 例如,要為系統新增宣告型別,只需加入實作 IComponentDeclarativeTypes 的類別即可。

public class MyComponentRegistration : IComponentDeclarativeTypes
{
    public IEnumerable<DeclarativeType>()
    {  
         yield return new DeclarativeType<MyType>("Contoso.MyType");
         ...
    }
}
startup.cs:
     ComponentRegistration.Add(new DeclarativeComponentRegistration()); 
     ComponentRegistration.Add(new MyComponentRegistration());

建構函式

名稱 Description
ComponentRegistration()
已淘汰.

ComponentRegistration 是用來探索元件資產的簽章類別。

屬性

名稱 Description
Components
已淘汰.

取得已註冊的所有 ComponentRegistration 物件清單。

方法

名稱 Description
Add(ComponentRegistration)
已淘汰.

新增實作註冊方法的元件。

適用於