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


C# ITypeHandler4类代码示例

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


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

示例1: CorrectHandlerVersion

 public virtual ITypeHandler4 CorrectHandlerVersion(ITypeHandler4 originalHandler,
     int version)
 {
     if (version >= HandlerRegistry.HandlerVersion)
     {
         return originalHandler;
     }
     if (originalHandler == null)
     {
         return null;
     }
     // HandlerVersionKey with null key will throw NPE.
     var replacement = (ITypeHandler4) _versions.Get(new HandlerVersionKey
         (this, GenericTemplate(originalHandler), version));
     if (replacement == null)
     {
         return CorrectHandlerVersion(originalHandler, version + 1);
     }
     if (replacement is IVersionedTypeHandler)
     {
         return (ITypeHandler4) ((IVersionedTypeHandler) replacement).DeepClone(new TypeHandlerCloneContext
             (_registry, originalHandler, version));
     }
     return replacement;
 }
开发者ID:masroore,项目名称:db4o,代码行数:25,代码来源:HandlerVersionRegistry.cs

示例2: HandlerVersionKey

 public HandlerVersionKey(HandlerVersionRegistry _enclosing, ITypeHandler4 handler
     , int version)
 {
     this._enclosing = _enclosing;
     _handler = handler;
     _version = version;
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:HandlerVersionRegistry.cs

示例3: PrimitiveTypeMetadata

 public PrimitiveTypeMetadata(ObjectContainerBase container, ITypeHandler4 handler
     , int id, IReflectClass classReflector) : base(container, classReflector)
 {
     _aspects = FieldMetadata.EmptyArray;
     _typeHandler = handler;
     _id = id;
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:PrimitiveTypeMetadata.cs

示例4: PreparedArrayContainsComparison

 public PreparedArrayContainsComparison(IContext context, ArrayHandler arrayHandler
     , ITypeHandler4 typeHandler, object obj)
 {
     _arrayHandler = arrayHandler;
     _preparedComparison = Handlers4.PrepareComparisonFor(typeHandler, context, obj);
     _container = context.Transaction().Container();
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:PreparedArrayContainsComparison.cs

示例5: TypeHandlerCloneContext

		public TypeHandlerCloneContext(HandlerRegistry handlerRegistry_, ITypeHandler4 original_
			, int version_)
		{
			handlerRegistry = handlerRegistry_;
			original = original_;
			version = version_;
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:7,代码来源:TypeHandlerCloneContext.cs

示例6: GenericTemplate

 private ITypeHandler4 GenericTemplate(ITypeHandler4 handler)
 {
     if (handler is IVersionedTypeHandler)
     {
         return ((IVersionedTypeHandler) handler).UnversionedTemplate();
     }
     return handler;
 }
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:HandlerVersionRegistry.cs

示例7: ReadAtCurrentSeekPosition

		public virtual object ReadAtCurrentSeekPosition(ITypeHandler4 handler)
		{
			if (Handlers4.UseDedicatedSlot(this, handler))
			{
				return ReadObject();
			}
			return Handlers4.ReadValueType(this, handler);
		}
开发者ID:erdincay,项目名称:db4o,代码行数:8,代码来源:AbstractReadContext.cs

示例8: IsIndirectedWithinSlot

		public override bool IsIndirectedWithinSlot(ITypeHandler4 handler)
		{
			if (Handlers4.IsUntyped(handler))
			{
				return false;
			}
			return Handlers4.IsVariableLength(handler) && Handlers4.IsValueType(handler);
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:8,代码来源:SlotFormatCurrent.cs

示例9: SeekSecondaryOffset

		protected override void SeekSecondaryOffset(IReadBuffer buffer, ITypeHandler4 typeHandler
			)
		{
			if (Handlers4.HandlesPrimitiveArray(typeHandler))
			{
				buffer.Seek(buffer.ReadInt());
			}
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:8,代码来源:OpenTypeHandler2.cs

示例10: RegisterTypeHandler

 private void RegisterTypeHandler(IConfiguration config, Type clazz, ITypeHandler4
     typeHandler)
 {
     var reflector = ((Config4Impl) config).Reflector();
     var itemClass = reflector.ForClass(clazz);
     ITypeHandlerPredicate predicate = new _ITypeHandlerPredicate_229(itemClass);
     config.RegisterTypeHandler(predicate, typeHandler);
 }
开发者ID:masroore,项目名称:db4o,代码行数:8,代码来源:CustomTypeHandlerTestCase.cs

示例11: 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

示例12: DoWithSlotIndirection

 public virtual object DoWithSlotIndirection(IReadBuffer buffer, ITypeHandler4 typeHandler
     , IClosure4 closure)
 {
     if (!IsIndirectedWithinSlot(typeHandler))
     {
         return closure.Run();
     }
     return DoWithSlotIndirection(buffer, closure);
 }
开发者ID:masroore,项目名称:db4o,代码行数:9,代码来源:SlotFormat.cs

示例13: TypeHandlerAspect

		public TypeHandlerAspect(ClassMetadata classMetadata, ITypeHandler4 typeHandler)
		{
			if (Handlers4.IsValueType(typeHandler))
			{
				throw new InvalidOperationException();
			}
			_ownerMetadata = classMetadata;
			_typeHandler = typeHandler;
		}
开发者ID:erdincay,项目名称:db4o,代码行数:9,代码来源:TypeHandlerAspect.cs

示例14: ReadObject

		public object ReadObject(ITypeHandler4 handlerType)
		{
			if (null == handlerType)
			{
				throw new ArgumentNullException();
			}
			ITypeHandler4 handler = HandlerRegistry.CorrectHandlerVersion(this, handlerType);
			return SlotFormat().DoWithSlotIndirection(this, handler, new _IClosure4_38(this, 
				handler));
		}
开发者ID:erdincay,项目名称:db4o,代码行数:10,代码来源:AbstractReadContext.cs

示例15: PrimitiveClassReflector

		public static IReflectClass PrimitiveClassReflector(ITypeHandler4 handler, IReflector
			 reflector)
		{
			ITypeHandler4 baseTypeHandler = BaseTypeHandler(handler);
			if (baseTypeHandler is PrimitiveHandler)
			{
				return ((PrimitiveHandler)baseTypeHandler).PrimitiveClassReflector();
			}
			return null;
		}
开发者ID:erdincay,项目名称:db4o,代码行数:10,代码来源:Handlers4.cs


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