Esempio n. 1
0
        private void add_film(film f)
        {
            panel_film film = new panel_film();

            film.Poster   = f.get_poster();
            film.NameFilm = f.get_name();
            film.Year     = f.get_year();
            film.Ozenka   = f.get_sr_ozenka();
            List <string> m_genres = f.get_genres();
            string        genres   = "";

            for (int g = 0; g < m_genres.Count; g++)
            {
                genres += m_genres[g];
                if (g != m_genres.Count - 1)
                {
                    genres += ", ";
                }
            }
            film.Genres       = genres;
            film.Views        = f.get_views();
            film.edit.Click  += open_edit_film;
            film.stat.Click  += stat_film;
            film.close.Click += delete_film;
            film.MouseDown   += dbl_click_film;
            wrp.Children.Add(film);
        }
Esempio n. 2
0
        public void update_views(int id)
        {
            film film = get_film_by_id(id);

            film.update_views();
            panel_film pf = (active.Parent as Border).Parent as panel_film;

            pf.Views = film.get_views();
            if (film.get_sr_ozenka() != pf.Ozenka)
            {
                pf.Ozenka = film.get_sr_ozenka();
            }
        }