aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Converters/StringToBoolYesNoNullConverter.cs
blob: f7633a7d0e948d3cda93fa7f5bc9f2075b758a38 (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
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Data;

namespace Tango.MachineStudio.Statistics.Converters
{
    public class StringToBoolYesNoNullConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if(value is bool)
            {
                return (bool)value ? "Yes" : "No";
            }
            return "Null";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            //throw new NotImplementedException();
            if (value is ComboBoxItem)
            {
                string str_val = ((ComboBoxItem)value).Content.ToString();
                if (str_val.ToUpper() == "NO")
                    return false;
                if (str_val.ToUpper() == "YES")
                    return true;
            }
            return null;
        }
    }
}
lass="w"> #00ceff; text-decoration: none; } .blue { color: #00ceff; } .yellow { color: #00ceff; } .container th h1 { font-weight: bold; font-size: 1em; text-align: left; color: #00AFFF; } .container td { font-weight: normal; font-size: 1em; border: none; text-align: left; } .container { text-align: left; overflow: hidden; width: 80%; margin: 0 auto; display: table; margin-top: 50px; padding: 0 0 8em 0; border-spacing: 0px; } .container td, .container th { padding-bottom: 2%; padding-top: 2%; padding-left: 2%; } /* Background-color of the odd rows */ .container tr:nth-child(odd) { background-color: #1b1b1b; } /* Background-color of the even rows */ .container tr:nth-child(even) { background-color: #2B2B2B; } .container th { border-bottom: 1px solid #00ceff; } .container td:first-child a { color: #A7A1AE; /*cursor: pointer;*/ } .container td:first-child a:hover { color:white; } .container tbody tr { /*cursor:pointer;*/ } .container tr:hover { /*background-color: #A0A0A0; -webkit-box-shadow: 0 6px 6px -6px #0E1119; -moz-box-shadow: 0 6px 6px -6px #0E1119; box-shadow: 0 6px 6px -6px #0E1119; color: Black;*/ } .container tbody tr:hover { /*background-color: #00ceff; color: Black; font-weight: bold; box-shadow: #008CAE -1px 1px, #008CAE -2px 2px, #008CAE -3px 3px, #008CAE -4px 4px, #008CAE -5px 5px, #008CAE -6px 6px; transform: translate3d(6px, -6px, 0); transition-delay: 0s; transition-duration: 0.4s; transition-property: all; transition-timing-function: line;*/ } @media (max-width: 800px) { .container td:nth-child(4), .container th:nth-child(4) { display: none; } }