Load() public static method

Loads the specified modifier by name.
public static Load ( string modifier ) : IValueModifier
modifier string The modifier.
return IValueModifier
Example #1
0
 private void loadActionNodes()
 {
     actionNodes = new Dictionary <string, ScraperNode>();
     foreach (XmlNode currAction in xml.DocumentElement.SelectNodes("child::action"))
     {
         ActionNode newNode = (ActionNode)ScraperNode.Load(currAction, this);
         if (newNode != null && newNode.LoadSuccess)
         {
             actionNodes[newNode.Name] = newNode;
         }
         else
         {
             logger.Error("Error loading action node: " + currAction.OuterXml);
             loadSuccessful = false;
         }
     }
 }
Example #2
0
        protected bool loadChildren()
        {
            bool success = true;

            children.Clear();
            foreach (XmlNode currXmlNode in xmlNode.ChildNodes)
            {
                ScraperNode newScraperNode = ScraperNode.Load(currXmlNode, ScriptSettings);
                if (newScraperNode != null && newScraperNode.loadSuccess)
                {
                    children.Add(newScraperNode);
                }

                if (newScraperNode != null && !newScraperNode.loadSuccess)
                {
                    success = false;
                }
            }

            return(success);
        }