Inheritance: WindowsPhoneTestFramework.Server.WCFHostedAutomationController.Commands.AutomationElementCommandBase
        private bool LookForAutomationIdentifer(AutomationIdentifier controlIdentifier, int ordinal,
                                                AutomationIdentifier parentIdentifier)
        {
            var command = new GetPositionCommand
                {
                    AutomationIdentifier = controlIdentifier,
                    Ordinal = ordinal,
                    ParentIdentifier = parentIdentifier,
                    ReturnEmptyIfNotVisible = true
                };

            var result = SyncLookExecuteCommand(command) as PositionResult;
            if (result == null)
            {
                return false;
            }

            // check that position is not empty
            return result.Width + result.Height > 0.0;
        }
 public bool FindMessageBox(string title, string message, string[] buttons)
 {
     var automationIdentifier = CreateAutomationIdentifier(title);
     var command = new GetPositionCommand
         {
             AutomationIdentifier = automationIdentifier,
             ParentIdentifier = new AutomationIdentifier("MessageBox", AutomationIdentification.TryElementName)
         };
     var positionResult = SyncExecuteCommand(command) as PositionResult;
     if (positionResult == null)
     {
         return false;
     }
     return positionResult.Height + positionResult.Width > 0;
 }
        private RectangleF GetPositionOfAutomationIdentifier(AutomationIdentifier controlIdentifier, int ordinal,
                                                             AutomationIdentifier parentIdentifier)
        {
            var command = new GetPositionCommand
                {
                    AutomationIdentifier = controlIdentifier,
                    Ordinal = ordinal,
                    ParentIdentifier = parentIdentifier
                };

            var result = SyncExecuteCommand(command);
            var positionResult = result as PositionResult;
            if (positionResult == null)
            {
                // TODO - should log the result here really
                return RectangleF.Empty;
            }

            return new RectangleF(
                (float)positionResult.Left,
                (float)positionResult.Top,
                (float)positionResult.Width,
                (float)positionResult.Height);
        }
        private bool LookForAutomationIdentifer(AutomationIdentifier automationIdentifier)
        {
            var command = new GetPositionCommand() { AutomationIdentifier = automationIdentifier, ReturnEmptyIfNotVisible = true };
            var result = SyncLookExecuteCommand(command) as PositionResult;
            if (result == null)
                return false;

            // check that position is not empty
            return (result.Width + result.Height > 0.0);
        }