Exemplo n.º 1
0
        public override void DataBindItem(object item, VirtualizingItemContainer itemContainer)
        {
            itemContainer.Clear();

            if (item != null)
            {
                VirtualizingTreeViewItemDataBindingArgs args = new VirtualizingTreeViewItemDataBindingArgs();
                args.Item            = item;
                args.ItemPresenter   = itemContainer.ItemPresenter == null ? gameObject : itemContainer.ItemPresenter;
                args.EditorPresenter = itemContainer.EditorPresenter == null ? gameObject : itemContainer.EditorPresenter;

                RaiseItemDataBinding(args);

                VirtualizingTreeViewItem treeViewItem = (VirtualizingTreeViewItem)itemContainer;
                treeViewItem.CanExpand       = args.HasChildren;
                treeViewItem.CanEdit         = CanEdit && args.CanEdit;
                treeViewItem.CanDrag         = CanDrag && args.CanDrag;
                treeViewItem.CanBeParent     = args.CanBeParent;
                treeViewItem.CanChangeParent = args.CanChangeParent;
                treeViewItem.UpdateIndent();
            }
            else
            {
                VirtualizingTreeViewItem treeViewItem = (VirtualizingTreeViewItem)itemContainer;
                treeViewItem.CanExpand       = false;
                treeViewItem.CanEdit         = false;
                treeViewItem.CanDrag         = false;
                treeViewItem.CanBeParent     = false;
                treeViewItem.CanChangeParent = false;
                treeViewItem.UpdateIndent();
            }
        }
Exemplo n.º 2
0
 public override void DataBindItem(object item, VirtualizingItemContainer itemContainer)
 {
     itemContainer.Clear();
     if (item != null)
     {
         VirtualizingTreeViewItemDataBindingArgs args = new VirtualizingTreeViewItemDataBindingArgs();
         args.Item            = item;
         args.ItemPresenter   = !Object.op_Equality((Object)itemContainer.ItemPresenter, (Object)null) ? itemContainer.ItemPresenter : ((Component)this).get_gameObject();
         args.EditorPresenter = !Object.op_Equality((Object)itemContainer.EditorPresenter, (Object)null) ? itemContainer.EditorPresenter : ((Component)this).get_gameObject();
         this.RaiseItemDataBinding(args);
         VirtualizingTreeViewItem virtualizingTreeViewItem = (VirtualizingTreeViewItem)itemContainer;
         virtualizingTreeViewItem.CanExpand   = args.HasChildren;
         virtualizingTreeViewItem.CanEdit     = this.CanEdit && args.CanEdit;
         virtualizingTreeViewItem.CanDrag     = this.CanDrag && args.CanDrag;
         virtualizingTreeViewItem.CanBeParent = args.CanBeParent;
         virtualizingTreeViewItem.UpdateIndent();
     }
     else
     {
         VirtualizingTreeViewItem virtualizingTreeViewItem = (VirtualizingTreeViewItem)itemContainer;
         virtualizingTreeViewItem.CanExpand = false;
         virtualizingTreeViewItem.CanEdit   = false;
         virtualizingTreeViewItem.CanDrag   = false;
         virtualizingTreeViewItem.UpdateIndent();
     }
 }
        public override void DataBindItem(object item, ItemContainerData containerData, VirtualizingItemContainer itemContainer)
        {
            itemContainer.Clear();

            VirtualizingTreeViewItemDataBindingArgs args = new VirtualizingTreeViewItemDataBindingArgs();

            args.Item            = item;
            args.ItemPresenter   = itemContainer.ItemPresenter == null ? gameObject : itemContainer.ItemPresenter;
            args.EditorPresenter = itemContainer.EditorPresenter == null ? gameObject : itemContainer.EditorPresenter;

            RaiseItemDataBinding(args);

            VirtualizingTreeViewItem treeViewItem = (VirtualizingTreeViewItem)itemContainer;

            treeViewItem.CanExpand = args.HasChildren;
            treeViewItem.CanEdit   = args.CanEdit;
            treeViewItem.CanDrag   = args.CanDrag;
            treeViewItem.UpdateIndent();
        }
Exemplo n.º 4
0
        public override void DataBindItem(object item, VirtualizingItemContainer itemContainer)
        {
            TDataBindingArgs args = new TDataBindingArgs();

            args.Item            = item;
            args.ItemPresenter   = !Object.op_Equality((Object)itemContainer.ItemPresenter, (Object)null) ? itemContainer.ItemPresenter : ((Component)this).get_gameObject();
            args.EditorPresenter = !Object.op_Equality((Object)itemContainer.EditorPresenter, (Object)null) ? itemContainer.EditorPresenter : ((Component)this).get_gameObject();
            itemContainer.Clear();
            if (item != null)
            {
                this.RaiseItemDataBinding(args);
                itemContainer.CanEdit     = args.CanEdit;
                itemContainer.CanDrag     = args.CanDrag;
                itemContainer.CanBeParent = args.CanBeParent;
            }
            else
            {
                itemContainer.CanEdit     = false;
                itemContainer.CanDrag     = false;
                itemContainer.CanBeParent = false;
            }
        }