public static void Save(IValueSink sink, Recipient value)
{
sink.EnterChoice((byte)value.Tag);
switch(value.Tag)
{
case Tags.Device:
Value<DeviceWrapper>.Save(sink, (DeviceWrapper)value);
break;
case Tags.Address:
Value<AddressWrapper>.Save(sink, (AddressWrapper)value);
break;
default:
throw new Exception();
}
sink.LeaveChoice();
}