Beispiel #1
0
        /// <summary>
        /// Stops the service.
        /// </summary>
        /// <exception cref="InvalidOperationException">When the service hasn't started yet, or has already been stopped.</exception>
        public virtual void Stop()
        {
            if (!_serviceTimer.Enabled)
            {
                throw new InvalidOperationException("The service hasn't started yet, or has already been stopped.");
            }

            _serviceTimer.Stop();

            OnServiceStopped?.Invoke(this, new OnServiceStoppedArgs());
        }
 public void Stop()
 {
     try
     {
         if (Server == null)
         {
             return;
         }
         Server.Dispose();
         IsStarted = false;
         ServiceTimer.Stop();
     }
     catch (Exception exception)
     {
         VirtualAssistant.Instance.Logger.Error(exception);
     }
 }
 public void Stop()
 {
     ServiceTimer.Stop();
     ServiceTimer.Elapsed -= ServiceTimer_Elapsed;
     Log.Instance.Info("Core.Bitcon.Service service is Stopped");
 }
 private void ServiceTimer_Elapsed(object sender, ElapsedEventArgs e)
 {
     ServiceTimer.Stop();
     Executor.ExecuteAction(CoreServiceRepository.DataProcessingApiRequest);
     ServiceTimer.Start();
 }