private NotifyFilters ProcessFilters(SymbolicLink symbolicLink)
        {
            NotifyFilters filters = NotifyFilters.Size;

            if (symbolicLink.WatchFileName)
            {
                filters = filters | NotifyFilters.FileName;
            }

            if (symbolicLink.WatchDirectoryName)
            {
                filters = filters | NotifyFilters.DirectoryName;
            }

            if (symbolicLink.WatchSize)
            {
                filters = filters | NotifyFilters.Size;
            }

            if (symbolicLink.WatchLastWrite)
            {
                filters = filters | NotifyFilters.LastWrite;
            }

            if (symbolicLink.WatchLastAccess)
            {
                filters = filters | NotifyFilters.LastAccess;
            }

            if (symbolicLink.WatchCreationTime)
            {
                filters = filters | NotifyFilters.CreationTime;
            }

            if (symbolicLink.WatchSecurity)
            {
                filters = filters | NotifyFilters.Security;
            }

            return(filters);
        }
        public FileSystemWatcher StartWatcher(string sourcePath)
        {
            SymbolicLink symbolicLink = DirWatchTransferApp.SymbolicLinks.FirstOrDefault(a => a.Source == sourcePath);

            symbolicLink.Monitor = this;

            if (!Directory.Exists(sourcePath))
            {
                Directory.CreateDirectory(sourcePath);
            }

            this.watcher.Path = sourcePath;
            this.watcher.IncludeSubdirectories = true;
            this.watcher.NotifyFilter          = this.ProcessFilters(symbolicLink);

            this.watcher.Changed += SymbolicLinkWatcher_Changed;
            this.watcher.Created += SymbolicLinkWatcher_Created;

            // Begin watching directory
            this.watcher.EnableRaisingEvents = true;

            return(this.watcher);
        }