ActivityMetadata.AddVariable 方法
定义
将指定的变量添加到变量的元数据集合中。Adds the specified variable to the metadata's collection of variables.
重载
| AddVariable(Variable) |
将指定的变量添加到变量的元数据集合中。Adds the specified variable to the metadata's collection of variables. |
| AddVariable(Variable, Object) |
将指定的变量添加到变量的元数据集合中。Adds the specified variable to the metadata's collection of variables. |
AddVariable(Variable)
将指定的变量添加到变量的元数据集合中。Adds the specified variable to the metadata's collection of variables.
public:
void AddVariable(System::Activities::Variable ^ variable);
public void AddVariable (System.Activities.Variable variable);
member this.AddVariable : System.Activities.Variable -> unit
Public Sub AddVariable (variable As Variable)
参数
- variable
- Variable
要添加的变量。The variable to add.
注解
使用此方法添加的变量被视为活动的可公开配置的表面的一部分,也就是说,它们将由活动的使用者提供。Variables added using this method are considered part of the activity's publicly configurable surface, that is, they are to be provided by the consumer of the activity. 例如,Sequence 会使用此方法在它的 Variables 集合中添加变量。For example, Sequence adds the variables in its Variables collection using this method. 活动的实现无法访问使用此方法添加的变量。An activity's implementation cannot access variables added using this method. 通过 AddImportedChild 添加的活动(及它们的任何未实现子活动)可以访问使用此方法添加的变量。Activities added through AddImportedChild (and any of their non-implementation child activities) can access variables added using this method. 例如,Sequence 会使用此方法添加它的 Activities 集合。For example, Sequence adds its Activities collection in this manner.
适用于
AddVariable(Variable, Object)
将指定的变量添加到变量的元数据集合中。Adds the specified variable to the metadata's collection of variables.
public:
void AddVariable(System::Activities::Variable ^ variable, System::Object ^ origin);
public void AddVariable (System.Activities.Variable variable, object origin);
member this.AddVariable : System.Activities.Variable * obj -> unit
Public Sub AddVariable (variable As Variable, origin As Object)
参数
- variable
- Variable
要添加的变量。The variable to add.
- origin
- Object
源 。The origin.