首页 > 编程知识 正文

pattern design软件,condition类

时间:2023-05-06 17:48:23 阅读:107774 作者:229

.NET Framework 2.0其他版本提供类上属性的抽象。

33558 www.Sina.com/system.component model

33558 www.Sina.com/system (在system.dll中) )。

c#cVB[comvisibleattribute(true ) ] publicabstractclasspropertydescriptor 3360 memberdescriptorj #/* @ attributecomvisisissisisior 公共bstractclasspropertydescriptorextendsmemberdescriptorjscriptcomvisibleattribute (true ) )。 publicabstractclasspropertydescriptorextendsmemberdescriptor注释属性说明由名称、其特性、与属性相关联的组件类和属性类型组成。

命名空间:提供以下属性和方法:

转换器包含此属性的类型转换器。

IsLocalizable指示是否应该本地化属性。

GetEditor返回指定类型的编辑器。

程序集:还提供了以下PropertyDescriptor属性和方法:

组件类型包括

该属性绑定到的组件的类型。

IsReadOnly 指示该属性是否是只读的。

PropertyType 获取属性的类型。

CanResetValue 指示重置组件是否会更改该组件的值。

GetValue 返回组件上属性的当前值。

ResetValue 重置组件属性的值。

SetValue 将组件的值设置为一个不同的值。

ShouldSerializeValue 指示是否需要持久保存该属性的值。

通常,abstract 成员是通过反射实现的。有关反射的更多信息,请参见 反射 中的主题。

注意

应用于此类的 HostProtectionAttribute 属性 (Attribute) 具有以下 Resources 属性 (Property) 值:SharedState。HostProtectionAttribute 不影响桌面应用程序(桌面应用程序一般通过双击图标,键入命令或在浏览器中输入 URL 启动)。有关更多信息,请参见 HostProtectionAttribute 类或 SQL Server 编程和宿主保护属性。

示例

下面的代码示例是基于 PropertyDescriptorCollection 类中的示例生成的。该示例输出文本框中某个按钮的文本信息(类别、说明、显示名称)。它假定已在窗体上实例化 button1 和 textbox1。

C# C++ VB // Creates a new collection and assign it the properties for button1.PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(button1);// Sets an PropertyDescriptor to the specific property.System.ComponentModel.PropertyDescriptor myProperty = properties.Find("Text", false);// Prints the property and the property description.textBox1.Text = myProperty.DisplayName+ 'n' ;textBox1.Text += myProperty.Description + 'n';textBox1.Text += myProperty.Category + 'n'; J# // Creates a new collection and assign it the properties for button1.PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(button1);// Sets an PropertyDescriptor to the specific property.System.ComponentModel.PropertyDescriptor myProperty = properties.Find("Text", false);// Prints the property and the property description.textBox1.set_Text(myProperty.get_DisplayName() + 'n');textBox1.set_Text(textBox1.get_Text() + myProperty.get_Description() + 'n');textBox1.set_Text(textBox1.get_Text() + myProperty.get_Category() + 'n'); 继承层次结构 System.Object 
    System.ComponentModel.MemberDescriptor 
     System.ComponentModel.PropertyDescriptor
        System.ComponentModel.TypeConverter.SimplePropertyDescriptor 
线程安全 此类型的任何公共静态(Visual Basic 中的  Shared)成员都是线程安全的,但不保证所有实例成员都是线程安全的。 平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求。

版本信息 .NET Framework 受以下版本支持:2.0、1.1、1.0
.NET Compact Framework 受以下版本支持:2.0、1.0
请参见 参考 PropertyDescriptor 成员
System.ComponentModel 命名空间
MemberDescriptor 类
Attribute
DefaultValueAttribute 类

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。