Import from internal git
This commit is contained in:
37
Generator/Controllers/PreGenerationController.cs
Normal file
37
Generator/Controllers/PreGenerationController.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Core;
|
||||
using Core.Events;
|
||||
using Core.Interfaces;
|
||||
using Core.Process;
|
||||
using Core.SpecConfig;
|
||||
using Generator.Services;
|
||||
using Generator.views;
|
||||
|
||||
namespace Generator.Controllers;
|
||||
|
||||
public class PreGenerationController : IController
|
||||
{
|
||||
private readonly PreGenerationService _preGenService;
|
||||
private readonly ConsoleView _view;
|
||||
public DisplayEmitter Emitter { get; set; }
|
||||
|
||||
public PreGenerationController(DisplayEmitter emitter, PreGenerationService preGenService)
|
||||
{
|
||||
_view = new ConsoleView();
|
||||
_preGenService = preGenService;
|
||||
Emitter = emitter;
|
||||
}
|
||||
|
||||
public GenerationProcess ComputeGeneration(string specPath, GenerationType? generationType, PublishType publishType)
|
||||
{
|
||||
try
|
||||
{
|
||||
return _preGenService.ComputeGeneration(specPath, generationType, publishType);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Emitter.Warn(this, e.Message);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user