Example #1
0
        public static void Pause()
        {
            if (_Timer != null)
            {
                if (_Timer.Enabled)
                {
                    _Timer.Enabled = false;
                }
                _Timer.Stop();
            }

            SshHelper.CloseConnection();
            NotifyHelper.SshClosed();
        }
Example #2
0
        public static void Stop()
        {
            try
            {
                if (_Timer != null)
                {
                    if (_Timer.Enabled)
                    {
                        _Timer.Enabled = false;
                    }
                    _Timer.Stop();
                    _Timer.Dispose();
                }

                if (!RunAsService)
                {
                    Console.WriteLine("Closing SSH connection...");
                }

                SshHelper.CloseConnection();

                if (!RunAsService)
                {
                    Console.WriteLine("SSH connection closed!");
                }

                NotifyHelper.Stopped();
            }
            catch (Exception ex)
            {
                if (!RunAsService)
                {
                    Console.WriteLine(ex);
                }
            }
            finally
            {
                if (!RunAsService)
                {
                    Console.ReadLine();
                }
            }
        }