Ejemplo n.º 1
0
        public M2mgoProjectAgent(ISerializer serializer, ILoggerFactory loggerFactory)
        {
            _loggerFactory = loggerFactory;
            _logger        = loggerFactory.GetLoggerFor(GetType());
            _configuration = GetConfiguration(serializer);

            _projectCloudWebApiWrapper = new ProjectCloudWebApiWrapper(loggerFactory.GetLoggerFor(typeof(ProjectCloudWebApiWrapper)), serializer);
        }
Ejemplo n.º 2
0
        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);
        }