File tree Expand file tree Collapse file tree 2 files changed +42
-1
lines changed
xml/System.IO.Enumeration Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . IO ;
3
+ using System . IO . Enumeration ;
4
+
5
+ namespace MyNamespace
6
+ {
7
+ public class MyClassCS
8
+ {
9
+ static void Main ( )
10
+ {
11
+ var enumeration = new FileSystemEnumerable < string > (
12
+ directory : Path . GetTempPath ( ) , // search Temp directory
13
+ transform : ( ref FileSystemEntry entry ) => entry . ToFullPath ( ) , // map FileSystemEntry to string (see FileSystemEnumerable generic argument)
14
+ options : new EnumerationOptions ( )
15
+ {
16
+ RecurseSubdirectories = true
17
+ } )
18
+ {
19
+ // The following predicate will be used to filter the file entries
20
+ ShouldIncludePredicate = ( ref FileSystemEntry entry ) => ! entry . IsDirectory && Path . GetExtension ( entry . ToFullPath ( ) ) == ".tmp"
21
+ } ;
22
+
23
+ // Prints all ".tmp" files from Temp directory
24
+ foreach ( string filePath in enumeration )
25
+ {
26
+ Console . WriteLine ( filePath ) ;
27
+ }
28
+ }
29
+ }
30
+
31
+ }
Original file line number Diff line number Diff line change 35
35
<Docs >
36
36
<typeparam name =" TResult" >The type that this enumerable encapsulates.</typeparam >
37
37
<summary >Allows utilizing custom filter predicates and transform delegates for enumeration purposes.</summary >
38
- <remarks >To be added.</remarks >
38
+ <remarks >
39
+ <format type =" text/markdown" ><]
46
+
47
+ ]]> </format >
48
+ </remarks >
39
49
</Docs >
40
50
<Members >
41
51
<Member MemberName =" .ctor" >
You can’t perform that action at this time.
0 commit comments