Пример #1
0
        private MethodDefinitionHandle CreateMethods(MethodInfo[] methods)
        {
            if (methods.Length == 0)
            {
                return(default(MethodDefinitionHandle));
            }

            var handles = new MethodDefinitionHandle[methods.Length];

            for (var i = 0; i < methods.Length; i++)
            {
                var method = methods[i];
                handles[i] = GetOrCreateMethod(method);
            }

            return(handles.First());
        }
        internal MethodDefinitionHandle CreateConstructors(ConstructorInfo[] constructors)
        {
            if (constructors.Length == 0)
            {
                return(default(MethodDefinitionHandle));
            }

            var handles = new MethodDefinitionHandle[constructors.Length];

            for (var i = 0; i < constructors.Length; i++)
            {
                var ctor    = constructors[i];
                var ctorDef = CreateConstructor(ctor);
                handles[i] = ctorDef;
            }

            return(handles.First());
        }