129 references to MatchKind
Microsoft.TemplateEngine.Abstractions (6)
TemplateFiltering\MatchInfo.cs (2)
19public MatchInfo(string name, string? value, MatchKind kind) 31public MatchKind Kind { get; }
TemplateFiltering\MatchKind.cs (4)
40[Obsolete("This value will be removed in next release, use + " + nameof(MatchKind.Mismatch) + " or " + nameof(MatchKind.InvalidValue) + " instead")] 43[Obsolete("This value will be removed in next release, use + " + nameof(MatchKind.Mismatch) + " or " + nameof(MatchKind.InvalidValue) + " instead")]
Microsoft.TemplateEngine.Cli (29)
TemplateResolution\CliFilters.cs (13)
23return new MatchInfo(MatchInfo.BuiltIn.ShortName, name, MatchKind.Mismatch); 29return new MatchInfo(MatchInfo.BuiltIn.ShortName, name, MatchKind.Exact); 32return new MatchInfo(MatchInfo.BuiltIn.ShortName, name, MatchKind.Mismatch); 48return new MatchInfo(MatchInfo.BuiltIn.Name, name, MatchKind.Partial); 55return new MatchInfo(MatchInfo.BuiltIn.Name, name, MatchKind.Exact); 66return new MatchInfo(MatchInfo.BuiltIn.ShortName, name, MatchKind.Exact); 74return new MatchInfo(MatchInfo.BuiltIn.Name, name, MatchKind.Partial); 79return new MatchInfo(MatchInfo.BuiltIn.ShortName, name, MatchKind.Partial); 82return new MatchInfo(MatchInfo.BuiltIn.Name, name, MatchKind.Mismatch); 113return new MatchInfo(MatchInfo.BuiltIn.Language, language, MatchKind.Exact); 117return new MatchInfo(MatchInfo.BuiltIn.Language, language, MatchKind.Mismatch); 125return new MatchInfo(MatchInfo.BuiltIn.Language, defaultLanguage, MatchKind.Exact); 131return new MatchInfo(MatchInfo.BuiltIn.Language, language, MatchKind.Exact);
TemplateResolution\ParameterMatchInfo.cs (1)
11internal ParameterMatchInfo(string name, string? value, MatchKind kind, MismatchKind mismatchKind = MismatchKind.NoMismatch, string? inputFormat = null) : base(name, value, kind)
TemplateResolution\TemplateGroupMatchInfo.cs (4)
49internal bool IsGroupMatch => _groupDispositions.All(x => x.Kind != MatchKind.Mismatch); 208if (groupMatchDispositions.Any(x => x.Kind == MatchKind.Mismatch)) 295.All(match => match.Kind != MatchKind.Mismatch); 302.All(match => match.Kind != MatchKind.Mismatch);
TemplateResolution\TemplateMatchInfoExtensions.cs (10)
16.Where(x => x.Kind == MatchKind.Exact) 24.Where(match => match.Kind == MatchKind.InvalidName) 37if (otherMatches.Any(mi => mi.Kind == MatchKind.Mismatch || mi.Kind == MatchKind.InvalidName || mi.Kind == MatchKind.InvalidValue)) 42return constraintsMatches.Any(mi => mi.Kind == MatchKind.Mismatch); 59if (otherMatches.Any(mi => mi.Kind == MatchKind.Mismatch || mi.Kind == MatchKind.InvalidName || mi.Kind == MatchKind.InvalidValue)) 64return filterMatches.Any(mi => mi.Kind == MatchKind.Mismatch);
TemplateResolution\TemplateResolutionResult.cs (1)
296&& matchInfo.Kind == MatchKind.Mismatch)))
Microsoft.TemplateEngine.Utils (94)
TemplateMatchInfoExtensions.cs (46)
14/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Exact" /> or <see cref="MatchKind.Partial" /> match on <see cref="MatchInfo.BuiltIn.Name"/>. 18return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.Name && (x.Kind == MatchKind.Exact || x.Kind == MatchKind.Partial)); 22/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Exact" /> match on <see cref="MatchInfo.BuiltIn.Name"/>. 26return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.Name && x.Kind == MatchKind.Exact); 30/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Partial" /> match on <see cref="MatchInfo.BuiltIn.Name"/>. 34return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.Name && x.Kind == MatchKind.Partial); 38/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Mismatch" /> on <see cref="MatchInfo.BuiltIn.Name"/>. 42return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.Name && x.Kind == MatchKind.Mismatch); 46/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Exact" /> or <see cref="MatchKind.Partial" /> match on <see cref="MatchInfo.BuiltIn.ShortName"/>. 50return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.ShortName && (x.Kind == MatchKind.Exact || x.Kind == MatchKind.Partial)); 54/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Exact" /> match on <see cref="MatchInfo.BuiltIn.ShortName"/>. 58return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.ShortName && x.Kind == MatchKind.Exact); 62/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Partial" /> match on <see cref="MatchInfo.BuiltIn.ShortName"/>. 66return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.ShortName && x.Kind == MatchKind.Partial); 70/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Mismatch" /> on <see cref="MatchInfo.BuiltIn.ShortName"/>. 74return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.ShortName && x.Kind == MatchKind.Mismatch); 78/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Exact" /> match on <see cref="MatchInfo.BuiltIn.Type"/>. 82return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.Type && x.Kind == MatchKind.Exact); 86/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Mismatch" /> on <see cref="MatchInfo.BuiltIn.Type"/>. 90return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.Type && x.Kind == MatchKind.Mismatch); 94/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Exact" /> match on <see cref="MatchInfo.BuiltIn.Classification"/>. 98return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.Classification && x.Kind == MatchKind.Exact); 102/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Mismatch" /> on <see cref="MatchInfo.BuiltIn.Classification"/>. 106return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.Classification && x.Kind == MatchKind.Mismatch); 110/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Exact" /> match on <see cref="MatchInfo.BuiltIn.Language"/>. 114return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.Language && x.Kind == MatchKind.Exact); 118/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Mismatch" /> on <see cref="MatchInfo.BuiltIn.Language"/>. 122return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.Language && x.Kind == MatchKind.Mismatch); 126/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Exact" /> match on <see cref="MatchInfo.BuiltIn.Baseline"/>. 130return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.Baseline && x.Kind == MatchKind.Exact); 134/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Mismatch" /> on <see cref="MatchInfo.BuiltIn.Baseline"/>. 138return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.Baseline && x.Kind == MatchKind.Mismatch); 142/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Exact" /> or <see cref="MatchKind.Partial" /> match on <see cref="MatchInfo.BuiltIn.Author"/>. 146return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.Author && (x.Kind == MatchKind.Exact || x.Kind == MatchKind.Partial)); // CodeQL [cs/campaign/constantine] False Positive: CodeQL wrongly detected "Author" 150/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Exact" /> match on <see cref="MatchInfo.BuiltIn.Author"/>. 154return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.Author && x.Kind == MatchKind.Exact); // CodeQL [cs/campaign/constantine] False Positive: CodeQL wrongly detected "Author" 158/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Partial" /> match on <see cref="MatchInfo.BuiltIn.Author"/>. 162return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.Author && x.Kind == MatchKind.Partial); // CodeQL [cs/campaign/constantine] False Positive: CodeQL wrongly detected "Author" 166/// Returns true when <paramref name="templateMatchInfo"/> has <see cref="MatchKind.Mismatch" /> on <see cref="MatchInfo.BuiltIn.Author"/>. 170return templateMatchInfo.MatchDisposition.Any(x => x.Name == MatchInfo.BuiltIn.Author && x.Kind == MatchKind.Mismatch); // CodeQL [cs/campaign/constantine] False Positive: CodeQL wrongly detected "Author"
WellKnownSearchFilters.cs (48)
16/// The template should match all filters: <see cref="ITemplateMatchInfo.MatchDisposition"/> should have all dispositions of <see cref="MatchKind.Exact"/> or <see cref="MatchKind.Partial"/>. 19t => t.MatchDisposition.Count > 0 && t.MatchDisposition.All(x => x.Kind is MatchKind.Exact or MatchKind.Partial); 22/// The template should match at least one filter: <see cref="ITemplateMatchInfo.MatchDisposition"/> should have at least one disposition of <see cref="MatchKind.Exact"/> or <see cref="MatchKind.Partial"/>. 25t => t.MatchDisposition.Any(x => x.Kind is MatchKind.Exact or MatchKind.Partial); 29/// - if <paramref name="name"/> is null or empty, adds match disposition <see cref="MatchInfo.BuiltIn.Name"/> with <see cref="MatchKind.Partial"/>;<br/> 30/// - if <paramref name="name"/> is equal to <see cref="ITemplateMetadata.Name"/> (case insensitive), adds match disposition <see cref="MatchInfo.BuiltIn.Name"/> with <see cref="MatchKind.Exact"/>;<br/> 31/// - if <paramref name="name"/> is equal to one of the short names in <see cref="ITemplateMetadata.ShortNameList"/> (case insensitive), adds match disposition <see cref="MatchInfo.BuiltIn.ShortName"/> with <see cref="MatchKind.Exact"/>;<br/> 32/// - if <see cref="ITemplateMetadata.Name"/> contains <paramref name="name"/> (case insensitive), adds match disposition <see cref="MatchInfo.BuiltIn.Name"/> with <see cref="MatchKind.Partial"/>;<br/> 33/// - if one of the short names in <see cref="ITemplateMetadata.ShortNameList"/> contains <paramref name="name"/> (case insensitive), adds match disposition <see cref="MatchInfo.BuiltIn.ShortName"/> with <see cref="MatchKind.Partial"/>;<br/> 34/// - adds match disposition <see cref="MatchInfo.BuiltIn.Name"/> with <see cref="MatchKind.Mismatch"/> otherwise.<br/> 43return new MatchInfo(MatchInfo.BuiltIn.Name, name, MatchKind.Partial); 50return new MatchInfo(MatchInfo.BuiltIn.Name, name, MatchKind.Exact); 61return new MatchInfo(MatchInfo.BuiltIn.ShortName, name, MatchKind.Exact); 69return new MatchInfo(MatchInfo.BuiltIn.Name, name, MatchKind.Partial); 74return new MatchInfo(MatchInfo.BuiltIn.ShortName, name, MatchKind.Partial); 77return new MatchInfo(MatchInfo.BuiltIn.Name, name, MatchKind.Mismatch); 84/// - if <paramref name="inputType"/> is equal to tag named 'type' from <see cref="ITemplateInfo.Tags"/> (case insensitive), adds match disposition <see cref="MatchInfo.BuiltIn.Type"/> with <see cref="MatchKind.Exact"/>;<br/> 85/// - adds match disposition <see cref="MatchInfo.BuiltIn.Type"/> with <see cref="MatchKind.Mismatch"/> otherwise.<br/> 100return new MatchInfo(MatchInfo.BuiltIn.Type, type, MatchKind.Exact); 104return new MatchInfo(MatchInfo.BuiltIn.Type, type, MatchKind.Mismatch); 112/// - if <paramref name="classification"/> is equal to any entry from <see cref="ITemplateMetadata.Classifications"/> (case insensitive), adds match disposition <see cref="MatchInfo.BuiltIn.Classification"/> with <see cref="MatchKind.Exact"/>;<br/> 113/// - adds match disposition <see cref="MatchInfo.BuiltIn.Classification"/> with <see cref="MatchKind.Mismatch"/> otherwise.<br/> 126return new MatchInfo(MatchInfo.BuiltIn.Classification, classification, MatchKind.Exact); 128return new MatchInfo(MatchInfo.BuiltIn.Classification, classification, MatchKind.Mismatch); 135/// - if <paramref name="language"/> is equal to tag named 'language' from <see cref="ITemplateInfo.Tags"/> (case insensitive), adds match disposition <see cref="MatchInfo.BuiltIn.Language"/> with <see cref="MatchKind.Exact"/>;<br/> 136/// - adds match disposition <see cref="MatchInfo.BuiltIn.Language"/> with <see cref="MatchKind.Mismatch"/> otherwise.<br/> 150return new MatchInfo(MatchInfo.BuiltIn.Language, language, MatchKind.Exact); 154return new MatchInfo(MatchInfo.BuiltIn.Language, language, MatchKind.Mismatch); 162/// - if <paramref name="baselineName"/> is equal to key from <see cref="ITemplateMetadata.BaselineInfo"/> (case insensitive), adds match disposition <see cref="MatchInfo.BuiltIn.Baseline"/> with <see cref="MatchKind.Exact"/>;<br/> 163/// - adds match disposition <see cref="MatchInfo.BuiltIn.Baseline"/> with <see cref="MatchKind.Mismatch"/> otherwise.<br/> 177return new MatchInfo(MatchInfo.BuiltIn.Baseline, baselineName, MatchKind.Exact); 181return new MatchInfo(MatchInfo.BuiltIn.Baseline, baselineName, MatchKind.Mismatch); 189/// - if <see cref="ITemplateMetadata.Author"/> is null or empty, adds match disposition <see cref="MatchInfo.BuiltIn.Author"/> with <see cref="MatchKind.Mismatch"/>;<br/> 190/// - if <paramref name="author"/> is equal to <see cref="ITemplateMetadata.Author"/> (case insensitive), adds match disposition <see cref="MatchInfo.BuiltIn.Author"/> with <see cref="MatchKind.Exact"/>;<br/> 191/// - if <see cref="ITemplateMetadata.Author"/> contains <paramref name="author"/> (case insensitive), adds match disposition <see cref="MatchInfo.BuiltIn.Author"/> with <see cref="MatchKind.Partial"/>;<br/> 192/// - <see cref="MatchInfo.BuiltIn.Author"/> with <see cref="MatchKind.Mismatch"/> otherwise.<br/> 206return new MatchInfo(MatchInfo.BuiltIn.Author, author, MatchKind.Mismatch); 213return new MatchInfo(MatchInfo.BuiltIn.Author, author, MatchKind.Exact); 218return new MatchInfo(MatchInfo.BuiltIn.Author, author, MatchKind.Partial); 220return new MatchInfo(MatchInfo.BuiltIn.Author, author, MatchKind.Mismatch); 228/// - if the template meets the constraint, adds match disposition with <see cref="MatchKind.Exact"/>;<br/> 229/// - if the template does not meet the constraint or constraint cannot be evaluated, adds match disposition with <see cref="MatchKind.Mismatch"/>.<br/> 250return new MatchInfo($"{MatchInfo.BuiltIn.Constraint}.{constraintDefinition.Type}", null, MatchKind.Mismatch); 253return new MatchInfo($"{MatchInfo.BuiltIn.Constraint}.{constraintDefinition.Type}", null, MatchKind.Exact);