Exemple #1
0
        public IEnumerable<Function> SelectedFunctions()
        {
            if (SelectedNode == null)
                return Enumerable.Empty<Function>();
            var collector = new Collector();
            
            SelectedNodes.Select(n => n.Tag).Cast<DeviareNode>().ForEach(n => n.Accept(collector));

            return collector.CollectedFunctions;
        }
        private void ProcessesTreeViewDragDrop(object sender, DragEventArgs e)
        {
            var data = new DataObject(new TreeNodeAdv(new Node()));

            if (!e.Data.GetDataPresent(data.GetFormats()[0])) return;

            var draggedTreeNode = (TreeNodeAdv)e.Data.GetData(data.GetFormats()[0]);
            var draggedNode = (DeviareNode)draggedTreeNode.Tag;

            var targetTreeNode = _processesTreeView.DropPosition.Node;
            var targetNode = (DeviareNode)targetTreeNode.Tag;

            var processCollector = new Collector();
            targetNode.Accept(processCollector);

            var hookCollector = new Collector();
            draggedNode.Accept(hookCollector);

            _presenter.ReplicateHooks(processCollector.CollectedProcesses, hookCollector.CollectedHooks);
        }
Exemple #3
0
        public IProcess[] SelectedProcesses()
        {
            var collector = new Collector();

            foreach (DeviareNode node in SelectedDeviareNodes())
            {
                node.Accept(collector);
            }

            return collector.CollectedProcesses.ToArray();
        }
Exemple #4
0
 public void HandleSelectedNode(ApplicationPresenter presenter)
 {
     var nodeHandler = DeviareNodeHandler.ForProcesses(
         processNode =>
             {
                 var collector = new Collector();
                 processNode.Accept(collector);
                 presenter.SelectedProcessesChanged(
                     collector.CollectedProcesses);
                 return true;
             },
         processGroupNode =>
             {
                 var collector = new Collector();
                 processGroupNode.Accept(collector);
                 presenter.SelectedProcessesChanged(
                     collector.CollectedProcesses);
                 return true;
             },
         processCategoryNode => false,
         presenter.ClearSelectedProcesses);
     
     SelectedDeviareNode().Accept(nodeHandler);
 }
Exemple #5
0
        public IEnumerable<Function> AllFunctions()
        {
            var collector = new Collector();

            AllNodes.ForEach(n => ((DeviareNode)n.Tag).Accept(collector));

            return collector.CollectedFunctions;
        }