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; }
}
}