protected internal CallableCoreWithGeneric(MethodBase[] minfos, Dictionary <Types, UniqueCallableCore> cache)
        {
            List <MethodBase> nmethods = new List <MethodBase>();
            List <MethodBase> gmethods = new List <MethodBase>();

            if (minfos != null)
            {
                foreach (var method in minfos)
                {
                    if (method != null)
                    {
                        if (method.IsGenericMethod && method.ContainsGenericParameters)
                        {
                            gmethods.Add(method);
                        }
                        else
                        {
                            nmethods.Add(method);
                        }
                    }
                }
            }

            if (gmethods.Count > 0)
            {
                if (gmethods.Count > 1)
                {
                    _GenericCore = new GroupGenericCore(gmethods.ToArray());
                }
                else
                {
                    _GenericCore = new GenericCallableCore(gmethods[0]);
                }
            }
            var rv = new PackedCallableCore(nmethods.ToArray());

            if (rv._CallableGroups.Count > 0)
            {
                if (rv._CallableGroups.Count > 1)
                {
                    _NormalCore = rv;
                }
                else
                {
                    _NormalCore = rv._CallableGroups.First().Value;
                }
            }
        }
Beispiel #2
0
 internal PackedCallableOverloadSelector(PackedCallableCore core, object tar)
 {
     _Core  = core;
     Target = tar;
 }