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); }
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); }