summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Converters/OptionTabConverter.cs
blob: bc52652f43b8bb409d0f7b1a2f406ed6652417d1 (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
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="OptionTabConverter.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>
//   Controls display of tab pages
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace HandBrakeWPF.Converters
{
    using System;
    using System.Globalization;
    using System.Linq;
    using System.Windows.Data;

    using HandBrakeWPF.Model;
    using HandBrakeWPF.Utilities;

    public class OptionTabConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            OptionsTab[] tabs = value as OptionsTab[];
            if (tabs != null && !Portable.IsUpdateCheckEnabled())
            {
                return tabs.Where(s => s != OptionsTab.Updates).ToArray();
            }
            
            return value;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}