示例#1
0
        public void Start()
        {
            if (Running.IsCompleted)
            {
                throw new InvalidOperationException("Service was running and is being started again");
            }

            if (_startAction != null)
            {
                _startAction();
            }

            WasRunning.Complete(true);
            Running.Complete(true);
        }