public ComplexType(String name, string typeNamespace, params Node[] properties) : base(name, typeNamespace, properties.OfType <NodeFacet>().ToArray()) { _properties = new Nodes <NodeProperty>(this, properties.OfType <NodeProperty>()); _relations = new NodeRelations(this, properties.OfType <NodeRelation>().ToArray()); DerivedTypes = new List <ComplexType>(); //Pull-up additional relations, if they were specified at the property level this.Relations.Infer(); }
public ComplexType(String name, string typeNamespace, ComplexType baseType, params Node[] properties) : base(name, typeNamespace, properties.OfType <NodeFacet>().ToArray()) { _properties = new Nodes <NodeProperty>(this, baseType.Properties.Union(properties.OfType <NodeProperty>())); _relations = new NodeRelations(this, properties.OfType <NodeRelation>().ToArray()); DerivedTypes = new List <ComplexType>(); this.BaseType = baseType; this.BaseType.DerivedTypes.Add(this); foreach (ComplexType ancestor in this.BaseType.BaseTypes) { ancestor.DerivedTypes.Add(this); } this.Relations.Infer(); }