Пример #1
0
        internal List <Task> Find(string findString, EHPMReportViewType viewType)
        {
            List <Task>        found       = new List <Task>();
            HPMFindContext     findContext = new HPMFindContext();
            HPMFindContextData data        = SessionManager.Session.UtilPrepareFindContext(findString, UniqueID, viewType, findContext);
            HPMTaskEnum        items       = SessionManager.Session.TaskFind(data, EHPMTaskFindFlag.None);

            foreach (HPMUniqueID taskID in items.m_Tasks)
            {
                found.Add(Task.GetTask(taskID, viewType));
            }
            return(found);
        }
Пример #2
0
        public static SprintSearchCollection findSprintTaskID(Task parentTask)
        {
            HPMFindContext FindContext = new HPMFindContext();

            HPMFindContextData FindContextData = SessionManager.Session.UtilPrepareFindContext("Itemname: \"Program - PI\" AND ! Itemname: \":\"", parentTask.Project.UniqueID, EHPMReportViewType.AgileMainProject, FindContext);
            HPMTaskEnum        SprintIDEnum    = SessionManager.Session.TaskFind(FindContextData, EHPMTaskFindFlag.None);

            foreach (HPMUniqueID searchID in SprintIDEnum.m_Tasks)
            {
                HPMUniqueID SprintRefID = SessionManager.Session.TaskGetMainReference(searchID);
                Task        sprint      = Task.GetTask(SprintRefID);
                foreach (Task child in sprint.DeepChildren)
                {
                    if (child.UniqueTaskID == parentTask.UniqueTaskID)
                    {
                        return(new SprintSearchCollection(child.UniqueID, SprintRefID));
                    }
                }
            }

            return(new SprintSearchCollection(null, null));
        }