public ParamRule Build() { var rule = new ParamRule(); if (_areForbidden.HasValue) { rule.AddItem(RuleType.AreForbidden, _areForbidden); } if (_validAttributes.Any()) { rule.AddItem(RuleType.ValidAttributes, _validAttributes); } if (_forbiddenAttributes.Any()) { rule.AddItem(RuleType.InValidAttributes, _forbiddenAttributes); } if (_hasGetter != null) { rule.AddItem(RuleType.HasGetter, _hasGetter); } if (_hasSetter != null) { rule.AddItem(RuleType.HasSetter, _hasSetter); } rule.AddMany(((NameParam)_nameParam).Build()); return(rule); }
public ParamRule Build() { var rule = new ParamRule(); if (_areForbidden.HasValue) { rule.AddItem(RuleType.AreForbidden, _areForbidden); } if (_validAttributes.Any()) { rule.AddItem(RuleType.ValidAttributes, _validAttributes); } if (_forbiddenAttributes.Any()) { rule.AddItem(RuleType.InValidAttributes, _forbiddenAttributes); } if (_areVoid.HasValue) { rule.AddItem(RuleType.AreVoid, _areVoid); } if (_minArgsCount.HasValue) { rule.AddItem(RuleType.HasMoreArgsThan, _minArgsCount); } if (_maxArgsCount.HasValue) { rule.AddItem(RuleType.HasLessArgsThan, _maxArgsCount); } rule.AddMany(((NameParam)_nameParam).Build()); rule.AddMany(((ArgsNameParam)_argsNameParam).Build()); return(rule); }
public ParamRule Build() { var rule = new ParamRule(); if (_areForbidden.HasValue) { rule.AddItem(RuleType.AreForbidden, _areForbidden); } if (_validAttributes.Any()) { rule.AddItem(RuleType.ValidAttributes, _validAttributes); } if (_forbiddenAttributes.Any()) { rule.AddItem(RuleType.InValidAttributes, _forbiddenAttributes); } if (_inherits != null) { rule.AddItem(RuleType.Inherits, _inherits); } if (_implementTypes.Any()) { rule.AddItem(RuleType.Implements, _implementTypes); } if (_maxAllowedMethods.HasValue) { rule.AddItem(RuleType.MaxMethods, _maxAllowedMethods); } if (_maxAllowedProperties.HasValue) { rule.AddItem(RuleType.MaxProperties, _maxAllowedProperties); } if (_hasPublicConstructor != null) { rule.AddItem(RuleType.HasPublicConstructor, _hasPublicConstructor); } if (_defaultConstructorOptions != null) { rule.AddItem(RuleType.DefaultConstructor, _defaultConstructorOptions); } rule.AddMany(((NameParam)_nameParam).Build()); return(rule); }