예제 #1
0
 private void SetLaneBusy(int lane, TimelineDateTime tld)
 {
     if (laneBusyUntil[lane] == null)
     {
         laneBusyUntil[lane] = new TimelineDateTime(DateTime.UtcNow);
     }
     tld.CopyTo(ref laneBusyUntil[lane]);
 }
예제 #2
0
 public MTimelineEvent(string _title, TimelineDateTime _startdate, int _length = 1)
 {
     Title     = _title;
     startDate = _startdate;
     endDate   = new TimelineDateTime(DateTime.UtcNow);
     startDate.CopyTo(ref endDate);
     endDate.Add(_length);
 }
예제 #3
0
        private void DrawUnitsAndSubUnits(SKCanvas canvas)
        {
            float unitPos;
            float subUnitPos;

            Int64 minTicks = date.Ticks - halfWidth * pixeltime;

            if (minTicks < BCACDateTime.MinTicks)
            {
                minTicks = BCACDateTime.MinTicks;
            }
            Int64 maxTicks = date.Ticks + halfWidth * pixeltime;

            if (maxTicks > BCACDateTime.MaxTicks)
            {
                maxTicks = BCACDateTime.MaxTicks;
            }
            //TimelineDateTime minDate = TimelineDateTime.FromTicksCapped(date.Ticks - halfWidth * pixeltime);
            //TimelineDateTime maxDate = TimelineDateTime.FromTicksCapped(date.Ticks + halfWidth * pixeltime);

            date.CopyTo(ref unitDate, ZoomUnit);
            while (unitDate.Ticks > minTicks)
            {
                unitDate.AddCapped(ZoomUnit, -1);
            }

            while (unitDate.Ticks < maxTicks)
            {
                unitPos = (unitDate.Ticks - minTicks) / pixeltime;

                //UNIT MARK
                canvas.DrawLine(unitPos, unitMarkY1, unitPos, unitMarkY2, unitMarkPaint);
                //UNIT TEXT
                canvas.DrawText(GetUnitText(unitDate), unitPos, unitTextY, unitTextPaint);

                unitDate.CopyTo(ref subUnitDate, ZoomUnit - 1);
                unitDate.AddCapped(ZoomUnit);
                while (subUnitDate.Ticks < unitDate.Ticks && subUnitDate.Ticks < maxTicks)
                {
                    subUnitPos = (subUnitDate.Ticks - minTicks) / pixeltime;

                    //SUBUNIT MARK
                    canvas.DrawLine(subUnitPos, subUnitMarkY1, subUnitPos, subUnitMarkY2, subUnitMarkPaint);

                    //SUBUNIT TEXT
                    if (showSubUnitText)
                    {
                        canvas.DrawText(GetSubUnitText(subUnitDate), subUnitPos + 3, subUnitTextY, subUnitTextPaint);
                    }

                    subUnitDate.AddCapped(ZoomUnit - 1);
                }
            }
        }