Ejemplo n.º 1
0
        public static bool Save(TelloSettings telloSettings, string file)
        {
            if (string.IsNullOrWhiteSpace(file))
            {
                throw new ArgumentNullException(file);
            }

            var config = JsonConvert.SerializeObject(telloSettings, GetSerializerSettings());

            File.WriteAllText(file, config, Encoding.UTF8);
            return(true);
        }
Ejemplo n.º 2
0
        public TelloController(ILoggerFactory loggerFactory,
                               TelloSettings settings,
                               IConnectionController controller)
        {
            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            logger               = loggerFactory.CreateLogger <TelloController>();
            Settings             = settings ?? throw new ArgumentNullException(nameof(settings));
            ConnectionController = controller ?? throw new ArgumentNullException(nameof(controller));
        }