Version

TaskConstraintViolation Event

Fired when a property value is modified in such a way as to cause a task's Constraint to be violated.
Syntax
'Declaration
 
Public Event TaskConstraintViolation As TaskConstraintViolationHandler
public event TaskConstraintViolationHandler TaskConstraintViolation
Event Data

The event handler receives an argument of type TaskConstraintViolationEventArgs containing data related to this event. The following TaskConstraintViolationEventArgs properties provide information specific to this event.

PropertyDescription
Action Returns or sets a value indicating the action to be taken in response to the event.
Constraint Returns the TaskConstraint setting that would be violated. Not applicable when the Reason property returns 'ProjectStartDateConflict'
MessageBoxText (Inherited from Infragistics.Win.UltraWinSchedule.TaskPromptUserEventArgsBase)Returns or sets the text to be displayed in the MessageBox that appears to inform the user of the conflict. Setting this property to null or an empty string prevents the MessageBox from being displayed. Not used when the PromptUser property is set to false.
MessageBoxTitle (Inherited from Infragistics.Win.UltraWinSchedule.TaskPromptUserEventArgsBase)Returns or sets the title for the MessageBox that appears to inform the user of the conflict. Not used when the PromptUser property is set to false.
PromptUser (Inherited from Infragistics.Win.UltraWinSchedule.TaskPromptUserEventArgsBase)Returns or sets a value indicating whether the user should be prompted on what action to take.
Reason Returns a value indicating the reason the event occurred.
Task (Inherited from Infragistics.Win.UltraWinSchedule.TaskEventArgs)Returns the Task for which the event was fired.
Remarks

The TaskConstraintViolation event is fired when the Constraint, ConstraintDateTime, StartDateTime, EndDateTime properties, or the Dependencies collection are modified in such a way as to cause a scheduling conflict for the task. A listener can override the action that caused the event to fire, thus preventing the conflict, and in some instances can opt to continue execution with the condition that caused the conflict remaining in place, in which case the task works around the discrepancy. In these situations, the task's Constraint and ConstraintDateTime properties take precedence over any other criteria.

The following section lists examples of actions that cause the event to fire:

  • Setting the Constraint property to a value other than 'AsSoonAsPossible', 'AsLateAsPossible', 'StartNoEarlierThan', or 'FinishNoEarlierThan' when the task's Dependencies collection contains one or more items.
  • Setting the StartDateTime or EndDateTime properties when the Constraint property is set to a value other than 'AsSoonAsPossible', 'AsLateAsPossible', 'StartNoEarlierThan', or 'FinishNoEarlierThan' when the task's Dependencies collection contains one or more items. Note that the event is fired even when the new task start/end does not conflict with the current constraining date.
  • Adding an item to the Dependencies collection when the Constraint property is set to a value other than 'AsSoonAsPossible', 'AsLateAsPossible', 'StartNoEarlierThan', or 'FinishNoEarlierThan'.

The event arguments provide a way to suppress the prompt that is presented to the user, as well as a way to override the action that caused the event to fire.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also