internal HdaBrowseNode Browse(string address) { var browseElements = _browser.Browse(new ItemIdentifier(string.IsNullOrWhiteSpace(address) ? null : address)); var root = new HdaBrowseNode { Tag = string.IsNullOrEmpty(address) ? "" : address, Name = string.IsNullOrEmpty(address) ? "Root" : address, Root = true, HasChildren = browseElements.Length > 0 }; this.GetNodes(root, browseElements); return(root); }
private void ProccessPage() { string url = _repo.GetNextUrl(); if (url == null) { Stop(); return; } string html = _browser.Browse(url); if (IsInvalidPage(html)) { return; } if (_checker.IsSearched(url, html)) { _repo.AddFound(url); OnFound(new FoundEventArgs(url)); } else { _repo.AddVisited(url); } _repo.Enqueue(_extractor.ExtractUrls(html, url)); }
static void Main(string[] args) { Smartphone smartphone = new Smartphone(); ICaller caller = smartphone; string[] phoneNumbers = Console.ReadLine().Split(); caller.Call(phoneNumbers); IBrowser browser = smartphone; string[] urls = Console.ReadLine().Split(); browser.Browse(urls); }