public void SetUp()
        {
            document = new XmlDocument();
            document.Load("Topics.xml");

            theStack = new TopicXmlStack(theRootDirectory);
        }
Example #2
0
        private void walkFolderNode(TopicXmlStack stack, XmlElement child)
        {
            var folder = child.Name;
            stack.PushFolder(folder);

            walkChildren(child, stack);

            stack.PopFolder();
        }
Example #3
0
        private void walkFolderNode(TopicXmlStack stack, XmlElement child)
        {
            var folder = child.Name;

            stack.PushFolder(folder);

            walkChildren(child, stack);

            stack.PopFolder();
        }
Example #4
0
        private void walkTopicNode(TopicXmlStack stack, XmlElement child)
        {
            var request = stack.AddTopic(child);
            if (child.HasChildNodes)
            {
                stack.PushTopic(request);

                walkChildren(child, stack);

                stack.PopTopic();
            }
        }
Example #5
0
        public TopicRequest Parse(string directory, XmlDocument document)
        {
            var element = document.DocumentElement;
            var stack = new TopicXmlStack(directory);

            var request = stack.AddTopic(element);
            stack.PushTopic(request);

            walkChildren(element, stack);

            return request;
        }
Example #6
0
        private void walkTopicNode(TopicXmlStack stack, XmlElement child)
        {
            var request = stack.AddTopic(child);

            if (child.HasChildNodes)
            {
                stack.PushTopic(request);

                walkChildren(child, stack);

                stack.PopTopic();
            }
        }
Example #7
0
        public TopicRequest Parse(string directory, XmlDocument document)
        {
            var element = document.DocumentElement;
            var stack   = new TopicXmlStack(directory);

            var request = stack.AddTopic(element);

            stack.PushTopic(request);

            walkChildren(element, stack);

            return(request);
        }
Example #8
0
        // assume that topic has been pushed before you get here!
        private void walkChildren(XmlElement element, TopicXmlStack stack)
        {
            foreach (XmlNode node in element.ChildNodes)
            {
                var child = node as XmlElement;
                if (child == null) continue;

                if (child.Name == "Topic")
                {
                    walkTopicNode(stack, child);
                }
                else
                {
                    walkFolderNode(stack, child);
                }
            }
        }
Example #9
0
        // assume that topic has been pushed before you get here!
        private void walkChildren(XmlElement element, TopicXmlStack stack)
        {
            foreach (XmlNode node in element.ChildNodes)
            {
                var child = node as XmlElement;
                if (child == null)
                {
                    continue;
                }

                if (child.Name == "Topic")
                {
                    walkTopicNode(stack, child);
                }
                else
                {
                    walkFolderNode(stack, child);
                }
            }
        }