Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ATask"></param>
        /// <returns></returns>
        public TaskNode FindTaskNodeForTask(List <TaskNode> Nodes, ProjectTask ATask)
        {
            TaskNode Value = null;

            foreach (TaskNode ANode in Nodes)
            {
                Value = ANode.FindNodeForTask(ATask);

                if (Value != null)
                {
                    break;
                }
            }

            return(Value);
        }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="NewTask"></param>
        public TaskNode(Project AProject, ProjectTask ATask, TaskNode AParent)
        {
            _Task     = ATask;
            _Parent   = AParent;
            _Children = new List <TaskNode>();

            List <ProjectTask> SomeChildren = AProject.GetChildTasks(ATask);

            foreach (ProjectTask AChild in SomeChildren)
            {
                if (AChild.Level == ATask.Level + 1)
                {
                    _Children.Add(new TaskNode(AProject, AChild, this));
                }
            }
        }
Beispiel #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ATask"></param>
        /// <returns></returns>
        public String GetWBSForTask(ProjectTask ATask)
        {
            String Value = String.Empty;

            List <TaskNode> Nodes = GetTaskHierarchy();
            TaskNode        ANode = FindTaskNodeForTask(Nodes, ATask);

            while (ANode != null)
            {
                if (Value.Length > 0)
                {
                    Value = "." + Value;
                }
                Value = (ANode.Task.Index + 1).ToString() + Value;

                ANode = ANode.Parent;
            }

            return(Value);
        }
Beispiel #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ATask"></param>
        /// <returns></returns>
        public TaskNode FindNodeForTask(ProjectTask ATask)
        {
            TaskNode Value = null;

            if (_Task == ATask)
            {
                return(this);
            }

            foreach (TaskNode ANode in _Children)
            {
                Value = ANode.FindNodeForTask(ATask);

                if (Value != null)
                {
                    break;
                }
            }

            return(Value);
        }