summaryrefslogtreecommitdiff
path: root/Gestor.Common/Gestor.Common.Converters/TipoCriticaConverter.cs
blob: b45f5d33c855995caa3b8afec651e60e85ca783e (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
using System;
using System.Globalization;
using System.Windows.Data;

namespace Gestor.Common.Converters;

public class TipoCriticaConverter : IMultiValueConverter
{
	public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
	{
		try
		{
			string text = (string)values[0];
			if (!(text == "0"))
			{
				if (!(text == "1"))
				{
					return "";
				}
				return (string)values[2];
			}
			return (string)values[1];
		}
		catch (Exception)
		{
			return "";
		}
	}

	public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
	{
		return null;
	}
}