Beispiel #1
0
 public void Stop(IStoppable service)
 {
     try
     {
         service.Stop();
     }
     catch (Exception e)
     {
         OnException(service, e);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Sets the <c>PrivateRootActor</c> instances as a <c>IStoppable</c>. (INTERNAL ONLY)
        /// </summary>
        /// <param name="privateRoot">The <c>IStoppable</c> protocol backed by the <c>PrivateRootActor</c></param>
        internal void SetPrivateRoot(IStoppable privateRoot)
        {
            lock (privateRootMutex)
            {
                if (privateRoot != null && PrivateRoot != null)
                {
                    privateRoot.Stop();
                    throw new InvalidOperationException("Private root already exists.");
                }

                PrivateRoot = privateRoot;
            }
        }
        /// <summary>
        /// </summary>
        /// <param name="isLive"></param>
        /// <param name="stoppable"></param>
        public void SetupStop(bool isLive, IStoppable stoppable)
        {
            if (_thread != null)
            {
                throw new Exception();
            }

            if (isLive == false)
            {
                return;
            }

            _stoppable = stoppable;
            Console.WriteLine("Press any key to stop recording!");

            _thread = new Thread(() =>
            {
                Console.ReadKey(true);
                _stoppable.Stop();
            });

            _thread.Start();
        }
Beispiel #4
0
 static void Sammuta(IStoppable laite)
 {
     laite.Stop();
 }
Beispiel #5
0
 static void Shutdown(IStoppable machine)
 {
     machine.Stop();
 }
Beispiel #6
0
 public void Exit() => target.Stop();