Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MethodAccessor"/> class.
        /// </summary>
        /// <param name="methodInfo">The method info.</param>
        public MethodAccessor(MethodInfo methodInfo)
        {
            if (methodInfo == null)
            {
                throw new ArgumentNullException(nameof(methodInfo));
            }

            MethodInfo = methodInfo;
            Name       = methodInfo.Name;
            _invoker   = new Lazy <Func <object, object[], object> >(() => DelegateFactory.CreateMethod(MethodInfo));
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MethodAccessor"/> class.
 /// </summary>
 /// <param name="methodInfo">The method info.</param>
 public MethodAccessor(MethodInfo methodInfo)
 {
     _methodInfo      = methodInfo;
     _name            = methodInfo.Name;
     _lateBoundMethod = new Lazy <LateBoundMethod>(() => DelegateFactory.CreateMethod(_methodInfo));
 }