コード例 #1
0
ファイル: Archivist.cs プロジェクト: mikagouzee/RpgSheetMaker
        public Archivist(IFileProvider fileProvider, ILogMachine logMachine)
        {
            _fileProvider = fileProvider;
            _logger       = logMachine;

            //this will get the folder from which the code is executed.
            //our code should use that path and search inside if the needed folders exists.

            var current = AssemblyLocator.GetAssemblyLocation();

            _logger.Log($"Archivist looking inside {current} for required folders...");

            var directories = Directory.GetDirectories(current);

            Directory.CreateDirectory(Path.Combine(current, "CharacterSheets"));
            _logger.Log($"Archivist created Character Sheet folder");

            sheetPath = Path.GetFullPath(Path.Combine(current, "CharacterSheets"));

            var archiveFolder = directories.FirstOrDefault(x => x == "Archives");

            Directory.CreateDirectory(Path.Combine(current, "Archives"));
            _logger.Log($"Archivist created Archives folder");
            archivePath = Path.GetFullPath(Path.Combine(current, "Archives"));

            _logger.Log($"Characters will be saved in {sheetPath} and archived in {archivePath} .");
        }
コード例 #2
0
 public Startup(IConfiguration configuration, IHostingEnvironment env)
 {
     _hostingEnvironment = env;
     Configuration       = configuration;
     _logMachine         = new LogMachine();
 }
コード例 #3
0
 public CharacterService(IRepository repo, ILogMachine logmachine)
 {
     //_repositories = repositories;
     _repo   = repo;
     _logger = logmachine;
 }
コード例 #4
0
 public GameController(ILogMachine logger, IGameService service)
 {
     _logger  = logger;
     _service = service;
 }
コード例 #5
0
 public Startup(IConfiguration configuration, IHostingEnvironment env)
 {
     _hostingEnvironment = env;
     Configuration       = configuration;
     _logMachine         = new LogMachine(env.ContentRootFileProvider);
 }
コード例 #6
0
 public CharacterController(ICharacterService service, ILogMachine logMachine)
 {
     _logger  = logMachine;
     _service = service;
 }
コード例 #7
0
 public Repository(ICharacterFactory factory, IArchivist archivist, ILogMachine logMachine)
 {
     _factory   = factory;
     _archivist = archivist;
     _logger    = logMachine;
 }