public void Load() { Global.flag = false; if (Root != null) { Root.ChildElements.Clear(); } browser.SendProcessMessage(CefProcessId.Renderer, CefProcessMessage.Create("GetDocument")); while (!Global.flag) { } _root = Global.RootList[browser.Identifier]; CefCookieManager.Global.VisitUrlCookies(browser.GetMainFrame().Url, true, new CwbCookieVisitor(CwbCookieStyle.csVisitUrlCookie, this)); }
private CwbElement GetElementById(string id, CwbElement parent) { foreach (CwbElement e in parent.ChildElements) { if (e.Id.ToUpper() == id.ToUpper()) { return(e); } CwbElement element = GetElementById(id, e); if (element != null) { if (element.Id.ToUpper() == id.ToUpper()) { return(element); } } } return(null); }
private List <CwbElement> GetElementsByTagName(string tagName, CwbElement parent) { List <CwbElement> list = new List <CwbElement>(); foreach (CwbElement e in parent.ChildElements) { if (string.IsNullOrEmpty(e.TagName)) { continue; } List <CwbElement> items = GetElementsByTagName(tagName, e); if (e.TagName.ToUpper() == tagName.ToUpper()) { list.Add(e); } list.AddRange(items); } return(list); }