Пример #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();
 }
Пример #2
0
 private static string GetTypeName(FieldProto ext)
 {
     return ext.HasTypeName ? ext.TypeName : Types[ext.Type];
 }
Пример #3
0
 private static string GetTypeName(FieldProto ext)
 {
     return(ext.HasTypeName ? ext.TypeName : Types[ext.Type]);
 }
Пример #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();
 }