using Client.ISServiceRef;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Imaging;

namespace Client.Converters
{
    public class ProjectStateConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            try
            {
                ProjectState projectState = (ProjectState)value;

                switch(projectState)
                {
                    case ProjectState.Active:
                        return Properties.Resources.ProjectStateActive;
                    case ProjectState.Done:
                        return Properties.Resources.ProjectStateDone;
                    default:
                        return Properties.Resources.ProjectStateInPreparation;
                }
            }
            catch
            {
                return string.Empty;
            }
        }

        // No need to implement converting back on a one-way binding 
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
