/// <summary>
 /// Begins the auto-detection.
 /// </summary>
 /// <param name="DetectionEvent">Callback function when the detection finished.</param>
 public void BeginDetection(DetectionCallback DetectionEvent)
 {
     DetectionDelegate detectdelegate = new DetectionDelegate(RunDetection);
     IAsyncResult result = detectdelegate.BeginInvoke(
         (r) =>
         {
             var outcome = detectdelegate.EndInvoke(r);
             if (DetectionEvent != null) DetectionEvent(outcome);
         }, null);
 }
 /// <summary>
 /// Begins the auto-detection.
 /// </summary>
 /// <param name="DetectionEvent">Callback function when the detection finished.</param>
 public void BeginDetection(DetectionCallback DetectionEvent)
 {
     DetectionDelegate detectdelegate = new DetectionDelegate(RunDetection);
     IAsyncResult      result         = detectdelegate.BeginInvoke(
         (r) =>
     {
         var outcome = detectdelegate.EndInvoke(r);
         if (DetectionEvent != null)
         {
             DetectionEvent(outcome);
         }
     }, null);
 }