![]() | BackgroundCopyManagerEnumerateJobs Method (Boolean) |
Namespace: usis.Net.Bits
Exception | Condition |
---|---|
ObjectDisposedException | The method was called after the object was disposed. |
The enumerator provides a snapshot of the jobs in the transfer queue at the time you call the EnumerateJobs method. If you retrieve property values from a job in the list, however, the values reflect the current property values of the job.
Each BackgroundCopyJob object that is returned by the enumerator holds a reference to a COM interface and implements the IDisposable intrface. Therefore you should call Dispose when your are finished with it.
using System; using usis.Net.Bits; namespace BitsTest { internal static class Sample { internal static void Main() { using (var manager = BackgroundCopyManager.Connect()) { Console.WriteLine("BITS Version {0}", manager.Version); Console.WriteLine(); // list all BITS jobs of the current user foreach (var job in manager.EnumerateJobs(false)) { Console.WriteLine("{0} '{1}' {2}", job.Id.ToString("B"), job.DisplayName, job.State.ToString()); job.Dispose(); } } } } }