/// <summary>
        /// Search all work items
        /// </summary>
        /// <param name="store"></param>
        /// <param name="iterationPath"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        public WorkItemTimeCollection(WorkItemStore store, string iterationPath, DateTime startDate, DateTime endDate)
        {
            this.IterationPath = iterationPath;
            this.Data = new ObservableCollection<WorkItemTime>();

            // Sets a list of dates to compute
            _trackDates.Add(startDate.Date);
            for (DateTime date = startDate.Date; date <= endDate.Date; date = date.AddDays(1))
            {
                _trackDates.Add(date.AddHours(23).AddMinutes(59));
            }

            // Gets all work items for each dates
            foreach (DateTime asOfDate in _trackDates)
            {
                // Execute the query
                var wiCollection = store.Query(this.GetQueryString(asOfDate));

                // Iterate through all work items
                foreach (WorkItem wi in wiCollection)
                {
                    WorkItemTime time = new WorkItemTime(asOfDate, wi);
                    this.Data.Add(time);
                }
            }
        }
        /// <summary>
        /// Search all work items
        /// </summary>
        /// <param name="store"></param>
        /// <param name="iterationPath"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        public WorkItemTimeCollection(WorkItemStore store, string iterationPath, DateTime startDate, DateTime endDate)
        {
            this.IterationPath = iterationPath;
            this.Data          = new ObservableCollection <WorkItemTime>();

            // Sets a list of dates to compute
            _trackDates.Add(startDate.Date);
            for (DateTime date = startDate.Date; date <= endDate.Date; date = date.AddDays(1))
            {
                _trackDates.Add(date.AddHours(23).AddMinutes(59));
            }

            // Gets all work items for each dates
            foreach (DateTime asOfDate in _trackDates)
            {
                // Execute the query
                var wiCollection = store.Query(this.GetQueryString(asOfDate));

                // Iterate through all work items
                foreach (WorkItem wi in wiCollection)
                {
                    WorkItemTime time = new WorkItemTime(asOfDate, wi);
                    this.Data.Add(time);
                }
            }
        }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of WorkItemTime base on day associated to these values
 /// and based on values included in specified work item.
 /// </summary>
 /// <param name="trackDay"></param>
 /// <param name="item"></param>
 public WorkItemTime(DateTime trackDay, WorkItemTime item) : this(trackDay)
 {
     this.WorkItemID       = item.WorkItemID;
     this.Title            = item.Title;
     this.Type             = item.Type;
     this.AssignedTo       = item.AssignedTo;
     this.OriginalEstimate = 0;
     this.RemainingWork    = 0;
     this.CompletedWork    = 0;
 }
 /// <summary>
 /// Initializes a new instance of WorkItemTime base on day associated to these values
 /// and based on values included in specified work item.
 /// </summary>
 /// <param name="trackDay"></param>
 /// <param name="item"></param>
 public WorkItemTime(DateTime trackDay, WorkItemTime item)
     : this(trackDay)
 {
     this.WorkItemID = item.WorkItemID;
     this.Title = item.Title;
     this.Type = item.Type;
     this.AssignedTo = item.AssignedTo;
     this.OriginalEstimate = 0;
     this.RemainingWork = 0;
     this.CompletedWork = 0;
 }