Exemplo n.º 1
0
        private void ExpandPath(GoalNode node, List <ulong> uplinks)
        {
            if (!uplinks.Contains(node.Goal.Person))
            {
                return;
            }

            // expand triggers even loading nodes two levels down, one level shown, the other hidden
            node.Expand();

            foreach (GoalNode sub in node.Nodes)
            {
                ExpandPath(sub, uplinks);
            }
        }
Exemplo n.º 2
0
        private void ReloadGoals()
        {
            TreeMap.Clear();
            GoalTree.Nodes.Clear();

            List <ulong> uplinks = Trust.GetUplinkIDs(View.UserID, View.ProjectID);

            uplinks.Add(View.UserID);

            // show all branches
            if (!MineOnly.Checked)
            {
                GoalNode root = CreateNode(Head);
                LoadNode(root);
                GoalTree.Nodes.Add(root);

                ExpandPath(root, uplinks);
            }

            // show only our branch
            else if (Head != null)
            {
                foreach (ulong id in uplinks)
                {
                    OpPlan plan = Plans.GetPlan(id, true);

                    if (plan != null && plan.GoalMap.ContainsKey(Head.Ident))
                    {
                        foreach (PlanGoal goal in plan.GoalMap[Head.Ident])
                        {
                            if (goal.Person == View.UserID)
                            {
                                GoalNode root = CreateNode(goal);
                                LoadNode(root);
                                InsertSubNode(GoalTree.virtualParent, root);
                                root.Expand();
                            }
                        }
                    }
                }
            }

            Reselect();
        }
Exemplo n.º 3
0
        private void VisiblePath(GoalNode node, List <ulong> path)
        {
            bool found = false;

            foreach (GoalNode sub in node.Nodes)
            {
                if (path.Contains(sub.Goal.Person))
                {
                    found = true;
                }
            }

            if (found)
            {
                node.Expand();

                foreach (GoalNode sub in node.Nodes)
                {
                    VisiblePath(sub, path);
                }
            }
        }
Exemplo n.º 4
0
        private void ExpandPath(GoalNode node, List<ulong> uplinks)
        {
            if (!uplinks.Contains(node.Goal.Person))
                return;

            // expand triggers even loading nodes two levels down, one level shown, the other hidden
            node.Expand();

            foreach (GoalNode sub in node.Nodes)
                ExpandPath(sub, uplinks);
        }
Exemplo n.º 5
0
        private void VisiblePath(GoalNode node, List<ulong> path)
        {
            bool found = false;

            foreach (GoalNode sub in node.Nodes)
                if (path.Contains(sub.Goal.Person))
                    found = true;

            if (found)
            {
                node.Expand();

                foreach (GoalNode sub in node.Nodes)
                    VisiblePath(sub, path);
            }
        }