コード例 #1
0
ファイル: EventAction.cs プロジェクト: abelperez/mindplex-eda
        /// <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);
            }
        }
コード例 #2
0
ファイル: EventSource.cs プロジェクト: abelperez/mindplex-eda
        /// <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);
            }
        }