First of all, this should not be a structure. It is more than 16 bytes, so you do not get performance benefits from the structure. In addition, it does not represent a single meaning, so it does not make sense semantically to make it a structure. Just make a class instead.
Array Sort, :
Array.Sort(theArray, (x,y) => string.Compare(x.Artist,y.Artist));
# 3, :
Array.Sort(theArray, delegate(uLib x, uLib y) { return string.Compare(x.Artist,y.Artist) } );
Edit:
, :
public class ULib {
private string _path, _artist, _title, _album, _length;
public string Path { get { return _path; } set { _path = value; } }
public string Artist { get { return _artist; } set { _artist = value; } }
public string Title { get { return _title; } set { _title = value; } }
public string Album { get { return _album; } set { _album = value; } }
public string Length { get { return _length; } set { _length = value; } }
public ULib() {}
public ULib(string path, string artist, string title, string album, string length) {
Path = path;
Artist = artist;
Title = title;
Album = album;
Length = length;
}
}
# . , getter , :
public string Path { get; set; }