public Watcher(string folder)
{
#if __MonoCS__
// http://stackoverflow.com/questions/16859372/why-doesnt-the-servicestack-razor-filesystemwatcher-work-on-mono-mac-os-x
Environment.SetEnvironmentVariable("MONO_MANAGED_WATCHER", "enabled");
#endif
Path = System.IO.Path.GetFullPath(folder);
IncludeSubdirectories = true;
Filter = "*";
InternalBufferSize = 4 * 1024 * 16;
NotifyFilter = NotifyFilters.Size | NotifyFilters.FileName | NotifyFilters.DirectoryName;
Error += new ErrorEventHandler(OnError);
Created += new FileSystemEventHandler(OnCreated);
Deleted += new FileSystemEventHandler(OnDeleted);
Changed += new FileSystemEventHandler(OnChanged);
Renamed += new RenamedEventHandler(OnRenamed);
EnableRaisingEvents = true;
EnableEvent = true;
}