-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
PatternMatchingResult.cs
48 lines (42 loc) · 1.71 KB
/
PatternMatchingResult.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections.Generic;
using System.Linq;
namespace Microsoft.Extensions.FileSystemGlobbing
{
/// <summary>
/// Represents a collection of <see cref="FilePatternMatch" />
/// </summary>
public class PatternMatchingResult
{
/// <summary>
/// Initializes the result with a collection of <see cref="FilePatternMatch" />
/// </summary>
/// <param name="files">A collection of <see cref="FilePatternMatch" /></param>
public PatternMatchingResult(IEnumerable<FilePatternMatch> files)
: this(files, hasMatches: files.Any())
{
Files = files;
}
/// <summary>
/// Initializes the result with a collection of <see cref="FilePatternMatch" />
/// </summary>
/// <param name="files">A collection of <see cref="FilePatternMatch" /></param>
/// <param name="hasMatches">A value that determines if <see cref="PatternMatchingResult"/> has any matches.</param>
public PatternMatchingResult(IEnumerable<FilePatternMatch> files, bool hasMatches)
{
ThrowHelper.ThrowIfNull(files);
Files = files;
HasMatches = hasMatches;
}
/// <summary>
/// A collection of <see cref="FilePatternMatch" />
/// </summary>
public IEnumerable<FilePatternMatch> Files { get; set; }
/// <summary>
/// Gets a value that determines if this instance of <see cref="PatternMatchingResult"/> has any matches.
/// </summary>
public bool HasMatches { get; }
}
}