Example #1
0
        internal static void MoveWorkBetweenBuckets(RteWorkItem workItem, int id)
        {
            if (id == 0)
            {
                return;
            }

            var area      = areas.Get(workItem.AreaPath);
            var fromState = workItem.States[id - 1].Value;
            var toState   = workItem.States[id].Value;

            var fromBucket = BucketType.Backlog;

            if (fromState == "New" || fromState == "Proposed" || fromState == "Ready")
            {
                fromBucket = BucketType.Backlog;
            }
            else if (fromState == "Active")
            {
                fromBucket = BucketType.Commited;
            }
            else
            {
                fromBucket = BucketType.Done;
            }

            var toBucket = BucketType.Backlog;

            if (toState == "New" || toState == "Proposed" || toState == "Ready")
            {
                toBucket = BucketType.Backlog;
            }
            else if (toState == "Active")
            {
                toBucket = BucketType.Commited;
            }
            else
            {
                toBucket = BucketType.Done;
            }

            if (fromBucket != toBucket)
            {
                area.RemoveItemFromBucket(workItem, workItem.States[id].Key.Date, fromBucket);
                area.AddItemToBucket(workItem, workItem.States[id].Key.Date, toBucket);
            }
        }
Example #2
0
        private static void AddWorkItemToAreaBucket(RteWorkItem workItem, DateTime created)
        {
            var area = areas.Get(workItem.AreaPath);

            area.AddItemToBucket(workItem, created.Date, BucketType.Backlog);
        }
Example #3
0
 public void RemoveItemFromBucket(RteWorkItem workItem, DateTime date, BucketType bucket)
 {
     buckets[bucket].Remove(workItem, date);
 }
Example #4
0
 public void AddItemToBucket(RteWorkItem workItem, DateTime date, BucketType bucket)
 {
     buckets[bucket].Add(workItem, date);
 }
Example #5
0
 public Change(RteWorkItem workItem, DateTime date, ChangeType type)
 {
     this.workItem = workItem;
     this.date     = date;
     this.type     = type;
 }
Example #6
0
 internal void Remove(RteWorkItem workItem, DateTime date)
 {
     changes.Add(new Change(workItem, date, ChangeType.Remove));
 }
Example #7
0
 internal void Add(RteWorkItem workItem, DateTime date)
 {
     changes.Add(new Change(workItem, date, ChangeType.Add));
 }