添加淄博站廊桥看板

This commit is contained in:
wxl0430
2025-04-19 12:02:06 +08:00
committed by GitHub
parent 1cfc64694c
commit 71c5850b37
8 changed files with 301 additions and 1 deletions

View File

@@ -6,10 +6,48 @@ namespace CRSim.ScreenSimulator.Converters
public class LocationToStringConverter : IMultiValueConverter
{
public string DisplayMode { get; set; } = "normal";
/*
normal: 正常
less: 简化
least极简适用于廊桥屏幕
*/
object IMultiValueConverter.Convert(object[] values, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
{
// return $"{values[0]},{values[1]},{values[2]}";
if (values[0] is int Length && values[1] is int Location)
{
if(DisplayMode == "least" && values[2] is string Direction){
// return Direction;
if(Direction == "left")
{
if(Location <= Length)
{
return $"←1~{Location}";
}
else if(Length == 1)
{
return "←1";
}
else
{
return $"←1~{Length}";
}
}
if(Direction == "right")
{
if(Location+1 > Length){
return string.Empty;
}
else if(Location+1 == Length)
{
return $"{Length}→";
}
else{
return $"{Location+1}~{Length}→";
}
}
return string.Empty;
}
if (DisplayMode == "less")
{
if (Location > Length)