-
Notifications
You must be signed in to change notification settings - Fork 264
Expand file tree
/
Copy pathFileSystemWatcherFactory.cs
More file actions
43 lines (37 loc) · 1.22 KB
/
FileSystemWatcherFactory.cs
File metadata and controls
43 lines (37 loc) · 1.22 KB
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
namespace System.IO.Abstractions
{
/// <inheritdoc />
#if FEATURE_SERIALIZABLE
[Serializable]
#endif
public class FileSystemWatcherFactory : IFileSystemWatcherFactory
{
/// <summary>
/// Base factory class for creating a <see cref="IFileSystemWatcher"/>
/// </summary>
public FileSystemWatcherFactory(IFileSystem fileSystem)
{
FileSystem = fileSystem;
}
/// <inheritdoc />
public IFileSystem FileSystem { get; }
/// <inheritdoc />
public IFileSystemWatcher New()
=> new FileSystemWatcherWrapper(FileSystem);
/// <inheritdoc />
public IFileSystemWatcher New(string path)
=> new FileSystemWatcherWrapper(FileSystem, path);
/// <inheritdoc />
public IFileSystemWatcher New(string path, string filter)
=> new FileSystemWatcherWrapper(FileSystem, path, filter);
/// <inheritdoc />
public IFileSystemWatcher Wrap(FileSystemWatcher fileSystemWatcher)
{
if (fileSystemWatcher == null)
{
return null;
}
return new FileSystemWatcherWrapper(FileSystem, fileSystemWatcher);
}
}
}