AutomationElement.Equals(Object) 方法

定義

判斷指定的 AutomationElement 是否具有與此 AutomationElement 相同的值。Determines whether the specified AutomationElement has the same value as this AutomationElement.

public:
 override bool Equals(System::Object ^ obj);
public override bool Equals (object obj);
override this.Equals : obj -> bool
Public Overrides Function Equals (obj As Object) As Boolean

參數

obj
Object

要比較的 AutomationElementAn AutomationElement to compare.

傳回

Boolean

true 表示指定的 AutomationElement 與此 AutomationElement 相同;否則為 falsetrue if the specified AutomationElement is equal to this AutomationElement;otherwise false.

備註

比較為相等的兩個元素,可能會包含不同時間點的不同快取資訊。Two elements that compare as equal may contain different cached information from different points in time. 相等檢查只會測試物件是否 AutomationElement 參考相同的基礎使用者介面專案,也就是它們具有相同的執行時間識別碼。The equality check only tests that the AutomationElement objects refer to the same underlying user interface element; that is, that they have the same run-time identifier.

這個方法相當於相等運算子,也比較了執行時間識別碼。This method is equivalent to the equality operator, which also compare run-time identifiers.

適用於

另請參閱