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());

建構函式

ComponentRegistration()
已淘汰.

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

屬性

Components
已淘汰.

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

方法

Add(ComponentRegistration)
已淘汰.

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

適用於