private void DeriveItemType() { ItemType = ItemType.Unknown; foreach (string line in dataLines) { //If we hit a separator, we haven't found an item type that matches if (line.Equals(Separator)) { break; } //Try to parse into an item type ItemType parsedType = BaseTypes.GetItemType(line); if (parsedType != ItemType.Unknown) { ItemType = parsedType; break; } } }