private static byte[] FromFloat(object value, int order) { if (value is double d || double.TryParse(value.ToString(), out d)) { return(ProtoBufSerializer.GetData(d, order)); } return(null); }
private static byte[] FromBool(object value, int order) { if (value is bool b || bool.TryParse(value.ToString(), out b)) { return(ProtoBufSerializer.GetData(b, order)); } return(null); }
private static byte[] FromUint32(object value, int order) { if (value is uint v1 || uint.TryParse(value.ToString(), out v1)) { return(ProtoBufSerializer.GetData(v1, order)); } return(null); }
private static byte[] FromString(object value, int order) { var s = value.ToString(); return(ProtoBufSerializer.GetData(s, order)); }