Share via


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

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

适用于