/// <summary>
        /// Returns a list of RuntimeMember wrapping all the serializable members in the specified type.
        /// </summary>
        private List <RuntimeMember> GetSerializableMembers(Type type, object target)
        {
            var members             = ReflectionHelper.CachedGetMembers(type);
            var serializableMembers = members.Where(IsSerializableMember);
            var result = RuntimeMember.WrapMembers(serializableMembers, target);

            return(result);
        }
Beispiel #2
0
        static VisibilityLogic()
        {
            Attributes = VisibilityAttributes.Default;

            _cachedGetDefaultVisibleMembers = new Func <Type, List <MemberInfo> >(type =>
            {
                return(ReflectionHelper.CachedGetMembers(type)
                       .Where(IsVisibleMember)
                       .OrderBy <MemberInfo, float>(GetMemberDisplayOrder)
                       .ToList());
            }).Memoize();
        }
Beispiel #3
0
        static VisibilityLogic()
        {
            Attributes = VisibilityAttributes.Default;

            _cachedGetDefaultVisibleMembers = new Func <Type, List <MemberInfo> >(type =>
            {
                return(ReflectionHelper.CachedGetMembers(type)
                       .Where(x => IsVisibleMember(x, null))
                       .OrderBy <MemberInfo, float>(GetMemberDisplayOrder)
                       .ToList());
            }).Memoize();

            _cachedGetVisibleMembers = new Func <Tuple <Type, RuntimeMember[]>, List <MemberInfo> >(tup =>
            {
                return(ReflectionHelper.CachedGetMembers(tup.Item1)
                       .Where(x => IsVisibleMember(x, tup.Item2))
                       .OrderBy <MemberInfo, float>(GetMemberDisplayOrder)
                       .ToList());
            }).Memoize();
        }