Ejemplo n.º 1
0
        private void ClickMeButton_Click(object sender, RoutedEventArgs e)
        {
            OutputListBox.Items.Clear();

            var mp3s = new MP3Locator(@"D:\Users\jeremy\Music\iTunes\iTunes Music");

            foreach (var mp3 in mp3s
                     .Where(m => m.Name.Contains(SearchTextBox.Text) ||
                            m.Directory.Name.Contains(SearchTextBox.Text) ||
                            m.Directory.Parent.Name.Contains(SearchTextBox.Text)))
            {
                OutputListBox.Items.Add(mp3);
            }
        }
Ejemplo n.º 2
0
        public void Iterator_Mp3Iterator()
        {
            //Lister ut fil-informasjon
            //Egentlig laget til for mp3 filtype men kan benyttes for ulike typer.
            string searchText = "";
            var    path       = Directory.GetCurrentDirectory();
            var    mp3s       = new MP3Locator(path);

            foreach (var mp3 in mp3s
                     .Where(m => m.Name.Contains(searchText) ||
                            m.Directory.Name.Contains(searchText) ||
                            m.Directory.Parent.Name.Contains(searchText)))
            {
                Console.WriteLine("Name: " + mp3.Name + " - Parent: " + mp3.Directory.Parent.Name);
            }
            Assert.IsNotNull(mp3s);
        }