Exemple #1
0
        public SUIHtmlAnchor SearchHtmlAnchorByHref(string href, int index)
        {
            List <SUIHtmlControlBase> list = GetElementsByTagName("A");
            int i = 0;

            foreach (SUIHtmlControlBase ctrl in list)
            {
                if (SUIHtmlAnchor.IsAnchorElement(ctrl))
                {
                    SUIHtmlAnchor anchor = new SUIHtmlAnchor(ctrl);
                    if ((anchor.NameProp != null && anchor.NameProp.Equals(href)) ||
                        (anchor.NameProp == null && href == null))
                    {
                        if (i == index)
                        {
                            return(anchor);
                        }
                        i++;
                    }
                }
            }
            return(null);
        }
Exemple #2
0
        public SUIHtmlAnchor SearchHtmlAnchorByText(string text, int index)
        {
            List <SUIHtmlControlBase> list = GetElementsByTagName("A");
            int i = 0;

            foreach (SUIHtmlControlBase ctrl in list)
            {
                if (SUIHtmlAnchor.IsAnchorElement(ctrl))
                {
                    SUIHtmlAnchor anchor = new SUIHtmlAnchor(ctrl);
                    if ((ctrl.InnerText != null && ctrl.InnerText.Equals(text)) ||
                        (ctrl.InnerText == null && text == null))
                    {
                        if (i == index)
                        {
                            //SUIHtmlAnchor anchor = new SUIHtmlAnchor(ctrl);
                            return(anchor);
                        }
                        i++;
                    }
                }
            }
            return(null);
        }
Exemple #3
0
 public SUIHtmlAnchor SearchHtmlAnchorByHref(string href, int index)
 {
     List<SUIHtmlControlBase> list = GetElementsByTagName("A");
     int i = 0;
     foreach (SUIHtmlControlBase ctrl in list)
     {
         if (SUIHtmlAnchor.IsAnchorElement(ctrl))
         {
             SUIHtmlAnchor anchor = new SUIHtmlAnchor(ctrl);
             if ((anchor.NameProp != null && anchor.NameProp.Equals(href)) ||
                 (anchor.NameProp == null && href == null))
             {
                 if (i == index)
                 {
                     return anchor;
                 }
                 i++;
             }
         }
     }
     return null;
 }
Exemple #4
0
 public SUIHtmlAnchor SearchHtmlAnchorByText(string text, int index)
 {
     List<SUIHtmlControlBase> list = GetElementsByTagName("A");
     int i = 0;
     foreach (SUIHtmlControlBase ctrl in list)
     {
         if (SUIHtmlAnchor.IsAnchorElement(ctrl))
         {
             SUIHtmlAnchor anchor = new SUIHtmlAnchor(ctrl);
             if ((ctrl.InnerText != null && ctrl.InnerText.Equals(text)) ||
                 (ctrl.InnerText == null && text == null))
             {
                 if (i == index)
                 {
                     //SUIHtmlAnchor anchor = new SUIHtmlAnchor(ctrl);
                     return anchor;
                 }
                 i++;
             }
         }
     }
     return null;
 }