protected Path(XElement xml, LinkPackage root, IPathParent parent) { LinkPackage = root; Parent = parent; Name = xml.AttributeValueOrDefault("name"); Id = xml.AttributeValueOrDefault("id"); Paths = xml.Elements().Select(x => Path.Construct(x, root, this)).ToArray(); }
public static Path Construct(XElement xml, LinkPackage root, IPathParent parent) { var name = xml.Name.ToString(); switch (name) { case VariablePath.ElementName: return new VariablePath(xml, root, parent); case DirectoryPath.ElementName: return new DirectoryPath(xml, root, parent); case FilePath.ElementName: return new FilePath(xml, root, parent); default: throw new ArgumentException("Unknown Path element: " + xml); } }
public VariablePath(XElement xml, LinkPackage root, IPathParent parent) : base(xml, root, parent) { }
public DirectoryPath(XElement xml, LinkPackage root, IPathParent parent) : base(xml, root, parent) { }