Ejemplo n.º 1
0
        private static bool _subtract(List <TimeBox> tbListA, List <TimeBox> tbListB)
        {
            for (int i = 0; i < tbListA.Count; i++)
            {
                var tbA = tbListA[i];

                foreach (var tbB in tbListB)
                {
                    bool change = false;
                    var  res    = _subtract(tbA, tbB, ref change);
                    if (change)
                    {
                        // insert res at i
                        if (res.Count > 0)
                        {
                            tbListA.AddRange(res);
                        }
                        // remove original
                        tbListA.Remove(tbA);
                        TimeBox._sort(tbListA);
                        return(true);
                    }
                }
            }

            return(false);
        }
Ejemplo n.º 2
0
        internal TimeBox TimeBoxAdd(DateTime start, DateTime end)
        {
            // add time box
            var trb = new TimeBox(start, end, this);

            TimeBoxCollection.Add(trb);
            TimeBox._sort(TimeBoxCollection);
            TimeBoxMerge();
            return(trb);
        }
Ejemplo n.º 3
0
 internal void TimeBoxAdd(List <TimeBox> collection)
 {
     foreach (var src in collection)
     {
         var trb = new TimeBox(src.StartDate, src.EndDate, this);
         trb.CopyStates(src);
         TimeBoxCollection.Add(trb);
     }
     TimeBox._sort(TimeBoxCollection);
     TimeBoxMerge();
 }
Ejemplo n.º 4
0
 internal void TimeBoxSort()
 {
     TimeBox._sort(TimeBoxCollection);
 }