示例#1
0
        public static Type[] GetSerializableMembersTypes(Type forType)
        {
            var members = CachedGetSerializableMembers(forType);
            var result  = X20Reflection.GetMembersTypes(members);

            return(result);
        }
示例#2
0
        static X20Logic()
        {
            SerializeMemberAttributes     = new Type[] { typeof(SerializeField) };
            DontSerializeMemberAttributes = new Type[] { typeof(NonSerializedAttribute) };

            CachedGetSerializableMembers = new Func <Type, MemberInfo[]>(type =>
            {
                var members             = X20Reflection.CachedGetMembers(type);
                var serializableMembers = members.Where(IsSerializableMember).ToArray();
                return(serializableMembers);
            }).Memoize();
        }
示例#3
0
        public X20Logic(FieldPredicate isSerializableField, PropertyPredicate isSerializableProperty)
        {
            _IsSerializableField    = isSerializableField;
            _IsSerializableProperty = isSerializableProperty;

            CachedGetSerializableMembers = new Func <Type, MemberInfo[]>(type =>
            {
                var members             = X20Reflection.CachedGetMembers(type);
                var serializableMembers = members.Where(IsSerializableMember).ToArray();
                return(serializableMembers);
            }).Memoize();
        }