Version

NotificationSettings Class

Exposes properties which determine the manner in which the end user is notified of a failed validation.
Syntax
'Declaration
 
Public Class NotificationSettings 
   Inherits Infragistics.Shared.SubObjectBase
public class NotificationSettings : Infragistics.Shared.SubObjectBase 
Remarks

The NotificationSettings class enacapsulates the notification functionality extended by the UltraValidator component. Most of the settings related to the way that the end user is notified when a validation error occurs are exposed by this class. The type of notification that is issued is defined by the Action property, which is of type NotificationAction, an enumeration which defines each of the available ways to notify the end user. The following table lists each constant along with a high-level description of its behavior and how it utilizes the other properties of this class:

This setting causes a balloon tipto be displayed, with the callout pointing to the control/embeddable element's upper right corner. The value of the Captionproperty is displayed in the balloon tip's title, the value of the Textproperty defines the text that it displays, and the value of the Imageproperty defines the image it displays.

Note: The BalloonTip is only displayed when the associated control or embeddable editor has the input focus. When a validation is triggered by the control/editor losing focus (see ValidationTrigger, the balloon tip will notbe displayed unless the RetainFocusOnErrorproperty is explictly set to true, since the default value for that property is false. With all of the previously mentioned settings, a sound is played prior to the visual notification if the Soundproperty is explicitly set. For the SoundOnly setting, no visual notification is displayed, but rather this sound is played. In the case where the Actionproperty is set to 'SoundOnly', and the Sound property has not been explicitly set, the Beepproperty is used to generate a system-defined sound. As the name implies, no notification is issued by the UltraValidator. The ValidationErrorevent fires independently of the notification settings; the 'None' setting can be used to suppress notification altogether, or to display a customized notification such as a dialog.

Constant Description
Image

For standalone controls, this setting closely resembles the funtionality provided by the Windows Forms ErrorProvider component. Where the ErrorProvider only supports icons, however, UltraValidator supports the display of any image. The image that is displayed is defined by the Image property. In the absence of an explicit setting, a red circle with a white 'X'is displayed. The size at which the image is displayed is determined by the ErrorImageSize property. The amount of horizontal space between the control and the error image is determined by the ErrorImagePadding property. The placement of the error image, as relative to the controls' bounds, is determined by the ErrorImageAlignment property. Transparency for these images is fully supported; by default, the color of the lower left pixel determines the color that is masked out when the image is displayed. The color designated as the transparent color can be explicitly specified using the ErrorImageTransparentColor property. The image can be made to blink at a specific interval; whether the image blinks is determined by the ErrorImageBlinkStyle property, and the interval at which it blinks is determined by the ErrorImageBlinkRate property. When the end user hovers the mouse over this image, a balloon tip is displayed, with the callout pointing to the image. If blinking was enabled, it is suspended during the time that the cursor remains positioned over the control. The value of the Caption property is displayed in the balloon tip's title, and the value of the Text property defines the text that it displays. Double-clicking on the image causes the associated control to be selected.

For embeddable editors, the 'Image' setting is supported, but exhibits different behavior than it does for a standalone control. Most notably, the image is displayed within the embeddable editor's UI element, as opposed to outside its bounds. This image is displayed whenever the current value is invalid as defined by the validation criteria, as opposed to being shown/hidden in reponse to an explicit validation.

MessageBox This setting causes a MessageBox to be displayed when a validation session fails. The value of the Caption property is passed to the caption parameter of the MessageBox's MessageBox.Show method, and the value of the Text property is passed to its text parameter. The buttons parameter is always hardcoded to OK, since the message box is displayed for informational purposes only; the value of the icon parameter is defined by the UltraValidator's MessageBoxIcon property.
BalloonTip
SoundOnly
None

Notification settings can be specified in design mode on two different levels, the one that takes precedence being the instance returned by the NotificationSettings property of the ValidationSettings instance that is extended as a control-level property. These setting apply only to the control to which it was extended. A NotificationSettings property is also exposed by the UltraValidator component; settings on that instance apply to all controls using a ValidationSettings instance that was extended by that component instance. Furthermore, the event arguments class for the ValidationError event exposes a NotificationSettings property; this instance contains the resolved property values, all of which are settable so that a listener of that event can dynamically modify the notification behavior.

The properties of the NotificationSettings class are only applicable to the case where a single control or embeddable editor is being validated, i.e., when the validation is triggered by user interaction, or by the Validate method overload which takes a specific control reference. The Validate method overloads which support validating multiple controls provide the ability to display a MessageBox and/or error image, but this behavior is determined by the method parameters, and has no bearing on the values of the NotificationSettings properties.

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