Esempio n. 1
0
        /// <summary>
        /// Creates a new playlist for the authenticated user.
        /// </summary>
        /// <param name="title">
        /// A <see cref="System.String"/>
        /// </param>
        /// <param name="description">
        /// A <see cref="System.String"/>
        /// </param>
        /// <param name="session">
        /// A <see cref="Session"/>
        /// </param>
        /// <returns>
        /// A <see cref="Playlist"/>
        /// </returns>
        public static Playlist CreateNew(string title, string description, Session session)
        {
            //manually test session for authentication.
            if (!session.Authenticated)
            {
                throw new AuthenticationRequiredException();
            }


            RequestParameters p = new dotLastfm.RequestParameters();

            p["title"]       = title;
            p["description"] = description;

            XmlDocument doc = (new Request("playlist.create", session, p)).execute();
            int         id  = Int32.Parse(doc.GetElementsByTagName("id")[0].InnerText);

            return(new Playlist(AuthenticatedUser.GetUser(session), id, session));
        }
Esempio n. 2
0
 public RecommendedEvents(AuthenticatedUser user, Session session)
     : base("user.getRecommendedEvents", session)
 {
     this.User = user;
 }