Revision 5d7b20e8 trunk/Pithos.Core/Agents/FileAgent.cs

b/trunk/Pithos.Core/Agents/FileAgent.cs
76 76
        
77 77
        private FileEventIdleBatch _eventIdleBatch;
78 78

  
79
        public FileAgent(int idleTimeout)
80
        {            
81
            _eventIdleBatch=new FileEventIdleBatch(idleTimeout,ProcessBatchedEvents);
82
        }
79
        public TimeSpan IdleTimeout { get; set; }
80

  
83 81

  
84 82
        private void ProcessBatchedEvents(Dictionary<string, FileSystemEventArgs[]> fileEvents)
85 83
        {
......
127 125
                throw new ArgumentNullException("rootPath");
128 126
            if (!Path.IsPathRooted(rootPath))
129 127
                throw new ArgumentException("rootPath must be an absolute path","rootPath");
128
            if (IdleTimeout == null)
129
                throw new InvalidOperationException("IdleTimeout must have a valid value");
130 130
            Contract.EndContractBlock();
131 131

  
132 132
            AccountInfo = accountInfo;
133 133
            RootPath = rootPath;
134

  
135
            _eventIdleBatch = new FileEventIdleBatch((int)IdleTimeout.TotalMilliseconds, ProcessBatchedEvents);
136

  
134 137
            _watcher = new FileSystemWatcher(rootPath) {IncludeSubdirectories = true,InternalBufferSize=8*4096};
135 138
            _adapter = new FileSystemWatcherAdapter(_watcher);
136 139

  

Also available in: Unified diff