Exemplo n.º 1
0
        public static FieldInfo[] GetPublicFields(Type t)
        {
            List <FieldInfo> list  = new List <FieldInfo>();
            BindingFlags     flags = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public;

            TaskUtility.GetFields(t, ref list, (int)flags);
            return(list.ToArray());
        }
Exemplo n.º 2
0
 // Token: 0x06000223 RID: 547 RVA: 0x0001026C File Offset: 0x0000E46C
 private static void GetFields(Type t, ref List <FieldInfo> fieldList, int flags)
 {
     if (t == null || t.Equals(typeof(ParentTask)) || t.Equals(typeof(Task)) || t.Equals(typeof(SharedVariable)))
     {
         return;
     }
     FieldInfo[] fields = t.GetFields((BindingFlags)flags);
     for (int i = 0; i < fields.Length; i++)
     {
         fieldList.Add(fields[i]);
     }
     TaskUtility.GetFields(t.BaseType, ref fieldList, flags);
 }
Exemplo n.º 3
0
 // Token: 0x06000222 RID: 546 RVA: 0x00010218 File Offset: 0x0000E418
 public static FieldInfo[] GetPublicFields(Type t)
 {
     FieldInfo[] array = null;
     if (!TaskUtility.publicFieldsLookup.TryGetValue(t, out array))
     {
         List <FieldInfo> list = ObjectPool.Get <List <FieldInfo> >();
         list.Clear();
         BindingFlags flags = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public;
         TaskUtility.GetFields(t, ref list, (int)flags);
         array = list.ToArray();
         ObjectPool.Return <List <FieldInfo> >(list);
         TaskUtility.publicFieldsLookup.Add(t, array);
     }
     return(array);
 }