示例#1
0
        public void OnCopyBagItems(CCBBag targetBag, string[] bagItems)
        {
            CCBTreeViewBag bagNode = FindBagNodeFromBag(targetBag);

            if (null != bagNode)
            {
                CCBBag bag = bagNode.Bag;

                bagNode.StartBulkEdit();
                foreach (string item in bagItems)
                {
                    CCBBagItem bagItem = bag.AddItem(item);
                    bagNode.Items.Add(new CCBTreeViewItem(bagItem));
                }
                bagNode.EndBulkEdit();
            }
        }
示例#2
0
        public bool OnDeleteBagItems(CCBBag targetBag, string[] bagItems)
        {
            CCBTreeViewBag bagNode = FindBagNodeFromBag(targetBag);

            if (null != bagNode)
            {
                CCBBag bag = bagNode.Bag;

                bagNode.StartBulkEdit();
                foreach (string item in bagItems)
                {
                    bag.RemoveItem(item);
                    bagNode.Remove(item);
                }
                bagNode.EndBulkEdit();
                ResetEntitiesList();
                return(true);
            }
            return(false);
        }