Esempio n. 1
0
        public void Click(string itemText)
        {
            MsoCommandBarItemPopup target = null;

            foreach (MsoCommandBarItemPopup item in ItemList)
            {
                if (item != null && item.Name.Equals(itemText))
                {
                    target = item;
                    break;
                }
            }
            if (target != null)
            {
                target.Click();
            }
        }
Esempio n. 2
0
 private void InitToolBar()
 {
     if (this.WindowHandle != null)
     {
         CurAccessibile = new SUIAccessibility(WindowHandle, AccType.NativeOM);
         int count = CurAccessibile.ChildCount;
         itemList = new MsoCommandBarItemPopup[count];
         int index = 0;
         for (int i = 1; i <= count; i++)
         {
             if (CurAccessibile.Children[i].IsVisible || CurAccessibile.Children[i].Height > 0)//Judge whether it is visible not only by property IsVisible but also Height
             {
                 itemList[index] = new MsoCommandBarItemPopup(CurAccessibile.Children[i]);
                 index++;
             }
         }
     }
 }
Esempio n. 3
0
        public SUIMsoCommandBarPopup PopupSubMenu(string itemText)
        {
            MsoCommandBarItemPopup target = null;

            foreach (MsoCommandBarItemPopup item in ItemList)
            {
                if (item != null && item.Name.Equals(itemText))
                {
                    target = item;
                    break;
                }
            }
            if (target != null)
            {
                target.Click();
                SUISleeper.Sleep(500);
                SUIWinAPIs.EnumWindows(new EnumSMARTUIWindowsProc(this.FindPopupMenu), 0);
                return(popupedMenu);
            }
            return(null);
        }
Esempio n. 4
0
 private void InitToolBar()
 {
     if (this.WindowHandle != null)
     {
         CurAccessibile = new SUIAccessibility(WindowHandle, AccType.NativeOM);
         int count = CurAccessibile.ChildCount;
         itemList = new MsoCommandBarItemPopup[count];
         int index = 0;
         for (int i = 1; i <= count; i++)
         {
             if (CurAccessibile.Children[i].IsVisible || CurAccessibile.Children[i].Height > 0)//Judge whether it is visible not only by property IsVisible but also Height
             {
                 itemList[index] = new MsoCommandBarItemPopup(CurAccessibile.Children[i]);
                 index++;
             }
         }
     }
 }