refactor: 更改部分变量、属性、转换器名称 [skip cliff]

This commit is contained in:
denglihong2007
2025-06-08 22:04:38 +08:00
parent 090f136e6b
commit 053a67587b
25 changed files with 40 additions and 40 deletions

View File

@@ -9,7 +9,7 @@ namespace CRSim.ScreenSimulator.ViewModels.Ankang
{
Text = $"西安局集团公司推出西铁行APP站车服务产品欢迎体验使用。";
ItemsPerPage = 7;
PageCount = 1;
ScreenCount = 1;
StationType = StationType.Arrival;
}
}

View File

@@ -8,7 +8,7 @@ namespace CRSim.ScreenSimulator.ViewModels.BeijingNan
: base(timeService, settingsService)
{
ItemsPerPage = 10;
PageCount = 1;
ScreenCount = 1;
StationType = StationType.Departure;
}
}

View File

@@ -8,7 +8,7 @@ namespace CRSim.ScreenSimulator.ViewModels.BeijingXi
: base(timeService, settingsService)
{
ItemsPerPage = 13;
PageCount = 2;
ScreenCount = 2;
StationType = StationType.Departure;
}
}

View File

@@ -9,7 +9,7 @@ namespace CRSim.ScreenSimulator.ViewModels.ChengduDong
{
Text = " 检票口信息请以车站显示屏信息为准。公共场所请妥善保管个人贵重物品。";
ItemsPerPage = 12;
PageCount = 2;
ScreenCount = 2;
StationType = StationType.Departure;
}
}

View File

@@ -9,7 +9,7 @@ namespace CRSim.ScreenSimulator.ViewModels.ChengduShuangliuAirport
{
Text = $"国内航班截载时间为起飞前{settingsService.GetSettings().StopCheckInAdvanceDuration.TotalMinutes}分钟。";
ItemsPerPage = 7;
PageCount = 1;
ScreenCount = 1;
StationType = StationType.Departure;
}
}

View File

@@ -8,7 +8,7 @@ namespace CRSim.ScreenSimulator.ViewModels.DezhouDong
: base(timeService, settingsService)
{
ItemsPerPage = 10;
PageCount = 1;
ScreenCount = 1;
StationType = StationType.Departure;
}
}

View File

@@ -8,7 +8,7 @@ namespace CRSim.ScreenSimulator.ViewModels.GuangdongIntercity
{
Text = $"列 车 到 发 信 息";
ItemsPerPage = 8;
PageCount = 1;
ScreenCount = 1;
}
}
}

View File

@@ -9,7 +9,7 @@ namespace CRSim.ScreenSimulator.ViewModels.Guangyuan
{
Text = "成都铁路客服电话028-12306";
ItemsPerPage = 12;
PageCount = 1;
ScreenCount = 1;
StationType = StationType.Departure;
}
}

View File

@@ -9,7 +9,7 @@ namespace CRSim.ScreenSimulator.ViewModels.Harbin
{
Text = $"开车前{settingsService.GetSettings().StopCheckInAdvanceDuration.TotalMinutes}分钟停止检票";
ItemsPerPage = 6;
PageCount = 2;
ScreenCount = 2;
StationType = StationType.Departure;
}
}

View File

@@ -8,7 +8,7 @@ namespace CRSim.ScreenSimulator.ViewModels.Jinanxi
: base(timeService, settingsService)
{
ItemsPerPage = 9;
PageCount = 1;
ScreenCount = 1;
StationType = StationType.Departure;
SetText();
}

View File

@@ -9,7 +9,7 @@ namespace CRSim.ScreenSimulator.ViewModels.Niuzhou
{
Text = $"开车前{settingsService.GetSettings().PassingCheckInAdvanceDuration.TotalMinutes}分钟开始检票,开车前{settingsService.GetSettings().StopCheckInAdvanceDuration.TotalMinutes}分钟停止检票。";
ItemsPerPage = 10;
PageCount = 1;
ScreenCount = 1;
StationType = StationType.Departure;
}
}

View File

