/* * Copyright 2008 Matthias Sessler * * This file is part of LibMpc.net. * * LibMpc.net is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 2.1 of the License, or * (at your option) any later version. * * LibMpc.net is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with LibMpc.net. If not, see . */ 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; } } }