Exemplo n.º 1
0
        public void RemoveChildItem(UiItem item)
        {
            ChildItemList.Remove(item);
            item.ParentItem = null;

            ChildRemoved?.Invoke(item, this);
        }
Exemplo n.º 2
0
        public void InsertChildItem(int index, UiItem item)
        {
            ChildItemList.Insert(index, item);
            item.ParentItem = this;

            ChildInserted?.Invoke(index, item);
        }
Exemplo n.º 3
0
 public UiFile(bool createRootItem = true)
 {
     if (createRootItem)
     {
         RootUiItem = new UiItem(this);
     }
 }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
 public void AddChildItem(UiItem item)
 {
     InsertChildItem(ChildItemList.Count, item);
 }