// Called from any thread
 internal void Stop()
 {
     lock (this) {
         if (dialog != null && dialog.IsHandleCreated)
         {
             dialog.BeginInvoke(new MethodInvoker(dialog.Close));
             return;
         }
         alreadyStopped = true;
     }
 }
            internal void Stop()
            {
                lock (this)
                {
                    if (_dialog is not null && _dialog.IsHandleCreated)
                    {
                        _dialog.BeginInvoke(new MethodInvoker(_dialog.Close));
                        return;
                    }

                    _alreadyStopped = true;
                }
            }