Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
 public VariablePath(XElement xml, LinkPackage root, IPathParent parent)
     : base(xml, root, parent)
 {
 }
Esempio n. 4
0
 public DirectoryPath(XElement xml, LinkPackage root, IPathParent parent)
     : base(xml, root, parent)
 {
 }