1 // --------------------------------------------------------------------------------------------------------------------
2 // <copyright file="TitleSpecificViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
3 //   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
4 // </copyright>
5 // <summary>
6 //   Defines the TitleSpecificViewModel type.
7 // </summary>
8 // --------------------------------------------------------------------------------------------------------------------
9 
10 namespace HandBrakeWPF.ViewModels
11 {
12     using HandBrakeWPF.ViewModels.Interfaces;
13 
14     /// <summary>
15     /// The Title Specific View Model
16     /// </summary>
17     public class TitleSpecificViewModel : ViewModelBase, ITitleSpecificViewModel
18     {
19         #region Constants and Fields
20 
21         /// <summary>
22         /// The selected title.
23         /// </summary>
24         private int? selectedTitle;
25 
26         #endregion
27 
28         #region Constructors and Destructors
29 
30         /// <summary>
31         /// Initializes a new instance of the <see cref="TitleSpecificViewModel"/> class.
32         /// </summary>
TitleSpecificViewModel()33         public TitleSpecificViewModel()
34         {
35             this.SelectedTitle = 0;
36         }
37 
38         #endregion
39 
40         #region Properties
41 
42         /// <summary>
43         /// Gets or sets SelectedTitle.
44         /// </summary>
45         public int? SelectedTitle
46         {
47             get
48             {
49                 return this.selectedTitle;
50             }
51 
52             set
53             {
54                 this.selectedTitle = value;
55                 this.NotifyOfPropertyChange(() => this.SelectedTitle);
56             }
57         }
58 
59         #endregion
60 
61         #region Public Methods
62 
63         /// <summary>
64         /// Cancel the request to scan.
65         /// </summary>
Cancel()66         public void Cancel()
67         {
68             this.selectedTitle = null;
69             this.TryCloseAsync();
70         }
71 
72         /// <summary>
73         /// Open the selected title.
74         /// </summary>
Open()75         public void Open()
76         {
77             this.TryCloseAsync();
78         }
79 
80         #endregion
81     }
82 }