WIP
DirectOutput framework for virtual pinball cabinets WIP
Go to:
Overview 
FilePatternList.cs
Go to the documentation of this file.
1 using System.Collections.Generic;
2 using System.IO;
3 using System.Linq;
4 
5 namespace DirectOutput.General
6 {
10  public class FilePatternList : List<FilePattern>
11  {
17  public List<FileInfo> GetMatchingFiles(Dictionary<string, string> ReplaceValues=null)
18  {
19  List<FileInfo> L = new List<FileInfo>();
20  foreach(FilePattern P in this) {
21  List<FileInfo> PL = P.GetMatchingFiles(ReplaceValues);
22  foreach (FileInfo FI in PL)
23  {
24  if (!L.Any(x=>x.FullName==FI.FullName))
25  {
26  L.Add(FI);
27  }
28  }
29  }
30  return L;
31  }
32 
33 
39  public FileInfo GetFirstMatchingFile(Dictionary<string, string> ReplaceValues = null)
40  {
41  foreach (FilePattern P in this)
42  {
43  FileInfo F = P.GetFirstMatchingFile(ReplaceValues);
44  if (F != null)
45  {
46  return F;
47  }
48  }
49  return null;
50  }
51 
52 
53  }
54 }
FileInfo GetFirstMatchingFile(Dictionary< string, string > ReplaceValues=null)
Gets the first matching file for the entries in the list.
FileInfo GetFirstMatchingFile(Dictionary< string, string > ReplaceValues=null)
Gets the first file matching the value of the Pattern property.
Definition: FilePattern.cs:148
List< FileInfo > GetMatchingFiles(Dictionary< string, string > ReplaceValues=null)
Gets the files matching the value of the property Pattern.
Definition: FilePattern.cs:116
A file pattern class used to lookup files matching a specified pattern.
Definition: FilePattern.cs:12
List< FileInfo > GetMatchingFiles(Dictionary< string, string > ReplaceValues=null)
Gets the files matching one of the entries in this list