Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public BuildInfo(Type type, InjectConstructor constructor, IBuilderValue[] values)
 {
     this.buildType   = type;
     this.constructor = constructor;
     this.values      = values;
 }
Beispiel #4
0
 public static ICallPolicy AddMachRule <TMatchRule>(this ICallPolicy source, InjectConstructor constructor = null, params IBuilderValue[] values)
     where TMatchRule : ICallMatchRule
 {
     return(source.AddMachRule(typeof(TMatchRule), constructor, values));
 }
Beispiel #5
0
 public static ICallPolicy AddMachRule(this ICallPolicy source, Type matchRuleType, InjectConstructor constructor = null)
 {
     return(source.AddMachRule(matchRuleType, constructor, null));
 }
Beispiel #6
0
 public static ICallPolicy AddBehaviour <TAopBehaviour>(this ICallPolicy source, InjectConstructor constructor = null, params IBuilderValue[] values)
     where TAopBehaviour : IAopBehaviour
 {
     return(source.AddBehaviour(typeof(TAopBehaviour), constructor, values));
 }
Beispiel #7
0
 public static ICallPolicy AddBehaviour(this ICallPolicy source, Type behaviourType, InjectConstructor constructor = null)
 {
     return(source.AddBehaviour(behaviourType, constructor, null));
 }