public bool allowMember(MemberWrapper wrapper)
 {
     return(!(wrapper.getCustomAttributes(typeof(DoNotSaveAttribute), true).Any() ||
              wrapper.getWrappedType().GetCustomAttributes(typeof(DoNotSaveAttribute), true).Any() ||
              wrapper.getWrappedType().GetCustomAttributes(typeof(NativeSubsystemTypeAttribute), true).Any() ||
              !wrapper.getWrappedType().IsSubclassOf(typeof(Delegate))));
 }
 /// <summary>
 /// This is the test function. It will return true if the member should
 /// be accepted.
 /// </summary>
 /// <param name="wrapper">The MemberWrapper with info about the field/property being scanned.</param>
 /// <returns>True if the member should be included in the results. False to omit it.</returns>
 public bool allowMember(MemberWrapper wrapper)
 {
     if (wrapper.getCustomAttributes(typeof(EditableAttribute), true).Any())
     {
         Type wrappedType = wrapper.getWrappedType();
         return(ReflectedVariable.canCreateVariable(wrappedType) || wrappedType.GetInterface(BEHAVIOR_OBJECT_INTERFACE) != null);
     }
     return(false);
 }
Exemple #3
0
        private static EditableAttribute findEditableAttribute(MemberWrapper memberWrapper)
        {
            EditableAttribute editable = memberWrapper.getCustomAttributes(typeof(EditableAttribute), true).Select(s => (EditableAttribute)s).FirstOrDefault();

            if (editable != null)
            {
                return(editable);
            }
            return(defaultEditableAttribute);
        }
Exemple #4
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());
        }
Exemple #5
0
 /// <summary>
 /// This is the test function. It will return true if the member should
 /// be accepted.
 /// </summary>
 /// <param name="wrapper">The MemberWrapper with info about the field/property being scanned.</param>
 /// <returns>True if the member should be included in the results. False to omit it.</returns>
 public bool allowMember(MemberWrapper wrapper)
 {
     return(wrapper.getCustomAttributes(typeof(JsonPropertyAttribute), true).Any());
 }
Exemple #6
0
 /// <summary>
 /// This is the test function. It will return true if the member should
 /// be accepted.
 /// </summary>
 /// <param name="wrapper">The MemberWrapper with info about the field/property being scanned.</param>
 /// <returns>True if the member should be included in the results. False to omit it.</returns>
 public bool allowMember(MemberWrapper wrapper)
 {
     return(wrapper.getCustomAttributes(typeof(EditableAttribute), true).Any());
 }