public void GenerateLoad(IILGen ilGenerator, Action<IILGen> pushReader, Action<IILGen> pushCtx, Action<IILGen> pushDescriptor, Type targetType)
{
pushReader(ilGenerator);
Type typeRead;
if (_signed)
{
ilGenerator.Call(() => default(AbstractBufferedReader).ReadVInt64());
typeRead = typeof(long);
}
else
{
ilGenerator.Call(() => default(AbstractBufferedReader).ReadVUInt64());
typeRead = typeof(ulong);
}
if (targetType == typeof(object))
{
ilGenerator.Do(pushDescriptor);
if (_signed)
{
ilGenerator.Newobj(() => new DynamicEnum(0L, null));
}
else
{
ilGenerator.Newobj(() => new DynamicEnum(0UL, null));
}
ilGenerator.Castclass(typeof(object));
return;
}
new DefaultTypeConvertorGenerator().GenerateConversion(typeRead, targetType.GetEnumUnderlyingType())(ilGenerator);
}