using System; using System.Collections.ObjectModel; using System.Collections.Generic; namespace LibMpc { /// /// The MpdDirectoryListing class contains the response of a MPD server to a list command. /// public class MpdDirectoryListing { private readonly ReadOnlyCollection file; private readonly ReadOnlyCollection directory; private readonly ReadOnlyCollection playlist; /// /// The list of files in the directory. /// public ReadOnlyCollection FileList { get { return this.file; } } /// /// The list of subdirectories in the directory. /// public ReadOnlyCollection DirectoryList { get { return this.directory; } } /// /// The list of playlists in the directory. /// public ReadOnlyCollection PlaylistList { get { return this.playlist; } } /// /// Creates a new MpdDirectoryListing. /// /// The list of files in the directory. /// The list of subdirectories in the directory. /// The list of playlists in the directory. public MpdDirectoryListing(List file, List directory, List playlist) { if (file == null) throw new ArgumentNullException("file"); if (directory == null) throw new ArgumentNullException("directory"); if (playlist == null) throw new ArgumentNullException("playlist"); this.file = new ReadOnlyCollection(file); this.directory = new ReadOnlyCollection(directory); this.playlist = new ReadOnlyCollection(playlist); } /// /// Creates a new MpdDirectoryListing. /// /// The list of files in the directory. /// The list of subdirectories in the directory. /// The list of playlists in the directory. public MpdDirectoryListing(ReadOnlyCollection file, ReadOnlyCollection directory, ReadOnlyCollection playlist) { if (file == null) throw new ArgumentNullException("file"); if (directory == null) throw new ArgumentNullException("directory"); if (playlist == null) throw new ArgumentNullException("playlist"); this.file = file; this.directory = directory; this.playlist = playlist; } } }