public MainViewModel(ILocationService gps) { _gps = gps; Location = "MELBOURNE, AUSTRALIA"; client = new WWOClient("your-api-key"); LoadData(); }
private static void Main(string[] args) { HandlerRoutine hr = new HandlerRoutine(ConsoleCtrlCheck); GC.KeepAlive(hr); SetConsoleCtrlHandler(hr, true); InitializedInfos(); var datasourceKey = File.ReadAllText("key.txt"); var client = new WWOClient(datasourceKey); foreach (var tag in metrics.Select(metric => metric.ToTag())) { client.CreateTag(tag); } var stopWatch = Stopwatch.StartNew(); while (!cancellationTokenSource.IsCancellationRequested) { foreach (var metric in metrics) { client.Track(metric.ToTag().TagName, metric.GetValue()); } var waitTime = (int)(1000 - stopWatch.ElapsedMilliseconds); Thread.Sleep(waitTime); stopWatch.Restart(); } Console.WriteLine("DONE"); }