summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/TitleSpecificViewModel.cs
blob: 836a7b0aa5eb9de787a48fd8e0975357fbd83a0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="TitleSpecificViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
// </copyright>
// <summary>
//   Defines the TitleSpecificViewModel type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace HandBrakeWPF.ViewModels
{
    using HandBrakeWPF.ViewModels.Interfaces;

    /// <summary>
    /// The Title Specific View Model
    /// </summary>
    public class TitleSpecificViewModel : ViewModelBase, ITitleSpecificViewModel
    {
        #region Constants and Fields

        /// <summary>
        /// The selected title.
        /// </summary>
        private int? selectedTitle;

        #endregion

        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="TitleSpecificViewModel"/> class. 
        /// </summary>
        public TitleSpecificViewModel()
        {
            this.SelectedTitle = 0;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets SelectedTitle.
        /// </summary>
        public int? SelectedTitle
        {
            get
            {
                return this.selectedTitle;
            }

            set
            {
                this.selectedTitle = value;
                this.NotifyOfPropertyChange(() => this.SelectedTitle);
            }
        }

        #endregion

        #region Public Methods

        /// <summary>
        /// Cancel the request to scan.
        /// </summary>
        public void Cancel()
        {
            this.selectedTitle = null;
            this.TryClose();
        }

        /// <summary>
        /// Open the selected title.
        /// </summary>
        public void Open()
        {
            this.TryClose();
        }

        #endregion
    }
}