private void AddMember(TreeNode parent, Member m) { TreeNode node = parent.Nodes.Add(m.Name); if (m is Category) { foreach (Member m1 in m.Children) { AddMember(node, m1); } } else { Leaf l = (Leaf)m; node.Nodes.Add(l.Address); node.Nodes.Add(l.Coords); foreach (String x in l.Phones) { node.Nodes.Add(x); } foreach (String x in l.Sites) { node.Nodes.Add(x); } } }
public Form1() { InitializeComponent(); // look for the old data in temp direcotry Object oldData = DeserializeData(); if (oldData != null) { root = (Category)oldData; HasOldData = root.Children.Count > 0; currentMember = root.getNextUnprocessed(); hasUnfinishedData = currentMember != null; } else { NewSession(); } IsBusy = false; }
private void ProcessMember() { if (currentMember != null) { currentMember.Process(browser.Document); currentMember = root.getNextUnprocessed(); if (currentMember != null) { HasUnfinishedData = true; browser.Navigate(currentMember.Url); } else { HasUnfinishedData = false; IsBusy = false; } } else IsBusy = false; }
private void NewSession() { root = new Category("root", startUri, true); currentMember = root; HasOldData = false; HasUnfinishedData = false; }