Пример #1
0
        public SUIHtmlInputButton SearchHtmlInputButtonByID(string id, int index)
        {
            List <SUIHtmlControlBase> list = GetElementsByTagName("INPUT");
            int    i      = 0;
            Regex  regex  = new Regex("[0-9]+");
            string ctrlID = null;

            foreach (SUIHtmlControlBase ctrl in list)
            {
                if (SUIHtmlInputButton.IsInputButtonElement(ctrl))
                {
                    if (ctrl.ID != null)
                    {
                        ctrlID = regex.Replace(ctrl.ID, "*");
                    }
                    if ((ctrl.ID != null && ctrlID.Equals(id)) ||
                        (ctrl.ID == null && id == null))
                    {
                        if (i == index)
                        {
                            SUIHtmlInputButton inputButton = new SUIHtmlInputButton(ctrl);
                            return(inputButton);
                        }
                        i++;
                    }
                }
            }
            return(null);
        }
Пример #2
0
 public SUIHtmlInputButton SearchHtmlInputButtonByID(string id, int index)
 {
     List<SUIHtmlControlBase> list = GetElementsByTagName("INPUT");
     int i = 0;
     Regex regex = new Regex("[0-9]+");
     string ctrlID = null;
     foreach (SUIHtmlControlBase ctrl in list)
     {
         if (SUIHtmlInputButton.IsInputButtonElement(ctrl))
         {
             if (ctrl.ID != null)
                 ctrlID = regex.Replace(ctrl.ID, "*");
             if ((ctrl.ID != null && ctrlID.Equals(id)) ||
                 (ctrl.ID == null && id == null))
             {
                 if (i == index)
                 {
                     SUIHtmlInputButton inputButton = new SUIHtmlInputButton(ctrl);
                     return inputButton;
                 }
                 i++;
             }
         }
     }
     return null;
 }