Esempio n. 1
0
        /// <inheritdoc />
        protected override async Task InitializeAsync()
        {
            XTimingLyricInventoryImporter li = new XTimingLyricInventoryImporter();

            var vendorLinks = await GetVendorUrls();

            if (!vendorLinks.Any())
            {
                return;
            }

            foreach (var vendorLink in vendorLinks)
            {
                try
                {
                    var xml = await _downloadService.GetFileAsStringAsync(new Uri(vendorLink.Url));

                    var response = await li.Import(xml);

                    SongInventories.Add(response);
                }
                catch (Exception e)
                {
                    Log.Error(e, $"An error occurred retrieving the inventory from: {vendorLink}");
                    _messageBoxService.ShowError($"Unable to retrieve inventory from {vendorLink.Name}\nEnsure you have an active internet connection.", "Error Retrieving Inventory");
                }
            }

            SelectedInventory = SongInventories.FirstOrDefault();
            //    new Uri("https://www.xlightsfaces.com/wp-content/uploads/xlights_music_free.xml"));
        }