public Entity Update(Spread <Entity> children) { // Quick change check if (children != this.children) { this.children = children; } else { return(entity); } // Synchronize our entity links var @array = children._array; for (int i = 0; i < array.Length; i++) { var link = links.ElementAtOrDefault(i); if (link == null) { link = new EntityLink(entity); links.Add(link); } link.Child = array[i]; } for (int i = links.Count - 1; i >= array.Length; i--) { var link = links[i]; link.Dispose(); links.RemoveAt(i); } return(entity); }
public EntityGroup() { self = new Entity(); link1 = new EntityLink(self); link2 = new EntityLink(self); }