private TBox _FindMethod(MethodSearch search)
        {
            var bindingFlags = search.Context.AccessModifier.ToBindingFlags().Add(search.Context.MethodType.ToBindingFlags());
            var methodInfo   = search.Context.OwnerType.FoundMatchingType.GetMethods(bindingFlags).FindBestMatchingMethodInfo(search);

            return(BuildMethod(MethodBoxBuilderContext.Build(methodInfo, Options)).MethodInfoBox);
        }
        private MethodBoxBuilderResult <TBox> BuildMethod(MethodBoxBuilderContext options)
        {
            if (_methodBoxBuilderAction == null)
            {
                throw new Exception("MethodBoxBuilderAction is not defined!");
            }
            var boxkit = new MethodBoxBuilderResult <TBox>();

            _methodBoxBuilderAction(options, boxkit);
            if (boxkit.Ignore)
            {
                return(null);
            }

            return(boxkit);
        }
        public TBox RegisterMethod(MethodInfo methodInfo)
        {
            var box = BuildMethod(MethodBoxBuilderContext.Build(methodInfo, Options));

            return(_methodInfoBoxCache.Add(box));
        }