Exemplo n.º 1
0
 public void loadProductionListToMovie(int itemID, int year)
 {
     productionList.Clear();
     List<MRListData> productionListToMovie = db.getProductionListToMovie(itemID, year);
     productionListToMovie.ForEach(delegate(MRListData actor)
     {
         BitmapImage posterBitmap = new BitmapImage();
         posterBitmap.BeginInit();
         posterBitmap.UriSource = new Uri(PictureHandler.getPersonPortraitPath(actor.dbItemID, PosterSize.LIST));
         posterBitmap.EndInit();
         MRListBoxItem item = new MRListBoxItem(actor.dbItemID, actor.titleName, actor.yearAge.ToString(), actor.editableCharakter, posterBitmap);
         productionList.Add(item);
     });
     view.productionListBox.ItemsSource = productionList;
 }
Exemplo n.º 2
0
 public void changeItem(int id, MRListBoxItem item)
 {
     MRListBoxItem itemToChange;
     movieListItems.TryGetValue(id, out itemToChange);
     itemToChange = item;
 }
Exemplo n.º 3
0
 public void addItem(int id, MRListBoxItem item)
 {
     movieList.Add(item);
     movieListItems.Add(id, item);
 }
Exemplo n.º 4
0
        public void setDetailsView(DetailsView dv)
        {
            this.view = dv;
            view.listBoxMovies.ItemsSource = movieList;

            Dispatcher disp = Dispatcher.CurrentDispatcher;
            addToListFunction = (MRListData movie) => disp.BeginInvoke(DispatcherPriority.Background, (new Action(() =>
            {
                Thread.Sleep(0);
                BitmapImage posterBitmap = new BitmapImage();
                posterBitmap.BeginInit();
                posterBitmap.UriSource = new Uri(PictureHandler.getMoviePosterPath(movie.dbItemID, PosterSize.LIST));
                posterBitmap.CreateOptions = BitmapCreateOptions.DelayCreation;
                posterBitmap.CacheOption = BitmapCacheOption.OnDemand;
                posterBitmap.EndInit();
                MRListBoxItem item = new MRListBoxItem(movie.dbItemID, movie.titleName, movie.yearAge.ToString(), movie.editableCharakter, posterBitmap);
                movieList.Add(item);
                movieListItems.Add(movie.dbItemID, item);
            })));

            /*

            var context = SynchronizationContext.Current;

            addToListFunction = (MRListData movie) => context.Send(delegate(object sender) {
                BitmapImage posterBitmap = new BitmapImage();
                posterBitmap.BeginInit();
                posterBitmap.UriSource = new Uri(PictureHandler.getMoviePosterPath(movie.dbItemID, PosterSize.LIST));
                posterBitmap.CreateOptions = BitmapCreateOptions.DelayCreation;
                posterBitmap.CacheOption = BitmapCacheOption.OnDemand;
                posterBitmap.EndInit();
                MRListBoxItem item = new MRListBoxItem(movie.dbItemID, movie.titleName, movie.yearAge.ToString(), movie.editableCharakter, posterBitmap);
                movieList.Add(item);
                movieListItems.Add(movie.dbItemID, item);

            }, null);
             */
        }
Exemplo n.º 5
0
 public void addItem(int id, MRListBoxItem item)
 {
     actorsList.Add(item);
     listBoxItems.Add(id, item);
 }
Exemplo n.º 6
0
        public void setActorsView(ActorsView av)
        {
            this.view = av;
            view.listBoxActor.ItemsSource = actorsList;

            Dispatcher disp = Dispatcher.CurrentDispatcher;
            addToListFunction = (MRListData movie) => disp.BeginInvoke(DispatcherPriority.Background, (new Action(() => {
                Thread.Sleep(0);
                BitmapImage posterBitmap = new BitmapImage();
                posterBitmap.BeginInit();
                posterBitmap.UriSource = new Uri(PictureHandler.getPersonPortraitPath(movie.dbItemID, PosterSize.LIST));
                posterBitmap.CreateOptions = BitmapCreateOptions.DelayCreation;
                posterBitmap.CacheOption = BitmapCacheOption.OnDemand;
                posterBitmap.EndInit();
                MRListBoxItem item = new MRListBoxItem(movie.dbItemID, movie.titleName, movie.yearAge.ToString(), movie.editableCharakter, posterBitmap);
                actorsList.Add(item);
                listBoxItems.Add(movie.dbItemID, item);
            })));
        }
Exemplo n.º 7
0
 internal void movieClicked(MRListBoxItem movie)
 {
     controller.changeToMovieView(db.getMovieInfo(movie.getId));
 }
Exemplo n.º 8
0
 internal void personClicked(MRListBoxItem person)
 {
     controller.changeToPersonView(person.getId);
 }