• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IWriteContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IWriteOnlyTransaction类代码示例发布时间:2022-05-24
下一篇:
C# IWrappedDictionary类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap