Ejemplo n.º 1
0
        public void SetUp()
        {
            document = new XmlDocument();
            document.Load("Topics.xml");

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

            walkChildren(child, stack);

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

            stack.PushFolder(folder);

            walkChildren(child, stack);

            stack.PopFolder();
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 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);
                }
            }
        }