Example #1
0
        public NewMovieDialog(Movie movie)
            : this()
        {
            _nameTextBox.DataBindings.Add("Text", movie, "Title", true, DataSourceUpdateMode.OnPropertyChanged);
              _ratingUpDown.DataBindings.Add("Value", movie, "Rating", true, DataSourceUpdateMode.OnPropertyChanged);
              _descriptionTextBox.DataBindings.Add("Text", movie, "Description", true, DataSourceUpdateMode.OnPropertyChanged);

              _nameTextBox.Select();
        }
Example #2
0
 private void MovieList_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     Movie movie = (Movie)MovieList.SelectedItem;
     Movie movieCopy = new Movie(movie);
     MovieEditorDialog editor = new MovieEditorDialog(movieCopy);
     if (editor.ShowDialog() == DialogResult.OK)
     {
         movie.Update(movieCopy);
     }
 }
Example #3
0
 private void MovieList_KeyPress(object sender, KeyPressEventArgs e)
 {
     Movie movie = (Movie)MovieList.SelectedItem;
     Movie movieCopy = new Movie(movie);
     MovieEditorDialog editor = new MovieEditorDialog(movieCopy);
     if (editor.ShowDialog() == DialogResult.OK)
     {
         movie.Update(movieCopy);
     }
 }
Example #4
0
        private void _newButton_Click(object sender, EventArgs e)
        {
            Movie movie = new Movie();
              using (NewMovieDialog dlg = new NewMovieDialog(movie))
              {
            dlg.StartPosition = FormStartPosition.CenterParent;
            if (dlg.ShowDialog(this) != DialogResult.OK) return;

            _movieRepository.Add(movie);
            _bindingSource.Position = _bindingSource.IndexOf(movie);
              }
        }
Example #5
0
 // Copy constructor
 public Movie(Movie movie)
 {
     Title = movie.Title;
     Rating = movie.Rating;
     Description = movie.Description;
 }
Example #6
0
        public static MovieRepository GetSampleMovieRepository()
        {
            MovieRepository movieRepository = new MovieRepository();
            Person p2 = new Person { LastName = "Cronenberg", FirstName = "David" };
            Person p3 = new Person { LastName = "Mann", FirstName = "Michael" };
            Person p4 = new Person { LastName = "Eastwood", FirstName = "Clint" };
            Person p5 = new Person { LastName = "Allen", FirstName = "Woody" };
            Person p6 = new Person { LastName = "Coppola", FirstName = "Sofia" };
            Person p7 = new Person { LastName = "Raimi", FirstName = "Sam" };

            Movie m1 = new Movie("A History of Violence")
            {
                Director = p2,
                Rating = 8,
                Description = RemoveNL(
            @"Tom Stall, a humble family man and owner of a
            popular neighborhood restaurant, lives a quiet but
            fulfilling existence in the Midwest. One night Tom
            foils a crime at his place of business and, to his
            chagrin, is plastered all over the news for his
            heroics. Following this, mysterious people follow
            the Stalls' every move, concerning Tom more than
            anyone else. As this situation is confronted, more
            lurks out over where all these occurrences have
            stemmed from compromising his marriage, family
            relationship and the main characters' former
            relations in the process.")
            };

            Movie m2 = new Movie("Heat")
            {
                Director = p3,
                Rating = 7,
                Description = RemoveNL(
            @"Hunters and their prey--Neil and his professional
            criminal crew hunt to score big money targets
            (banks, vaults, armored cars) and are, in turn,
            hunted by Lt. Vincent Hanna and his team of cops
            in the Robbery/Homicide police division. A botched
            job puts Hanna onto their trail while they regroup
            and try to put together one last big 'retirement'
            score. Neil and Vincent are similar in many ways,
            including their troubled personal lives. At a
            crucial moment in his life, Neil disobeys the
            dictum taught to him long ago by his criminal
            mentor--'Never have anything in your life that you
            can't walk out on in thirty seconds flat, if you
            spot the heat coming around the corner'--as he
            falls in love. Thus the stage is set for the
            suspenseful ending....")
            };
            Movie m3 = new Movie("Lost in Translation")
            {
                Director = p6,
                Rating = 8,
            };
            Movie m4 = new Movie("Marie Antoinette")
            {
                Director = p6,
                Rating = 7,
                Description = RemoveNL(
            @"Based on Antonia Fraser's book about the ill-fated
            Archduchess of Austria and later Queen of France,
            'Marie Antoinette' tells the story of the most
            misunderstood and abused woman in history, from
            her birth in Imperial Austria to her later life in
            France.")
            };
            Movie m5 = new Movie("Match Point")
            {
                Director = p5,
                Rating = 8,
                Description = RemoveNL(
            @"Chris Wilton is a former tennis pro, looking to
            find work as an instructor. He meets Tom Hewett, a
            well-off pretty boy. Tom's sister Chloe falls in
            love with Chris but Chris has his eyes on Tom's
            fiancée, the luscious Nola. Both Chris and Nola
            know it's wrong but what could be more right than
            love? Chris tries to juggle both women but at some
            point, he must choose between them...")
            };
            Movie m6 = new Movie("Spider-Man")
            {
                Director = p7,
                Rating = 7,
                Description = RemoveNL(
            @"On a school field trip, Peter Parker (Maguire) is
            bitten by a genetically modified spider. He wakes
            up the next morning with incredible powers. After
            witnessing the death of his uncle (Robertson),
            Parkers decides to put his new skills to use in
            order to rid the city of evil, but someone else
            has other plans. The Green Goblin (Dafoe) sees
            Spider-Man as a threat and must dispose of him.
            Even if it means the Goblin has to target Parker's
            Aunt (Harris) and the girl he secretly pines for
            (Dunst) ")
            };
            Movie m7 = new Movie("Unforgiven")
            {
                Director = p4,
                Rating = 8,
                Description = RemoveNL(
            @"The town of Big Whisky is full of normal people
            trying to lead quiet lives. Cowboys try to make a
            living. Sheriff 'Little Bill' tries to build a
            house and keep a heavy-handed order. The town
            w****s just try to get by.Then a couple of cowboys
            cut up a w***e. Unsatisfied with Bill's justice,
            the prostitutes put a bounty on the cowboys. The
            bounty attracts a young gun billing himself as
            'The Schofield Kid', and aging killer William
            Munny. Munny reformed for his young wife, and has
            been raising crops and two children in peace. But
            his wife is gone. Farm life is hard. And Munny is
            no good at it. So he calls his old partner Ned,
            saddles his ornery nag, and rides off to kill one
            more time, blurring the lines between heroism and
            villainy, man and myth.")
            };

            movieRepository.Add(m1);
            movieRepository.Add(m2);
            movieRepository.Add(m3);
            movieRepository.Add(m4);
            movieRepository.Add(m5);
            movieRepository.Add(m6);
            movieRepository.Add(m7);

            return movieRepository;
        }
Example #7
0
 public void Update(Movie movie)
 {
     Title = movie.Title;
     Rating = movie.Rating;
     Description = movie.Description;
     Director = movie.Director;
 }
Example #8
0
 // Copy constructor
 public Movie(Movie movie)
 {
     Update(movie);
 }
Example #9
0
 private void NewButton_Click(object sender, EventArgs e)
 {
     Movie movie = new Movie();
     MovieEditorDialog editor = new MovieEditorDialog(movie);
     if (editor.ShowDialog() == DialogResult.OK)
     {
         _movies.Add(movie);
     }
     testList();
 }