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); }
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)); }