public static void Save(IValueSink sink, RangeType value)
{
sink.EnterChoice((byte)value.Tag);
switch(value.Tag)
{
case Tags.ByPosition:
Value<ByPosition>.Save(sink, (ByPosition)value);
break;
case Tags.BySequenceNumber:
Value<BySequenceNumber>.Save(sink, (BySequenceNumber)value);
break;
case Tags.ByTime:
Value<ByTime>.Save(sink, (ByTime)value);
break;
default:
throw new Exception();
}
sink.LeaveChoice();
}