GH_FileWatcher

References
Provides easy mechanisms to monitor changes to the local File System.

Properties

Active

#
Gets or sets the active flag on this watcher.
public bool Active { get; set; }

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.
public TimeSpan Buffer { get; set; }

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.
public bool InvokeOnDefaultThread { get; set; }

IsDisposed

#
public bool IsDisposed { get; }

Path

#
Gets the file or folder path currently being watched.
public string Path { get; }

Methods

CreateDirectoryWatcher

#
Create a new FileSystem Watcher object aimed at a specific file.
public static GH_FileWatcher CreateDirectoryWatcher(
folderPath,
Folder to watch.
filter,
Filter string for filenames.
events,
Events to watch for.
delegate
Callback delegate.
)
A new filewatcher aimed at the specified folder.

CreateDirectoryWatcher

#
Create a new FileSystem Watcher object aimed at a specific file.
public static GH_FileWatcher CreateDirectoryWatcher(
folderPath,
Folder to watch.
filter,
Filter string for filenames.
events,
Events to watch for.
delegate
Callback delegate.
)
A new filewatcher aimed at the specified folder.

CreateFileWatcher

#
Create a new FileSystem Watcher object aimed at a specific file.
public static GH_FileWatcher CreateFileWatcher(
filePath,
File to watch.
events,
Events to watch for.
delegate
Callback delegate.
)
A new filewatcher aimed at the specified file.

CreateFileWatcher

#
Create a new FileSystem Watcher object aimed at a specific file.
public static GH_FileWatcher CreateFileWatcher(
filePath,
File to watch.
events,
Events to watch for.
delegate
Callback delegate.
)
A new filewatcher aimed at the specified file.

Dispose

#
public void Dispose()

Dispose

#
protected virtual void Dispose(
disposing
)

SetCustomUIThread

#
If you want to override the default Invoke behaviour, you must set InvokeOnDefaultThread to False and supply either a custom Control or a Form.
public void SetCustomUIThread(
Control
target
GUI target object which will be used for Invoking File System Events.
)

SetCustomUIThread

#
If you want to override the default Invoke behaviour, you must set InvokeOnDefaultThread to False and supply either a custom Control or a Form.
public void SetCustomUIThread(
target
GUI target object which will be used for Invoking File System Events.
)