本文整理汇总了C#中Link.Click方法的典型用法代码示例。如果您正苦于以下问题:C# Link.Click方法的具体用法?C# Link.Click怎么用?C# Link.Click使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Link
的用法示例。
在下文中一共展示了Link.Click方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetItemFromTelerikComboBox
/// <summary>
/// Returns a item from a telerik "select list" element
/// </summary>
/// <param name="comboBoxLink">The link object that expands the drop down. Ex. ModuleComboBox</param>
/// <param name="comboBoxDiv">The div object containing all of the list items for the drop down. Ex. ModuleSelectDiv</param>
/// <param name="selectListClass">The class to filter all of the items within the comboBoxDiv by.
/// The currently selected item will have the class "rcbHovered ", all others will have the class "rcbItem ".</param>
/// <param name="ItemText">The text of the item in the drop down.</param>
/// <returns>The list item from the drop down, considered an Element object instead of a list item.</returns>
public Element GetItemFromTelerikComboBox(Link comboBoxLink, Div comboBoxDiv, string selectListClass, string ItemText)
{
//Click Drop down
comboBoxLink.Click();
System.Threading.Thread.Sleep(1500);
//Find Item to Select
//Find all List Item elements that match the class
ElementCollection selectListElements = comboBoxDiv.Elements.Filter(Find.ByClass(selectListClass));
Element result = null;
//Search for the desired Element
foreach (Element e in selectListElements)
{
if (e.InnerHtml.Contains(ItemText))
{
//Found the Element
result = e;
break;
}
continue;
}
return result;
}