internal EnumSerializer.EnumPair[] GetEnumMap() { if (enumPassthru) { return(null); } EnumSerializer.EnumPair[] result = new EnumSerializer.EnumPair[fields.Count]; for (int i = 0; i < result.Length; i++) { ValueMember member = (ValueMember)fields[i]; int wireValue = member.FieldNumber; Enum value = member.GetEnumValue(); result[i] = new EnumSerializer.EnumPair(wireValue, value); } return(result); }
internal EnumSerializer.EnumPair[] GetEnumMap() { if (!Helpers.IsEnum(Type)) { return(null); } if (GetFinalSettingsCopy().EnumPassthru.GetValueOrDefault()) { return(null); } var fields = _fields.Cast <ValueMember>().ToArray(); EnumSerializer.EnumPair[] result = new EnumSerializer.EnumPair[fields.Length]; for (int i = 0; i < result.Length; i++) { ValueMember member = (ValueMember)fields[i]; int wireValue = member.FieldNumber; object value = member.GetRawEnumValue(); result[i] = new EnumSerializer.EnumPair(wireValue, value, member.MemberType); } return(result); }