private void DrawBaseLine(GanttItem item, BasePlans.BasePlan baseplan, KS.Gantt.BoxFormatStyle bfstyle, Graphics Gfx) { // Поиск соответствующего задаче базового плана. var plmobj = this.parent.InstHelperPLM.DictTasksGetInfoObj(item.Key); var baseline2draw = baseplan.GetBaseLine4Task(plmobj); if (baseline2draw == null) return; Rectangle r = gantt1.RowBounds(item.RowIndex); int barbott = r.Top + gantt1.BarHeight + (r.Height - gantt1.BarHeight) / 2; int x1 = gantt1.Date2x(baseline2draw.Dates.DataBegTask); int x2 = gantt1.Date2x(baseline2draw.Dates.DataEndTask); Rectangle r2 = new Rectangle(x1, barbott, x2 - x1, gantt1.BarHeight / 4); // only paint if on screen if (r2.IntersectsWith(gantt1.ClientRectangle)) { bfstyle.DrawBox(Gfx, r2, Gantt.BarStyles.Rounded); } }
private void DrawTaskMonitored(GanttItem item, BasePlans.BasePlan baseplan) { (item as TaskItem).FormatStyle.BackgroundStyle.Color = this.usualTaskColor; // Поиск соответствующего задаче базового плана. var plmobj = this.parent.InstHelperPLM.DictTasksGetInfoObj(item.Key); var baseline2draw = baseplan.GetBaseLine4Task(plmobj); if (baseline2draw == null) return; if (baseline2draw.Dates.DataEndTask < (item as TaskItem).EndDate) (item as TaskItem).FormatStyle.BackgroundStyle.Color = Color.Red; }