diff options
Diffstat (limited to 'Gestor.Common/Gestor.Common.Converters/TipoSinistroConverter.cs')
| -rw-r--r-- | Gestor.Common/Gestor.Common.Converters/TipoSinistroConverter.cs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Gestor.Common/Gestor.Common.Converters/TipoSinistroConverter.cs b/Gestor.Common/Gestor.Common.Converters/TipoSinistroConverter.cs new file mode 100644 index 0000000..f344ca9 --- /dev/null +++ b/Gestor.Common/Gestor.Common.Converters/TipoSinistroConverter.cs @@ -0,0 +1,39 @@ +using System; +using System.Globalization; +using System.Windows.Data; +using Gestor.Model.Common; + +namespace Gestor.Common.Converters; + +public class TipoSinistroConverter : IMultiValueConverter +{ + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + //IL_000d: Unknown result type (might be due to invalid IL or missing references) + //IL_0012: Unknown result type (might be due to invalid IL or missing references) + //IL_001b: Unknown result type (might be due to invalid IL or missing references) + if (!(values[0] is TipoSinistro val)) + { + return ""; + } + if ((int)val == 0) + { + return "CLIENTE"; + } + object obj = values[1]; + if (obj != null) + { + if (obj is string text) + { + return "TERCEIRO NÂș " + text; + } + return ""; + } + return "TERCEIRO"; + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + return null; + } +} |