本文整理汇总了C#中IWriteContext类的典型用法代码示例。如果您正苦于以下问题:C# IWriteContext类的具体用法?C# IWriteContext怎么用?C# IWriteContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IWriteContext类属于命名空间,在下文中一共展示了IWriteContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: WriteTypeInfo
public virtual void WriteTypeInfo(IWriteContext context, ArrayInfo info)
{
BitMap4 typeInfoBitmap = new BitMap4(2);
typeInfoBitmap.Set(0, info.Primitive());
typeInfoBitmap.Set(1, info.Nullable());
context.WriteByte(typeInfoBitmap.GetByte(0));
}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:7,代码来源:ArrayVersionHelper.cs
示例2: Write
public virtual void Write(IWriteContext context, object obj)
{
_writeCalls++;
FieldsToTypeHandlerMigrationTestCase.Item item = (FieldsToTypeHandlerMigrationTestCase.Item
)obj;
context.WriteInt(item._id + 42);
}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:7,代码来源:FieldsToTypeHandlerMigrationTestCase.cs
示例3: Write
public void Write(IWriteContext context, object obj)
{
int classId = ClassMetadataIdFor(context, obj);
context.WriteInt(classId);
context.WriteLong(Convert.ToInt64(obj));
}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:7,代码来源:EnumTypeHandler.cs
示例4: Write
public override void Write(IWriteContext context, object obj)
{
DateTime dateTime = (DateTime)obj;
long ticks = dateTime.Ticks;
context.WriteLong(ticks);
WriteKind(context, dateTime);
}
开发者ID:superyfwy,项目名称:db4o,代码行数:7,代码来源:DateTimeHandler.cs
示例5: Write
public virtual void Write(IWriteContext context, object obj)
{
Array collection = (Array) obj;
ClassMetadata elementType = DetectElementTypeHandler(Container(context), collection);
WriteElementTypeId(context, elementType);
new ArrayHandler(elementType.TypeHandler(), false).Write(context, obj);
}
开发者ID:Galigator,项目名称:db4o,代码行数:7,代码来源:SystemArrayTypeHandler.cs
示例6: 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);
}
开发者ID:Galigator,项目名称:db4o,代码行数:11,代码来源:StringBuilderHandler.cs
示例7: Write
public virtual void Write(IWriteContext context, object obj)
{
ICollectionInitializer initializer = CollectionInitializer.For(obj);
IEnumerable enumerable = (IEnumerable)obj;
ClassMetadata elementType = DetectElementTypeErasingNullables(Container(context), enumerable);
WriteElementTypeHandlerId(context, elementType);
WriteElementCount(context, initializer);
WriteElements(context, enumerable, elementType.TypeHandler());
}
开发者ID:superyfwy,项目名称:db4o,代码行数:9,代码来源:GenericCollectionTypeHandler.cs
示例8: Write
public virtual void Write(IWriteContext context, object obj)
{
ICollection collection = (ICollection)obj;
ITypeHandler4 elementHandler = DetectElementTypeHandler(Container(context), collection
);
WriteElementClassMetadataId(context, elementHandler);
WriteElementCount(context, collection);
WriteElements(context, collection, elementHandler);
}
开发者ID:erdincay,项目名称:db4o,代码行数:9,代码来源:CollectionTypeHandler.cs
示例9: Write
public virtual void Write(IWriteContext context, object obj)
{
IDictionary map = (IDictionary)obj;
KeyValueHandlerPair handlers = DetectKeyValueTypeHandlers(Container(context), map
);
WriteClassMetadataIds(context, handlers);
WriteElementCount(context, map);
WriteElements(context, map, handlers);
}
开发者ID:erdincay,项目名称:db4o,代码行数:9,代码来源:MapTypeHandler.cs
示例10: Write
public override void Write(IWriteContext context, object obj)
{
var charValue = ((char) obj);
context.WriteBytes(new[]
{
(byte) (charValue & unchecked(0xff)), (byte
) (charValue >> 8)
});
}
开发者ID:masroore,项目名称:db4o,代码行数:9,代码来源:CharHandler.cs
示例11: Write
public override void Write(IWriteContext context, object obj)
{
ushort us = (ushort)obj;
context.WriteBytes(
new byte[] {
(byte)(us>>8),
(byte)us,
});
}
开发者ID:erdincay,项目名称:db4o,代码行数:9,代码来源:UShortHandler.cs
示例12: WriteElements
private void WriteElements(IWriteContext context, ICollection collection, ITypeHandler4
elementHandler)
{
IEnumerator elements = collection.GetEnumerator();
while (elements.MoveNext())
{
context.WriteObject(elementHandler, elements.Current);
}
}
开发者ID:erdincay,项目名称:db4o,代码行数:9,代码来源:CollectionTypeHandler.cs
示例13: WriteElements
private void WriteElements(IWriteContext context, IDictionary map, KeyValueHandlerPair
handlers)
{
IEnumerator elements = map.GetEnumerator();
while (elements.MoveNext())
{
DictionaryEntry entry = (DictionaryEntry)elements.Current;
context.WriteObject(handlers._keyHandler, entry.Key);
context.WriteObject(handlers._valueHandler, entry.Value);
}
}
开发者ID:erdincay,项目名称:db4o,代码行数:11,代码来源:MapTypeHandler.cs
示例14: Write
public override void Write(IWriteContext context, object obj)
{
uint ui = (uint)obj;
context.WriteBytes(
new byte[] {
(byte)(ui>>24),
(byte)(ui>>16),
(byte)(ui>>8),
(byte)ui,
});
}
开发者ID:superyfwy,项目名称:db4o,代码行数:11,代码来源:UIntHandler.cs
示例15: WriteElements
private void WriteElements(IWriteContext context, IDictionary map, KeyValueHandlerPair
handlers)
{
IEnumerator elements = map.Keys.GetEnumerator();
while (elements.MoveNext())
{
object key = elements.Current;
context.WriteObject(handlers._keyHandler, key);
context.WriteObject(handlers._valueHandler, map[key]);
}
}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:11,代码来源:MapTypeHandler.cs
示例16: 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]);
}
}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:14,代码来源:CustomTypeHandlerTestCase.cs
示例17: Write
public override void Write(IWriteContext context, object obj)
{
ulong ui = (ulong)obj;
context.WriteBytes(
new byte[] {
(byte)(ui>>56),
(byte)(ui>>48),
(byte)(ui>>40),
(byte)(ui>>32),
(byte)(ui>>24),
(byte)(ui>>16),
(byte)(ui>>8),
(byte)ui,
});
}
开发者ID:erdincay,项目名称:db4o,代码行数:15,代码来源:ULongHandler.cs
示例18: Write
public override void Write(IWriteContext context, object obj)
{
var dec = (decimal) obj;
var bytes = new byte[16];
var offset = 4;
var ints = decimal.GetBits(dec);
for (var i = 0; i < 4; i++)
{
bytes[--offset] = (byte) ints[i];
bytes[--offset] = (byte) (ints[i] >>= 8);
bytes[--offset] = (byte) (ints[i] >>= 8);
bytes[--offset] = (byte) (ints[i] >>= 8);
offset += 8;
}
context.WriteBytes(bytes);
}
开发者ID:masroore,项目名称:db4o,代码行数:16,代码来源:DecimalHandler.cs
示例19: Write
public override void Write(IWriteContext context, object obj)
{
decimal dec = (decimal)obj;
byte[] bytes = new byte[16];
int offset = 4;
int[] ints = Decimal.GetBits(dec);
for (int i = 0; i < 4; i++)
{
bytes[--offset] = (byte)ints[i];
bytes[--offset] = (byte)(ints[i] >>= 8);
bytes[--offset] = (byte)(ints[i] >>= 8);
bytes[--offset] = (byte)(ints[i] >>= 8);
offset += 8;
}
context.WriteBytes(bytes);
}
开发者ID:erdincay,项目名称:db4o,代码行数:16,代码来源:DecimalHandler.cs
示例20: Write
public override void Write(IWriteContext context, object obj)
{
context.WriteLong(Platform4.DoubleToLong(((double)obj)));
}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:4,代码来源:DoubleHandler.cs
注:本文中的IWriteContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论