You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
968 B
C#
35 lines
968 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Data;
|
|
|
|
namespace SlnMesnac.WPF.Converter.AgvAndTask
|
|
{
|
|
public class TaskStatusConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (value is int status)
|
|
{
|
|
return status switch
|
|
{
|
|
0 => "未下发",
|
|
1 => "已下发",
|
|
> 1 and < 6 => "执行中",
|
|
>= 6 => "执行完成",
|
|
_ => "未知状态",
|
|
};
|
|
}
|
|
return "未知状态";
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|