本文整理汇总了C#中ActionListener类的典型用法代码示例。如果您正苦于以下问题:C# ActionListener类的具体用法?C# ActionListener怎么用?C# ActionListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ActionListener类属于命名空间,在下文中一共展示了ActionListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ScrollBar
protected ScrollBar(AutomationElement automationElement, ActionListener actionListener, ScrollBarButtonAutomationIds automationIds)
: base(automationElement, actionListener)
{
this.automationIds = automationIds;
var finder = new AutomationElementFinder(automationElement);
primaryUIItemFactory = new PrimaryUIItemFactory(finder);
}
示例2: GetToolTip
private ToolTip GetToolTip(UIItem uiItem, ActionListener actionListener)
{
mouse.Click(uiItem.Bounds.Center());
actionListener.ActionPerformed(Action.WindowMessage);
Thread.Sleep(CoreAppXmlConfiguration.Instance.TooltipWaitTime);
return ToolTip.GetFrom(uiItem.Bounds.Center());
}
示例3: addActionListener
public void addActionListener(ActionListener actionListener)
{
lock (actionListeners)
{
actionListeners.Add(actionListener);
}
}
示例4: Create
private IUIItem Create(ContainerItemFactory containerItemFactory, SearchCriteria searchCriteria, ActionListener actionListener)
{
IUIItem item = containerItemFactory.Get(searchCriteria, actionListener);
if (item == null) return null;
windowItemsMap.Add(item.Location, searchCriteria);
return item;
}
示例5: UIItem
public UIItem(AutomationElement automationElement, ActionListener actionListener)
{
if (null == automationElement) throw new NullReferenceException();
this.automationElement = automationElement;
this.actionListener = actionListener;
factory = new PrimaryUIItemFactory(new AutomationElementFinder(automationElement));
}
示例6: ScrollBars
public ScrollBars(AutomationElement automationElement, ActionListener actionListener,
ScrollBarButtonAutomationIds hScrollBarButtonAutomationIds, ScrollBarButtonAutomationIds vScrollBarButtonAutomationIds) {
this.actionListener = actionListener;
this.hScrollBarButtonAutomationIds = hScrollBarButtonAutomationIds;
this.vScrollBarButtonAutomationIds = vScrollBarButtonAutomationIds;
finder = new AutomationElementFinder(automationElement);
}
示例7: WaitTill
private static SuggestionList WaitTill(ActionListener actionListener, string failureMessage, Clock.Matched matched)
{
Clock.Do getSuggestionList = () => Find(actionListener);
Clock.Expired onExpiration = delegate { throw new UIActionException(failureMessage + Constants.BusyMessage); };
return
(SuggestionList) new Clock(CoreAppXmlConfiguration.Instance.SuggestionListTimeout).Perform(getSuggestionList, matched, onExpiration);
}
示例8: CreateBars
internal static IScrollBars CreateBars(AutomationElement parentElement, ActionListener listener)
{
var frameworkId = parentElement.Current.FrameworkId;
if (frameworkId == Constants.WPFFrameworkId)
return new WPFScrollBars(parentElement, listener);
if (frameworkId == Constants.SilverlightFrameworkId)
return new ScrollBars(parentElement, listener, new SilverlightHScrollBarButtonAutomationIds(), new SilverlightVScrollBarButtonAutomationIds());
return new ScrollBars(parentElement, listener, new DefaultScrollBarButtonAutomationIds(), new DefaultScrollBarButtonAutomationIds());
}
示例9: Get
public virtual IUIItem Get(SearchCriteria searchCriteria, ActionListener uiItemActionListener)
{
IUIItem item = Find(searchCriteria);
if (item == null || item is UIItemContainer)
{
//Cannot create dynamic proxy for class which has methods using generics. Also its not required to intercept methods on UIItem containers
return item;
}
return UIItemProxyFactory.Create(item, uiItemActionListener);
}
示例10: Create
public virtual IUIItem Create(SearchCriteria searchCriteria, ActionListener actionListener)
{
if (searchCriteria.IsIndexed)
{
UIItemCollection collection = CreateAll(searchCriteria, actionListener);
return searchCriteria.IndexedItem(collection);
}
return dictionaryMappedItemFactory.Create(Finder.Descendant(searchCriteria.AutomationCondition), actionListener,
searchCriteria.CustomItemType);
}
示例11: TableScrollBars
public TableScrollBars(AutomationElementFinder finder, ActionListener actionListener, TableVerticalScrollOffset tableVerticalScrollOffset)
{
AutomationElement verticalScrollElement = finder.Child(AutomationSearchCondition.ByControlType(ControlType.Pane).OfName(UIItemIdAppXmlConfiguration.Instance.TableVerticalScrollBar));
verticalScrollBar = (verticalScrollElement == null)
? (IVScrollBar) new NullVScrollBar()
: new TableVerticalScrollBar(verticalScrollElement, actionListener, tableVerticalScrollOffset);
AutomationElement horizontalScrollElement = finder.Child(AutomationSearchCondition.ByControlType(ControlType.Pane).OfName(UIItemIdAppXmlConfiguration.Instance.TableHorizontalScrollBar));
horizontalScrollBar = (horizontalScrollElement == null)
? (IHScrollBar) new NullHScrollBar()
: new TableHorizontalScrollBar(horizontalScrollElement, actionListener);
}
示例12: TryGetPopupMenu
private bool TryGetPopupMenu(AutomationSearchCondition[] searchConditions, ActionListener actionListener, out PopUpMenu popUpMenu)
{
var element = Retry.For(() => Finder.Child(searchConditions), CoreAppXmlConfiguration.Instance.PopupTimeout(), TimeSpan.FromMilliseconds(100));
if (element == null)
{
popUpMenu = null;
return false;
}
popUpMenu = new PopUpMenu(element, actionListener);
return true;
}
示例13: WPFPopupMenu
public virtual PopUpMenu WPFPopupMenu(ActionListener actionListener)
{
var searchConditions = new[]
{
AutomationSearchCondition.ByControlType(ControlType.Window),
AutomationSearchCondition.ByControlType(ControlType.Menu)
};
PopUpMenu popUpMenu;
TryGetPopupMenu(searchConditions, actionListener, out popUpMenu);
return popUpMenu;
}
示例14: WaitTill
private static SuggestionList WaitTill(ActionListener actionListener, string failureMessage, Predicate<SuggestionList> shouldRetry)
{
try
{
return Retry.For(() => Find(actionListener), shouldRetry, CoreAppXmlConfiguration.Instance.SuggestionListTimeout);
}
catch (Exception ex)
{
throw new UIActionException(failureMessage + Constants.BusyMessage, ex);
}
}
示例15: Find
private static SuggestionList Find(ActionListener actionListener)
{
AutomationElement dropDown =
new AutomationElementFinder(AutomationElement.RootElement).Child(AutomationSearchCondition.ByClassName("Auto-Suggest Dropdown"));
if (dropDown == null) return null;
AutomationElement listViewElement =
new AutomationElementFinder(dropDown).Child(AutomationSearchCondition.ByControlType(ControlType.DataGrid));
if (listViewElement == null) return null;
return new ListView(listViewElement, actionListener);
}