using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using BS.Shared;

namespace BeWo.Scheduler.Converter
{
    public class TerminartZuBoolConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var obj = (AppointmentKind) value;
            var result = obj.Equals(AppointmentKind.Resource);

            if (parameter != null && parameter.Equals("Visibility"))
                return obj.Equals(AppointmentKind.Resource) ? Visibility.Visible : Visibility.Collapsed;

            return result;
        }

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