コード例 #1
0
 private static FieldData AssembleField(FieldInfo field)
 {
     return(new FieldData()
     {
         Type = TypeNaming.GetFullTypeName(field.FieldType)
     });
 }
コード例 #2
0
 private static EventData AssembleEvent(EventInfo e)
 {
     return(new EventData()
     {
         HandlerType = TypeNaming.GetFullTypeName(e.EventHandlerType),
         IsMulticast = e.IsMulticast
     });
 }
コード例 #3
0
 private static PropertyData AssembleProperty(PropertyInfo property)
 {
     return(new PropertyData()
     {
         Accessors = GetAccessors(property),
         Type = TypeNaming.GetFullTypeName(property.PropertyType)
     });
 }
コード例 #4
0
        private static string[] AssembleConstructor(ConstructorInfo ctor)
        {
            var parameters = new List <string>();

            foreach (ParameterInfo param in ctor.GetParameters())
            {
                parameters.Add(TypeNaming.GetFullTypeName(param.ParameterType));
            }

            return(parameters.ToArray());
        }
コード例 #5
0
        private static IndexerData AssembleIndexer(PropertyInfo indexer)
        {
            var paramTypes = new List <string>();

            foreach (ParameterInfo param in indexer.GetIndexParameters())
            {
                paramTypes.Add(TypeNaming.GetFullTypeName(param.ParameterType));
            }

            return(new IndexerData()
            {
                Accessors = GetAccessors(indexer),
                ItemType = TypeNaming.GetFullTypeName(indexer.PropertyType),
                Parameters = paramTypes.ToArray()
            });
        }
コード例 #6
0
        private static MethodData AssembleMethod(List <MethodInfo> methodOverloads)
        {
            var overloads = new List <string[]>();

            foreach (MethodInfo overload in methodOverloads)
            {
                var parameters = new List <string>();
                foreach (ParameterInfo param in overload.GetParameters())
                {
                    parameters.Add(TypeNaming.GetFullTypeName(param.ParameterType));
                }
                overloads.Add(parameters.ToArray());
            }

            return(new MethodData()
            {
                ReturnType = TypeNaming.GetFullTypeName(methodOverloads[0].ReturnType),
                OverloadParameters = overloads.ToArray()
            });
        }