private static object GetValue(FieldProto fdp, UnknownField unknownField) { if (unknownField.VarintList.Count > 0) { return(unknownField.VarintList[0]); } if (unknownField.Fixed32List.Count > 0) { if (fdp.Type == Type.TYPE_FLOAT) { return(BitConverter.ToSingle(BitConverter.GetBytes(unknownField.Fixed32List[0]), 0)); } return(unknownField.Fixed32List[0]); } throw new Exception(); }
private static string GetTypeName(FieldProto ext) { return ext.HasTypeName ? ext.TypeName : Types[ext.Type]; }
private static string GetTypeName(FieldProto ext) { return(ext.HasTypeName ? ext.TypeName : Types[ext.Type]); }
private static object GetValue(FieldProto fdp, UnknownField unknownField) { if (unknownField.VarintList.Count > 0) return unknownField.VarintList[0]; if (unknownField.Fixed32List.Count > 0) { if (fdp.Type == Type.TYPE_FLOAT) return BitConverter.ToSingle(BitConverter.GetBytes(unknownField.Fixed32List[0]), 0); return unknownField.Fixed32List[0]; } throw new Exception(); }