ConsoleKeyInfo.Equality(ConsoleKeyInfo, ConsoleKeyInfo) 运算符

定义

指示指定的 ConsoleKeyInfo 对象是否相等。Indicates whether the specified ConsoleKeyInfo objects are equal.

public:
 static bool operator ==(ConsoleKeyInfo a, ConsoleKeyInfo b);
public static bool operator == (ConsoleKeyInfo a, ConsoleKeyInfo b);
static member ( = ) : ConsoleKeyInfo * ConsoleKeyInfo -> bool
Public Shared Operator == (a As ConsoleKeyInfo, b As ConsoleKeyInfo) As Boolean

参数

a
ConsoleKeyInfo

要比较的第一个对象。The first object to compare.

b
ConsoleKeyInfo

要比较的第二个对象。The second object to compare.

返回

Boolean

如果 true 等于 a,则为 b;否则为 falsetrue if a is equal to b; otherwise, false.

注解

如果两个 ConsoleKeyInfo 对象的对应 KeyCharKeyModifiers 属性相等,则这两个对象相等。Two ConsoleKeyInfo objects are equal if their corresponding KeyChar, Key, and Modifiers properties are equal.

此运算符的等效方法为 ConsoleKeyInfo.Equals(ConsoleKeyInfo)The equivalent method for this operator is ConsoleKeyInfo.Equals(ConsoleKeyInfo).

适用于