public bool IsMatch <TItem>([NotNull] AbstractDependency <TItem> d) where TItem : AbstractItem <TItem> { MatchResult matchLeft = UsingMatch == null ? new MatchResult(true, null) : UsingMatch.Matches(d.UsingItem, NO_STRINGS); return(matchLeft.Success && (DependencyPattern == null || DependencyPattern.IsMatch(d)) && (UsedMatch == null || UsedMatch.Matches(d.UsedItem, matchLeft.Groups).Success)); }
public static void Apply(AbstractDependency dep) { dep.Group = Group; dep.Name = Name; dep.Arch = Arch; dep.Runtime = Runtime; dep.Ext = Ext; dep.Scope = Scopes.Runtime; }
public bool IsMatch <TItem>(AbstractDependency <TItem> dependency) where TItem : AbstractItem <TItem> { if (!_markerPattern.IsMatch(dependency.MarkerSet)) { return(false); } else { return(_evals.All(e => e.Predicate(GetValue(dependency, e.LeftOrNullForConstant), GetValue(dependency, e.RightOrNullForConstant)))); } }
private static int GetValue <TItem>(AbstractDependency <TItem> dependency, [CanBeNull] string operandOrNullForConstant) where TItem : AbstractItem <TItem> { switch (operandOrNullForConstant) { case null: return(0); case "#": return(dependency.Ct); case "?": return(dependency.QuestionableCt); case "!": return(dependency.BadCt); case "O": return(Equals(dependency.UsingItem, dependency.UsedItem) ? 1 : 0); default: throw new ArgumentException($"Unexpected DependencyPattern operand '{operandOrNullForConstant}'"); } }
public ComponentWithAbstactClassDependency(AbstractDependency dependency) { Dependency = dependency; }
public override bool IsMatch <TItem>(AbstractDependency <TItem> d) { return(_alternatives.Any(a => a.IsMatch(d))); }
public abstract bool IsMatch <TItem>([NotNull] AbstractDependency <TItem> d) where TItem : AbstractItem <TItem>;