本文整理汇总了C#中Db4objects.Db4o.Internal.ObjectContainerBase.Reflector方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectContainerBase.Reflector方法的具体用法?C# ObjectContainerBase.Reflector怎么用?C# ObjectContainerBase.Reflector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Db4objects.Db4o.Internal.ObjectContainerBase
的用法示例。
在下文中一共展示了ObjectContainerBase.Reflector方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReflectClassFromElementsEntry
public override IReflectClass ReflectClassFromElementsEntry(ObjectContainerBase container
, ArrayInfo info, int classID)
{
if (classID == Const4.IgnoreId)
{
// TODO: Here is a low-frequency mistake, extremely unlikely.
// If classID == 99999 by accident then we will get ignore.
return null;
}
info.Primitive(false);
if (UseJavaHandling())
{
if (classID < Const4.Primitive)
{
info.Primitive(true);
classID -= Const4.Primitive;
}
}
classID = -classID;
ClassMetadata classMetadata = container.ClassMetadataForID(classID);
if (classMetadata != null)
{
return ClassReflector(container.Reflector(), classMetadata, info.Primitive());
}
return null;
}
示例2: ReflectClassFromElementsEntry
public virtual IReflectClass ReflectClassFromElementsEntry(ObjectContainerBase container
, ArrayInfo info, int classID)
{
if (classID == 0)
{
return null;
}
ClassMetadata classMetadata = container.ClassMetadataForID(classID);
if (classMetadata == null)
{
return null;
}
return ClassReflector(container.Reflector(), classMetadata, info.Primitive());
}
示例3: FlattenCollection1
internal static void FlattenCollection1(ObjectContainerBase stream, Object obj, Collection4 collection4)
{
Array arr = obj as Array;
if (arr != null)
{
IReflectArray reflectArray = stream.Reflector().Array();
Object[] flat = new Object[arr.Length];
reflectArray.Flatten(obj, reflectArray.Dimensions(obj), 0, flat, 0);
for (int i = 0; i < flat.Length; i++)
{
FlattenCollection1(stream, flat[i], collection4);
}
}
else
{
// If obj implements IEnumerable, add all elements to collection4
IEnumerator enumerator = GetCollectionEnumerator(obj, true);
// Add elements to collection if conversion was succesful
if (enumerator != null)
{
if (enumerator is IDictionaryEnumerator)
{
IDictionaryEnumerator dictEnumerator = enumerator as IDictionaryEnumerator;
while (enumerator.MoveNext())
{
FlattenCollection1(stream, dictEnumerator.Key, collection4);
}
}
else
{
while (enumerator.MoveNext())
{
// recursive call to flatten Collections in Collections
FlattenCollection1(stream, enumerator.Current, collection4);
}
}
}
else
{
// If obj is not a Collection, it still needs to be collected.
collection4.Add(obj);
}
}
}
示例4: DetectElementTypeHandler
private static ClassMetadata DetectElementTypeHandler(ObjectContainerBase container, Array collection)
{
Type elementType = ElementTypeOf(collection);
return container.ProduceClassMetadata(container.Reflector().ForClass(elementType));
}
示例5: Analyze
protected void Analyze(ObjectContainerBase container, object obj, ArrayInfo info)
{
// TODO: Move as much analysis as possible to ReflectArray#analyze()
ArrayReflector(container).Analyze(obj, info);
IReflectClass claxx = ComponentType(container, obj);
Db4objects.Db4o.Internal.ClassMetadata classMetadata = container.ProduceClassMetadata
(claxx);
bool primitive = IsPrimitive(container.Reflector(), claxx, classMetadata);
if (primitive)
{
claxx = classMetadata.ClassReflector();
}
info.Primitive(primitive);
info.ReflectClass(claxx);
AnalyzeDimensions(container, obj, info);
}
示例6: ArrayReflector
protected virtual IReflectArray ArrayReflector(ObjectContainerBase container)
{
return container.Reflector().Array();
}
示例7: ComponentType
private IReflectClass ComponentType(ObjectContainerBase container, object obj)
{
return ArrayReflector(container).GetComponentType(container.Reflector().ForObject
(obj));
}
示例8: DetectElementTypeErasingNullables
private static ClassMetadata DetectElementTypeErasingNullables(ObjectContainerBase container, IEnumerable collection)
{
Type elementType = ElementTypeOf(collection);
if (IsNullableInstance(elementType))
{
return container.ClassMetadataForReflectClass(container.Handlers.IclassObject);
}
return container.ProduceClassMetadata(container.Reflector().ForClass(elementType));
}
示例9: PrepareComparison
internal virtual IPreparedComparison PrepareComparison(ObjectContainerBase container
, object constraint)
{
IContext context = container.Transaction.Context();
if (_fieldMetadata != null)
{
return _fieldMetadata.PrepareComparison(context, constraint);
}
if (_classMetadata != null)
{
return _classMetadata.PrepareComparison(context, constraint);
}
IReflector reflector = container.Reflector();
Db4objects.Db4o.Internal.ClassMetadata classMetadata = null;
if (_bytes != null)
{
classMetadata = container.ProduceClassMetadata(reflector.ForObject(constraint));
}
else
{
if (_member != null)
{
classMetadata = container.ClassMetadataForReflectClass(reflector.ForObject(_member
));
}
}
if (classMetadata != null)
{
if (_member != null && _member.GetType().IsArray)
{
ITypeHandler4 arrayElementTypehandler = classMetadata.TypeHandler();
if (reflector.Array().IsNDimensional(MemberClass()))
{
MultidimensionalArrayHandler mah = new MultidimensionalArrayHandler(arrayElementTypehandler
, false);
return mah.PrepareComparison(context, _member);
}
ArrayHandler ya = new ArrayHandler(arrayElementTypehandler, false);
return ya.PrepareComparison(context, _member);
}
return classMetadata.PrepareComparison(context, constraint);
}
return null;
}