Пример #1
0
 public static MemberDefinition ReadFromByteWriter(SimpleByteWriter writer)
 {
     return(new MemberDefinition()
     {
         MemberType = writer.ReadString(),
         FieldName = writer.ReadString(),
         OriginalType = writer.ReadType()
     });
 }
Пример #2
0
        public static TypeDefinition FromBytes(byte[] bytes)
        {
            string parentType;
            int    version;

            MemberDefinition[] members;

            using (var writer = new SimpleByteWriter(bytes))
            {
                parentType = writer.ReadString();
                version    = writer.ReadInt();
                members    = new MemberDefinition[writer.ReadInt()];

                for (int i = 0; i < members.Length; i++)
                {
                    members[i] = MemberDefinition.ReadFromByteWriter(writer);
                }
            }

            return(new TypeDefinition()
            {
                ParentType = parentType,
                Version = version,
                Members = members,
            });
        }