diff options
Diffstat (limited to 'Gestor.Application/Converters/ExtensaoVisibilityConverter.cs')
| -rw-r--r-- | Gestor.Application/Converters/ExtensaoVisibilityConverter.cs | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/Gestor.Application/Converters/ExtensaoVisibilityConverter.cs b/Gestor.Application/Converters/ExtensaoVisibilityConverter.cs deleted file mode 100644 index 6114950..0000000 --- a/Gestor.Application/Converters/ExtensaoVisibilityConverter.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System;
-using System.Globalization;
-using System.Windows;
-using System.Windows.Data;
-
-namespace Gestor.Application.Converters
-{
- public class ExtensaoVisibilityConverter : IMultiValueConverter
- {
- public ExtensaoVisibilityConverter()
- {
- }
-
- public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
- {
- object obj;
- try
- {
- if (values[0] == null || values[1] == null)
- {
- obj = Visibility.Collapsed;
- }
- else if (values[0] == null || (long)values[0] <= (long)0)
- {
- obj = (values[1].ToString().ToLower() == ".pdf" ? Visibility.Visible : Visibility.Collapsed);
- }
- else
- {
- obj = Visibility.Collapsed;
- }
- }
- catch (Exception exception)
- {
- obj = Visibility.Collapsed;
- }
- return obj;
- }
-
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value == null)
- {
- return Visibility.Collapsed;
- }
- if (value.ToString().ToLower() != ".pdf")
- {
- return Visibility.Collapsed;
- }
- return Visibility.Visible;
- }
-
- public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
- {
- return null;
- }
- }
-}
\ No newline at end of file |