.NotifyCreate // boolean - default: true - triggered when an object is created
.NotifyWrite  // boolean - default: true - triggered when an object is written
.NotifyRemove // boolean - default: true - triggered when an object is removed
.NotifyRename // boolean - default: true - triggered when an object is renamed
.NotifyChmod  // boolean - default: true - triggered when an object's metadata is changed


These 5 properties of the FsWatcher object determine which file system events will be included in the watcher's notifications and which ones won't. By default they are all set to true, so unless you want to disable some of them, you don't need to set/reset them in your code.


Example:


{
 ConsoleFeedback = true;
 var scli = new SftpClient();
 scli.Host = 'your.sftpserver.com:22';
 scli.User = 'some_username';
 scli.PassFromSecret = 'name_of_the_secret_password';
 if (scli.Connect()) {
  watchr = new FsWatcher();
  watchr.WatchDir('C:\\Docs', true);
  watchr.NotifyRename = false; // will NOT notify File-Rename events
  watchr.InclusionFilter = ['*.docx', '*.xlsx']
  watchr.ExclusionFilter = ['some_private_document.docx']
  watchr.Start(); 
  while (true) {
   Sleep(1000);
   if (HaltSignalReceived) {
    break;
   }
   evt = watchr.Events()
   if (evt.length > 0) {
    for (var i = 0; i < evt.length; i++) {
     if (evt[i].Event == 'WRITE') {
      scli.UploadWithPath(evt[i].Object, '/realtimebackup', 0);
     }
    }   
   }
  } 
  scli.Close();   
 } 
 scli = nil;
}