protected override void OnMouseMove(MouseEventArgs e) { var selTool = ActiveTool as Calendar.SelectionTool; if (selTool == null) { selTool = new Calendar.SelectionTool(); } if (selTool.IsResizing()) { if (ReadOnly) { return; } } else // Extra-over cursor handling { Calendar.Appointment appointment = GetAppointmentAt(e.Location.X, e.Location.Y); Cursor = Cursors.Default; if (!ReadOnly && (appointment != null)) { selTool.DayView = this; selTool.UpdateCursor(e, appointment); var taskItem = (appointment as CalendarItem); if (taskItem != null) { Cursor temp = null; if (taskItem.IsLocked) { temp = UIExtension.AppCursor(UIExtension.AppCursorType.LockedTask); } else if (taskItem.IconRect.Contains(e.Location)) { temp = UIExtension.HandCursor(); } if (temp != null) { Cursor = temp; } } } } base.OnMouseMove(e); }
private Calendar.SelectionTool.Mode GetMode(Calendar.Appointment appointment, Point mousePos) { if (ReadOnly || (appointment == null)) { return(Calendar.SelectionTool.Mode.None); } var selTool = (ActiveTool as Calendar.SelectionTool); if (selTool == null) { selTool = new Calendar.SelectionTool(); selTool.DayView = this; } return(selTool.GetMode(mousePos, appointment)); }