Exemple #1
0
 private void RemoveTargetChild(HashSet <ObjectCtrl> _objects, OCFolder _ocf)
 {
     if (_ocf == null)
     {
         return;
     }
     foreach (KeyValuePair <IObjectInfo, ObjectCtrl> keyValuePair in _ocf.Child)
     {
         _objects.Remove(keyValuePair.Value);
         this.RemoveTargetChild(_objects, keyValuePair.Value as OCFolder);
     }
 }
Exemple #2
0
        private void OnItemDataBinding(object sender, VirtualizingTreeViewItemDataBindingArgs e)
        {
            if (!(e.Item is ObjectCtrl objectCtrl))
            {
                return;
            }
            Text componentInChildren = (Text)e.ItemPresenter.GetComponentInChildren <Text>(true);

            componentInChildren.set_text(objectCtrl.Name);
            OCItem ocItem = objectCtrl as OCItem;

            ((Graphic)componentInChildren).set_color(ocItem == null ? Color.get_white() : (!ocItem.IsOverlapNow ? Color.get_white() : Color.get_red()));
            OCFolder ocFolder = objectCtrl as OCFolder;

            e.HasChildren = ocFolder != null && ocFolder.Child.Count > 0;
            e.CanBeParent = ocFolder != null;
        }