public HResult WaitForJob(INiJob job) { try { if (job == null) { throw new ArgumentNullException("job"); } Cursor.Current = Cursors.WaitCursor; while (true) { lock (job) { if (_currentJob != null) { OnProgressChanged(new JobEventArgs(_currentJob)); } if (job.Completed) { return(HResult.OK); } } _event.WaitOne(); } } catch (Exception ex) { return(ErrorUtil.GetHResult(ex)); } }
public HResult CreateJob(INiJobHandler handler, out INiJob job) { job = null; try { job = new NiJob(this, handler); return HResult.OK; } catch (Exception ex) { return ErrorUtil.GetHResult(ex); } }
public HResult CreateJob(INiJobHandler handler, out INiJob job) { job = null; try { job = new NiJob(this, handler); return(HResult.OK); } catch (Exception ex) { return(ErrorUtil.GetHResult(ex)); } }
public HResult WaitForJob(INiJob job) { try { if (job == null) throw new ArgumentNullException("job"); Cursor.Current = Cursors.WaitCursor; while (true) { lock (job) { if (_currentJob != null) OnProgressChanged(new JobEventArgs(_currentJob)); if (job.Completed) return HResult.OK; } _event.WaitOne(); } } catch (Exception ex) { return ErrorUtil.GetHResult(ex); } }
public abstract HResult Perform(INiJob job);