Beispiel #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);
            }
        }
Beispiel #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();
        }
Beispiel #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);
                }
            }
        }
Beispiel #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);
        }
Beispiel #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);
            }
        }