示例#1
0
        public List <MovieSongsProps> GetMoviesSongsProps(string file)
        {
            try
            {
                List <MovieSongsProps> movieSongsList = new List <MovieSongsProps>();

                XmlDocument documnet = new XmlDocument();

                try
                {
                    documnet.Load(file);
                }
                catch (Exception)
                {
                    return(null);
                }

                var root       = documnet.SelectSingleNode("MoviesSongs");
                var movieNodes = root.SelectNodes("Movie");

                foreach (XmlNode movieNode in movieNodes)
                {
                    MovieSongsProps singleMovie = new MovieSongsProps();

                    singleMovie.MovieName     = movieNode.Attributes["name"].Value;
                    singleMovie.MovieSongLink = movieNode.Attributes["link"].Value;

                    movieSongsList.Add(singleMovie);
                }

                return(movieSongsList);
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#2
0
        public List<MovieSongsProps> GetMoviesSongsProps(string file)
        {
            try
            {
                List<MovieSongsProps> movieSongsList = new List<MovieSongsProps>();

                XmlDocument documnet = new XmlDocument();

                try
                {
                    documnet.Load(file);
                }
                catch (Exception)
                {
                    return null;
                }

                var root = documnet.SelectSingleNode("MoviesSongs");
                var movieNodes = root.SelectNodes("Movie");

                foreach (XmlNode movieNode in movieNodes)
                {
                    MovieSongsProps singleMovie = new MovieSongsProps();

                    singleMovie.MovieName = movieNode.Attributes["name"].Value;
                    singleMovie.MovieSongLink = movieNode.Attributes["link"].Value;

                    movieSongsList.Add(singleMovie);
                }

                return movieSongsList;
            }
            catch (Exception)
            {
                throw;
            }
        }