Ejemplo n.º 1
0
 public static bool ClickThis(this Ranorex.MenuItem item)
 {
     System.Threading.Thread.Sleep(200);
     item.Click();
     System.Threading.Thread.Sleep(200);
     return(true);
 }
Ejemplo n.º 2
0
 public static void ClickThis(this Ranorex.MenuItem item)
 {
     try
     {
         item.Click();
         Sleep();
     }
     catch (Exception ex)
     {
         throw new Exception("MenuItem Click Failed : " + ex.Message);
     }
 }
Ejemplo n.º 3
0
        public static bool DoEnable(ListItem item, bool isEnable)
        {
            bool isActionSucceeded = false;

            if (isEnable)
            {
                // do enable
                item.Click(System.Windows.Forms.MouseButtons.Right);
                Delay.Milliseconds(1000);
                // select disable
                Ranorex.MenuItem menuitem = repo.ContextMenu.Self.FindSingle <Ranorex.MenuItem>("./?/?/menuitem[@accessiblename='Enable']");
                menuitem.Click();
                int i = 0;
                do
                {
                    Delay.Milliseconds(3000);
                    Text   text   = item.FindSingle <Text>("./text[@childindex=3]");
                    string status = text.TextValue;
                    if (status != "Not connected" && status != "Identifing..." && status != "Disabled" && status != "Network cable unplugged" && status != "Unidentified network")
                    {
                        isActionSucceeded = true;
                        break;
                    }
                    i++;
                }while(i < 3);
            }
            else
            {
                // do disable
                item.Click(System.Windows.Forms.MouseButtons.Right);
                Delay.Milliseconds(1000);
                // select disable
                Ranorex.MenuItem menuitem = repo.ContextMenu.Self.FindSingle <Ranorex.MenuItem>("./?/?/menuitem[@accessiblename='Disable']");
                menuitem.Click();
                int i = 0;
                do
                {
                    Delay.Milliseconds(3000);
                    Text   text   = item.FindSingle <Text>("./text[@childindex=3]");
                    string status = text.TextValue;
                    if (status == "Disabled")
                    {
                        isActionSucceeded = true;
                        break;
                    }
                    i++;
                }while(i < 3);
            }
            return(isActionSucceeded);
        }