public bool Filters(MethodInfo method, IClassStrategy classStrategy) {
            string typeName = method.DeclaringType == null ? "Unknown" : method.DeclaringType.FullName;

            if (classStrategy.IsSystemClass(method.DeclaringType)) {
                return true;
            }

            return false;
        }
        public bool Filters(PropertyInfo property, IClassStrategy classStrategy) {
            string typeName = property.DeclaringType == null ? "Unknown" : property.DeclaringType.FullName;

            if (classStrategy.IsSystemClass(property.DeclaringType)) {
                return true;
            }

            return false;
        }
        public bool Filters(MethodInfo method, IClassStrategy classStrategy) {
            string typeName = method.DeclaringType == null ? "Unknown" : method.DeclaringType.FullName;

            if (classStrategy.IsSystemClass(method.DeclaringType)) {
                Log.InfoFormat("Skipping actions in {0} (system class according to ClassStrategy)", typeName);
                return true;
            }

            return false;
        }
        public bool Filters(PropertyInfo property, IClassStrategy classStrategy) {
            string typeName = property.DeclaringType == null ? "Unknown" : property.DeclaringType.FullName;

            if (classStrategy.IsSystemClass(property.DeclaringType)) {
                Log.InfoFormat("Skipping field {0} in {1} (system class according to ClassStrategy)", property.Name, typeName);
                return true;
            }

            return false;
        }
        public bool Filters(PropertyInfo property, IClassStrategy classStrategy)
        {
            string typeName = property.DeclaringType == null ? "Unknown" : property.DeclaringType.FullName;

            if (classStrategy.IsSystemClass(property.DeclaringType))
            {
                return(true);
            }

            return(false);
        }
        public bool Filters(MethodInfo method, IClassStrategy classStrategy)
        {
            string typeName = method.DeclaringType == null ? "Unknown" : method.DeclaringType.FullName;

            if (classStrategy.IsSystemClass(method.DeclaringType))
            {
                return(true);
            }

            return(false);
        }
        public bool Filters(MethodInfo method, IClassStrategy classStrategy)
        {
            string typeName = method.DeclaringType == null ? "Unknown" : method.DeclaringType.FullName;

            if (classStrategy.IsSystemClass(method.DeclaringType))
            {
                Log.InfoFormat("Skipping actions in {0} (system class according to ClassStrategy)", typeName);
                return(true);
            }

            return(false);
        }
Exemplo n.º 8
0
        public bool Filters(PropertyInfo property, IClassStrategy classStrategy)
        {
            string typeName = property.DeclaringType == null ? "Unknown" : property.DeclaringType.FullName;

            if (classStrategy.IsSystemClass(property.DeclaringType))
            {
                Log.InfoFormat("Skipping field {0} in {1} (system class according to ClassStrategy)", property.Name, typeName);
                return(true);
            }

            return(false);
        }
        public bool Filters(PropertyInfo property, IClassStrategy classStrategy)
        {
            string typeName = property.DeclaringType == null ? "Unknown" : property.DeclaringType.FullName;

            //todo rework this so that factories filter actions appropraitely
            if (classStrategy.IsSystemClass(property.DeclaringType))
            {
                Log.InfoFormat("Skipping fields in {0} (system class according to ClassStrategy)", typeName);
                return(true);
            }

            return(false);
        }
        public bool Filters(MethodInfo method, IClassStrategy classStrategy)
        {
            string typeName = method.DeclaringType == null ? "Unknown" : method.DeclaringType.FullName;

            //todo rework this so that factories filter actions appropraitely
            if (classStrategy.IsSystemClass(method.DeclaringType))
            {
                Log.InfoFormat("Skipping fields in {0} (system class according to ClassStrategy)", typeName);
                return(true);
            }

            if (method.GetCustomAttribute <NakedObjectsIgnoreAttribute>() != null)
            {
                Log.InfoFormat("Ignoring method: {0}.{1} because it is ignored", typeName, method.Name);
                return(true);
            }

            if (method.IsStatic)
            {
                Log.InfoFormat("Ignoring method: {0}.{1} because it is static", typeName, method.Name);
                return(true);
            }

            if (method.IsGenericMethod)
            {
                Log.InfoFormat("Ignoring method: {0}.{1} because it is generic", typeName, method.Name);
                return(true);
            }

            if (!classStrategy.IsTypeToBeIntrospected(method.ReturnType))
            {
                Log.InfoFormat("Ignoring method: {0}.{1} because return type is of type {3}", typeName, method.Name, method.ReturnType);
                return(true);
            }

            foreach (ParameterInfo parameterInfo in method.GetParameters())
            {
                if (!classStrategy.IsTypeToBeIntrospected(parameterInfo.ParameterType))
                {
                    Log.InfoFormat("Ignoring method: {0}.{1} because parameter '{2}' is of type {3}", typeName, method.Name, parameterInfo.Name, parameterInfo.ParameterType);
                    return(true);
                }
            }
            return(false);
        }