|
/*
* The forms allows the user to choose which media library they want.
*
* Author: Phillip Piper
* Date: 2009-02-09 10:20 PM
*
* CHANGE LOG:
* 2009-02-09 JPP Initial Version
*/
using System;
using System.Windows.Forms;
namespace LyricsFetcher
{
public partial class ChooseLibraryForm : Form
{
public ChooseLibraryForm()
{
InitializeComponent();
}
#region Public properties
/// <summary>
/// Which library has the user chosen?
/// </summary>
public LibraryApplication Library
{
get { return this.library; }
set { this.library = value; }
}
private LibraryApplication library = LibraryApplication.Unknown;
#endregion
#region Event handlers
private void radioButtonITunes_CheckedChanged(object sender, EventArgs e)
{
if (this.radioButtonITunes.Checked)
this.Library = LibraryApplication.ITunes;
}
private void radioButtonWmp_CheckedChanged(object sender, EventArgs e)
{
if (this.radioButtonWmp.Checked)
this.Library = LibraryApplication.WindowsMediaPlayer;
}
private void ChooseLibraryForm_Load(object sender, EventArgs e)
{
// Does this machine have iTunes installed?
if (ITunes.HasITunes) {
if (this.Library == LibraryApplication.WindowsMediaPlayer)
this.radioButtonWmp.Checked = true;
else
this.radioButtonITunes.Checked = true;
} else {
this.radioButtonITunes.Text = "iTunes is not installed";
this.radioButtonITunes.Enabled = false;
this.radioButtonWmp.Checked = true;
}
}
private void buttonOK_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.OK;
this.Close();
}
private void buttonCancel_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
#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.
Phillip has been playing with computers since the Apple II was the hottest home computer available. He learned the fine art of C programming and Guru meditation on the Amiga.
C# and Python are his languages of choice. Smalltalk is his mentor for simplicity and beauty. C++ is to programming what drills are to visits to the dentist.
He worked for longer than he cares to remember as Lead Programmer and System Architect of the Objective document management system. (www.objective.com)
He has lived for 10 years in northern Mozambique, teaching in villages.
He has developed high volume trading software, low volume FX trading software, and is currently working for Atlassian on HipChat.