Dispose() public method

Finishes background processing and releases all resources.
public Dispose ( ) : void
return void
 private void OnFinished(object sender, BackgroundWorkerType e)
 {
     System.Diagnostics.Debug.WriteLine("TimedBackgroundWorker.OnFinished()");
     Deferral?.Complete();
     BackgroundEngine.Finished -= OnFinished;
     BackgroundEngine.Dispose();
 }
 private void OnFinished(object sender, BackgroundWorkerType type)
 {
     if (type == BackgroundWorkerType.AdvertisementWorker)
     {
         BackgroundEngine.ProcessDelayedActionsAsync(false).ConfigureAwait(false);
     }
     else
     {
         Deferral?.Complete();
         BackgroundEngine.Finished -= OnFinished;
         BackgroundEngine?.Dispose();
     }
 }