TypeDescriptor.AddAttributes 方法 (System.ComponentModel) | 您所在的位置:网站首页 › attributes方法 › TypeDescriptor.AddAttributes 方法 (System.ComponentModel) |
向目标组件实例添加类级别属性。 public: static System::ComponentModel::TypeDescriptionProvider ^ AddAttributes(System::Object ^ instance, ... cli::array ^ attributes); public static System.ComponentModel.TypeDescriptionProvider AddAttributes (object instance, params Attribute[] attributes); static member AddAttributes : obj * Attribute[] -> System.ComponentModel.TypeDescriptionProvider Public Shared Function AddAttributes (instance As Object, ParamArray attributes As Attribute()) As TypeDescriptionProvider 参数 instance Object目标组件的实例。 attributes Attribute[]要添加到组件的类的 Attribute 对象数组。 返回 TypeDescriptionProvider用于添加指定属性的新创建的 TypeDescriptionProvider。 例外 ArgumentNullException两个参数之一或两个参数均为 null。 注解该方法 AddAttributes(Object, Attribute[]) 将类级属性添加到组件的指定实例。 由于这是使用 Visual Studio Windows 窗体 Designer 和 属性窗口 的应用程序的常见要求,因此此方法通过创建一个类型说明提供程序来将所提供的属性与类上已存在的属性合并来提供快捷方式。 返回值是用于添加属性的类型说明提供程序。 稍后,当不再需要添加的属性时,可以将此提供程序传递给 RemoveProvider(TypeDescriptionProvider, Object) 方法。 另请参阅 GetAttributes 适用于 |
今日新闻 |
推荐新闻 |
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 |