namespace JD.Nas.Reporting.Console.Module { using Plume.Interfaces.Console.Modules; using Plume.Interfaces.Modules; using JD.Nas.Service; using JetBrains.Annotations; using System; public class ReportingConsoleModule: IConsoleModule { private ReportingConsoleModuleSetup _setup; public void Initialize([NotNull] IConsoleModuleContext context) { context.CommandLineManager.Register(new ReportingConsoleAction(context.GetService(), _setup.ApplicationLogPath)); } public void Setup(IModuleSetup setup) { if (setup == null) { throw new ArgumentNullException(nameof(setup)); } var configuration = setup as ReportingConsoleModuleSetup; _setup = configuration ?? throw new ArgumentException($"Expecting an {nameof(ReportingConsoleModuleSetup)} not a {setup.GetType()}", nameof(setup)); } public void Dispose() { // Nothing to dispose } } }