示例#1
0
        protected override void OnStop()
        {
            if (_listener == null)
            {
                throw new InvalidOperationException("Can't stop if not started");
            }

            _listener.Stop();
            _listener = null;
        }
示例#2
0
        protected override void OnStart()
        {
            if (_listener != null)
            {
                throw new InvalidOperationException("Already started");
            }

            _listener = new GcEventListener();

            _listener.GcEvents += OnGc;
            WriteLine(Header);
        }