public void RemoveChildItem(UiItem item) { ChildItemList.Remove(item); item.ParentItem = null; ChildRemoved?.Invoke(item, this); }
public void InsertChildItem(int index, UiItem item) { ChildItemList.Insert(index, item); item.ParentItem = this; ChildInserted?.Invoke(index, item); }
public UiFile(bool createRootItem = true) { if (createRootItem) { RootUiItem = new UiItem(this); } }
public void RemoveUiItem(UiItem item) { UiItem[] childs = item.ChildItemList.ToArray(); foreach (UiItem childItem in childs) { RemoveUiItem(childItem); } UiItem parentItem = item.ParentItem; parentItem.RemoveChildItem(item); ItemRemoved?.Invoke(item, parentItem); }
public UiItem CreateUiItem(UiItem parentUiItem) { if (parentUiItem == null) { parentUiItem = RootUiItem; } UiItem item = new UiItem(null); ItemCreatedPreview?.Invoke(item, parentUiItem); parentUiItem.AddChildItem(item); ItemCreated?.Invoke(item, parentUiItem); return(item); }
public void AddChildItem(UiItem item) { InsertChildItem(ChildItemList.Count, item); }