IMemberCreationService.CreateProperty 方法

定义

在指定类上使用指定的属性 (property) 名、属性 (property) 类型和属性 (attribute) 创建一个属性 (property)。

public:
 void CreateProperty(System::String ^ className, System::String ^ propertyName, Type ^ propertyType, cli::array <System::Workflow::ComponentModel::Compiler::AttributeInfo ^> ^ attributes, bool emitDependencyProperty, bool isMetaProperty, bool isAttached, Type ^ ownerType, bool isReadOnly);
public void CreateProperty (string className, string propertyName, Type propertyType, System.Workflow.ComponentModel.Compiler.AttributeInfo[] attributes, bool emitDependencyProperty, bool isMetaProperty, bool isAttached, Type ownerType, bool isReadOnly);
abstract member CreateProperty : string * string * Type * System.Workflow.ComponentModel.Compiler.AttributeInfo[] * bool * bool * bool * Type * bool -> unit
Public Sub CreateProperty (className As String, propertyName As String, propertyType As Type, attributes As AttributeInfo(), emitDependencyProperty As Boolean, isMetaProperty As Boolean, isAttached As Boolean, ownerType As Type, isReadOnly As Boolean)

参数

className
String

一个字符串,用于定义类的名称以添加字段。

propertyName
String

一个字符串,用于定义字段的名称。

propertyType
Type

新属性的 Type

attributes
AttributeInfo[]

一个 AttributeInfo 数组,其中包含有关要分配给属性 (property) 的所有属性 (attribute) 的信息。

emitDependencyProperty
Boolean

true 则发出任何与属性关联的依赖项属性;否则为 false

isMetaProperty
Boolean

true 则作为元属性来创建属性;否则为 false

isAttached
Boolean

true 则指示发出的依赖项属性的 IsAttached 属性设置为 true;否则为 false

ownerType
Type

声明依赖项属性的 Type

isReadOnly
Boolean

true 则创建的属性作为只读属性;为 false 则创建的属性作为读写属性。

适用于