This project is read-only.
Example Program

Here is the screenshot and the code that I used to make a small example of how to use it. You can download it from here: AMDbExample.rar

AMDbExample.png

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AMDb.IMDb;

namespace AMDbExample
{
    public partial class Form1 : Form
    {
        SearchResult sr = new SearchResult();
        List<Result> lSearchResult = new List<Result>();
        MovieInfo mi = new MovieInfo(); 

        public Form1()
        {
            InitializeComponent();
        }

        private void bSearch_Click(object sender, EventArgs e)
        {
            lvSearchResult.Items.Clear();
            ilTinyPosters.Images.Clear();
            sr.Keyword = tbKeyword.Text;
            lSearchResult = sr.getSearchResult();

            foreach (Result movie in lSearchResult)
            {
                ilTinyPosters.Images.Add(movie.PosterIcon);
                lvSearchResult.Items.Add(new ListViewItem(movie.Title, ilTinyPosters.Images.Count - 1));
            }
        }

        private void lvSearchResult_SelectedIndexChanged(object sender, EventArgs e)
        {

            lvMovieInfo.Items.Clear();
            lDescription.Text = "";
            mi.Url = lSearchResult[lvSearchResult.FocusedItem.Index].Url;
            var m = mi.getMovieInfo();
            pbPoster.Image = m.Poster;
            lvMovieInfo.Items.Add("Title").SubItems.Add(m.Title);
            lvMovieInfo.Items.Add("Year").SubItems.Add(m.Year);
            lvMovieInfo.Items.Add("Meter Rank").SubItems.Add(m.MeterRank);
            lvMovieInfo.Items.Add("Popularity").SubItems.Add(m.Popularity);
            lvMovieInfo.Items.Add("Meter Change").SubItems.Add(m.MeterChange);
            lvMovieInfo.Items.Add("Genre").SubItems.Add(m.Genre);
            lvMovieInfo.Items.Add("Content Rating").SubItems.Add(m.ContentRating);
            lvMovieInfo.Items.Add("Release Date").SubItems.Add(m.ReleaseDate);
            lvMovieInfo.Items.Add("Rating").SubItems.Add(m.Rating);
            lvMovieInfo.Items.Add("Votes").SubItems.Add(m.Votes);
            lvMovieInfo.Items.Add("Metascore").SubItems.Add(m.Metascore);
            lvMovieInfo.Items.Add("Metacritic").SubItems.Add(m.Metacritic);
            lvMovieInfo.Items.Add("User Reviews").SubItems.Add(m.UserReviews);
            lvMovieInfo.Items.Add("Critic Reviews").SubItems.Add(m.CriticReviews);
            lvMovieInfo.Items.Add("Duration").SubItems.Add(m.Duration);
            lvMovieInfo.Items.Add("Director").SubItems.Add(m.Director);
            lvMovieInfo.Items.Add("Writers").SubItems.Add(m.Writers);
            lvMovieInfo.Items.Add("Stars").SubItems.Add(m.Stars);
            lvMovieInfo.Items.Add("Awards").SubItems.Add(m.Awards);
            lDescription.Text += m.Description;
        }
    }
}

Last edited May 28, 2013 at 11:51 AM by Almis, version 3

Comments

No comments yet.