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

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

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

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

            root.BuildTree(file);
            roots.Add(root);
        }
Esempio 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);
     }
 }
Esempio 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);
     }
 }
Esempio 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);
         }
     }
 }
Esempio 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);
     }
 }
Esempio n. 9
0
 public void GenerateInLogger(TreeRoot root)
 {
     Logger.WriteLine(root.Doctype);
     this.SetDataForNodeLogger(root.Child);
 }