PowerTools InputMan for Windows Forms 8.0J
GetValidateItems メソッド (GcTimeValidator)
使用例 

検証するターゲット。
ValidateItem のコレクションを取得します。
構文
Public Overrides Function GetValidateItems( _
   ByVal control As Control _
) As Validator(Of GcTime)
public override Validator<GcTime> GetValidateItems( 
   Control control
)

パラメータ

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

public void SetGcTimeValidatorSettings()
{
    // Creates an instance of a GcTime control.
    GcTime gcTime1 = new GcTime();
    // Creates an instance of a GcTimeValidator component.
    GcTimeValidator gcTimeValidator1 = new GcTimeValidator();
    // Creates a InvalidValue object.
    GcTimeValidator.InvalidValue invalidValue1 = new GcTimeValidator.InvalidValue();
    invalidValue1.NullIsValid = false;
    // Creates a ValueProcess object.
    ValueProcess valueProcess1 = new ValueProcess();
    valueProcess1.ValueProcessOption = ValueProcessOption.Restore;
    // Gets the ValidateActions defined for the gcTime, and adds the ThreeStateIconNotify object to the collection.
    gcTimeValidator1.GetValidateActions(gcTime1).AddRange(new ValidateAction[] {valueProcess1});
    // Gets the ValidateItems defined for the gcTime, and adds the InvalidValue object to the collection.
    gcTimeValidator1.GetValidateItems(gcTime1).AddRange(new object[] { invalidValue1 });
}
'  Please use the following namespace
'  Imports System.Windows.Forms;
'  Imports GrapeCity.Win.Editors;

Public Sub SetGcTimeValidatorSettings()
    ' 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 InvalidValue object.
    Dim invalidValue1 As New GcTimeValidator.InvalidValue()
    invalidValue1.NullIsValid = False
    ' Creates a ValueProcess object.
    Dim valueProcess1 As New ValueProcess()
    valueProcess1.ValueProcessOption = ValueProcessOption.Restore
    ' Gets the ValidateActions defined for the gcTime, and adds the ThreeStateIconNotify object to the collection.
    gcTimeValidator1.GetValidateActions(gcTime1).AddRange(New ValidateAction() {valueProcess1})
    ' Gets the ValidateItems defined for the gcTime, and adds the InvalidValue object to the collection.
    gcTimeValidator1.GetValidateItems(gcTime1).AddRange(New Object() {invalidValue1})
End Sub
参照

GcTimeValidator クラス
GcTimeValidator メンバ

 

 


© 2004-2015 GrapeCity inc. All rights reserved.