System.Windows.Automation.Automation.Compare C# (CSharp) Method

Compare() public static method

public static Compare ( AutomationElement el1, AutomationElement el2 ) : bool
el1 AutomationElement
el2 AutomationElement
return bool
        public static bool Compare(AutomationElement el1, AutomationElement el2)
        {
            if (el1 == null && el2 == null)
            {
                return true;
            }
            if (el1 == null || el2 == null)
            {
                return false;
            }
            try
            {
                return Factory.CompareElements(el1.NativeElement, el2.NativeElement) != 0;
            }
            catch (System.Runtime.InteropServices.COMException e)
            {
                Exception newEx; if (Utility.ConvertException(e, out newEx)) { throw newEx; } else { throw; }
            }
        }

Same methods

Automation::Compare ( int runtimeId1, int runtimeId2 ) : bool

Usage Example

Exemplo n.º 1
0
        public override bool Equals(Object obj)
        {
            AutomationElement other = obj as AutomationElement;

            if (null == other)
            {
                return(false);
            }

            return(Automation.Compare(this, other));
        }
All Usage Examples Of System.Windows.Automation.Automation::Compare