Exemplo n.º 1
0
 public virtual bool HasPrimaryChildren(ControlType controlType)
 {
     if (controlType.Equals(ControlType.Custom)) return true;
     var results = items.FindBy(controlType).ToArray();
     if (!results.Any()) throw new ControlDictionaryException("Could not find control of type " + controlType.LocalizedControlType);
     return results.Any(i => i.HasPrimaryChildren);
 }
Exemplo n.º 2
0
 public virtual bool HasPrimaryChildren(ControlType controlType)
 {
     if (controlType.Equals(ControlType.Custom)) return true;
     ControlDictionaryItem item = items.FindBy(controlType);
     if (item == null) throw new ControlDictionaryException("Could not find control of type " + controlType.LocalizedControlType);
     return item.HasPrimaryChildren;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Actuates a standard windows control such as a button,
        /// checkbox etc.
        /// </summary>
        /// <param name="ctrlType">Type of the control</param>
        /// <returns>true if the element is a windows control</returns>
        protected bool actuateStandardControl(ControlType ctrlType)
        {
            bool handled = true;

            if (ctrlType.Equals(ControlType.Button) ||
                ctrlType.Equals(ControlType.CheckBox) ||
                ctrlType.Equals(ControlType.RadioButton))
            {
                AgentManager.Instance.Keyboard.Send(Keys.Space);
            }
            else if (ctrlType.Equals(ControlType.ListItem))
            {
                AgentManager.Instance.Keyboard.Send(Keys.Enter);
            }
            else
            {
                handled = false;
            }

            return handled;
        }