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

C# ITypeHandler4类代码示例

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

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



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


示例16: BaseTypeHandler

		public static ITypeHandler4 BaseTypeHandler(ITypeHandler4 handler)
		{
			if (handler is ArrayHandler)
			{
				return ((ArrayHandler)handler).DelegateTypeHandler();
			}
			if (handler is PrimitiveTypeMetadata)
			{
				return ((PrimitiveTypeMetadata)handler).TypeHandler();
			}
			return handler;
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:12,代码来源:Handlers4.cs


示例17: IsQueryLeaf

		public static bool IsQueryLeaf(ITypeHandler4 handler)
		{
			ITypeHandler4 baseTypeHandler = BaseTypeHandler(handler);
			if (!(baseTypeHandler is IQueryableTypeHandler))
			{
				return false;
			}
			if (baseTypeHandler is ArrayHandler)
			{
				return false;
			}
			return baseTypeHandler is IValueTypeHandler;
		}
开发者ID:erdincay,项目名称:db4o,代码行数:13,代码来源:Handlers4.cs


示例18: RegisterHandlerFor

		private static void RegisterHandlerFor(IConfiguration config, Type type, ITypeHandler4 collectionHandler)
		{
			Config4Impl configImpl = (Config4Impl)config;
			ITypeHandler4 handler = configImpl.TypeHandlerForClass(configImpl.Reflector().ForClass(type), 0);

			if (handler == null)
			{
				config.RegisterTypeHandler(new GenericTypeHandlerPredicate(type.GetGenericTypeDefinition()), collectionHandler);
				return;
			}

			if (!(handler is GenericCollectionTypeHandler))
			{
				throw new InvalidOperationException();
			}
		}
开发者ID:Galigator,项目名称:db4o,代码行数:16,代码来源:GenericCollectionTypeHandlerTestUnitBase.cs


示例19: Delete

		public virtual void Delete(ITypeHandler4 handler)
		{
			ITypeHandler4 correctHandlerVersion = HandlerRegistry.CorrectHandlerVersion(this, 
				handler);
			int preservedCascadeDepth = CascadeDeleteDepth();
			CascadeDeleteDepth(AdjustedDepth());
			if (Handlers4.HandleAsObject(correctHandlerVersion))
			{
				DeleteObject();
			}
			else
			{
				correctHandlerVersion.Delete(this);
			}
			CascadeDeleteDepth(preservedCascadeDepth);
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:16,代码来源:DeleteContextImpl.cs


示例20: TypeHandlerPredicatePair

 public TypeHandlerPredicatePair(ITypeHandlerPredicate predicate, ITypeHandler4 typeHandler
     )
 {
     _predicate = predicate;
     _typeHandler = typeHandler;
 }
开发者ID:masroore,项目名称:db4o,代码行数:6,代码来源:TypeHandlerPredicatePair.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# ITypeInfo类代码示例发布时间:2022-05-24
下一篇:
C# ITypeFinder类代码示例发布时间: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