From d127c1a9910bc97f31c271261e7f95d3cd32d203 Mon Sep 17 00:00:00 2001 From: "tt@kmycode.net" Date: Sun, 28 Aug 2022 16:27:52 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=89=8D=E3=81=AE=E7=89=88?= =?UTF-8?q?=E3=82=92=E4=BD=BF=E3=81=A3=E3=81=A6=E3=81=84=E3=82=8B=E4=BA=BA?= =?UTF-8?q?=E3=81=8C=E3=82=A2=E3=83=97=E3=81=A7=E3=81=97=E3=81=9F=E3=81=A8?= =?UTF-8?q?=E3=81=8D=E3=80=81=E5=87=A6=E7=90=86=E3=81=8C=E3=83=95=E3=83=AA?= =?UTF-8?q?=E3=83=BC=E3=82=BA=E3=81=97=E3=81=AA=E3=81=84=E3=82=88=E3=81=86?= =?UTF-8?q?=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ExNumber/ExternalNumberConfigModel.cs | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/KmyKeiba/Models/Race/ExNumber/ExternalNumberConfigModel.cs b/KmyKeiba/Models/Race/ExNumber/ExternalNumberConfigModel.cs index f01d3f5..a433f39 100644 --- a/KmyKeiba/Models/Race/ExNumber/ExternalNumberConfigModel.cs +++ b/KmyKeiba/Models/Race/ExNumber/ExternalNumberConfigModel.cs @@ -123,6 +123,8 @@ public class ExternalNumberConfigItem : IDisposable, ICheckableItem public ExternalNumberConfigItem(ExternalNumberConfig data) { this.Data = data; + + this.CheckInvalidData(); this.LoadFromData(); this.Name @@ -143,9 +145,9 @@ public ExternalNumberConfigItem(ExternalNumberConfig data) return; } - if (this.IsFormatHorseCsv.Value == this.IsFormatRaceFixedLength.Value == this.IsFormatRaceCsv.Value == this.IsFormatHorseFixedLength.Value == false || - this.IsValuesNumberOnly.Value == this.IsValuesNumberAndOrder.Value == false || - this.IsSortLarger.Value == this.IsSortSmaller.Value == this.IsSortSmallerWithoutZero.Value == false) + if ((this.IsFormatHorseCsv.Value == false && this.IsFormatRaceFixedLength.Value == false && this.IsFormatRaceCsv.Value == false && this.IsFormatHorseFixedLength.Value == false) || + (this.IsValuesNumberOnly.Value == false && this.IsValuesNumberAndOrder.Value == false) || + (this.IsSortLarger.Value == false && this.IsSortSmaller.Value == false && this.IsSortSmallerWithoutZero.Value == false)) { // UIのせいでなぜか全部falseになってイベント通知してくることがある this.LoadFromData(); @@ -178,6 +180,24 @@ public ExternalNumberConfigItem(ExternalNumberConfig data) this._isInitializing = false; } + private void CheckInvalidData() + { + var data = this.Data; + + if (data.FileFormat == ExternalNumberFileFormat.Unknown) + { + data.FileFormat = ExternalNumberFileFormat.RaceCsv; + } + if (data.ValuesFormat == ExternalNumberValuesFormat.Unknown) + { + data.ValuesFormat = ExternalNumberValuesFormat.NumberOnly; + } + if (data.SortRule == ExternalNumberSortRule.Unknown) + { + data.SortRule = ExternalNumberSortRule.Larger; + } + } + private void LoadFromData() { var data = this.Data;