示例#1
0
        private void OnItemsRemoved(object sender, ItemsRemovedArgs e)
        {
            HashSet <ObjectCtrl> objectCtrlSet = new HashSet <ObjectCtrl>(((IEnumerable <object>)e.Items).Select <object, ObjectCtrl>((Func <object, ObjectCtrl>)(v => v as ObjectCtrl)));

            foreach (ObjectCtrl _objectCtrl in ((IEnumerable <object>)e.Items).Select <object, ObjectCtrl>((Func <object, ObjectCtrl>)(v => v as ObjectCtrl)))
            {
                this.CheckParent(objectCtrlSet, _objectCtrl);
            }
            DeleteCommand deleteCommand = new DeleteCommand(objectCtrlSet.ToArray <ObjectCtrl>());

            if (!this.isOnFuncSkip)
            {
                Singleton <UndoRedoManager> .Instance.Do((ICommand)deleteCommand);
            }
            else
            {
                deleteCommand.Do();
            }
            this.isOnFuncSkip = false;
            IEnumerable selectedItems = this.virtualizingTreeView.SelectedItems;

            ObjectCtrl[] objectCtrlArray = selectedItems != null?selectedItems.OfType <ObjectCtrl>().ToArray <ObjectCtrl>() : (ObjectCtrl[])null;

            if (Singleton <Selection> .IsInstance())
            {
                Action <ObjectCtrl[]> onSelectFunc = Singleton <Selection> .Instance.onSelectFunc;
                if (onSelectFunc != null)
                {
                    onSelectFunc(objectCtrlArray);
                }
            }
            this.RefreshList();
        }