Skip to content

Commit d798db8

Browse files
committed
updated readme and license
1 parent e13ba9d commit d798db8

2 files changed

Lines changed: 78 additions & 16 deletions

File tree

LICENSE

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
2-
Copyright (c) Microsoft Corporation
3-
4-
All rights reserved.
5-
61
MIT License
72

8-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
9-
files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy,
10-
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
11-
is furnished to do so, subject to the following conditions:
3+
Copyright (c) 2022 Duong Dieu Phap
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
1211

13-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
1414

15-
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
16-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
17-
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
18-
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,77 @@ A wrapper of C# `FileSystemWatcher` for Windows, used in [ImageGlass](https://gi
33

44
This project is based on the *VSCode FileWatcher*: https://github.com/Microsoft/vscode-filewatcher-windows
55

6-
6+
![Nuget](https://img.shields.io/nuget/dt/FileWatcherEx?color=%2300a8d6&logo=nuget)
77
[![Build status](https://ci.appveyor.com/api/projects/status/t20tf9qyta8enhu1?svg=true)](https://ci.appveyor.com/project/d2phap/filewatcherex)
88

9+
10+
## Resource links
11+
- Project url: [https://github.com/d2phap/FileWatcherEx](https://github.com/d2phap/FileWatcherEx)
12+
- Website: [https://imageglass.org](https://imageglass.org)
13+
- Nuget package: [https://www.nuget.org/packages/FileWatcherEx](https://www.nuget.org/packages/FileWatcherEx/)
14+
915
## Features
10-
- Standardize the events of C# `FileSystemWatcher`
16+
- Standardize the events of C# `FileSystemWatcher`.
1117
- No false change notifications when a file system item is created, deleted, changed or renamed.
18+
- Support .NET 6.0.
1219

1320
## Installation
1421
Run the command
1522
```bat
1623
Install-Package FileWatcherEx
1724
```
1825

26+
## Usage
27+
See Demo project for full details
28+
29+
```cs
30+
using FileWatcherEx;
31+
32+
33+
var _fw = new FileSystemWatcherEx(@"C:\path\to\watch");
34+
35+
// event handlers
36+
_fw.OnRenamed += FW_OnRenamed;
37+
_fw.OnCreated += FW_OnCreated;
38+
_fw.OnDeleted += FW_OnDeleted;
39+
_fw.OnChanged += FW_OnChanged;
40+
_fw.OnError += FW_OnError;
41+
42+
// thread-safe for event handlers
43+
_fw.SynchronizingObject = this;
44+
45+
// start watching
46+
_fw.Start();
47+
48+
49+
50+
void FW_OnRenamed(object sender, FileChangedEvent e)
51+
{
52+
// do something here
53+
}
54+
...
55+
56+
```
57+
1958
## License
2059
[MIT](LICENSE)
60+
61+
## Support this project
62+
63+
<a href="https://github.com/sponsors/d2phap" target="_blank" title="Become a sponsor">
64+
<img src="https://img.shields.io/badge/Github-@d2phap-24292e.svg?maxAge=3600&logo=github" height="30" alt="Become a sponsor">
65+
</a>
66+
67+
<a href="https://www.patreon.com/d2phap" target="_blank" title="Become a patron">
68+
<img src="https://img.shields.io/badge/Patreon-@d2phap%20-e85b46.svg?maxAge=3600&logo=patreon" height="30" alt="Become a patron">
69+
</a>
70+
71+
<a href="https://www.paypal.me/d2phap" target="_blank" title="Buy me a beer?">
72+
<img src="https://img.shields.io/badge/PayPal-Donate%20$10%20-0070ba.svg?maxAge=3600&logo=paypal" height="30" alt="Buy me a beer?">
73+
</a>
74+
75+
<a href="https://donorbox.org/imageglass" target="_blank" title="Wire transfer">
76+
<img src="https://img.shields.io/badge/DonorBox-@imageglass%20-005384.svg?maxAge=3600&logo=donorbox" height="30" alt="Wire transfer">
77+
</a>
78+
79+
Thanks for your gratitude and finance help!

0 commit comments

Comments
 (0)