Пример #1
0
        public bool LoadFrom(string folder)
        {
            string p = Path.Combine(folder, "users.dat");

            if (!File.Exists(p))
            {
                return(false);
            }
            Users = User.ReadUsers(p);
            p     = Path.Combine(folder, "movies.dat");
            if (!File.Exists(p))
            {
                return(false);
            }
            Movies = Movie.ReadMovies(p);
            p      = Path.Combine(folder, "ratings.dat");
            if (!File.Exists(p))
            {
                return(false);
            }
            RatingCount = User.ReadRatings(Users, Movies, p);
            return(true);
        }
Пример #2
0
 public void LoadFrom(string folder)
 {
     Users  = User.ReadUsers(Path.Combine(folder, "users.dat"));
     Movies = Movie.ReadMovies(Path.Combine(folder, "movies.dat"));
     User.ReadRatings(Users, Movies, Path.Combine(folder, "ratings.dat"));
 }