コード例 #1
0
 /// <summary>Gets the <see cref="BackgroundCopyJob"/> object with the specified job identifier.</summary>
 /// <param name="jobId">Unique identifier of the job.</param>
 /// <returns>The referenced <see cref="BackgroundCopyJob"/> object if found, null if not.</returns>
 public BackgroundCopyJob this[Guid jobId]
 {
     get
     {
         var job = BackgroundCopyManager.GetJob(jobId);
         return(job != null ? new BackgroundCopyJob(job) : throw new KeyNotFoundException());
     }
 }
コード例 #2
0
 /// <summary>Determines whether the <see cref="ICollection{T}"/> contains a specific value.</summary>
 /// <param name="jobId">The object to locate in the <see cref="ICollection{T}"/>.</param>
 /// <returns>true if <paramref name="jobId"/> is found in the <see cref="ICollection{T}"/>; otherwise, false.</returns>
 public bool Contains(Guid jobId)
 {
     try
     {
         var ijob = BackgroundCopyManager.GetJob(jobId);
         return(ijob != null);
     }
     catch
     {
         return(false);
     }
 }