Esempio n. 1
0
 /// <summary>
 /// Parse only method. Parses and adds all entities found in the given node and adds them to the given
 /// list.
 /// </summary>
 /// <param name="node"></param>
 /// <param name="taskElements"></param>
 public static void ParseFromXml(XmlNode node, IList elements)
 {
     if (node != null && elements != null)
     {
         XmlNodeList excludes = node.SelectNodes("excludes/exclude");
         foreach (XmlNode exclude in excludes)
         {
             if (exclude.NodeType == XmlNodeType.Comment)
             {
                 continue;
             }
             ExcludeElement element = new ExcludeElement();
             element.Name = GetAttributeValue(exclude, NAME, element.Name);
             elements.Add(element);
         }
     }
 }
Esempio n. 2
0
        public static ArrayList ParseFromXml(Configuration options, XmlNode node, ParserValidationDelegate vd)
        {
            ArrayList   elements = new ArrayList();
            XmlNodeList excludes = node.SelectNodes("excludes/exclude");

            foreach (XmlNode exclude in excludes)
            {
                if (exclude.NodeType == XmlNodeType.Comment)
                {
                    continue;
                }
                ExcludeElement element = new ExcludeElement();
                element.Name = GetAttributeValue(exclude, NAME, element.Name);
                elements.Add(element);
            }
            return(elements);
        }
Esempio n. 3
0
        public static ArrayList ParseFromXml(Configuration options, XmlNode root, ParserValidationDelegate vd)
        {
            ArrayList   list  = new ArrayList();
            XmlNodeList nodes = root.SelectNodes("tasks/task");

            foreach (XmlNode node in nodes)
            {
                if (node.NodeType == XmlNodeType.Comment)
                {
                    continue;
                }
                TaskElement task = new TaskElement();
                task.Name           = node.Attributes["name"].Value;
                task.Element        = node.Attributes["element"].Value;
                task.Template       = node.Attributes["template"].Value;
                task.Directory      = node.Attributes["directory"].Value;
                task.FileNameFormat = node.Attributes["filenameformat"].Value;
                if (node.Attributes[BACKUP_DIRECTORY] != null)
                {
                    task.BackupDirectory = node.Attributes["backupdirectory"].Value;
                }
                else
                {
                    task.BackupDirectory = task.Directory;
                }
                if (!node.InnerText.Equals(String.Empty))
                {
                    task.Description = node.InnerText;
                }
                task.Includes   = IncludeElement.ParseFromXml(options, node, vd);
                task.Excludes   = ExcludeElement.ParseFromXml(options, node, vd);
                task.Parameters = ParameterElement.ParseFromXml(options, node, vd);
                task.Writer     = GetAttributeValue(node, WRITER, task.Writer);
                task.Styler     = GetAttributeValue(node, STYLER, task.Styler);
                TypeElement.ParseFromXml(node, task.Types);

                list.Add(task);
            }
            return(list);
        }