Пример #1
0
        // Stop watch the current file, if any.
        public void StopWatching()
        {
            try
            {
                LocalFileWatcher temp = null;

                lock (_lock)
                {
                    if (_watcher != null)
                    {
                        Log.Info("Will stop watching file: ", _filePath);
                        temp     = _watcher;
                        _watcher = null;
                    }
                }

                if (temp != null)
                {
                    temp.Stop();
                    Log.Info("Stopped the local watcher.");
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                throw;
                //throw new FaultException<ExceptionDetail>(new ExceptionDetail(ex), "Exception stopping watching file '" + (_filePath ?? "<null>") + "' (on the server).");
            }
        }