本文整理汇总了C#中IReflectClass.GetSuperclass方法的典型用法代码示例。如果您正苦于以下问题:C# IReflectClass.GetSuperclass方法的具体用法?C# IReflectClass.GetSuperclass怎么用?C# IReflectClass.GetSuperclass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IReflectClass
的用法示例。
在下文中一共展示了IReflectClass.GetSuperclass方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MapSuperclass
private ClassInfo MapSuperclass(IReflectClass claxx)
{
IReflectClass superClass = claxx.GetSuperclass();
if (superClass != null)
{
return GetClassMeta(superClass);
}
return null;
}
示例2: TraverseSuperclass
private void TraverseSuperclass(object @object, IReflectClass claxx)
{
IReflectClass superclass = claxx.GetSuperclass();
if (superclass == null)
{
return;
}
TraverseAllFields(@object, superclass);
}
示例3: ForEachField
public static void ForEachField(IReflectClass claxx, IProcedure4 procedure)
{
while (claxx != null)
{
IReflectField[] declaredFields = claxx.GetDeclaredFields();
for (int reflectFieldIndex = 0; reflectFieldIndex < declaredFields.Length; ++reflectFieldIndex)
{
IReflectField reflectField = declaredFields[reflectFieldIndex];
procedure.Apply(reflectField);
}
claxx = claxx.GetSuperclass();
}
}
示例4: Field
public static IReflectField Field(IReflectClass claxx, string name)
{
while (claxx != null)
{
try
{
return claxx.GetDeclaredField(name);
}
catch (Exception)
{
}
claxx = claxx.GetSuperclass();
}
return null;
}
示例5: GetDeclaredFieldInHeirarchy
public static IReflectField GetDeclaredFieldInHeirarchy(IReflectClass aClass, string attribute)
{
try
{
while (aClass != null)
{
IReflectField refField = GetDeclaredField(aClass, attribute);
if (refField != null)
return refField;
aClass = aClass.GetSuperclass();
}
}
catch (Exception e)
{
LoggingHelper.HandleException(e);
}
return null;
}
示例6: CallConstructorSpecialized
private TernaryBool CallConstructorSpecialized(IReflectClass clazz)
{
Config4Class clazzConfig = _config.ConfigClass(clazz.GetName());
if (clazzConfig != null)
{
TernaryBool res = clazzConfig.CallConstructor();
if (!res.IsUnspecified())
{
return res;
}
}
if (Platform4.IsEnum(_config.Reflector(), clazz))
{
return TernaryBool.No;
}
IReflectClass ancestor = clazz.GetSuperclass();
if (ancestor != null)
{
return CallConstructorSpecialized(ancestor);
}
return TernaryBool.Unspecified;
}
示例7: SetFieldsToNull
private void SetFieldsToNull(object @object, IReflectClass claxx)
{
IReflectField[] fields;
fields = claxx.GetDeclaredFields();
for (int i = 0; i < fields.Length; i++)
{
IReflectField field = fields[i];
if (field.IsStatic())
{
continue;
}
if (field.IsTransient())
{
continue;
}
field.Set(@object, null);
}
IReflectClass superclass = claxx.GetSuperclass();
if (superclass == null)
{
return;
}
SetFieldsToNull(@object, superclass);
}
示例8: CreateClassMetadata
internal bool CreateClassMetadata(ClassMetadata clazz, IReflectClass reflectClazz
)
{
bool result = false;
_classMetadataCreationDepth++;
try
{
IReflectClass parentReflectClazz = reflectClazz.GetSuperclass();
ClassMetadata parentClazz = null;
if (parentReflectClazz != null && !parentReflectClazz.Equals(Container()._handlers
.IclassObject))
{
parentClazz = ProduceClassMetadata(parentReflectClazz);
}
result = Container().CreateClassMetadata(clazz, reflectClazz, parentClazz);
}
finally
{
_classMetadataCreationDepth--;
}
InitClassMetadataOnUp();
return result;
}
示例9: CopyFieldValuesAcross
private void CopyFieldValuesAcross(object src, object dest, IReflectClass claxx,
IReplicationProviderInside sourceProvider, IReplicationProviderInside targetProvider
)
{
if (dest == null)
{
throw new InvalidOperationException("Dest cannot be null: src=" + src + ", class="
+ claxx + ", source=" + sourceProvider.GetName() + ", target=" + targetProvider
.GetName());
}
IEnumerator fields = FieldIterators.PersistentFields(claxx);
while (fields.MoveNext())
{
IReflectField field = (IReflectField)fields.Current;
object value = field.Get(src);
field.Set(dest, FindCounterpart(value, sourceProvider, targetProvider));
}
IReflectClass superclass = claxx.GetSuperclass();
if (superclass == null)
{
return;
}
CopyFieldValuesAcross(src, dest, superclass, sourceProvider, targetProvider);
}
示例10: IsAssignableFrom
public virtual bool IsAssignableFrom(IReflectClass subclassCandidate)
{
if (subclassCandidate == null)
{
return false;
}
if (Equals(subclassCandidate))
{
return true;
}
if (_delegate != null)
{
if (subclassCandidate is Db4objects.Db4o.Reflect.Generic.GenericClass)
{
subclassCandidate = ((Db4objects.Db4o.Reflect.Generic.GenericClass)subclassCandidate
).GetDelegate();
}
return _delegate.IsAssignableFrom(subclassCandidate);
}
if (!(subclassCandidate is Db4objects.Db4o.Reflect.Generic.GenericClass))
{
return false;
}
return IsAssignableFrom(subclassCandidate.GetSuperclass());
}
示例11: GetFieldList
public static List<IReflectField> GetFieldList(IReflectClass aClass)
{
try
{
if (aClass == null)
return null;
List<IReflectField> ret = NonVirtualFieldsFor(aClass);
IReflectClass parent = aClass.GetSuperclass();
if (parent != null && !(parent.GetName().StartsWith("System.")))
ret.AddRange(GetFieldList(parent));
return ret;
}
catch (Exception e)
{
LoggingHelper.HandleException(e);
}
return null;
}
示例12: CopyFieldValuesAcross
private void CopyFieldValuesAcross(object src, object dest, IReflectClass claxx,
IReplicationProviderInside sourceProvider, IReplicationProviderInside targetProvider
)
{
IEnumerator fields = FieldIterators.PersistentFields(claxx);
while (fields.MoveNext())
{
IReflectField field = (IReflectField)fields.Current;
object value = field.Get(src);
field.Set(dest, FindCounterpart(value, sourceProvider, targetProvider));
}
IReflectClass superclass = claxx.GetSuperclass();
if (superclass == null)
{
return;
}
CopyFieldValuesAcross(src, dest, superclass, sourceProvider, targetProvider);
}
示例13: CreateType
private ITypeDescription CreateType(TypeName name,
IReflectClass classInfo,
Func<TypeName, Maybe<IReflectClass>> classLookup,
IDictionary<string, ITypeDescription> knownTypes)
{
var knownType = typeResolver(name)
.Otherwise(() => typeResolver(name.GetGenericTypeDefinition()));
if (knownType.HasValue)
{
var systemType = KnownType.Create(knownType.Value,
name.GenericArguments.Select(
t => GetOrCreateTypeByName(t.Value, classLookup, knownTypes)).
ToList(), IndexLookUp);
knownTypes[name.FullName] = systemType;
return systemType;
}
return SimpleClassDescription.Create(name,
classInfo.GetSuperclass().AsMaybe().Convert(sc=>GetOrCreateType(sc, classLookup,
knownTypes)),
t =>
{
knownTypes[name.FullName] = t;
return ExtractFields(name, classInfo,
typeName =>
GetOrCreateType(typeName, classLookup,
knownTypes));
});
}