public MinTargetSizeRule() : base() { base.name = RuleTypeEnumHelper.ToType(RuleTypeEnum.MIN_TARGET_SIZE_RULE); base.exProperty = "include"; this.unit = "kb"; }
public MinLengthRule() : base() { base.name = RuleTypeEnumHelper.ToType(RuleTypeEnum.MIN_LENGTH_RULE); base.exProperty = "include"; this.unit = UNIT_BYTE; }
public XmlElement ToElement(String fieldId) { XmlElement rule = XmlUtils.CreateRootElement("rule"); if (StringUtil.IsEmpty(this.name)) { throw new TopSchemaException(TopSchemaErrorCodeEnum.ERROR_CODE_31001, fieldId); } if (StringUtil.IsEmpty(this.value)) { throw new TopSchemaException(TopSchemaErrorCodeEnum.ERROR_CODE_31002, fieldId); } rule.SetAttribute("name", this.name); rule.SetAttribute("value", this.value); if (!StringUtil.IsEmpty(exProperty)) { rule.SetAttribute("exProperty", this.exProperty); } //for Special if (this.name.Equals(RuleTypeEnumHelper.ToType(RuleTypeEnum.MAX_TARGET_SIZE_RULE))) { MaxTargetSizeRule mtsRule = (MaxTargetSizeRule)this; if (!StringUtil.IsEmpty(mtsRule.Unit)) { rule.SetAttribute("unit", mtsRule.Unit); } } if (this.name.Equals(RuleTypeEnumHelper.ToType(RuleTypeEnum.MIN_TARGET_SIZE_RULE))) { MinTargetSizeRule misRule = (MinTargetSizeRule)this; if (!StringUtil.IsEmpty(misRule.Unit)) { rule.SetAttribute("unit", misRule.Unit); } } if (this.name.Equals(RuleTypeEnumHelper.ToType(RuleTypeEnum.TIP_RULE))) { TipRule tipRule = (TipRule)this; if (!StringUtil.IsEmpty(tipRule.Url)) { rule.SetAttribute("url", tipRule.Url); } } if (this.name.Equals(RuleTypeEnumHelper.ToType(RuleTypeEnum.DEV_TIP_RULE))) { DevTipRule devTipRule = (DevTipRule)this; if (!StringUtil.IsEmpty(devTipRule.Url)) { rule.SetAttribute("url", devTipRule.Url); } } //depend element if (dependGroup != null && !dependGroup.IsEmpty()) { XmlElement depend = dependGroup.ToElement(); XmlUtils.AppendElement(rule, depend); } return(rule); }
public MaxValueRule(String value, bool isInclude) : base(RuleTypeEnumHelper.ToType(RuleTypeEnum.MAX_VALUE_RULE), value) { if (isInclude) { base.exProperty = "include"; } else { base.exProperty = "not include"; } }
public MaxImageSizeRule(String value, bool isInclude) : base(RuleTypeEnumHelper.ToType(RuleTypeEnum.MAX_IMAGE_SIZE_RULE), value) { if (isInclude) { base.exProperty = "include"; } else { base.exProperty = "not include"; } }
public MaxInputNumRule(String value, bool isInclude) : base(RuleTypeEnumHelper.ToType(RuleTypeEnum.MAX_INPUT_NUM_RULE), value) { if (isInclude) { base.exProperty = "include"; } else { base.exProperty = "not include"; } }
public MinDecimalDigitsRule(string value, bool isInclude) : base(RuleTypeEnumHelper.ToType(RuleTypeEnum.MIN_DECIMAL_DIGITS_RULE), value) { if (isInclude) { base.exProperty = "include"; } else { base.exProperty = "not include"; } }
public MinTargetSizeRule(String value, bool isInclude, string unit) : base(RuleTypeEnumHelper.ToType(RuleTypeEnum.MIN_TARGET_SIZE_RULE), value) { if (isInclude) { base.exProperty = "include"; } else { base.exProperty = "not include"; } this.unit = unit; }
public MaxLengthRule(String value, bool isInclude, String unit) : base(RuleTypeEnumHelper.ToType(RuleTypeEnum.MAX_LENGTH_RULE), value) { if (isInclude) { base.exProperty = "include"; } else { base.exProperty = "not include"; } this.unit = unit; }
public MinDecimalDigitsRule() : base() { base.name = RuleTypeEnumHelper.ToType(RuleTypeEnum.MIN_DECIMAL_DIGITS_RULE); base.exProperty = "include"; }
public DisableRule() : base() { base.name = RuleTypeEnumHelper.ToType(RuleTypeEnum.DISABLE_RULE); base.value = "false"; }
public MinTargetSizeRule(string value) : base(RuleTypeEnumHelper.ToType(RuleTypeEnum.MIN_TARGET_SIZE_RULE), value, "include") { }
public ReadOnlyRule(string value) : base(RuleTypeEnumHelper.ToType(RuleTypeEnum.READ_ONLY_RULE), value) { }
public DisableRule(string value) : base(RuleTypeEnumHelper.ToType(RuleTypeEnum.DISABLE_RULE), value) { }
public MaxImageSizeRule() : base() { base.name = RuleTypeEnumHelper.ToType(RuleTypeEnum.MAX_IMAGE_SIZE_RULE); base.exProperty = "include"; }
public MaxImageSizeRule(string value) : base(RuleTypeEnumHelper.ToType(RuleTypeEnum.MAX_IMAGE_SIZE_RULE), value, "include") { }
public MaxValueRule() : base() { base.name = RuleTypeEnumHelper.ToType(RuleTypeEnum.MAX_VALUE_RULE); base.exProperty = "include"; }
public MaxInputNumRule(String value) : base(RuleTypeEnumHelper.ToType(RuleTypeEnum.MAX_INPUT_NUM_RULE), value, "include") { }
public MaxInputNumRule() : base() { base.name = RuleTypeEnumHelper.ToType(RuleTypeEnum.MAX_INPUT_NUM_RULE); base.exProperty = "include"; }
public MinInputNumRule(string value) : base(RuleTypeEnumHelper.ToType(RuleTypeEnum.MIN_INPUT_NUM_RULE), value, "include") { }
public MinDecimalDigitsRule(string value) : base(RuleTypeEnumHelper.ToType(RuleTypeEnum.MIN_DECIMAL_DIGITS_RULE), value, "include") { }
public MaxLengthRule() : base() { base.name = RuleTypeEnumHelper.ToType(RuleTypeEnum.MAX_LENGTH_RULE); base.exProperty = "include"; }
public RequiredRule() { base.name = RuleTypeEnumHelper.ToType(RuleTypeEnum.REQUIRED_RULE); }
public MinLengthRule(string value) : base(RuleTypeEnumHelper.ToType(RuleTypeEnum.MIN_LENGTH_RULE), value, "include") { }
public MaxLengthRule(string value) : base(RuleTypeEnumHelper.ToType(RuleTypeEnum.MAX_LENGTH_RULE), value, "include") { this.unit = UNIT_BYTE; }
public MaxValueRule(String value) : base(RuleTypeEnumHelper.ToType(RuleTypeEnum.MAX_VALUE_RULE), value, "include") { }
public RegexRule() { base.name = RuleTypeEnumHelper.ToType(RuleTypeEnum.REGEX_RULE); }
public RegexRule(string value) : base(RuleTypeEnumHelper.ToType(RuleTypeEnum.REGEX_RULE), value) { }
public RequiredRule(string value) : base(RuleTypeEnumHelper.ToType(RuleTypeEnum.REQUIRED_RULE), value) { }
public ReadOnlyRule() { base.name = RuleTypeEnumHelper.ToType(RuleTypeEnum.READ_ONLY_RULE); }