Beispiel #1
0
        /// <summary>
        /// 
        /// </summary>
        /// 
        /// <param name="destination"></param>
        /// 
        public EventAction(string destination)
        {
            if (String.IsNullOrEmpty(destination))
            {
                ArgumentException exception = new ArgumentException("invalid destination specified.");
                if (Logger.IsErrorEnabled)
                {
                    LogError(exception, "invalid destination specified: {0}.", destination);
                }
                throw exception;
            }

            this.destination = destination;
            outputStream = EventStreamFactory.GetEventOutputStream(destination);

            if (Logger.IsDebugEnabled)
            {
                LogDebug("constructed with destination: {0}.", destination);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 
        /// </summary>
        /// 
        public override void Start()
        {
            if (String.IsNullOrEmpty(destination))
            {
                if (Logger.IsErrorEnabled)
                {
                    LogError("destination is invalid: {0}.", destination);
                }
                throw new EventSourceException(string.Format("destination is invalid: {0}.", destination));
            }

            lock (syncRoot)
            {
                if (outputStream == null)
                {
                    outputStream = EventStreamFactory.GetEventOutputStream(destination);
                    initialized = true;
                }
            }

            base.Start();
            if (Logger.IsDebugEnabled)
            {
                LogDebug("initialized with destination: {0}", destination);
            }
        }