コード例 #1
0
        public static ExcelDataValidation Create(DataValidationType type, string address)
        {
            switch (type.Type)
            {
            case ExcelDataValidationType.TextLength:
            case ExcelDataValidationType.Whole:
                return(new DataValidationInt(address, type));

            case ExcelDataValidationType.Decimal:
                return(new DataValidationDecimal(address, type));

            case ExcelDataValidationType.List:
                return(new DataValidationList(address, type));

            case ExcelDataValidationType.DateTime:
                return(new DataValidationDateTime(address, type));

            case ExcelDataValidationType.Time:
                return(new DataValidationTime(address, type));

            case ExcelDataValidationType.Custom:
                return(new DataValidationCustom(address, type));

            default:
                throw new InvalidOperationException("不存在验证: " + type.Type.ToString());
            }
        }
コード例 #2
0
 internal DataValidationInt(string address, DataValidationType validationType)
     : base(address, validationType)
 {
     Formula  = new DataValidationFormulaInt();
     Formula2 = new DataValidationFormulaInt();
 }
コード例 #3
0
 internal DataValidationCustom(string address, DataValidationType validationType)
     : base(address, validationType)
 {
     Formula = new DataValidationFormulaCustom();
 }
コード例 #4
0
 internal DataValidationDateTime(string address, DataValidationType validationType)
     : base(address, validationType)
 {
     Formula  = new DataValidationFormulaDateTime();
     Formula2 = new DataValidationFormulaDateTime();
 }
コード例 #5
0
 internal DataValidationDecimal(string address, DataValidationType validationType)
     : base(address, validationType)
 {
     Formula  = new DataValidationFormulaDecimal();
     Formula2 = new DataValidationFormulaDecimal();
 }