本文整理汇总了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;
}
示例2: HandlerVersionKey
public HandlerVersionKey(HandlerVersionRegistry _enclosing, ITypeHandler4 handler
, int version)
{
this._enclosing = _enclosing;
_handler = handler;
_version = version;
}
示例3: PrimitiveTypeMetadata
public PrimitiveTypeMetadata(ObjectContainerBase container, ITypeHandler4 handler
, int id, IReflectClass classReflector) : base(container, classReflector)
{
_aspects = FieldMetadata.EmptyArray;
_typeHandler = handler;
_id = id;
}
示例4: PreparedArrayContainsComparison
public PreparedArrayContainsComparison(IContext context, ArrayHandler arrayHandler
, ITypeHandler4 typeHandler, object obj)
{
_arrayHandler = arrayHandler;
_preparedComparison = Handlers4.PrepareComparisonFor(typeHandler, context, obj);
_container = context.Transaction().Container();
}
示例5: TypeHandlerCloneContext
public TypeHandlerCloneContext(HandlerRegistry handlerRegistry_, ITypeHandler4 original_
, int version_)
{
handlerRegistry = handlerRegistry_;
original = original_;
version = version_;
}
示例6: GenericTemplate
private ITypeHandler4 GenericTemplate(ITypeHandler4 handler)
{
if (handler is IVersionedTypeHandler)
{
return ((IVersionedTypeHandler) handler).UnversionedTemplate();
}
return handler;
}
示例7: ReadAtCurrentSeekPosition
public virtual object ReadAtCurrentSeekPosition(ITypeHandler4 handler)
{
if (Handlers4.UseDedicatedSlot(this, handler))
{
return ReadObject();
}
return Handlers4.ReadValueType(this, handler);
}
示例8: IsIndirectedWithinSlot
public override bool IsIndirectedWithinSlot(ITypeHandler4 handler)
{
if (Handlers4.IsUntyped(handler))
{
return false;
}
return Handlers4.IsVariableLength(handler) && Handlers4.IsValueType(handler);
}
示例9: SeekSecondaryOffset
protected override void SeekSecondaryOffset(IReadBuffer buffer, ITypeHandler4 typeHandler
)
{
if (Handlers4.HandlesPrimitiveArray(typeHandler))
{
buffer.Seek(buffer.ReadInt());
}
}
示例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);
}
示例11: WriteElements
private void WriteElements(IWriteContext context, ICollection collection, ITypeHandler4
elementHandler)
{
IEnumerator elements = collection.GetEnumerator();
while (elements.MoveNext())
{
context.WriteObject(elementHandler, elements.Current);
}
}
示例12: DoWithSlotIndirection
public virtual object DoWithSlotIndirection(IReadBuffer buffer, ITypeHandler4 typeHandler
, IClosure4 closure)
{
if (!IsIndirectedWithinSlot(typeHandler))
{
return closure.Run();
}
return DoWithSlotIndirection(buffer, closure);
}
示例13: TypeHandlerAspect
public TypeHandlerAspect(ClassMetadata classMetadata, ITypeHandler4 typeHandler)
{
if (Handlers4.IsValueType(typeHandler))
{
throw new InvalidOperationException();
}
_ownerMetadata = classMetadata;
_typeHandler = typeHandler;
}
示例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));
}
示例15: PrimitiveClassReflector
public static IReflectClass PrimitiveClassReflector(ITypeHandler4 handler, IReflector
reflector)
{
ITypeHandler4 baseTypeHandler = BaseTypeHandler(handler);
if (baseTypeHandler is PrimitiveHandler)
{
return ((PrimitiveHandler)baseTypeHandler).PrimitiveClassReflector();
}
return null;
}