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); }
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); }
/// <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()); }
/// <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()); }
/// <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()); }