private static void LoadOptions(XMLTool T, XmlLoad X) { var O = Options.XML.XMLLoader.LoadOptions(X); if (O != null) { T.Options.AddRange(O); } }
private static void LoadTags(XMLTool T, XmlLoad X) { while (X.Read()) { switch (X.ElementName) { case "tag": T.ControllerTypes.Add(X.GetAttribute("value")); break; } } X.Close(); }
private static void LoadActions(XMLTool T, XmlLoad X, bool Custom) { while (X.Read()) { XMLToolAction A = LoadAction(X.GetSubtree()); A.Name = X.ElementName; T.Actions.Add(A); } X.Close(); }
public static bool Load(string FileName, XMLTool Tool, bool Custom) { XmlLoad X = new XmlLoad(); if (!X.Load(FileName)) { return(false); } while (X.Read()) { if (Custom) { switch (X.ElementName) { case "name": Tool.ToolName = X.GetAttribute("value"); break; case "path": Tool.ToolPath = X.GetAttribute("value"); break; case "actions": LoadActions(Tool, X.GetSubtree(), true); break; case "tags": LoadTags(Tool, X.GetSubtree()); break; } } else { switch (X.ElementName) { case "name": Tool.ToolName = X.GetAttribute("value"); break; case "path": Tool.ToolPath = X.GetAttribute("value"); break; case "supported": LoadSupportedTypes(Tool, X.GetSubtree()); break; case "actions": LoadActions(Tool, X.GetSubtree(), false); break; case "options": LoadOptions(Tool, X.GetSubtree()); break; case "tags": LoadTags(Tool, X.GetSubtree()); break; } } } X.Close(); return(true); }