Ejemplo n.º 1
0
        public void CleanAttributes(TreeRoot root)
        {
            AttributeCleaner cleaner = new AttributeCleaner();
            TreeNode         current = root.Child;

            CleanAttributesChild(current, cleaner);
        }
Ejemplo n.º 2
0
        public void CheckForNotClosedTags(TreeRoot root)
        {
            TreeNode current = root.Child;

            current.Closed = true;
            CheckForNotClosedTagsChild(current, root);
        }
Ejemplo n.º 3
0
        public void RemoveUnwantedTags(TreeRoot root)
        {
            TagCleaner cleaner = new TagCleaner();
            TreeNode   current = root.Child;

            RemoveUnwantedTagChild(current, cleaner, root);
        }
Ejemplo n.º 4
0
        void BuildTree(string file)
        {
            var root = new TreeRoot();

            root.BuildTree(file);
            roots.Add(root);
        }
Ejemplo n.º 5
0
 public void GenerateFile(TreeRoot root)
 {
     File.Move(root.FilePath, root.FilePath + "_copy");
     current_level++;
     using (StreamWriter writer = new StreamWriter(root.FilePath))
     {
         writer.WriteLine(root.Doctype);
         this.SetDataForNodeFile(root.Child, writer);
     }
 }
Ejemplo n.º 6
0
 public void GenerateOutput(TreeRoot root)
 {
     if (root == null)
     {
         Logger.WriteLine("Plik nie został załadowany");
     }
     else
     {
         OutputGenerator generator = new OutputGenerator();
         generator.Generate(root);
     }
 }
Ejemplo n.º 7
0
 void RemoveUnwantedTagChild(TreeNode node, TagCleaner cleaner, TreeRoot root)
 {
     if (cleaner.TagRemover(node) != 1)
     {
         try
         {
             foreach (TreeNode current in node.Children)
             {
                 RemoveUnwantedTagChild(current, cleaner, root);
             }
         }
         catch
         {
             RemoveUnwantedTags(root);
         }
     }
 }
Ejemplo n.º 8
0
 void CheckForNotClosedTagsChild(TreeNode node, TreeRoot root)
 {
     if (!node.Closed)
     {
         if (Dictionaries.Instance.TagWithOptionalClosing.ContainsKey(node.Name))
         {
             Logger.WriteLine("[" + Path.GetFileName(root.FilePath) + "]" + "Warning! The " + node.Name + " tag which starts at " + node.LineNumber + " line should have closing");
         }
         else
         {
             throw new Exception("[" + Path.GetFileName(root.FilePath) + "]" + "Error! The " + node.Name + " tag which starts at " + node.LineNumber + " line does not have closing");
         }
     }
     foreach (TreeNode current in node.Children)
     {
         CheckForNotClosedTagsChild(current, root);
     }
 }
Ejemplo n.º 9
0
 public void GenerateInLogger(TreeRoot root)
 {
     Logger.WriteLine(root.Doctype);
     this.SetDataForNodeLogger(root.Child);
 }