OverloadGroupAttribute Class

Definition

提供一种方法,指示哪些参数组合在活动中有效。Provides a method for indicating which combinations of arguments are valid in an activity.

public ref class OverloadGroupAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=true)]
public sealed class OverloadGroupAttribute : Attribute
type OverloadGroupAttribute = class
    inherit Attribute
Public NotInheritable Class OverloadGroupAttribute
Inherits Attribute
Inheritance
OverloadGroupAttribute
Attributes

Remarks

可以将参数组合到一起以形成有效的重载组。Arguments can be grouped together to form valid overload groups. 重载组不能为另一个重载组的子集或等价集。An overload group cannot be a subset or an equivalent set of another overload group. 当子集仅包含 IsRequiredfalse 的自变量时例外,这是此规则的唯一例外情况。The only exception to this rule is a subset that contains only arguments where IsRequired is false. 重载组可以重叠,但如果组的交集包含一个或两个重载组的所有必需自变量,则会出错。Overload groups can overlap but it is an error if the intersection of the groups contains all the required arguments of one or both the overload groups.

如果重载组中的所有 IsRequired 自变量均被绑定,则该组将被视为绑定的重载组。An overload group is considered bound if all the IsRequired arguments in the group are bound. 如果一个组具有零个 IsRequired 自变量且至少有一个自变量被绑定,则该组将被视为绑定的组。If a group has zero IsRequired arguments and at least one argument bound, then the group is considered bound. 如果没有绑定任何组,除非其中的一个重载组中未包含任何 IsRequired 参数,否则将会出错。It is an error if none of the groups are bound unless one overload group has no IsRequired arguments in it. 不允许绑定多个重载组中的 IsRequired 参数。Binding IsRequired arguments from more than one overload group is not permitted. 绑定多个重载组(即,绑定一个重载组中的所有必需自变量,并同时绑定另一个重载组中的所有自变量)的做法是错误的。It is an error to have more than one overload group bound, that is, all required arguments in one overload group are bound and any argument in another overload group is also bound.

对先前规则的任何违反都会导致在包含的活动准备执行时引发 InvalidWorkflowExceptionAny violation of the preceding rules results in a InvalidWorkflowException being thrown when the containing activity is prepared for execution.

如果应用于自变量, 则设置为trueRuntimeArgument.IsRequired System.Activities.RequiredArgumentAttributeThe RuntimeArgument.IsRequired is set to true if the System.Activities.RequiredArgumentAttribute is applied to an argument.

Constructors

OverloadGroupAttribute()

初始化 OverloadGroupAttribute 类的新实例。Initializes a new instance of the OverloadGroupAttribute class.

OverloadGroupAttribute(String)

初始化 OverloadGroupAttribute 类的新实例。Initializes a new instance of the OverloadGroupAttribute class.

Properties

GroupName

获取 OverloadGroupAttribute 的名称。Gets the name of the OverloadGroupAttribute.

TypeId

获取此特性的唯一标识符。Gets a unique identifier for this attribute.

Methods

Equals(Object)

返回一个值,该值指示此实例是否与指定的对象相等。Returns a value that indicates whether this instance is equal to a specified object.

(Inherited from Attribute)
GetHashCode()

返回此实例的哈希代码。Returns the hash code for this instance.

(Inherited from Attribute)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
IsDefaultAttribute()

在派生类中重写时,指示此实例的值是否是派生类的默认值。When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.

(Inherited from Attribute)
Match(Object)

当在派生类中重写时,返回一个指示此实例是否等于指定对象的值。When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.

(Inherited from Attribute)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

将一组名称映射为对应的一组调度标识符。Maps a set of names to a corresponding set of dispatch identifiers.

(Inherited from Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

检索对象的类型信息,然后可以使用该信息获取接口的类型信息。Retrieves the type information for an object, which can be used to get the type information for an interface.

(Inherited from Attribute)
_Attribute.GetTypeInfoCount(UInt32)

检索对象提供的类型信息接口的数量(0 或 1)。Retrieves the number of type information interfaces that an object provides (either 0 or 1).

(Inherited from Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

提供对某一对象公开的属性和方法的访问。Provides access to properties and methods exposed by an object.

(Inherited from Attribute)

Applies to