Esempio n. 1
0
 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();
 }
Esempio n. 2
0
 private static string GetTypeName(FieldProto ext)
 {
     return ext.HasTypeName ? ext.TypeName : Types[ext.Type];
 }
Esempio n. 3
0
 private static string GetTypeName(FieldProto ext)
 {
     return(ext.HasTypeName ? ext.TypeName : Types[ext.Type]);
 }
Esempio n. 4
0
 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();
 }