Пример #1
0
        public void CleanAttributes(TreeRoot root)
        {
            AttributeCleaner cleaner = new AttributeCleaner();
            TreeNode         current = root.Child;

            CleanAttributesChild(current, cleaner);
        }
Пример #2
0
        public void CheckForNotClosedTags(TreeRoot root)
        {
            TreeNode current = root.Child;

            current.Closed = true;
            CheckForNotClosedTagsChild(current, root);
        }
Пример #3
0
        public void RemoveUnwantedTags(TreeRoot root)
        {
            TagCleaner cleaner = new TagCleaner();
            TreeNode   current = root.Child;

            RemoveUnwantedTagChild(current, cleaner, root);
        }
Пример #4
0
        void BuildTree(string file)
        {
            var root = new TreeRoot();

            root.BuildTree(file);
            roots.Add(root);
        }
Пример #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);
     }
 }
Пример #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);
     }
 }
Пример #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);
         }
     }
 }
Пример #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);
     }
 }
Пример #9
0
 public void GenerateInLogger(TreeRoot root)
 {
     Logger.WriteLine(root.Doctype);
     this.SetDataForNodeLogger(root.Child);
 }