예제 #1
0
        //Filter by Track Artist Done button
        private void metroButton5_Click(object sender, EventArgs e)
        {
            FileStream      FS = new FileStream("mp3.txt", FileMode.Open);
            BinaryFormatter BF = new BinaryFormatter();

            List <MP3Tag_and_nameOf_MP3> list = new List <MP3Tag_and_nameOf_MP3>();

            while (FS.Position < FS.Length)
            {
                MP3Tag_and_nameOf_MP3 Tag = (MP3Tag_and_nameOf_MP3)BF.Deserialize(FS);
                if (Tag.Artist == metroComboBox2.SelectedItem.ToString())
                {
                    list.Add(Tag);
                }
            }

            FS.Close();

            FileStream fs = new FileStream("mp3.txt", FileMode.Truncate);

            fs.Close();

            FileStream F = new FileStream("mp3.txt", FileMode.Open);

            for (int i = 0; i < list.Count; i++)
            {
                BF.Serialize(F, list[i]);
            }

            F.Close();

            MessageBox.Show("You have chosen: " + list.Count().ToString() + " song for Artist: " + list[0].Artist);
            ArtistsPanel.Hide();
        }
예제 #2
0
 //Filter by Artis button ( switches panels )
 private void bunifuTileButton2_Click(object sender, EventArgs e)
 {
     ArtistsPanel.Show();
 }