/// <summary>
        /// Executes the <paramref name="filter"/> on the <paramref name="type"/>, logging information if it was
        /// excluded.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="filter">The <see cref="Type"/> filter.</param>
        /// <returns>The result of <see cref="ITypeFilter.ExcludeType"/>.</returns>
        /// <exception cref="ArgumentNullException">The <paramref name="type"/> or <paramref name="filter"/> parameters
        /// are <see langword="null"/>.</exception>
        private static bool ApplyFilter(this Type type, ITypeFilter filter)
        {
            if (type == null)
                throw new ArgumentNullException("type");
            if (filter == null)
                throw new ArgumentNullException("filter");

            bool excludeType = filter.ExcludeType(type);
            if (excludeType)
            {
                Trace.TraceInformation(
                    "The type '{0}' was excluded by the filter '{1}'.",
                    type,
                    filter.Name);
            }

            return excludeType;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Executes the <paramref name="filter"/> on the <paramref name="type"/>, logging information if it was
        /// excluded.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="filter">The <see cref="Type"/> filter.</param>
        /// <returns>The result of <see cref="ITypeFilter.ExcludeType"/>.</returns>
        /// <exception cref="ArgumentNullException">The <paramref name="type"/> or <paramref name="filter"/> parameters
        /// are <see langword="null"/>.</exception>
        private static bool ApplyFilter(this Type type, ITypeFilter filter)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }
            if (filter == null)
            {
                throw new ArgumentNullException(nameof(filter));
            }

            bool excludeType = filter.ExcludeType(type);

            if (excludeType)
            {
                ////TODO: Look into Tracing.
                ////Trace.TraceInformation(
                ////    "The type '{0}' was excluded by the filter '{1}'.",
                ////    type,
                ////    filter.Name);
            }

            return(excludeType);
        }