C# 클래스 WPF.JoshSmith.Controls.Validation.RegexValidator

This static class provides attached properties which supply validation of the text in a TextBox, using regular expressions.
Documentation: http://www.codeproject.com/KB/WPF/RegexValidationInWPF.aspx
파일 보기 프로젝트 열기: Warewolf-ESB/Warewolf

공개 프로퍼티들

프로퍼티 타입 설명
ErrorMessageProperty System.Windows.DependencyProperty
RegexTextProperty System.Windows.DependencyProperty

공개 메소드들

메소드 설명
GetErrorMessage ( TextBox textBox ) : string

Returns the error message used when validation fails for the specified TextBox.

GetRegexText ( TextBox textBox ) : string

Returns the regular expression used to validate the specified TextBox.

SetErrorMessage ( TextBox textBox, string value ) : void

Sets the error message used when validation fails for the specified TextBox.

SetRegexText ( TextBox textBox, string value ) : void

Sets the regular expression used to validate the specified TextBox.

비공개 메소드들

메소드 설명
GetRegexValidationRuleForTextBox ( TextBox textBox ) : RegexValidationRule

Returns a RegexValidationRule to be used for validating the specified TextBox. If the TextBox is not yet initialized, this method returns null.

OnAttachedPropertyChanged ( DependencyObject depObj, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Invoked whenever an attached property of the RegexValidator is modified for a TextBox.

RegexValidator ( ) : System
VerifyRegexValidationRule ( TextBox textBox ) : void

Creates or modifies the RegexValidationRule in the TextBox's Text property binding to use the current values of the attached properties exposed by this class.

메소드 상세

GetErrorMessage() 공개 정적인 메소드

Returns the error message used when validation fails for the specified TextBox.
public static GetErrorMessage ( TextBox textBox ) : string
textBox System.Windows.Controls.TextBox The TextBox whose error message is returned.
리턴 string

GetRegexText() 공개 정적인 메소드

Returns the regular expression used to validate the specified TextBox.
public static GetRegexText ( TextBox textBox ) : string
textBox System.Windows.Controls.TextBox The TextBox whose regular expression is returned.
리턴 string

SetErrorMessage() 공개 정적인 메소드

Sets the error message used when validation fails for the specified TextBox.
public static SetErrorMessage ( TextBox textBox, string value ) : void
textBox System.Windows.Controls.TextBox The TextBox being validated.
value string The error message.
리턴 void

SetRegexText() 공개 정적인 메소드

Sets the regular expression used to validate the specified TextBox.
public static SetRegexText ( TextBox textBox, string value ) : void
textBox System.Windows.Controls.TextBox The TextBox being validated.
value string The regular expression.
리턴 void

프로퍼티 상세

ErrorMessageProperty 공개적으로 정적으로 프로퍼티

Identifies the RegexValidator's ErrorMessage attached property. This field is read-only.
public static DependencyProperty,System.Windows ErrorMessageProperty
리턴 System.Windows.DependencyProperty

RegexTextProperty 공개적으로 정적으로 프로퍼티

Identifies the RegexValidator's RegexText attached property. This field is read-only.
public static DependencyProperty,System.Windows RegexTextProperty
리턴 System.Windows.DependencyProperty