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)
已过时.

添加实现注册方法的组件。

适用于