예제 #1
0
        public FieldDefinition(FieldInfo fieldInfo)
        {
            this.FieldName       = fieldInfo.Name;
            this.fieldDefinition = String.Format("{0} {1} {2}",
                                                 TypeModifier.GetAccessModifier(fieldInfo.GetType()),
                                                 fieldInfo.FieldType.Name,
                                                 fieldInfo.Name);


            //this.fieldDefinition += (fieldInfo.FieldType.IsGenericType ?
            //     String.Format("{0}<{1}>", fieldInfo.ReflectedType.Name, GetGenericType(fieldInfo.FieldType.GenericTypeArguments)) :
            //     fieldInfo.ReflectedType.Name);
        }
예제 #2
0
        public MethodDefinition(MethodInfo methodInfo)
        {
            ParameterInfo[] pi   = methodInfo.GetParameters();
            string          pars = "";

            foreach (ParameterInfo par in pi)
            {
                pars += String.Format("{0} {1},", par.ParameterType.Name, par.Name);
            }
            if (pars.Length > 0)
            {
                pars = pars.Substring(0, pars.Length - 1);
            }

            methodName = String.Format("{0} {1} {2} ({3})",
                                       TypeModifier.GetAccessModifier(methodInfo.GetType()),
                                       methodInfo.ReturnType.Name,
                                       methodInfo.Name,
                                       pars);
        }