本文整理汇总了C#中IReadContext.ReadInt方法的典型用法代码示例。如果您正苦于以下问题:C# IReadContext.ReadInt方法的具体用法?C# IReadContext.ReadInt怎么用?C# IReadContext.ReadInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IReadContext
的用法示例。
在下文中一共展示了IReadContext.ReadInt方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
public object Read(IReadContext context)
{
int classId = context.ReadInt();
long enumValue = context.ReadLong();
return ToEnum(context, classId, enumValue);
}
示例2: Read
// #end example
// #example: Read the StringBuilder
public object Read(IReadContext readContext)
{
int length = readContext.ReadInt();
byte[] data = new byte[length];
readContext.ReadBytes(data);
return new StringBuilder(Encoding.UTF8.GetString(data));
}
示例3: Read
public override object Read(IReadContext context)
{
int i = context.ReadInt();
if (i == int.MaxValue)
{
return null;
}
return i;
}
示例4: ReadPlainObject
private object ReadPlainObject(IReadContext context)
{
int id = context.ReadInt();
Transaction transaction = context.Transaction();
object obj = transaction.ObjectForIdFromCache(id);
if (obj != null)
{
return obj;
}
obj = new object();
AddReference(context, obj, id);
return obj;
}
示例5: ReadKind
protected virtual object ReadKind(IReadContext context, DateTime dateTime)
{
DateTimeKind kind = (DateTimeKind) context.ReadInt();
return DateTime.SpecifyKind(dateTime, kind);
}
示例6: ReadElements
private static void ReadElements(IReadContext context, ICollectionInitializer initializer, ITypeHandler4 elementHandler)
{
int elementCount = context.ReadInt();
for (int i = 0; i < elementCount; i++)
{
initializer.Add(context.ReadObject(elementHandler));
}
}
示例7: Read
public override object Read(IReadContext context)
{
return context.ReadInt();
}
示例8: Read
public override object Read(IReadContext context)
{
return Sharpen.Runtime.IntBitsToFloat(context.ReadInt());
}