public PageObjectProxy(PassengerConfiguration configuration) { _configuration = configuration; _typeSubstitution = new TypeSubstitutionHandler(configuration); _elementSelectionHandler = new ElementSelectionHandler(configuration); _postProcessor = new ReturnValuePostProcessor(configuration); }
public void Setup() { _someDivPropertyInfo = typeof(SelectionTestClass).GetProperty("SomeDiv"); _idAttribute = _someDivPropertyInfo.GetCustomAttribute <IdAttribute>(); _navHandlers = new List <DriverBindings.IHandle>(); _mockDriver = new Mock <IDriverBindings>(); _mockDriver.Setup(x => x.NavigationHandlers).Returns(_navHandlers); var cfg = new PassengerConfiguration { Driver = _mockDriver.Object }; _handler = new ElementSelectionHandler(cfg); }
private ContextMenu CreateElementSelectionMenu(Action <IModeElement> selectionAction) { ContextMenu menu = new ContextMenu(); foreach (IMode mode in m_Project.GetModes()) { MenuItem menuItem = new MenuItem(mode.Title); foreach (IModeElement modeElement in mode.GetElements()) { if (modeElement.StartElement == m_ContainingMacro) { continue; } ElementSelectionHandler handler = new ElementSelectionHandler(selectionAction, modeElement); MenuItem elementItem = new MenuItem(modeElement.Title, new EventHandler(handler.HandleEvent)); menuItem.MenuItems.Add(elementItem); } menu.MenuItems.Add(menuItem); } return(menu); }