本文整理汇总了C#中IReflectClass.GetDeclaredFields方法的典型用法代码示例。如果您正苦于以下问题:C# IReflectClass.GetDeclaredFields方法的具体用法?C# IReflectClass.GetDeclaredFields怎么用?C# IReflectClass.GetDeclaredFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IReflectClass
的用法示例。
在下文中一共展示了IReflectClass.GetDeclaredFields方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NewUserClassMeta
private ClassInfo NewUserClassMeta(IReflectClass claxx)
{
ClassInfo classMeta = ClassInfo.NewUserClass(claxx.GetName());
classMeta.SetSuperClass(MapSuperclass(claxx));
RegisterClassMeta(claxx.GetName(), classMeta);
classMeta.SetFields(MapFields(claxx.GetDeclaredFields(), ShouldStoreTransientFields
(claxx)));
return classMeta;
}
示例2: 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();
}
}
示例3: 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);
}
示例4: PersistentFields
public static IEnumerator PersistentFields(IReflectClass claxx)
{
return Iterators.Filter(claxx.GetDeclaredFields(), new _IPredicate4_31());
}
示例5: NonVirtualFieldsFor
public static List<IReflectField> NonVirtualFieldsFor(IReflectClass aClass)
{
try
{
List<IReflectField> ret = new List<IReflectField>();
foreach (IReflectField field in aClass.GetDeclaredFields())
{
if (!(field is GenericVirtualField))
ret.Add(field);
}
return ret;
}
catch (Exception e)
{
LoggingHelper.HandleException(e);
}
return null;
}
示例6: ExtractFields
private IEnumerable<SimpleFieldDescription> ExtractFields(TypeName declaringTypeName, IReflectClass classInfo,
Func<IReflectClass, ITypeDescription> typeLookUp)
{
return classInfo.GetDeclaredFields()
.Where(f=>!(f is GenericVirtualField))
.Select(f => CreateField(declaringTypeName, f, typeLookUp));
}