public ICallPolicy AddMachRule(Type machRuleType, InjectConstructor constructor, IBuilderValue[] values) { if (machRuleType == null) { return(this); } if (!typeof(ICallMatchRule).IsAssignableFrom(machRuleType)) { throw new ArgumentException("machRuleType not AssignableFrom:" + typeof(ICallPolicy)); } BuildInfo rule = new BuildInfo(machRuleType, constructor, values); machRules.Add(rule); return(this); }
public ICallPolicy AddBehaviour(Type behaviourType, InjectConstructor constructor, IBuilderValue[] values) { if (behaviourType == null) { throw new ArgumentNullException(nameof(behaviourType)); } if (!typeof(IAopBehaviour).IsAssignableFrom(behaviourType)) { throw new ArgumentException("<{0}> not implement <{1}>, type:<{2}>".FormatArgs(nameof(behaviourType), nameof(IAopBehaviour), behaviourType.FullName), nameof(behaviourType)); } var data = new BuildInfo(behaviourType, constructor, values); behaviourDatas.Add(data); return(this); }
public BuildInfo(Type type, InjectConstructor constructor, IBuilderValue[] values) { this.buildType = type; this.constructor = constructor; this.values = values; }
public static ICallPolicy AddMachRule <TMatchRule>(this ICallPolicy source, InjectConstructor constructor = null, params IBuilderValue[] values) where TMatchRule : ICallMatchRule { return(source.AddMachRule(typeof(TMatchRule), constructor, values)); }
public static ICallPolicy AddMachRule(this ICallPolicy source, Type matchRuleType, InjectConstructor constructor = null) { return(source.AddMachRule(matchRuleType, constructor, null)); }
public static ICallPolicy AddBehaviour <TAopBehaviour>(this ICallPolicy source, InjectConstructor constructor = null, params IBuilderValue[] values) where TAopBehaviour : IAopBehaviour { return(source.AddBehaviour(typeof(TAopBehaviour), constructor, values)); }
public static ICallPolicy AddBehaviour(this ICallPolicy source, Type behaviourType, InjectConstructor constructor = null) { return(source.AddBehaviour(behaviourType, constructor, null)); }