'Declaration Public Event TaskConstraintViolation As TaskConstraintViolationHandler
public event TaskConstraintViolationHandler TaskConstraintViolation
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.
Property | Description |
---|---|
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. |
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:
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.
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