Exemplo n.º 1
0
        public void Watch(string path)
        {
            FileFollower follower = null;

            lock (followers) {
                if (!IsWatching(path))
                {
                    Log.Inform(string.Format(">>>>>  START   |  |  |     |  |                      |  |          |  |" + path + "|"));
                    follower = new FileFollower(new FileStreamLiveFollower(path, token), handler);
                    followers.Add(path, follower);
                }
            }
            if (follower != null)
            {
                (new Thread(() => Process(follower, path))).Start();
            }
        }
Exemplo n.º 2
0
 private void Process(FileFollower follower, string path)
 {
     follower.Process();
     lock (followers) followers.Remove(path);
     Log.Inform(string.Format("<<<<<  DONE    |XX|  |     |  |                      |  |          |  |" + path + "|"));
 }