public override bool Equals(object obj) { IWebElement webElement = obj as IWebElement; if (webElement == null) { return(false); } if (webElement is IWrapsElement) { webElement = ((IWrapsElement)obj).WrappedElement; } FirefoxWebElement firefoxWebElement = webElement as FirefoxWebElement; return(firefoxWebElement != null && base.Id == firefoxWebElement.Id); }
/// <summary> /// Determines whether two <see cref="FirefoxWebElement"/> instances are equal. /// </summary> /// <param name="obj">The <see cref="FirefoxWebElement"/> to compare with the current <see cref="FirefoxWebElement"/>.</param> /// <returns><see langword="true"/> if the specified <see cref="FirefoxWebElement"/> is equal to the /// current <see cref="FirefoxWebElement"/>; otherwise, <see langword="false"/>.</returns> public override bool Equals(object obj) { IWebElement other = obj as IWebElement; if (other == null) { return(false); } if (other is IWrapsElement) { other = ((IWrapsElement)obj).WrappedElement; } FirefoxWebElement otherAsElement = other as FirefoxWebElement; if (otherAsElement == null) { return(false); } return(Id == otherAsElement.Id); }