using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using NavisworksTransport.Core.Models;

namespace NavisworksTransport.UI.WPF.Converters
{
    /// <summary>
    /// 批处理队列状态转换器，将BatchQueueStatus枚举转换为中文显示
    /// </summary>
    public class BatchQueueStatusConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is BatchQueueStatus status)
            {
                switch (status)
                {
                    case BatchQueueStatus.All:
                        return "全部";
                    case BatchQueueStatus.Pending:
                        return "待处理";
                    case BatchQueueStatus.Running:
                        return "执行中";
                    case BatchQueueStatus.Completed:
                        return "已完成";
                    case BatchQueueStatus.Failed:
                        return "失败";
                    case BatchQueueStatus.Skipped:
                        return "已跳过";
                    default:
                        return "未知";
                }
            }
            return "全部";
        }

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