示例#1
0
 internal BitsError(BitsJob job, IBackgroundCopyError error)
 {
     if (null == error)
         throw new ArgumentNullException("error", "Parameter IBackgroundCopyError cannot be a null reference");
     this.error = error;
     this.job = job;
 }
示例#2
0
 internal BitsError(BitsJob job, IBackgroundCopyError error)
 {
     if (null == error)
         throw new ArgumentNullException("IBackgroundCopyError");
     this.error = error;
     this.job = job;
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="bitsError">
        /// The IBackgroundCopyError interface object which holds the cause of
        /// an error and knows if the transfer process can proceed.
        /// </param>
        public BitsErrorAdapter( IBackgroundCopyError bitsError )
        {
            Error = bitsError;

            // This is a COM resource, so I want to manage it.
            IBackgroundCopyFile ppFile;
            Error.GetFile( out ppFile );
            File = new BitsFileAdapter( ppFile );
        }
 void IBackgroundCopyCallback.JobError( IBackgroundCopyJob pJob, IBackgroundCopyError pError )
 {
     EventHandler<JobErrorEventArgs> handler = JobError;
     if ( handler != null )
     {
         handler( this,
                  new JobErrorEventArgs( new BitsJob( new BitsJobAdapter( pJob ) ),
                                         new BitsError( new BitsErrorAdapter( pError ) ) ) );
     }
 }
示例#5
0
 public void JobError(IBackgroundCopyJob pJob, IBackgroundCopyError pError)
 {
     BitsJob job;
     if (null != this.onJobErrored)
     {
         Guid guid;
         pJob.GetId(out guid);
         if (manager.Jobs.ContainsKey(guid))
         {
             job = manager.Jobs[guid];
         }
         else
         {
             // Update Joblist to check whether the job still exists. If not, just return
             manager.EnumJobs(manager.currentOwner);
             if (manager.Jobs.ContainsKey(guid))
             {
                 job = manager.Jobs[guid];
             }
             else
                 return;
         }
         this.onJobErrored(this, new ErrorNotificationEventArgs(job, new BitsError(job, pError)));
         //forward event
         if (job.notificationTarget != null)
             job.notificationTarget.JobError(pJob, pError);
     }
 }
示例#6
0
 public UpdateJobErrorEventArgs(UpdateJob eventJob, IBackgroundCopyError errorInfo) : base(eventJob)
 {
     this.errorInfo = errorInfo;
 }
示例#7
0
 void IBackgroundCopyCallback.JobError(IBackgroundCopyJob job, IBackgroundCopyError error)
 {
     JobEvents.ErrorEvent(new UpdateJob(job), error);
 }
示例#8
0
 void IBackgroundCopyCallback.JobError(IBackgroundCopyJob pJob, IBackgroundCopyError pError)
 {
     parent.OnError(pError);
 }