コード例 #1
0
        public void InitComboboxGenres(MMAParseGenres parsedGenres)
        {
            comboboxGenres.DisplayMemberPath = "Genre";
            comboboxGenres.SelectedValuePath = "Url";

            // fill combobox
            int index = 0;

            foreach (string genre in parsedGenres.SubGenres)
            {
                string url = parsedGenres.SubGenresURLs[index];

                comboboxGenres.Items.Add(new GenreURL(genre, url));
                index++;
            }

            comboboxGenres.SelectedIndex = 0;
        }
コード例 #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Tools.InitLogsFiles();

            // check if required dlls are present
            string execDir = Environment.CurrentDirectory;
            string dllName = "HtmlAgilityPack.dll";
            string dllPath = System.IO.Path.Combine(execDir, dllName);

            if (!File.Exists(dllPath))
            {
                MessageBox.Show("Library " + dllName + " not found", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                Close();
            }

            // parse genres
            string urlSite = "https://www.metalmusicarchives.com/";
            //Tools.LogEvent("Searching albums of " + band + "...");
            string         sourceHTML   = Tools.GetWebPageSourceHTML(urlSite);
            MMAParseGenres parsedGenres = new MMAParseGenres(sourceHTML);

            InitComboboxLetters();
            InitComboboxGenres(parsedGenres);

            // for debug purposes only
            //textboxBand.Text = "blind guardian";
            //textboxBand.Text = "cirith ungol";
            //textboxBand.Text = "cirith";
            //textboxBand.Text = "Mael Mórdha";
            //textboxBand.Text = "Iron Maiden";
            //textboxBand.Text = "Deep Purple";
            //textboxBand.Text = "jjkh9878g7fhghgf";
            //textboxBand.Text = "amo";
            //textboxBand.Text = "killswitch engage";
            //textboxBand.Text = "abigail";
            //textboxBand.Text = "www.metal-archives.com/bands/Abigail";
            //textboxBand.Text = "www.metal-archives.com/bands/Abigail/1282";
            //textboxBand.Text = "www.metal-archives.com/bands/Blind_Guardian/3";
            textboxBand.Text = "www.metal-archives.com/bands/Airs/3540301744";
            //textboxBand.Text = "www.metal-archives.com/bands/La_Torture_des_T%C3%A9n%C3%A8bres/3540410503";
        }