コード例 #1
0
ファイル: MinLength.cs プロジェクト: simonep77/bdo
        internal override void Validate(Schema.Definition.Property propIn, object value)
        {
            string sVal = value as string;

            if (sVal.Length < this.Value)
            {
                throw new ObjectException(this.CustomMessage, propIn.Schema.ClassName, propIn.Name, this.Value);
            }
        }
コード例 #2
0
ファイル: ValidateRegex.cs プロジェクト: simonep77/bdo
        internal override void Validate(Schema.Definition.Property propIn, object value)
        {
            string sVal = value as string;

            if (!System.Text.RegularExpressions.Regex.IsMatch(sVal, this.Value))
            {
                throw new ObjectException(this.CustomMessage, propIn.Schema.ClassName, propIn.Name, this.Value);
            }
        }
コード例 #3
0
        internal override void Validate(Schema.Definition.Property propIn, object value)
        {
            var dVal = Convert.ToDouble(value);

            if (dVal < this.From || dVal > this.To)
            {
                throw new ObjectException(this.CustomMessage, propIn.Schema.ClassName, propIn.Name, this.From, this.To);
            }
        }
コード例 #4
0
ファイル: MinLength.cs プロジェクト: simonep77/bdo
 internal override bool CanApplyToProperty(Schema.Definition.Property propIn)
 {
     return(TypeHelper.IsString(propIn.Type));
 }