Example #1
0
        public static Dictionary <String, int> GetFieldInfo(Type structType)
        {
            FieldInfo[] infos = StructOpt.GetFieldInfosOfStructure(structType);
            Dictionary <String, int> fields = new Dictionary <String, int>();

            foreach (FieldInfo info in infos)
            {
                fields.Add(info.Name, StructOpt.GetMaxSizeOfField(info));
            }
            return(fields);
        }
Example #2
0
        public static int[] GetMaxSizeOfStructure(Type structType)
        {
            FieldInfo[] infos   = StructOpt.GetFieldInfosOfStructure(structType);
            int[]       maxSize = new int[infos.Length];
            int         index   = 0;

            foreach (FieldInfo info in infos)
            {
                maxSize[index++] = StructOpt.GetMaxSizeOfField(info);
            }
            return(maxSize);
        }
Example #3
0
        public static String[] GetFieldNamesOfStructure(Type structType)
        {
            FieldInfo[] infos      = StructOpt.GetFieldInfosOfStructure(structType);
            String[]    fieldNames = new String[infos.Length];
            int         index      = 0;

            foreach (FieldInfo info in infos)
            {
                fieldNames[index++] = info.Name;
            }
            return(fieldNames);
        }