private void HandleCOMException(COMException cex) { BackgroundCopyJobState state = BackgroundCopyJob.GetState(m_ijob); if (state == BackgroundCopyJobState.Error || state == BackgroundCopyJobState.TransientError) { Interop.IBackgroundCopyError pErr; m_ijob.GetError(out pErr); throw new BackgroundCopyException(pErr); } else { throw new BackgroundCopyException(cex); } }
/// <summary> /// Creates a new upload or download transfer job. /// </summary> /// <param name="displayName">Name of the job.</param> /// <param name="description">Description of t he job.</param> /// <param name="jobType">Type (upload or download) of the job.</param> /// <returns>The new <see cref="BackgroundCopyJob"/>.</returns> public static BackgroundCopyJob CreateJob(string displayName, string description, BackgroundCopyJobType jobType) { try { IBackgroundCopyJob newJob; Guid newJobID; mgr.CreateJob(displayName, jobType, out newJobID, out newJob); BackgroundCopyJob job = new BackgroundCopyJob(newJob); if (!string.IsNullOrEmpty(description)) { job.Description = description; } return(job); } catch (COMException cex) { HandleCOMException(cex); } return(null); }
internal BackgroundCopyJobEventArgs(BackgroundCopyJob j) { Job = j; }
public Notifier(BackgroundCopyJob job) { parent = job; }