Exemplo n.º 1
0
        public void Close()
        {
            // Method entry trace

            const string method = "Close";

            if (EventSource.IsEnabled(Event.MethodEnter))
            {
                EventSource.Raise(Event.MethodEnter, method);
            }

            try
            {
                // Finalize all the sources

                _source.Close();
                _source = null;

                _initialised = false;
            }
            catch (Exception ex)
            {
                if (EventSource.IsEnabled(Event.CriticalError))
                {
                    EventSource.Raise(Event.CriticalError, method, "Cannot close the channel.", ex);
                }
            }

            // Method exit trace

            if (EventSource.IsEnabled(Event.MethodExit))
            {
                EventSource.Raise(Event.MethodExit, method);
            }
        }