Esempio n. 1
0
        async Task<bool> ShouldExcludeAsync(Document document)
        {
            foreach (Export<IDocumentMatcher, INamedMetadata> exclusionMatcher in this.exclusionMatchers)
            {
                document.ApplyOptions(exclusionMatcher.OptionApplier);

                using (new PerformanceTracer(exclusionMatcher.Metadata.Name, document.Name))
                {
                    if (await exclusionMatcher.Part.IsMatchAsync(document))
                    {
                        Log.WriteVerbose(
                            $"Matcher {exclusionMatcher.Metadata.Name} excluded document {document.Name}");
                        return true;
                    }
                }
            }

            return false;
        }