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

既定検証項目のコレクションを取得します。
構文
Public Overrides Property DefaultValidateItems As Validator(Of GcTime)
public override Validator<GcTime> DefaultValidateItems {get; set;}

プロパティ値

既定検証項目。
使用例
次のサンプルコードは、検証項目と検証アクションを持つ GcTimeValidator コンポーネントを作成します。
//  Please use the following namespace
//  using System.Windows.Forms;
//  using System.Drawing
//  using GrapeCity.Win.Editors;

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

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

GcTimeValidator クラス
GcTimeValidator メンバ

 

 


© 2004-2015 GrapeCity inc. All rights reserved.