PowerTools InputMan for Windows Forms 8.0J
DefaultValidateItems プロパティ (GcTimeSpanValidator)
使用例 

既定の検証アイテムのコレクションを取得または設定します。
構文
Public Overrides Property DefaultValidateItems As Validator(Of GcTimeSpan)
public override Validator<GcTimeSpan> DefaultValidateItems {get; set;}

プロパティ値

検証アイテムのコレクションを表すValidator<GcTimeSpan>. ValidateItemCollectionオブジェクト。
使用例
検証アイテムと検証アクションを設定した GcTimeSpanValidator コンポーネントを作成するコード例を次に示します。
//  Please use the following namespace
//  using System.Windows.Forms;
//  using System.Drawing
//  using GrapeCity.Win.Editors;

public void SetGcTimeSpanValidatorDefaultSettings()
{
    // Creates an instance of a GcTimeSpan control.
    GcTimeSpan gcTimeSpan1 = new GcTimeSpan();
    // Creates an instance of a GcTimeSpanValidator component.
    GcTimeSpanValidator gcTimeSpanValidator1 = new GcTimeSpanValidator();
    // Creates a instance of a ThreeStateBorderNotify object.
    ThreeStateBorderNotify threeStateBorderNotify1 = new ThreeStateBorderNotify();
    threeStateBorderNotify1.ValidLineColor = Color.Empty;
    // Creates a CompareValue object.
    GcTimeSpanValidator.CompareValue compareValue1 = new GcTimeSpanValidator.CompareValue();
    compareValue1.ComparedOperator = ComparedOperator.SmallerThanOrEquals;
    compareValue1.ComparedValue = System.TimeSpan.Parse("5.00:00:00");
    // Adds a ValidateAction object to the DefaultValidateActions.
    gcTimeSpanValidator1.DefaultValidateActions.AddRange(new ValidateAction[] {threeStateBorderNotify1});
    // Adds the compareValue to the DefaultValidateItems.
    gcTimeSpanValidator1.DefaultValidateItems.AddRange(new object[] {compareValue1});
    // The gcTimeSpan will use the DefaultValidateActions's settings
    // as well as using the ValidateAction defined for itself.
    gcTimeSpanValidator1.SetUseDefaultValidateActions(gcTimeSpan1, true);
    // The gcTimeSpan will use the DefaultValidateItems's settings
    // as well as using the ValidateItems defined for itself.
    gcTimeSpanValidator1.SetUseDefaultValidateItems(gcTimeSpan1, true);
}
'  Please use the following namespace
'  Imports System.Windows.Forms;
'  Imports System.Drawing
'  Imports GrapeCity.Win.Editors;

Public Sub SetGcTimeSpanValidatorDefaultSettings()
    ' Creates an instance of a GcTimeSpan control.
    Dim gcTimeSpan1 As New GcTimeSpan()
    ' Creates an instance of a GcTimeSpanValidator component.
    Dim gcTimeSpanValidator1 As New GcTimeSpanValidator()
    ' Creates a instance of a ThreeStateBorderNotify object.
    Dim threeStateBorderNotify1 As New ThreeStateBorderNotify()
    threeStateBorderNotify1.ValidLineColor = Color.Empty
    ' Creates a CompareValue object.
    Dim compareValue1 As New GcTimeSpanValidator.CompareValue()
    compareValue1.ComparedOperator = ComparedOperator.SmallerThanOrEquals
    compareValue1.ComparedValue = System.TimeSpan.Parse("5.00:00:00")
    ' Adds a ValidateAction object to the DefaultValidateActions.
    gcTimeSpanValidator1.DefaultValidateActions.AddRange(New ValidateAction() {threeStateBorderNotify1})
    ' Adds the compareValue to the DefaultValidateItems.
    gcTimeSpanValidator1.DefaultValidateItems.AddRange(New Object() {compareValue1})
    ' The gcTimeSpan will use the DefaultValidateActions's settings
    ' as well as using the ValidateAction defined for itself.
    gcTimeSpanValidator1.SetUseDefaultValidateActions(gcTimeSpan1, True)
    ' The gcTimeSpan will use the DefaultValidateItems's settings
    ' as well as using the ValidateItems defined for itself.
    gcTimeSpanValidator1.SetUseDefaultValidateItems(gcTimeSpan1, True)
End Sub
参照

GcTimeSpanValidator クラス
GcTimeSpanValidator メンバ

 

 


© 2004-2015 GrapeCity inc. All rights reserved.