예제 #1
0
        /// <summary>
        /// Gets the MovieInfo object for the given movie title and year
        /// </summary>
        /// <param name="title">The title of the movie</param>
        /// <param name="year">The year of the movie</param>
        /// <param name="movieInfo">The reference object to store the resulting MovieInfo object in</param>
        /// <returns>The result status code for this service call</returns>
        public ServiceResultStatus GetMovieInfo(string title, int year, out IMovieInfo movieInfo)
        {
            movieInfo = null;

            // Build URL
            var url = _url
                      .Replace("%title", HttpUtility.UrlEncode(title))
                      .Replace("%year", year > 0 ? year.ToString() : "");

            // Get info
            MovieInfo mi;
            var       status = LoadMovieData(url, out mi);

            // Check status
            if (status != ServiceResultStatus.Success)
            {
                return(status);
            }

            // All ok!
            movieInfo = (IMovieInfo)mi;
            return(status);
        }
 /// <summary>
 /// Gets the MovieInfo object for the given movie title
 /// </summary>
 /// <param name="title">The title of the movie</param>
 /// <param name="year">The year of the movie</param>
 /// <param name="movieInfo">The reference object to store the resulting MovieInfo object in</param>
 /// <returns>The result status code for this service call</returns>
 public ServiceResultStatus GetMovieInfo(string title, out IMovieInfo movieInfo)
 {
     return GetMovieInfo(title, 0, out movieInfo);
 }
        /// <summary>
        /// Gets the MovieInfo object for the given movie title and year
        /// </summary>
        /// <param name="title">The title of the movie</param>
        /// <param name="year">The year of the movie</param>
        /// <param name="movieInfo">The reference object to store the resulting MovieInfo object in</param>
        /// <returns>The result status code for this service call</returns>
        public ServiceResultStatus GetMovieInfo(string title, int year, out IMovieInfo movieInfo)
        {
            movieInfo = null;

            // Build URL
            var url = _url
                .Replace("%title", HttpUtility.UrlEncode(title))
                .Replace("%year", year > 0 ? year.ToString() : "");

            // Get info
            MovieInfo mi;
            var status = LoadMovieData(url, out mi);

            // Check status
            if (status != ServiceResultStatus.Success) return status;

            // All ok!
            movieInfo = (IMovieInfo)mi;
            return status;
        }
예제 #4
0
 /// <summary>
 /// Gets the MovieInfo object for the given movie title
 /// </summary>
 /// <param name="title">The title of the movie</param>
 /// <param name="year">The year of the movie</param>
 /// <param name="movieInfo">The reference object to store the resulting MovieInfo object in</param>
 /// <returns>The result status code for this service call</returns>
 public ServiceResultStatus GetMovieInfo(string title, out IMovieInfo movieInfo)
 {
     return(GetMovieInfo(title, 0, out movieInfo));
 }