private void Window_Loaded(object sender, RoutedEventArgs e) { //Loading the band details Band Band1 = new RockBand("Rolling Stones", 1962, "Brian Jones, Mick Jagger, Keith Richards, Bill Wyman, Charlie Watts and Ian Stewart", "Rock Band"); Band Band2 = new IndieBand("Led Zeppelin", 1968, "Robert Plant, Jimmy Page, John Paul Jones and John Bonham", "Indie Band"); Band Band3 = new PopBand("The Beatles", 1957, "John Lennon, Paul McCartney, George Harrison and Ringo Starr", "Pop Band"); Band Band4 = new IndieBand("Pink Floyd", 1965, " Syd Barrett, David Gilmour, Roger Waters, Richard Wright, Nick Mason and Bob Klose", "Indie Band"); Band Band5 = new RockBand("Metallica", 1981, "James Hetfield, Cliff Burton, Lars Ulrich, Dave Mustaine etc", "Rock Band"); Band Band6 = new PopBand("Guns N' Roses", 1985, "Slash, Axl Rose, Duff McKagan, Izzy Stradlin etc", "Pop Band"); //Loading Album Details Album Album1 = new Album("Prism"); //Add them to a list List <Band> bandList = new List <Band>(); bandList.Add(Band1); bandList.Add(Band2); bandList.Add(Band3); bandList.Add(Band4); bandList.Add(Band5); bandList.Add(Band6); //Populate them into a listBox LBBandDetails.ItemsSource = bandList; }
private void CreateDummyData() { RockBand rb1 = new RockBand("AC/DC", "1973", new List <string> { "Member1" }, new List <Album> { new Album("Album1", new DateTime(rn.Next(1850, 2000), rn.Next(1, 12), rn.Next(1, 20)), rn.Next(300, 600)) }); PopBand pb1 = new PopBand("Maroon 5", "2001", new List <string> { "Member1", "Member2" }, new List <Album> { new Album("Album1", new DateTime(rn.Next(1850, 2000), rn.Next(1, 12), rn.Next(1, 20)), rn.Next(300, 600)), new Album("Album2", new DateTime(rn.Next(1850, 2000), rn.Next(1, 12), rn.Next(1, 20)), rn.Next(300, 600)) }); IndieBand ib1 = new IndieBand("Arcade Fire", "2001", new List <string> { "Member1", "Member2", "Member3" }, new List <Album> { new Album("Album1", new DateTime(rn.Next(1850, 2000), rn.Next(1, 12), rn.Next(1, 20)), rn.Next(300, 600)), new Album("Album2", new DateTime(rn.Next(1850, 2000), rn.Next(1, 12), rn.Next(1, 20)), rn.Next(300, 600)), new Album("Album3", new DateTime(rn.Next(1850, 2000), rn.Next(1, 12), rn.Next(1, 20)), rn.Next(300, 600)) }); bandList.Add(rb1); bandList.Add(pb1); bandList.Add(ib1); genreList.Add("All"); genreList.Add("Rock"); genreList.Add("Pop"); genreList.Add("Indie"); }
private void Window_Loaded(object sender, RoutedEventArgs e) { RocBand b1 = new RocBand() { BandName = "Foo Fighters", year = 1994, Members = "Dave Grohl, Nate Mendel, Pat Smear,Taylor Hawkins,Chris Shiflett, Rami Jaffee" }; RocBand b2 = new RocBand() { BandName = "The Rolling Stones", year = 1962, Members = "Mick Jagger, Keith Richards, Charlie Watts, Ronnie Wood" }; PopBand b3 = new PopBand() { BandName = "The Beatles", year = 1960, Members = "John Lennon, Paul McCartney, George Harrison, Ringo Starr" }; PopBand b4 = new PopBand() { BandName = "Green Day", year = 1986, Members = " Billie Joe Armstrong,Mike Dirnt, Tré Cool" }; IndieBand b5 = new IndieBand() { BandName = "Arctic Monkeys", year = 2002, Members = "Alex Turner, Jamie Cook, Nick O'Malley, Matt Helders" }; IndieBand b6 = new IndieBand() { BandName = "The Strokes", year = 1998, Members = " Julian Casablancas, Nick Valensi, Albert Hammond Jr., Nikolai Fraiture, Fabrizio Moretti" }; Random rand = new Random(); Album a1 = new Album() { AlbumName = "Greatest Hits", YearsOfRelease = rand.Next(1960, 2020), Sales = rand.Next(1000000, 10000000) }; Album a2 = new Album() { AlbumName = "One by One", YearsOfRelease = rand.Next(1960, 2020), Sales = rand.Next(1000000, 10000000) }; Album a3 = new Album() { AlbumName = "Beggars Banquet", YearsOfRelease = rand.Next(1960, 2020), Sales = rand.Next(1000000, 10000000) }; Album a4 = new Album() { AlbumName = "Blue & Lonesome ", YearsOfRelease = rand.Next(1960, 2020), Sales = rand.Next(1000000, 10000000) }; Album a5 = new Album() { AlbumName = "Let It Be ", YearsOfRelease = rand.Next(1960, 2020), Sales = rand.Next(1000000, 10000000) }; Album a6 = new Album() { AlbumName = "Sgt. Pepper's Lonely Hearts Club Band", YearsOfRelease = rand.Next(1960, 2020), Sales = rand.Next(1000000, 10000000) }; Album a7 = new Album() { AlbumName = "Dookie", YearsOfRelease = rand.Next(1960, 2020), Sales = rand.Next(1000000, 10000000) }; Album a8 = new Album() { AlbumName = "American Idiot", YearsOfRelease = rand.Next(1960, 2020), Sales = rand.Next(1000000, 10000000) }; Album a9 = new Album() { AlbumName = "Whatever People Say I Am, That's What I'm Not", YearsOfRelease = rand.Next(1960, 2020), Sales = rand.Next(1000000, 10000000) }; Album a10 = new Album() { AlbumName = "Favourite Worst Nightmare", YearsOfRelease = rand.Next(1960, 2020), Sales = rand.Next(1000000, 10000000) }; Album a11 = new Album() { AlbumName = "Room on Fire", YearsOfRelease = rand.Next(1960, 2020), Sales = rand.Next(1000000, 10000000) }; Album a12 = new Album() { AlbumName = "The Modern Age", YearsOfRelease = rand.Next(1960, 2020), Sales = rand.Next(1000000, 10000000) }; b1.AlbumList.Add(a1); b1.AlbumList.Add(a2); b2.AlbumList.Add(a3); b2.AlbumList.Add(a4); b3.AlbumList.Add(a5); b3.AlbumList.Add(a6); b4.AlbumList.Add(a7); b4.AlbumList.Add(a8); b5.AlbumList.Add(a9); b5.AlbumList.Add(a10); b6.AlbumList.Add(a11); b6.AlbumList.Add(a12); bands.Add(b1); bands.Add(b2); bands.Add(b3); bands.Add(b4); bands.Add(b5); bands.Add(b6); bands.Sort(); LstBox.ItemsSource = bands; }
//Create all bands and albums needed private Band[] GetBands() { ////Create bands //Rock RockBand r1 = new RockBand() { Name = "The Foo Fighters", Formed = 1994, Members = "Dave Grohl, Nate Mendel, Pat Smear, Taylor Hawkins, Chris Shifflett, Rami Jafee" }; RockBand r2 = new RockBand() { Name = "The Rolling Stones", Formed = 1962, Members = "Mick Jagger, Ian Stewart, Dick Taylor, Bill Wyman, Mick Taylor" }; //Pop PopBand p1 = new PopBand() { Name = "The Beatles", Formed = 1960, Members = "John Lennon, Paul McCartney, George Harrison, Ringo Starr" }; PopBand p2 = new PopBand() { Name = "Green Day", Formed = 1986, Members = "Billie Joe Armstrong, Mike Dirnt, Tre Cool" }; //Indie IndieBand i1 = new IndieBand() { Name = "Arctic Monkeys", Formed = 2002, Members = "Alex Turner, Matt Heldens, Jamie Cook, Nick O'Malley" }; IndieBand i2 = new IndieBand() { Name = "The Strokes", Formed = 1998, Members = "Julian Casablancas, Nick Valensi, Albert Hammond Jr, Nikolai Fraiture, Fabrizio Moretti" }; #region albums ////Create and assign albums to appropriate artists //Random Declaration Random random = new Random(); //Foo fighters albums Album a1 = new Album() { Name = "Greatest Hits", Released = GetRandomDate(r1, random), Sales = random.Next(1000000, 10000000) }; Album a2 = new Album() { Name = "One by One", Released = GetRandomDate(r1, random), Sales = random.Next(1000000, 10000000) }; r1.Albums[0] = a1; r1.Albums[1] = a2; //Rolling stones albums Album a3 = new Album() { Name = "Beggars Banquet", Released = GetRandomDate(r2, random), Sales = random.Next(1000000, 10000000) }; Album a4 = new Album() { Name = "Blue & Lonesome", Released = GetRandomDate(r2, random), Sales = random.Next(1000000, 10000000) }; r2.Albums[0] = a3; r2.Albums[1] = a4; //The Beatles albums Album a5 = new Album() { Name = "Let It Be", Released = GetRandomDate(p1, random), Sales = random.Next(1000000, 10000000) }; Album a6 = new Album() { Name = "Sgt. Pepper's Lonely Heart Club Band", Released = GetRandomDate(p1, random), Sales = random.Next(1000000, 10000000) }; p1.Albums[0] = a5; p1.Albums[1] = a6; //Green Day albums Album a7 = new Album() { Name = "Dookie", Released = GetRandomDate(p2, random), Sales = random.Next(1000000, 10000000) }; Album a8 = new Album() { Name = "American Idiot", Released = GetRandomDate(p2, random), Sales = random.Next(1000000, 10000000) }; p2.Albums[0] = a7; p2.Albums[1] = a8; //Arctic Monkeys albums Album a9 = new Album() { Name = "Whatever People Say I am, That's what I'm not", Released = GetRandomDate(i1, random), Sales = random.Next(1000000, 10000000) }; Album a10 = new Album() { Name = "Favourite Worst Nightmare", Released = GetRandomDate(i1, random), Sales = random.Next(1000000, 10000000) }; i1.Albums[0] = a9; i1.Albums[1] = a10; //The Strokes albums Album a11 = new Album() { Name = "Room on Fire", Released = GetRandomDate(i2, random), Sales = random.Next(1000000, 10000000) }; Album a12 = new Album() { Name = "The Modern Age", Released = GetRandomDate(i2, random), Sales = random.Next(1000000, 10000000) }; i2.Albums[0] = a11; i2.Albums[1] = a12; #endregion albums Band[] bandsCreated = { r1, r2, p1, p2, i1, i2 }; return(bandsCreated); }