public DrawAppointment ( System g, System rect, Calendar appointment, bool isSelected, System gripRect ) : void | ||
g | System | |
rect | System | |
appointment | Calendar | |
isSelected | bool | |
gripRect | System | |
Résultat | void |
protected override void DrawAppointment(Graphics g, Rectangle rect, Calendar.Appointment appointment, bool isSelected, Rectangle gripRect) { // Our custom gripper bar gripRect = rect; gripRect.Inflate(-2, -2); gripRect.Width = 5; // If the start date precedes the start of the week then extend the // draw rect to the left so the edge is clipped and likewise for the right. if (appointment.StartDate < StartDate) { rect.X -= 4; rect.Width += 4; gripRect.X = rect.X; gripRect.Width = 0; } if (appointment.EndDate >= EndDate) { rect.Width += 5; } m_Renderer.DrawAppointment(g, rect, appointment, isSelected, gripRect); }
protected override void DrawAppointment(Graphics g, Rectangle rect, Calendar.Appointment appointment, bool isSelected, Rectangle gripRect) { // Allow selection to be drawn even when a // selection rect is active isSelected = (appointment.Id == m_SelectedTaskID); // Our custom gripper bar gripRect = rect; gripRect.Inflate(-2, -2); gripRect.Width = 5; // If the start date precedes the start of the week then extend the // draw rect to the left so the edge is clipped and likewise for the right. CalendarItem taskItem = (appointment as CalendarItem); bool longAppt = taskItem.IsLongAppt(); if (longAppt) { if (appointment.StartDate < StartDate) { rect.X -= 4; rect.Width += 4; gripRect.X = rect.X; gripRect.Width = 0; } else if (appointment.StartDate > StartDate) { rect.X++; rect.Width--; gripRect.X++; } if (appointment.EndDate >= EndDate) { rect.Width += 5; } } else // day appointment { if (taskItem.StartDate.TimeOfDay.TotalHours == 0.0) { rect.Y++; rect.Height--; } rect.Width -= 1; } m_Renderer.DrawAppointment(g, rect, appointment, isSelected, gripRect); }
protected override void DrawAppointment(Graphics g, Rectangle rect, Calendar.Appointment appointment, bool isSelected, Rectangle gripRect) { isSelected = WantDrawAppointmentSelected(appointment); // Our custom gripper bar gripRect = rect; gripRect.Inflate(-2, -2); gripRect.Width = 5; // If the start date precedes the start of the week then extend the // draw rect to the left so the edge is clipped and likewise for the right. bool longAppt = IsLongAppt(appointment); if (longAppt) { if (appointment.StartDate < StartDate) { rect.X -= 4; rect.Width += 4; gripRect.X = rect.X; gripRect.Width = 0; } else if (appointment.StartDate > StartDate) { rect.X++; rect.Width--; gripRect.X++; } if (appointment.EndDate >= EndDate) { rect.Width += 5; } } else // day appointment { if (appointment.StartDate.TimeOfDay.TotalHours == 0.0) { rect.Y++; rect.Height--; } rect.Width -= 1; } m_Renderer.DrawAppointment(g, rect, appointment, longAppt, isSelected, gripRect); }