public void AddCollection(string name, IEnumerable<IObject> namedObjects, Tree tree = null) { List<IObject> namedCollection; if (!collectionsByName.TryGetValue(name, out namedCollection)) { namedCollection = new List<IObject>(); this.collectionsByName.Add(name, namedCollection); } var namedObjectList = (namedObjects as IList<IObject>) ?? namedObjects.ToArray(); namedCollection.AddRange(namedObjectList); foreach (var namedObject in namedObjectList) { objects.Add(namedObject); tree?.Resolve(namedObject, this.objects); } }
public Tree Add(RoleType roleType, Tree tree) { var treeNode = new TreeNode(roleType, tree.Nodes); this.nodes.Add(treeNode); return this; }
public Tree Add(RelationType relationType, Tree tree) { return this.Add(relationType.RoleType, tree); }
public void AddObject(string name, IObject namedObject, Tree tree = null) { objects.Add(namedObject); objectByName.Add(name, namedObject); tree?.Resolve(namedObject, this.objects); }
internal override void TestExtend() { this.Description.RoleType.DataTypeAttribute = new DataTypeAttribute(DataType.MultilineText); this.Information.RoleType.DisplayAttribute = new DisplayAttribute { Name = "Ik ben het label" }; this.Information.RoleType.DataTypeAttribute = new DataTypeAttribute(DataType.Html); var organisation = this; this.AngularEmployees = new Tree(organisation) .Add(organisation.Employee); var person = PersonClass.Instance; this.AngularShareholders = new Tree(organisation) .Add(organisation.Shareholder, new Tree(person) .Add(person.Photo)); }