Inheritance: ValidatorBase
コード例 #1
0
        public static IValidator GetByType(ValidatorType type)
        {
            IValidator validator;

            switch (type)
            {
            case ValidatorType.EMPTY:
                validator = new ValidatorEmpty();
                break;

            case ValidatorType.MONTH:
                validator = new ValidatorMonth();
                break;

            case ValidatorType.YEAR:
                validator = new ValidatorYear();
                break;

            case ValidatorType.CVV:
                validator = new ValidatorCvv();
                break;

            case ValidatorType.CREDIT_CARD:
                validator = new ValidatorCreditCard();
                break;

            default:
                validator = new ValidatorEmpty();
                break;
            }
            return(validator);
        }
コード例 #2
0
ファイル: Validators.cs プロジェクト: xsolla/xsolla-unity-sdk
 public static IValidator GetByType(ValidatorType type)
 {
     IValidator validator;
     switch (type) {
         case ValidatorType.EMPTY:
             validator = new ValidatorEmpty();
             break;
         case ValidatorType.MONTH:
             validator = new ValidatorMonth();
             break;
         case ValidatorType.YEAR:
             validator = new ValidatorYear();
             break;
         case ValidatorType.CVV:
             validator = new ValidatorCvv();
             break;
         case ValidatorType.CREDIT_CARD:
             validator = new ValidatorCreditCard();
             break;
         default:
             validator = new ValidatorEmpty();
             break;
     }
     return validator;
 }