Exemplo n.º 1
0
        private UserConstructor DefineConstructor(UserType type, List <string> modifiers, String[] parTypes, String[] parNames)
        {
            MethodAttributes attr = MethodAttributes.HideBySig | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName;

            foreach (String s in modifiers)
            {
                attr |= (MethodAttributes)Enum.Parse(typeof(MethodAttributes), s, true);
            }

            IdEntry[] pars = new IdEntry[parTypes.Length];
            for (int i = 0; i < parTypes.Length; i++)
            {
                pars[i] = this.GetTypeIdEntry(parTypes[i]);
            }
            UserConstructor cb = type.DefineConstructor(attr, pars, parNames);

            return(cb);
        }