当前位置: 首页>>代码示例>>C#>>正文


C# IWriteContext类代码示例

本文整理汇总了C#中IWriteContext的典型用法代码示例。如果您正苦于以下问题:C# IWriteContext类的具体用法?C# IWriteContext怎么用?C# IWriteContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IWriteContext类属于命名空间,在下文中一共展示了IWriteContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的IWriteContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。