Пример #1
0
        public override PolicyMethodBinding BindMethod(
            MethodRule rule, MethodDispatch dispatch,
            DefinitionAttribute attribute)
        {
            var binding = base.BindMethod(rule, dispatch, attribute);

            InferVariance(binding);
            return(binding);
        }
Пример #2
0
 public PolicyMethodBinding(MethodRule rule,
                            MethodDispatch dispatch,
                            DefinitionAttribute attribute,
                            CallbackPolicy policy)
     : base(dispatch)
 {
     if (rule == null)
     {
         throw new ArgumentNullException(nameof(rule));
     }
     if (dispatch == null)
     {
         throw new ArgumentNullException(nameof(dispatch));
     }
     Rule      = rule;
     Attribute = attribute;
     Policy    = policy;
 }
Пример #3
0
 public virtual PolicyMethodBinding BindMethod(MethodRule rule,
                                               MethodDispatch dispatch, DefinitionAttribute attribute)
 {
     return(Binder?.Invoke(rule, dispatch, attribute, this)
            ?? new PolicyMethodBinding(rule, dispatch, attribute, this));
 }
Пример #4
0
 public void AddMethodRule(MethodRule rule)
 {
     _rules.Add(rule);
 }