本文整理汇总了C#中System.Windows.Automation.ControlType.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# ControlType.Equals方法的具体用法?C# ControlType.Equals怎么用?C# ControlType.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Automation.ControlType
的用法示例。
在下文中一共展示了ControlType.Equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HasPrimaryChildren
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);
}
示例2: HasPrimaryChildren
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;
}
示例3: actuateStandardControl
/// <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;
}