protected override void Drop(SchedulingDragDropState state) { state.DestinationSlot.End = SnappingHelper.RoundUpDateTime(state.DestinationSlot.End); state.DestinationSlot.Start = SnappingHelper.RoundUpDateTime(state.DestinationSlot.Start); base.Drop(state); }
protected override bool CanStartDrag(SchedulingDragDropState state) { if (!base.CanStartDrag(state)) { return false; } var task = state.DraggedItem as GanttTask; if (!this.AllowModificationsInThePast && task.Start <= DateTime.Now) { return false; } if (task.IsMilestone) { return this.CanDragMilestones; } if (task.IsSummary) { return this.CanDragSummaries; } return this.CanDragTasks; }
protected override void Drop(SchedulingDragDropState state) { state.DestinationSlot.End = SnappingHelper.RoundUpDateTime(state.DestinationSlot.End); state.DestinationSlot.Start = SnappingHelper.RoundUpDateTime(state.DestinationSlot.Start); base.Drop(state); }
/// <summary> /// Determines whether movement via drag/drop is generally allowed for the task related /// with the given SchedulingDragDropState. /// </summary> /// <param name="state">The SchedulingDragDropState.</param> /// <returns>Value indicating whether drag/drop-action can be started.</returns> protected override bool CanStartDrag(SchedulingDragDropState state) { if (state.SourceGroupKey is RecurrenceTask) { return(false); } return(base.CanStartDrag(state)); }
protected override bool CanStartDrag(SchedulingDragDropState state) { if (state.IsReorderOperation) { return(((CustomGanttTask)state.DraggedItem).IsDragReorderAllowed); } return(base.CanStartDrag(state)); }
/// <summary> /// Determines whether movement via drag/drop is generally allowed for the task related /// with the given SchedulingDragDropState. /// </summary> /// <param name="state">The SchedulingDragDropState.</param> /// <returns>Value indicating whether drag/drop-action can be started.</returns> protected override bool CanStartDrag(SchedulingDragDropState state) { if (state.SourceGroupKey is RecurrenceTask) { return false; } return base.CanStartDrag(state); }
protected override bool CanStartDrag(SchedulingDragDropState state) { if (state.IsReorderOperation) { return ((CustomGanttTask)state.DraggedItem).IsDragReorderAllowed; } return base.CanStartDrag(state); }
protected override bool CanStartDrag(SchedulingDragDropState state) { var task = state.DraggedItem as GanttTask; if (task.IsMilestone) { return(false); } return(base.CanStartDrag(state)); }
protected override bool CanStartDrag(SchedulingDragDropState state) { if (!base.CanStartDrag(state)) { return false; } if (state.IsReorderOperation) { return !((LockingTask)state.DraggedItem).IsDragReorderLocked; } return !((LockingTask)state.DraggedItem).IsDragDropLocked; }
/// <summary> /// Determines whether drag/drop-action for the task related /// with the given SchedulingDragDropState is valid and can be executed. /// </summary> /// <param name="state">The SchedulingDragDropState.</param> /// <returns>Value indicating whether drag/drop-action is valid.</returns> protected override bool CanDrop(SchedulingDragDropState state) { return(true); }
protected override bool CanStartDrag(SchedulingDragDropState state) { return(state.IsReorderOperation); }
protected override bool CanStartDrag(SchedulingDragDropState state) { return state.IsReorderOperation; }
/// <summary> /// Determines whether drag/drop-action for the task related /// with the given SchedulingDragDropState is valid and can be executed. /// </summary> /// <param name="state">The SchedulingDragDropState.</param> /// <returns>Value indicating whether drag/drop-action is valid.</returns> protected override bool CanDrop(SchedulingDragDropState state) { return true; }
protected override bool CanStartDrag(SchedulingDragDropState state) { return false; }
protected override bool CanDrop(SchedulingDragDropState state) { if (base.CanDrop(state) && this.AllowModificationsInThePast || state.DestinationSlot.Start.Date > DateTime.Now) { if (this.SnapToDates) { var length = state.DestinationSlot.End - state.DestinationSlot.Start; var start = state.DestinationSlot.Start.Date; var end = start + TimeSpan.FromDays(Math.Ceiling(length.TotalDays)); state.DestinationSlot.Start = start; state.DestinationSlot.End = end; } return true; } return false; }