Ejemplo n.º 1
0
 /// <summary>
 /// Gets the list of devices.
 /// </summary>
 /// <param name="token">The cancellation token.</param>
 /// <returns><c>ObservableCollection</c> of <see cref="SystemDevice"/> list</returns>
 internal Task <ObservableCollection <SystemDevice> > GetDevices(CancellationToken token)
 {
     return(engine.BuildDevicesAsync(token)
            .ContinueWith <ObservableCollection <SystemDevice> >(tsk => {
         this.deviceCollection = tsk.Result;
         return new ObservableCollection <SystemDevice>(tsk.Result);
     }
                                                                 , token
                                                                 , TaskContinuationOptions.NotOnFaulted | TaskContinuationOptions.NotOnCanceled
                                                                 , TaskScheduler.Current));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the list of devices.
 /// </summary>
 /// <param name="token">The cancellation token.</param>
 /// <returns><c>ObservableCollection</c> of <see cref="SystemDevice"/> list</returns>
 internal Task<ObservableCollection<SystemDevice>> GetDevices(CancellationToken token)
 {
     return engine.BuildDevicesAsync(token)
         .ContinueWith<ObservableCollection<SystemDevice>>(tsk => {
             this.deviceCollection = tsk.Result;
             return new ObservableCollection<SystemDevice>(tsk.Result);
         }
         ,token
         , TaskContinuationOptions.NotOnFaulted | TaskContinuationOptions.NotOnCanceled
         , TaskScheduler.Current);
 }