|
using System;
namespace Example5
{
public class SongDatabase
{
#region Members
Random _random = new Random();
string[] _artists = { "Metallica", "Elvis Presley", "Madonna", "The Beatles", "The Rolling Stones", "Abba" };
string[] _songTitles = { "Islands in the Stream", "Imagine", "Living on a Prayer", "Enter Sandman", "A Little Less Conversation", "Wonderful World" };
#endregion
#region Properties
public string GetRandomArtistName
{
get { return _artists[_random.Next(_artists.Length)]; }
}
public string GetRandomSongTitle
{
get { return _songTitles[_random.Next(_songTitles.Length)]; }
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.