private static int Find_String_Length(PacketBase body, System.Reflection.FieldInfo info)
{
switch (info.DeclaringType.Name)
{
case "rfidError":
switch (info.Name)
{
// case "reason":
// return ((Greenwater.rfidError)body).reasonlen;
default:
throw new rfidInvalidPacketException(String.Format("Cannot find the string length of {0}.{1}.", info.DeclaringType.Name, info.Name));
}
default:
throw new rfidInvalidPacketException(String.Format("Cannot find the length of strings in {0}.", info.DeclaringType.Name));
}
}