|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace Bornander.UI.ListItems
{
public partial class Album : UserControl, IExtendedListItem
{
private event EventHandler Play;
public Album()
{
InitializeComponent();
SelectedChanged(false);
}
public Album(string title, string artist, string releaseYear, Image albumArt)
{
InitializeComponent();
Title = title;
Artist = artist;
ReleaseYear = releaseYear;
AlbumArt = albumArt;
SelectedChanged(false);
}
public string Title
{
get { return title.Text; }
set { title.Text = value; }
}
public string Artist
{
get { return artist.Text; }
set { artist.Text = value; }
}
public string ReleaseYear
{
get { return releaseYear.Text; }
set { releaseYear.Text = value; }
}
public Image AlbumArt
{
get { return albumArtPicture.Image; }
set { albumArtPicture.Image = value; }
}
#region IExtendedListItem Members
public void SelectedChanged(bool isSelected)
{
if (isSelected)
{
Height = 72;
albumArtPicture.Size = new Size(64, 64);
artist.Visible = true;
releaseYear.Visible = true;
}
else
{
Height = 40;
albumArtPicture.Size = new Size(32, 32);
artist.Visible = false;
releaseYear.Visible = false;
}
}
public void PositionChanged(int index)
{
if ((index & 1) == 0)
BackColor = SystemColors.Control;
else
BackColor = SystemColors.ControlLight;
}
#endregion
private void playButton_Click(object sender, EventArgs e)
{
// Do nada for now
}
}
}
|
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.
Article videos
Oakmead Apps Android Games
21 Feb 2014: Best VB.NET Article of January 2014 - Second Prize
18 Oct 2013: Best VB.NET article of September 2013
23 Jun 2012: Best C++ article of May 2012
20 Apr 2012: Best VB.NET article of March 2012
22 Feb 2010: Best overall article of January 2010
22 Feb 2010: Best C# article of January 2010