private async void checkForUpdate() { foreach (string branch in branches.Keys) { RegistryKey regBranch = registry.CreateSubKey(branch); string formalName = branches[branch]; foreach (string binaryType in binaryTypes) { string url = "https://versioncompatibility.api." + branch + ".com/GetCurrentClientVersion/?apiKey=" + apiKey + "&binaryType=" + binaryType; string oldVersion = regBranch.GetValue(binaryType) as string; string newVersion = await http.DownloadStringTaskAsync(url); newVersion = newVersion.Replace("\"", ""); if (oldVersion != newVersion) { QueuedNotification notification = new QueuedNotification(); notification.Title = "New " + binaryType + " deployed to " + formalName + "!"; notification.Message = newVersion + "\n(" + branch + ")"; queue.Add(notification); regBranch.SetValue(binaryType, newVersion); stepQueue(); } } } }
private void stepQueue() { if (!queueLock && queue.Count > 0) { queueLock = true; QueuedNotification notification = queue[0]; notifier.ShowBalloonTip(5000, notification.Title, notification.Message, ToolTipIcon.Info); queue.RemoveAt(0); } }