/// <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 root, IList elements)
 {
     if (root != null && elements != null)
     {
         XmlNodeList nodes = root.SelectNodes("parameters/parameter");
         foreach (XmlNode node in nodes)
         {
             if (node.NodeType == XmlNodeType.Comment)
             {
                 continue;
             }
             ParameterElement element = new ParameterElement();
             element.Name  = GetAttributeValue(node, NAME, element.Name);
             element.Value = GetAttributeValue(node, VALUE, element.Value);
             elements.Add(element);
         }
     }
 }
        public static ArrayList ParseFromXml(Configuration options, XmlNode root, ParserValidationDelegate vd)
        {
            ArrayList   elements = new ArrayList();
            XmlNodeList nodes    = root.SelectNodes("parameters/parameter");

            foreach (XmlNode node in nodes)
            {
                if (node.NodeType == XmlNodeType.Comment)
                {
                    continue;
                }
                ParameterElement element = new ParameterElement();
                element.Name  = GetAttributeValue(node, NAME, element.Name);
                element.Value = GetAttributeValue(node, VALUE, element.Value);
                elements.Add(element);
            }
            return(elements);
        }
Example #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);
        }