summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Model/SelectionTitle.cs
blob: 8983fb9716c93dec3a3bc394f8770e628e54524d (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
83
84
85
86
87
88
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="SelectionTitle.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>
//   A model for the multiple selection window for adding to the queue.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace HandBrakeWPF.Model
{
    using Caliburn.Micro;

    using HandBrake.ApplicationServices.Parsing;

    /// <summary>
    /// A model for the multiple selection window for adding to the queue.
    /// </summary>
    public class SelectionTitle : PropertyChangedBase
    {
        /// <summary>
        /// The source name.
        /// </summary>
        private readonly string sourceName;

        /// <summary>
        /// The is selected.
        /// </summary>
        private bool isSelected;

        /// <summary>
        /// Initializes a new instance of the <see cref="SelectionTitle"/> class.
        /// </summary>
        /// <param name="title">
        /// The title.
        /// </param>
        /// <param name="sourceName">
        /// The source Name.
        /// </param>
        public SelectionTitle(Title title, string sourceName)
        {
            this.sourceName = sourceName;
            this.Title = title;
        }

        /// <summary>
        /// Gets the source name.
        /// </summary>
        public string SourceName
        {
            get
            {
                return !string.IsNullOrEmpty(Title.SourceName) ? Title.SourceName : sourceName;
            }
        }

        /// <summary>
        /// Gets or sets the end point.
        /// </summary>
        public int EndPoint { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether is selected.
        /// </summary>
        public bool IsSelected
        {
            get
            {
                return this.isSelected;
            }
            set
            {
                this.isSelected = value;
                this.NotifyOfPropertyChange(() => this.IsSelected);
            }
        }

        /// <summary>
        /// Gets or sets the start point.
        /// </summary>
        public int StartPoint { get; set; }

        /// <summary>
        /// Gets or sets the title.
        /// </summary>
        public Title Title { get; set; }
    }
}