Esempio n. 1
0
        } // End Function GetGetter

        // ========================================================================================================================



        public static System.Reflection.MemberInfo[] GetFieldsAndProperties(System.Type t)
        {
            System.Reflection.TypeInfo ti = System.Reflection.IntrospectionExtensions.GetTypeInfo(t);

            System.Reflection.FieldInfo[]    fis = ti.GetFields();
            System.Reflection.PropertyInfo[] pis = ti.GetProperties();
            System.Reflection.MemberInfo[]   mis = new System.Reflection.MemberInfo[fis.Length + pis.Length];
            System.Array.Copy(fis, mis, fis.Length);
            System.Array.Copy(pis, 0, mis, fis.Length, pis.Length);

            return(mis);
        } // End Function GetFieldsAndProperties
Esempio n. 2
0
        public static string[] GetFieldAndPropertyNames(System.Type t)
        {
            System.Reflection.TypeInfo ti = System.Reflection.IntrospectionExtensions.GetTypeInfo(t);

            System.Reflection.FieldInfo[]    fis = ti.GetFields();
            System.Reflection.PropertyInfo[] pis = ti.GetProperties();

            string[] results = new string[fis.Length + pis.Length];
            int      i       = 0;

            for (; i < fis.Length; ++i)
            {
                results[i] = fis[i].Name;
            }

            for (int j = 0; j < pis.Length; ++j, ++i)
            {
                results[i] = pis[i].Name;
            }

            return(results);
        } // End Function GetFieldsAndProperties