예제 #1
0
 public TypeDefinition(TypeInfo type)
 {
     TypeName    = String.Format("{0} {1}", TypeModifier.GetTypeDefinition(type), type.Name);
     Fields      = GetFields(type);
     Propierties = GetPropierties(type);
     Methods     = GetMethods(type);
 }
예제 #2
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);
        }
예제 #3
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);
        }