File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,11 @@ namespace TestStack.White.UIItems.MenuItems
1212{
1313 public class Menus : UIItemList < Menu >
1414 {
15- private static readonly DictionaryMappedItemFactory Factory = new DictionaryMappedItemFactory ( ) ;
15+ static readonly DictionaryMappedItemFactory Factory = new DictionaryMappedItemFactory ( ) ;
1616
1717 public Menus ( AutomationElement parent , ActionListener actionListener )
1818 {
19+ if ( parent == null ) throw new ArgumentNullException ( "parent" , "You must specify a parent automation id when creating a menu" ) ;
1920 AutomationSearchCondition condition = AutomationSearchCondition . ByControlType ( ControlType . MenuItem ) ;
2021 var finder = new AutomationElementFinder ( parent ) ;
2122 finder = PerformanceHackAsPopupMenuForWin32AppComesOnDesktop ( finder , parent ) ;
Original file line number Diff line number Diff line change @@ -6,28 +6,26 @@ namespace TestStack.White.UIItems.MenuItems
66{
77 public class PopUpMenu : UIItem
88 {
9- private readonly Menus topLevelMenus ;
109 protected PopUpMenu ( ) { }
1110
1211 public PopUpMenu ( AutomationElement automationElement , ActionListener actionListener ) : base ( automationElement , actionListener )
1312 {
1413 this . actionListener = actionListener ;
15- topLevelMenus = new Menus ( automationElement , actionListener ) ;
1614 }
1715
1816 public virtual Menus Items
1917 {
20- get { return topLevelMenus ; }
18+ get { return new Menus ( automationElement , actionListener ) ; }
2119 }
2220
2321 public virtual Menu Item ( params string [ ] text )
2422 {
25- return topLevelMenus . Find ( text ) ;
23+ return Items . Find ( text ) ;
2624 }
2725
2826 public virtual Menu ItemBy ( params SearchCriteria [ ] path )
2927 {
30- return topLevelMenus . Find ( path ) ;
28+ return Items . Find ( path ) ;
3129 }
3230 }
3331}
You can’t perform that action at this time.
0 commit comments