Properties
Buffer
#Gets or sets the time during which events are buffered. If multiple events for the same file occur within the buffered timespan, they will be merged into one event.
InvokeOnDefaultThread
#Gets or sets invoke behaviour for events. If true, then the event delegate is called via the Grasshopper main UI thread. This is almost always what you need.
Methods
CreateDirectoryWatcher
#public static GH_FileWatcher CreateDirectoryWatcher(string folderPath, string filter, GH_FileWatcherEvents events, FileChanged delegate)
Create a new FileSystem Watcher object aimed at a specific file.
Parameters:
| folderPath (string) | Folder to watch. |
| filter (string) | Filter string for filenames. |
| events (GH_FileWatcherEvents) | Events to watch for. |
| delegate (GH_FileWatcher.FileChanged) | Callback delegate. |
Returns: A new filewatcher aimed at the specified folder.
CreateDirectoryWatcher
#public static GH_FileWatcher CreateDirectoryWatcher(string folderPath, string filter, GH_FileWatcherEvents events, FileChangedSimple delegate)
Create a new FileSystem Watcher object aimed at a specific file.
Parameters:
| folderPath (string) | Folder to watch. |
| filter (string) | Filter string for filenames. |
| events (GH_FileWatcherEvents) | Events to watch for. |
| delegate (GH_FileWatcher.FileChangedSimple) | Callback delegate. |
Returns: A new filewatcher aimed at the specified folder.
CreateFileWatcher
#public static GH_FileWatcher CreateFileWatcher(string filePath, GH_FileWatcherEvents events, FileChanged delegate)
Create a new FileSystem Watcher object aimed at a specific file.
Parameters:
| filePath (string) | File to watch. |
| events (GH_FileWatcherEvents) | Events to watch for. |
| delegate (GH_FileWatcher.FileChanged) | Callback delegate. |
Returns: A new filewatcher aimed at the specified file.
CreateFileWatcher
#public static GH_FileWatcher CreateFileWatcher(string filePath, GH_FileWatcherEvents events, FileChangedSimple delegate)
Create a new FileSystem Watcher object aimed at a specific file.
Parameters:
| filePath (string) | File to watch. |
| events (GH_FileWatcherEvents) | Events to watch for. |
| delegate (GH_FileWatcher.FileChangedSimple) | Callback delegate. |
Returns: A new filewatcher aimed at the specified file.
Dispose
#public void Dispose()
SetCustomUIThread
#public void SetCustomUIThread(Control target)
If you want to override the default Invoke behaviour, you must set InvokeOnDefaultThread to False and supply either a custom Control or a Form.
Parameters:
| target (Control) | GUI target object which will be used for Invoking File System Events. |