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);
                }
            }
        }
Beispiel #2
0
        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;
        }
Beispiel #3
0
 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;
 }
Beispiel #4
0
 private void NewSession()
 {
     root = new Category("root", startUri, true);
     currentMember = root;
     HasOldData = false;
     HasUnfinishedData = false;
 }