public void Reset()
 {
     if (detector != null)
     {
         detector.Dispose();
     }
     detector = null;
     UtilCallBackFunctions.WriteLog = (message, newline, style) =>
     {
         if (DetectLogCallback != null)
         {
             DetectLogCallback(message, style);
         }
     };
 }
        /// <summary>
        /// Reset AutoDetection settings
        /// </summary>
        public void Reset()
        {
            CloseLogger();

            if (valueDetector != null)
            {
                valueDetector.Dispose();
                valueDetector = null;
            }

            if (cts != null)
            {
                cts.Dispose();
            }

            UtilCallBackFunctions.WriteLog = (message, newline, style) =>
            {
                if (DetectLogCallback != null)
                {
                    DetectLogCallback(message, style);
                }
            };

            stepsLocker.EnterWriteLock();
            try
            {
                detectSteps = ValueDetector.GetDetectionSteps();
            }
            finally
            {
                stepsLocker.ExitWriteLock();
            }
            SetDetectionStatus(DetectionStatus.NotStart);
            taskCanceled      = false;
            detectedException = null;
        }