@@ -45,11 +45,11 @@ namespace CRSim.ScreenSimulator.ViewModels
}
[ObservableProperty]
private int _currentPageIndex = 0;
public int PagesCount
public int PageCount
{
get
{
return Math.Min((int)Math.Ceiling((double)TrainInfo.Count / ItemsPerPage * PageCount.Value),_settings.MaxPages);
return Math.Min((int)Math.Ceiling((double)TrainInfo.Count / ItemsPerPage * ScreenCount.Value),_settings.MaxPages);
}
}
public int ItemsPerPage = 1;
@@ -57,7 +57,7 @@ namespace CRSim.ScreenSimulator.ViewModels
//<summary>
// 适用于翻页屏的屏幕个数参数,非翻页屏请不要设置。
//</summary>
public int? PageCount = null;
public int? ScreenCount = null;
private async void Initialize()
{
@@ -150,7 +150,7 @@ namespace CRSim.ScreenSimulator.ViewModels
{
Application.Current.Dispatcher.Invoke(() =>
{
if (PageCount == null)
if (ScreenCount == null)
{
for (int i = 0; i < ItemsPerPage; i++)
{
@@ -165,10 +165,10 @@ namespace CRSim.ScreenSimulator.ViewModels
}
return;
}
int pageCount = (int)Math.Ceiling((double)TrainInfo.Count / (ItemsPerPage * PageCount.Value));
int startIndex = CurrentPageIndex * ItemsPerPage * PageCount.Value;
int pageCount = (int)Math.Ceiling((double)TrainInfo.Count / (ItemsPerPage * ScreenCount.Value));
int startIndex = CurrentPageIndex * ItemsPerPage * ScreenCount.Value;
switch (PageCount)
switch (ScreenCount)
{
case 1:
{

View File

@@ -8,7 +8,7 @@ namespace CRSim.ScreenSimulator.ViewModels.Shanghai
: base(timeService, settingsService)
{
ItemsPerPage = 9;
PageCount = 1;
ScreenCount = 1;
StationType = StationType.Departure;
}
}

View File

@@ -8,7 +8,7 @@ namespace CRSim.ScreenSimulator.ViewModels.Zibo
: base(timeService, settingsService)
{
ItemsPerPage = 8;
PageCount = 2;
ScreenCount = 2;
StationType = StationType.Departure;
}
}

View File

@@ -9,7 +9,7 @@ namespace CRSim.ScreenSimulator.ViewModels.Zibo
{
Text = $"开车前{settingsService.GetSettings().StopCheckInAdvanceDuration.TotalMinutes}分钟停止检票";
ItemsPerPage = 18;
PageCount = 1;
ScreenCount = 1;
StationType = StationType.Departure;
}
}

View File

@@ -12,17 +12,17 @@ namespace CRSim.ScreenSimulator.ViewModels.Zibo
Text = $" 开车前{settingsService.GetSettings().StopCheckInAdvanceDuration.TotalMinutes}分钟停止检票";
StationType = StationType.Departure;
ItemsPerPage = 5;
PageCount = 2;
ScreenCount = 2;
}
public override void RefreshDisplay(object? sender, EventArgs? e)
{
Application.Current.Dispatcher.Invoke(() =>
{
int pageCount = (int)Math.Ceiling((double)TrainInfo.Count / (ItemsPerPage * PageCount.Value));
int pageCount = (int)Math.Ceiling((double)TrainInfo.Count / (ItemsPerPage * ScreenCount.Value));
ScreenA.Clear();
ScreenB.Clear();
int startIndex = CurrentPageIndex * ItemsPerPage * PageCount.Value;
var ItemsToShow = TrainInfo.Skip(startIndex).Take(ItemsPerPage * PageCount.Value).ToList();
int startIndex = CurrentPageIndex * ItemsPerPage * ScreenCount.Value;
var ItemsToShow = TrainInfo.Skip(startIndex).Take(ItemsPerPage * ScreenCount.Value).ToList();
var leftItems = ItemsToShow.Where((item, index) => index % 2 == 0).ToList();
var rightItems = ItemsToShow.Where((item, index) => index % 2 == 1).ToList();
while (leftItems.Count < ItemsPerPage)