public M2mgoProjectAgent(ISerializer serializer, ILoggerFactory loggerFactory) { _loggerFactory = loggerFactory; _logger = loggerFactory.GetLoggerFor(GetType()); _configuration = GetConfiguration(serializer); _projectCloudWebApiWrapper = new ProjectCloudWebApiWrapper(loggerFactory.GetLoggerFor(typeof(ProjectCloudWebApiWrapper)), serializer); }
private M2mgoProjectAgentConfiguration GetConfiguration(ISerializer serializer) { var configHandler = new ConfigurationJsonFileHandler(@".\m2mgo_project_agent.json", serializer, _logger); M2mgoProjectAgentConfiguration config; if (configHandler.IsConfigFileExisting()) { config = configHandler.Load <M2mgoProjectAgentConfiguration>(); } else { config = new M2mgoProjectAgentConfiguration { RemoteProjectConfigurationUrl = "https://pst.m2mgo.com/api/sget/project/board/", EdmSnychronizationUrl = "https://pst.m2mgo.com/api/sget/embedded-modules/synch/" }; configHandler.Backup(config); } return(config); }