using System.Linq;
using Codelyzer.Analysis;
using CTA.FeatureDetection.Common.Extensions;
using CTA.FeatureDetection.Common.Models.Features.Base;
namespace CTA.FeatureDetection.ProjectType.CompiledFeatures
{
public class WebClassLibraryFeature : CompiledFeature
{
///
/// Determines if a project is using members from the System.Web namespace
///
///
/// Whether a project is using System.Web or not
public override bool IsPresent(AnalyzerResult analyzerResult)
{
var sourceFileRootNodes = analyzerResult.ProjectResult.SourceFileResults;
var isPresent = sourceFileRootNodes.Any(n => n.ContainsReference(Constants.SystemWebReferenceIdentifier));
return isPresent;
}
}
}