示例#1
0
        public void RemoveAppender(IFileAppender appender)
        {
            var existingAppender = this.appenders.FirstOrDefault(a => a.GetType().Name == appender.GetType().Name);

            if (existingAppender != null)
            {
                throw new InvalidOperationException(
                          string.Format("No appender of type {0} is currently in use by the File Exporter.",
                                        appender.GetType().Name));
            }

            this.appenders.Remove(existingAppender);
        }
示例#2
0
        public void AddAppender(IFileAppender appenderType)
        {
            var existingAppender = this.appenders.FirstOrDefault(a => a.GetType().Name == appenderType.GetType().Name);

            if (existingAppender != null)
            {
                throw new InvalidOperationException(
                          string.Format("The type of appender {0} is already being used by the File Exporter.",
                                        appenderType.GetType().Name));
            }

            this.appenders.Add(appenderType);
        }