Example #1
0
        public static void ReadAllMembers <T>(Reader reader, string key, ref T obj)
        {
            if (typeof(T).IsSerializable)
            {
                switch (reader.Mode)
                {
                case FieldMode:
                    FieldsReader <T> .ReadAllMembers(reader, key, ref obj);

                    return;

                case PropertyMode:
                    PropertiesReader <T> .ReadAllMembers(reader, key, ref obj);

                    return;
                }
            }
            MembersReader <T> .ReadAllMembers(reader, key, ref obj);
        }
Example #2
0
        public static void ReadAllMembers <T>(Reader reader, string key, ref T obj)
        {
#if !NET35_CF
            if (typeof(T).IsSerializable)
            {
#else
            if ((typeof(T).Attributes & TypeAttributes.Serializable) == TypeAttributes.Serializable)
            {
#endif
                switch (reader.Mode)
                {
                case FieldMode:
                    FieldsReader <T> .ReadAllMembers(reader, key, ref obj);

                    return;

                case PropertyMode:
                    PropertiesReader <T> .ReadAllMembers(reader, key, ref obj);

                    return;
                }
            }
            MembersReader <T> .ReadAllMembers(reader, key, ref obj);
        }