本文整理汇总了C#中IWriteContext.WriteInt方法的典型用法代码示例。如果您正苦于以下问题:C# IWriteContext.WriteInt方法的具体用法?C# IWriteContext.WriteInt怎么用?C# IWriteContext.WriteInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWriteContext
的用法示例。
在下文中一共展示了IWriteContext.WriteInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
public void Write(IWriteContext context, object obj)
{
CustomTypeHandlerTestCase.Item item = (CustomTypeHandlerTestCase.Item)obj;
if (item.numbers == null)
{
context.WriteInt(-1);
return;
}
context.WriteInt(item.numbers.Length);
for (int i = 0; i < item.numbers.Length; i++)
{
context.WriteInt(item.numbers[i]);
}
}
示例2: Write
public virtual void Write(IWriteContext context, object obj)
{
_writeCalls++;
FieldsToTypeHandlerMigrationTestCase.Item item = (FieldsToTypeHandlerMigrationTestCase.Item
)obj;
context.WriteInt(item._id + 42);
}
示例3: Write
// #end example
// #example: Write the StringBuilder
public void Write(IWriteContext writeContext, object o)
{
StringBuilder builder = (StringBuilder) o;
string str = builder.ToString();
byte[] bytes = Encoding.UTF8.GetBytes(str);
writeContext.WriteInt(bytes.Length);
writeContext.WriteBytes(bytes);
}
示例4: Write
public override void Write(IWriteContext context, object obj)
{
context.WriteInt(Sharpen.Runtime.FloatToIntBits(((float)obj)));
}
示例5: Write
public virtual void Write(IWriteContext context, object obj)
{
_writeCalls++;
var item = (Item
) obj;
context.WriteInt(item._id + 42);
}
示例6: WriteElementCount
private void WriteElementCount(IWriteContext context, IDictionary map)
{
context.WriteInt(map.Count);
}
示例7: WriteClassMetadataIds
private void WriteClassMetadataIds(IWriteContext context, KeyValueHandlerPair handlers
)
{
context.WriteInt(0);
context.WriteInt(0);
}
示例8: Write
public void Write(IWriteContext context, object obj)
{
var item = (ItemGrandChild
) obj;
context.WriteInt(item.age);
context.WriteInt(100);
}
示例9: WriteKind
protected virtual void WriteKind(IWriteContext context, DateTime dateTime)
{
context.WriteInt((int) dateTime.Kind);
}
示例10: WriteDimensions
protected virtual void WriteDimensions(IWriteContext context, ArrayInfo info)
{
context.WriteInt(info.ElementCount());
}
示例11: WriteElementClassMetadataId
private void WriteElementClassMetadataId(IWriteContext context, ITypeHandler4 elementHandler
)
{
context.WriteInt(0);
}
示例12: WriteDimensions
protected override void WriteDimensions(IWriteContext context, ArrayInfo info)
{
var dim = ((MultidimensionalArrayInfo) info).Dimensions();
context.WriteInt(dim.Length);
for (var i = 0; i < dim.Length; i++)
{
context.WriteInt(dim[i]);
}
}
示例13: Write
public override void Write(IWriteContext context, object obj)
{
context.WriteInt(((int)obj));
}
示例14: WriteElementCount
private void WriteElementCount(IWriteContext context, ICollection collection)
{
context.WriteInt(collection.Count);
}
示例15: WriteHeader
private void WriteHeader(IWriteContext context, ArrayInfo info)
{
context.WriteInt(MarshalledClassID(Container(context), info));
_versionHelper.WriteTypeInfo(context, info);
}