Revision d78d765c trunk/Pithos.Core/Agents/Agent.cs

b/trunk/Pithos.Core/Agents/Agent.cs
145 145
        /// <param name="action">The action to execute</param>
146 146
        public void DoAsync(Action action)
147 147
        {
148
            Contract.Requires(action!=null);
148
            if(action==null)
149
                throw new ArgumentNullException("action");
150
            Contract.EndContractBlock();
151

  
149 152
            Task.Factory.StartNew(action, CancellationToken);
150 153
        }
151 154

  
......
191 194

  
192 195
        public Task LoopAsync(Task process, Action loop,Action<Exception> onError=null)
193 196
        {
194
            Contract.Requires(process!=null);
195
            Contract.Requires(loop!=null);
197
            if(process==null)
198
                throw new ArgumentNullException("process");
199
            if(loop==null)
200
                throw new ArgumentNullException("loop");
201
            Contract.EndContractBlock();
196 202

  
197 203
            return process.ContinueWith(t =>
198 204
            {   

Also available in: Unified diff