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); }
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); }
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; }
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; }