/// <summary> /// Override to deserialize the object from the GFF file's binary data. /// </summary> /// <param name="rawField">The raw field from the GFF</param> /// <param name="rawData">The GFF's raw file data</param> void IGffFieldSerialize.Deserialize(RawGffData.RawGffField rawField, RawGffData rawData) { // Get the list of structure indeces for the items in the list uint[] indeces = rawData.GetListIndeces(rawField.DataOrDataOffset); // Create a field collection for the structures, and loop through // the index array. GffFieldCollection fields = new GffFieldCollection(); for (int i = 0; i < indeces.Length; i++) { // Get the raw structure data for this structure. RawGffData.RawGffStruct rawStruct = rawData.GetStruct(indeces[i]); // Create a GffStructField object for the structure and set it's // structure type. GffStructField field = (GffStructField) GffFieldFactory.CreateField(GffFieldType.Struct); field.StructureType = rawStruct.Type; // Create a dummy field object so we can deserialize the structure, // set it's DataOrDataOffset to the structure index. RawGffData.RawGffField dummyField = new RawGffData.RawGffField(GffFieldType.Struct); dummyField.LabelIndex = 0; dummyField.DataOrDataOffset = indeces[i]; // Deserialize the structure. ((IGffFieldSerialize) field).Deserialize(dummyField, rawData); // Add the structure to the collection. fields.Add(field); } Value = fields; }