Exemple #1
0
        /// <summary>
        /// Filter out all members that are marked with DoNotCopy or that cannot
        /// be read from and written to.
        /// </summary>
        /// <param name="wrapper"></param>
        /// <returns></returns>
        public bool allowMember(MemberWrapper wrapper)
        {
            Type wrappedType = wrapper.getWrappedType();

            bool reject = wrapper.getCustomAttributes(typeof(DoNotCopyAttribute), true).Any() ||
                          wrappedType.GetCustomAttributes(typeof(DoNotCopyAttribute), true).Any() ||
                          wrappedType.GetCustomAttributes(typeof(NativeSubsystemTypeAttribute), true).Any() ||
                          wrappedType.IsSubclassOf(typeof(Delegate));

            return(!reject && wrapper.canWrite() && wrapper.canRead());
        }