Exemplo n.º 1
0
 public AzureProjectAgent(ISerializer serializer, ILoggerFactory loggerFactory)
 {
     _loggerFactory = loggerFactory;
     _logger        = loggerFactory.GetLoggerFor(GetType());
     _configuration = GetConfiguration(serializer);
     _serializer    = serializer;
 }
Exemplo n.º 2
0
        private AzureProjectAgentConfiguration GetConfiguration(ISerializer serializer)
        {
            var configHandler = new ConfigurationJsonFileHandler(@".\azure_project_agent.json", serializer, _logger);
            AzureProjectAgentConfiguration config;

            if (configHandler.IsConfigFileExisting())
            {
                config = configHandler.Load <AzureProjectAgentConfiguration>();
            }
            else
            {
                config = new AzureProjectAgentConfiguration();
                configHandler.Backup(config);
            }
            return(config);
        }