Beispiel #1
0
        private void BuildConstructor(GenericTemplate classType, System.Reflection.ConstructorInfo constructorInfo)
        {
            var args = constructorInfo.GetParameters().Select(
                x => new VarInfo(
                    x.Name,
                    x.ParameterType.FullName == null?
                    GenericType.Get(x.ParameterType.GenericParameterPosition):
                    storage.GetType(ConvertMSILNames(x.ParameterType))
                    )).ToList();

            if (args.All(x => x.Type != null))
            {
                classType.AddConstructor(args);
            }
        }
Beispiel #2
0
        private void BuildConstructor(ClassType classType, System.Reflection.ConstructorInfo constructorInfo)
        {
            var args = constructorInfo.GetParameters().Select(
                x => new { Type = storage.GetType(ConvertMSILNames(x.ParameterType)), Name = x.Name });

            if (!args.Any(x => x.Type == null))
            {
                var constructor = new ConstructorInfo(false, classType);

                foreach (var item in args)
                {
                    constructor.AddArg(item.Name, item.Type);
                }

                classType.AddConstructor(constructor);
            }
        }