• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

EveryDB2のデータベースを読み込んでWinFormでGUI表示するサンプル


Commit MetaInfo

修订版e87fe26795e0e5dafde145d880c0f5f6305ef7a4 (tree)
时间2021-05-29 04:12:20
作者yoshy <yoshy@user...>
Commiteryoshy

Log Message

temp_20210529_0412

更改概述

差异

--- /dev/null
+++ b/App/Adaptor/Gateway/UI/ITokuRaceListProxy.cs
@@ -0,0 +1,10 @@
1+using UmaTest.App.Adaptor.Gateway.ViewModel;
2+using UmaTest.Infra.Gateway.UI;
3+
4+namespace UmaTest.App.Adaptor.Gateway.UI
5+{
6+ public interface ITokuRaceListProxy : IShowChildWindowProxy<ITokuRaceListViewModel>
7+ {
8+ void ShowChildWindow();
9+ }
10+}
\ No newline at end of file
--- /dev/null
+++ b/App/Adaptor/Gateway/UI/TokuRaceListProxy.cs
@@ -0,0 +1,23 @@
1+using System.Windows.Forms;
2+using UmaTest.App.Adaptor.Gateway.ViewModel;
3+using UmaTest.App.Presentation.View;
4+using UmaTest.Infra.Gateway.UI;
5+
6+namespace UmaTest.App.Adaptor.Gateway.UI
7+{
8+ internal class TokuRaceListProxy
9+ : ShowChildWindowProxy<TokuRaceListView, ITokuRaceListViewModel>, ITokuRaceListProxy
10+ {
11+ private readonly ITokuRaceListViewModel vm;
12+
13+ public TokuRaceListProxy(TokuRaceListView window, ITokuRaceListViewModel vm) : base(window)
14+ {
15+ this.vm = vm;
16+ }
17+
18+ public void ShowChildWindow()
19+ {
20+ ShowChildWindow(this.vm);
21+ }
22+ }
23+}
\ No newline at end of file
--- /dev/null
+++ b/App/Adaptor/Gateway/ViewModel/Dto/TokuRaceRowDto.cs
@@ -0,0 +1,31 @@
1+using System;
2+using System.Collections.Generic;
3+using System.Linq;
4+using System.Text;
5+using System.Threading.Tasks;
6+using UmaTest.App.Domain.Model.Repository.Database.Dto;
7+using UmaTest.App.Domain.Model.Repository.Database.Entity.EveryDB2;
8+using UmaTest.Infra.Helper;
9+
10+namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto
11+{
12+ public class TokuRaceRowDto : NTokuRace
13+ {
14+ public TokuRaceRowDto()
15+ {
16+ }
17+
18+ public TokuRaceRowDto(NTokuRace race)
19+ {
20+ BeanHelper.Copy(this, race);
21+ }
22+
23+ public string YearMonthDay { get => Year + "/" + Monthday.Substring(0, 2) + "/" + Monthday.Substring(2, 2); }
24+
25+ public string RaceName => !String.IsNullOrEmpty(Hondai)
26+ ? Hondai
27+ : CodeHelper.GetInstance().GetName(CodeHelper.JYOKEN_CODE1, Jyokencd1, "不明");
28+
29+ public string GradeName => CodeHelper.GetInstance().GetName(CodeHelper.GRADE_CODE, Gradecd, "-");
30+ }
31+}
--- a/App/Adaptor/Gateway/ViewModel/IMainWindowViewModel.cs
+++ b/App/Adaptor/Gateway/ViewModel/IMainWindowViewModel.cs
@@ -4,18 +4,21 @@ using System.ComponentModel;
44 using UmaTest.App.Adaptor.Gateway.UI;
55 using UmaTest.App.Adaptor.Gateway.ViewModel.Dto;
66 using UmaTest.Infra.Adaptor.Command;
7-using UmaTest.Infra.Adaptor.ViewModel;
87
98 namespace UmaTest.App.Adaptor.Gateway.ViewModel
109 {
11- public interface IMainWindowViewModel : INotifyPropertyChanged
10+ public interface IMainWindowViewModel
1211 {
13- ICommand CommandReadHorseList { get; }
12+ ICommand CommandOpenHorseList { get; }
13+ ICommand CommandOpenTokuRaceList { get; }
1414 EventHandler EventSelectedHorseChanged { get; }
1515 IManualHorseListProxy ManualHorseListProxy { get; }
1616 BindingList<UmaRaceRowDto> RaceList { get; set; }
17+ ITokuRaceListProxy TokuRaceListProxy { get; }
1718 BindingList<UmaSummaryRowDto> UmaSummaryList { get; set; }
1819
20+ event PropertyChangedEventHandler PropertyChanged;
21+
1922 void RefreshModel(List<UmaSummaryRowDto> umaSummaryList, Dictionary<string, List<UmaRaceRowDto>> umaRaceMap);
2023 }
2124 }
\ No newline at end of file
--- /dev/null
+++ b/App/Adaptor/Gateway/ViewModel/ITokuRaceListViewModel.cs
@@ -0,0 +1,18 @@
1+using System;
2+using System.ComponentModel;
3+using UmaTest.App.Adaptor.Gateway.ViewModel.Dto;
4+using UmaTest.Infra.Adaptor.Command;
5+
6+namespace UmaTest.App.Adaptor.Gateway.ViewModel
7+{
8+ public interface ITokuRaceListViewModel
9+ {
10+ ICommand CommandExecuteReadTokuUmaRaceList { get; }
11+ ICommand CommandInitReadTokuRaceList { get; }
12+ EventHandler EventSelectedRaceChanged { get; }
13+ int SelectedIndex { get; }
14+ BindingList<TokuRaceRowDto> TokuRaceList { get; set; }
15+
16+ event PropertyChangedEventHandler PropertyChanged;
17+ }
18+}
\ No newline at end of file
--- a/App/Adaptor/Gateway/ViewModel/MainWindowViewModel.cs
+++ b/App/Adaptor/Gateway/ViewModel/MainWindowViewModel.cs
@@ -25,20 +25,28 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel
2525
2626 public EventHandler EventSelectedHorseChanged { get; private set; }
2727
28- public ICommand CommandReadHorseList { get; private set; }
28+ public ICommand CommandOpenHorseList { get; private set; }
29+
30+ public ICommand CommandOpenTokuRaceList { get; private set; }
2931
3032 public IManualHorseListProxy ManualHorseListProxy { get; private set; }
3133
34+ public ITokuRaceListProxy TokuRaceListProxy { get; private set; }
35+
3236 private IWindowController wc;
3337
3438 private Dictionary<string, List<UmaRaceRowDto>> _umaRaceMap = null;
3539
36- public MainWindowViewModel(IWindowController wc, IManualHorseListProxy horseListProxy)
40+ public MainWindowViewModel(IWindowController wc
41+ , IManualHorseListProxy horseListProxy
42+ , ITokuRaceListProxy tokuRaceListProxy)
3743 {
3844 this.wc = wc;
3945 this.ManualHorseListProxy = horseListProxy;
46+ this.TokuRaceListProxy = tokuRaceListProxy;
4047
41- CommandReadHorseList = new DelegateCommand("Read Horse List (&R)", () => true, OnReadHorseList);
48+ CommandOpenHorseList = new DelegateCommand("Read Horse List (&H)", () => true, OnOpenHorseList);
49+ CommandOpenTokuRaceList = new DelegateCommand("Open Toku Race List (&T)", () => true, OnOpenTokuRaceList);
4250 EventSelectedHorseChanged = new EventHandler(OnSelectedHorseChanged);
4351 }
4452
@@ -69,11 +77,16 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel
6977 ChangeRaceList(0);
7078 }
7179 }
72- private void OnReadHorseList()
80+ private void OnOpenHorseList()
7381 {
7482 ManualHorseListProxy.ShowChildWindow();
7583 }
7684
85+ private void OnOpenTokuRaceList()
86+ {
87+ TokuRaceListProxy.ShowChildWindow();
88+ }
89+
7790 private void OnSelectedHorseChanged(object sender, EventArgs e)
7891 {
7992 DataGridView dgv = sender as DataGridView;
--- /dev/null
+++ b/App/Adaptor/Gateway/ViewModel/TokuRaceListViewModel.cs
@@ -0,0 +1,93 @@
1+using System;
2+using System.Collections.Generic;
3+using System.ComponentModel;
4+using System.Linq;
5+using System.Text;
6+using System.Threading.Tasks;
7+using System.Windows.Forms;
8+using System.Windows.Input;
9+using UmaTest.App.Adaptor.Controller;
10+using UmaTest.App.Adaptor.Gateway.ViewModel.Dto;
11+using UmaTest.App.Domain.Model.Repository.Database.Entity.EveryDB2;
12+using UmaTest.App.Domain.UseCase.Request;
13+using UmaTest.App.Domain.UseCase.Response;
14+using UmaTest.Infra.Adaptor.Command;
15+using UmaTest.Infra.Adaptor.Controller;
16+using UmaTest.Infra.Log;
17+using ICommand = UmaTest.Infra.Adaptor.Command.ICommand;
18+
19+namespace UmaTest.App.Adaptor.Gateway.ViewModel
20+{
21+ public class TokuRaceListViewModel : ITokuRaceListViewModel
22+ {
23+ public event PropertyChangedEventHandler PropertyChanged;
24+
25+ public EventHandler EventSelectedRaceChanged { get; private set; }
26+
27+ public ICommand CommandInitReadTokuRaceList { get; private set; }
28+
29+ public ICommand CommandExecuteReadTokuUmaRaceList { get; private set; }
30+
31+ private IWindowController wc;
32+
33+ public TokuRaceListViewModel(IWindowController wc)
34+ {
35+ this.wc = wc;
36+
37+ this.CommandInitReadTokuRaceList = new DelegateCommand(
38+ "Init", () => true, OnInitReadTokuRaceList);
39+
40+ this.CommandExecuteReadTokuUmaRaceList = new DelegateCommand(
41+ "Select", () => SelectedIndex != -1, OnExecuteReadTokuUmaRaceList);
42+
43+ EventSelectedRaceChanged = new EventHandler(OnSelectedRaceChanged);
44+ }
45+
46+ private async void OnInitReadTokuRaceList()
47+ {
48+ AsyncLoadTokuRaceListRequest req = new AsyncLoadTokuRaceListRequest();
49+ Logger.Debug($"OnInitReadTokuRaceList");
50+ await wc.ExecuteAsync(req);
51+ }
52+
53+ private async void OnExecuteReadTokuUmaRaceList()
54+ {
55+ if (SelectedIndex == -1)
56+ {
57+ return;
58+ }
59+
60+ AsyncLoadTokuUmaRaceListRequest req = new AsyncLoadTokuUmaRaceListRequest(TokuRaceList[SelectedIndex]);
61+ Logger.Debug($"OnExecuteReadTokuUmaRaceList: {SelectedIndex}");
62+ await wc.ExecuteAsync(req);
63+ }
64+
65+ private BindingList<TokuRaceRowDto> _tokuRaceList;
66+
67+ public BindingList<TokuRaceRowDto> TokuRaceList
68+ {
69+ get => _tokuRaceList;
70+ set => PropertyChanged.RaiseIfSet(() => TokuRaceList, ref _tokuRaceList, value);
71+ }
72+
73+ public int SelectedIndex { get; private set; } = -1;
74+
75+ private void OnSelectedRaceChanged(object sender, EventArgs e)
76+ {
77+ DataGridView dgv = sender as DataGridView;
78+
79+ var selected = dgv.SelectedRows;
80+
81+ if (selected.Count == 0)
82+ {
83+ Logger.Debug($"OnSelectedRaceChanged: count - {selected.Count}");
84+ return;
85+ }
86+
87+ Logger.Debug($"OnSelectedRaceChanged: index - {selected[0].Index}");
88+
89+ SelectedIndex = selected[0].Index;
90+ }
91+
92+ }
93+}
--- a/App/DI/ComponentConnectorFactory.cs
+++ b/App/DI/ComponentConnectorFactory.cs
@@ -59,6 +59,9 @@ namespace UmaTest.App.DI
5959 di.RegisterSingleton<ManualHorseListView>();
6060 di.RegisterSingleton<IManualHorseListViewModel, ManualHorseListViewModel>();
6161
62+ di.RegisterSingleton<TokuRaceListView>();
63+ di.RegisterSingleton<ITokuRaceListViewModel, TokuRaceListViewModel>();
64+
6265 ///
6366 /// UI Proxy
6467 ///
@@ -66,6 +69,7 @@ namespace UmaTest.App.DI
6669 di.RegisterSingleton<IUserDialogProxy, UserDialogProxy>();
6770 di.RegisterSingleton<IStatusBarProxy, StatusBarProxy>();
6871 di.RegisterSingleton<IManualHorseListProxy, ManualHorseListProxy>();
72+ di.RegisterSingleton<ITokuRaceListProxy, TokuRaceListProxy>();
6973
7074 ///
7175 /// Interactors
--- /dev/null
+++ b/App/Domain/UseCase/Request/AsyncLoadTokuRaceListRequest .cs
@@ -0,0 +1,22 @@
1+using System;
2+using System.Collections.Generic;
3+using System.Linq;
4+using System.Text;
5+using System.Threading.Tasks;
6+using UmaTest.App.Domain.UseCase.Response;
7+using UmaTest.Infra.Domain.UseCase;
8+
9+namespace UmaTest.App.Domain.UseCase.Request
10+{
11+ public class AsyncLoadTokuRaceListRequest : UseCaseRequest
12+ {
13+ public AsyncLoadTokuRaceListRequest()
14+ {
15+ }
16+
17+ protected override UseCaseResponse CreateResponse()
18+ {
19+ return new AsyncLoadTokuRaceListResponse(this);
20+ }
21+ }
22+}
--- /dev/null
+++ b/App/Domain/UseCase/Request/AsyncLoadTokuUmaRaceListRequest.cs
@@ -0,0 +1,28 @@
1+using System;
2+using System.Collections.Generic;
3+using System.Linq;
4+using System.Text;
5+using System.Threading.Tasks;
6+using UmaTest.App.Adaptor.Gateway.ViewModel.Dto;
7+using UmaTest.App.Domain.Model.Repository.Database.Entity.EveryDB2;
8+using UmaTest.App.Domain.UseCase.Response;
9+using UmaTest.Infra.Domain.UseCase;
10+
11+namespace UmaTest.App.Domain.UseCase.Request
12+{
13+ public class AsyncLoadTokuUmaRaceListRequest : UseCaseRequest
14+ {
15+ public AsyncLoadTokuUmaRaceListRequest(NTokuRace race)
16+ {
17+ Race = race;
18+ }
19+
20+ public NTokuRace Race { get; private set; }
21+
22+
23+ protected override UseCaseResponse CreateResponse()
24+ {
25+ return new AsyncLoadTokuUmaRaceListResponse(this);
26+ }
27+ }
28+}
--- /dev/null
+++ b/App/Domain/UseCase/Response/AsyncLoadTokuRaceListResponse.cs
@@ -0,0 +1,21 @@
1+using System;
2+using System.Collections.Generic;
3+using System.Linq;
4+using System.Text;
5+using System.Threading.Tasks;
6+using UmaTest.App.Domain.Model.Repository.Database.Dto;
7+using UmaTest.App.Domain.Model.Repository.Database.Entity.EveryDB2;
8+using UmaTest.App.Domain.UseCase.Request;
9+using UmaTest.Infra.Domain.UseCase;
10+
11+namespace UmaTest.App.Domain.UseCase.Response
12+{
13+ public class AsyncLoadTokuRaceListResponse : UseCaseResponse
14+ {
15+ public AsyncLoadTokuRaceListResponse(AsyncLoadTokuRaceListRequest req) : base(req)
16+ {
17+ }
18+
19+ public IEnumerable<NTokuRace> Races { get; set; }
20+ }
21+}
--- /dev/null
+++ b/App/Domain/UseCase/Response/AsyncLoadTokuUmaRaceListResponse.cs
@@ -0,0 +1,21 @@
1+using System;
2+using System.Collections.Generic;
3+using System.Linq;
4+using System.Text;
5+using System.Threading.Tasks;
6+using UmaTest.App.Domain.Model.Repository.Database.Dto;
7+using UmaTest.App.Domain.Model.Repository.Database.Entity.EveryDB2;
8+using UmaTest.App.Domain.UseCase.Request;
9+using UmaTest.Infra.Domain.UseCase;
10+
11+namespace UmaTest.App.Domain.UseCase.Response
12+{
13+ public class AsyncLoadTokuUmaRaceListResponse : UseCaseResponse
14+ {
15+ public AsyncLoadTokuUmaRaceListResponse(AsyncLoadTokuUmaRaceListRequest req) : base(req)
16+ {
17+ }
18+
19+ public IEnumerable<NTokuRace> Races { get; set; }
20+ }
21+}
--- a/App/Presentation/View/MainWindow.Designer.cs
+++ b/App/Presentation/View/MainWindow.Designer.cs
@@ -41,6 +41,7 @@ namespace UmaTest.App.Presentation.View
4141 this.dataGridView2 = new System.Windows.Forms.DataGridView();
4242 this.statusStrip1 = new System.Windows.Forms.StatusStrip();
4343 this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
44+ this.toolStripMenuOpenTokuRaceList = new System.Windows.Forms.ToolStripMenuItem();
4445 this.menuStrip1.SuspendLayout();
4546 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
4647 this.splitContainer1.Panel1.SuspendLayout();
@@ -70,6 +71,7 @@ namespace UmaTest.App.Presentation.View
7071 //
7172 this.toolStripMenuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
7273 this.toolStripMenuOpenHorseList,
74+ this.toolStripMenuOpenTokuRaceList,
7375 this.toolStripSeparator1,
7476 this.toolStripMenuQuit});
7577 this.toolStripMenuFile.Name = "toolStripMenuFile";
@@ -79,18 +81,18 @@ namespace UmaTest.App.Presentation.View
7981 // toolStripMenuOpenHorseList
8082 //
8183 this.toolStripMenuOpenHorseList.Name = "toolStripMenuOpenHorseList";
82- this.toolStripMenuOpenHorseList.Size = new System.Drawing.Size(152, 22);
84+ this.toolStripMenuOpenHorseList.Size = new System.Drawing.Size(180, 22);
8385 this.toolStripMenuOpenHorseList.Text = "OpenHorseList";
8486 //
8587 // toolStripSeparator1
8688 //
8789 this.toolStripSeparator1.Name = "toolStripSeparator1";
88- this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6);
90+ this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
8991 //
9092 // toolStripMenuQuit
9193 //
9294 this.toolStripMenuQuit.Name = "toolStripMenuQuit";
93- this.toolStripMenuQuit.Size = new System.Drawing.Size(152, 22);
95+ this.toolStripMenuQuit.Size = new System.Drawing.Size(180, 22);
9496 this.toolStripMenuQuit.Text = "Quit";
9597 //
9698 // splitContainer1
@@ -186,6 +188,12 @@ namespace UmaTest.App.Presentation.View
186188 this.toolStripStatusLabel1.Size = new System.Drawing.Size(41, 17);
187189 this.toolStripStatusLabel1.Text = "Ready.";
188190 //
191+ // toolStripMenuopenTokuRaceList
192+ //
193+ this.toolStripMenuOpenTokuRaceList.Name = "toolStripMenuopenTokuRaceList";
194+ this.toolStripMenuOpenTokuRaceList.Size = new System.Drawing.Size(180, 22);
195+ this.toolStripMenuOpenTokuRaceList.Text = "OpenTokuRaceList";
196+ //
189197 // MainWindow
190198 //
191199 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -231,6 +239,7 @@ namespace UmaTest.App.Presentation.View
231239 private System.Windows.Forms.DataGridView dataGridView2;
232240 private System.Windows.Forms.StatusStrip statusStrip1;
233241 private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
242+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuOpenTokuRaceList;
234243 }
235244 }
236245
--- a/App/Presentation/View/MainWindow.cs
+++ b/App/Presentation/View/MainWindow.cs
@@ -40,6 +40,7 @@ namespace UmaTest.App.Presentation.View
4040 // Initialize Child Window Onwer
4141
4242 vm.ManualHorseListProxy.Owner = this;
43+ vm.TokuRaceListProxy.Owner = this;
4344
4445 // Register UI EventHandler
4546
@@ -49,7 +50,8 @@ namespace UmaTest.App.Presentation.View
4950 // Bind UI Commands
5051 //
5152
52- cm.Bind(vm.CommandReadHorseList, this.toolStripMenuOpenHorseList);
53+ cm.Bind(vm.CommandOpenHorseList, this.toolStripMenuOpenHorseList);
54+ cm.Bind(vm.CommandOpenTokuRaceList, this.toolStripMenuOpenTokuRaceList);
5355
5456 //
5557 // Bind UI Text
--- /dev/null
+++ b/App/Presentation/View/TokuRaceListView.Designer.cs
@@ -0,0 +1,117 @@
1+
2+namespace UmaTest.App.Presentation.View
3+{
4+ partial class TokuRaceListView
5+ {
6+ /// <summary>
7+ /// Required designer variable.
8+ /// </summary>
9+ private System.ComponentModel.IContainer components = null;
10+
11+ /// <summary>
12+ /// Clean up any resources being used.
13+ /// </summary>
14+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
15+ protected override void Dispose(bool disposing)
16+ {
17+ if (disposing && (components != null))
18+ {
19+ components.Dispose();
20+ }
21+ base.Dispose(disposing);
22+ }
23+
24+ #region Windows Form Designer generated code
25+
26+ /// <summary>
27+ /// Required method for Designer support - do not modify
28+ /// the contents of this method with the code editor.
29+ /// </summary>
30+ private void InitializeComponent()
31+ {
32+ this.splitContainer1 = new System.Windows.Forms.SplitContainer();
33+ this.dataGridView1 = new System.Windows.Forms.DataGridView();
34+ this.btnCancel = new System.Windows.Forms.Button();
35+ this.btnSelect = new System.Windows.Forms.Button();
36+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
37+ this.splitContainer1.Panel1.SuspendLayout();
38+ this.splitContainer1.Panel2.SuspendLayout();
39+ this.splitContainer1.SuspendLayout();
40+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
41+ this.SuspendLayout();
42+ //
43+ // splitContainer1
44+ //
45+ this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
46+ this.splitContainer1.Location = new System.Drawing.Point(0, 0);
47+ this.splitContainer1.Name = "splitContainer1";
48+ this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
49+ //
50+ // splitContainer1.Panel1
51+ //
52+ this.splitContainer1.Panel1.Controls.Add(this.dataGridView1);
53+ //
54+ // splitContainer1.Panel2
55+ //
56+ this.splitContainer1.Panel2.Controls.Add(this.btnCancel);
57+ this.splitContainer1.Panel2.Controls.Add(this.btnSelect);
58+ this.splitContainer1.Size = new System.Drawing.Size(416, 455);
59+ this.splitContainer1.SplitterDistance = 425;
60+ this.splitContainer1.TabIndex = 0;
61+ //
62+ // dataGridView1
63+ //
64+ this.dataGridView1.AllowUserToAddRows = false;
65+ this.dataGridView1.AllowUserToDeleteRows = false;
66+ this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.ColumnHeader;
67+ this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
68+ this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
69+ this.dataGridView1.Location = new System.Drawing.Point(0, 0);
70+ this.dataGridView1.Name = "dataGridView1";
71+ this.dataGridView1.RowTemplate.Height = 21;
72+ this.dataGridView1.Size = new System.Drawing.Size(416, 425);
73+ this.dataGridView1.TabIndex = 0;
74+ //
75+ // btnCancel
76+ //
77+ this.btnCancel.Location = new System.Drawing.Point(258, -1);
78+ this.btnCancel.Name = "btnCancel";
79+ this.btnCancel.Size = new System.Drawing.Size(74, 25);
80+ this.btnCancel.TabIndex = 1;
81+ this.btnCancel.Text = "Cancel";
82+ this.btnCancel.UseVisualStyleBackColor = true;
83+ //
84+ // btnSelect
85+ //
86+ this.btnSelect.Location = new System.Drawing.Point(338, 0);
87+ this.btnSelect.Name = "btnSelect";
88+ this.btnSelect.Size = new System.Drawing.Size(75, 23);
89+ this.btnSelect.TabIndex = 0;
90+ this.btnSelect.Text = "Select";
91+ this.btnSelect.UseVisualStyleBackColor = true;
92+ //
93+ // TokuRaceListView
94+ //
95+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
96+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
97+ this.ClientSize = new System.Drawing.Size(416, 455);
98+ this.Controls.Add(this.splitContainer1);
99+ this.Name = "TokuRaceListView";
100+ this.Text = "TokuRaceListView";
101+ this.splitContainer1.Panel1.ResumeLayout(false);
102+ this.splitContainer1.Panel2.ResumeLayout(false);
103+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
104+ this.splitContainer1.ResumeLayout(false);
105+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
106+ this.ResumeLayout(false);
107+
108+ }
109+
110+ #endregion
111+
112+ private System.Windows.Forms.SplitContainer splitContainer1;
113+ private System.Windows.Forms.DataGridView dataGridView1;
114+ private System.Windows.Forms.Button btnCancel;
115+ private System.Windows.Forms.Button btnSelect;
116+ }
117+}
\ No newline at end of file
--- /dev/null
+++ b/App/Presentation/View/TokuRaceListView.cs
@@ -0,0 +1,130 @@
1+using System;
2+using System.Collections.Generic;
3+using System.ComponentModel;
4+using System.Data;
5+using System.Drawing;
6+using System.Linq;
7+using System.Text;
8+using System.Threading.Tasks;
9+using System.Windows.Forms;
10+using UmaTest.App.Adaptor.Gateway.ViewModel;
11+using UmaTest.Infra.Adaptor.Command;
12+using UmaTest.Infra.Presentation.View;
13+
14+namespace UmaTest.App.Presentation.View
15+{
16+ public partial class TokuRaceListView : Form, IChildWindow, IOwnerForm
17+ {
18+ private ITokuRaceListViewModel vm;
19+
20+ private BindingSource bindingSource1 = new BindingSource();
21+
22+ public TokuRaceListView(ITokuRaceListViewModel vm, ICommandManager cm)
23+ {
24+ InitializeComponent();
25+
26+ Bind(vm, cm);
27+
28+ this.vm = vm;
29+
30+ this.Visible = false;
31+ }
32+
33+ public void ShowChildWindow()
34+ {
35+ vm.CommandInitReadTokuRaceList.Execute();
36+
37+ this.CenterToParent();
38+ this.Show();
39+ }
40+
41+ public void HideChildWindow()
42+ {
43+ this.Hide();
44+ }
45+
46+ private void Bind(ITokuRaceListViewModel vm, ICommandManager cm)
47+ {
48+ // Subscribe VM PropertyChanged event
49+
50+ vm.PropertyChanged += new PropertyChangedEventHandler(OnViewModelChanged);
51+
52+ // Register UI EventHandler
53+
54+ this.dataGridView1.SelectionChanged += vm.EventSelectedRaceChanged;
55+
56+ //
57+ // Bind UI Commands
58+ //
59+
60+ ICommand commandHide = new DelegateCommand("Cancel", () => true, HideChildWindow);
61+
62+ cm.Bind(commandHide, btnCancel);
63+
64+ CompositeCommand commandRead = new CompositeCommand("Select");
65+
66+ commandRead.Add(vm.CommandExecuteReadTokuUmaRaceList);
67+ commandRead.Add(commandHide);
68+
69+ cm.Bind(commandRead, this.btnSelect);
70+
71+ //
72+ // Initialize DataGridView1
73+ //
74+
75+ bindingSource1.DataSource = vm.TokuRaceList;
76+
77+ dataGridView1.AutoGenerateColumns = false;
78+ dataGridView1.AutoSize = true;
79+ dataGridView1.DataSource = bindingSource1;
80+
81+ DataGridViewColumn[] grid1Cols = new DataGridViewColumn[]
82+ {
83+ new DataGridViewTextBoxColumn
84+ {
85+ DataPropertyName = "YearMonthDay",
86+ Name = "日付",
87+ },
88+ new DataGridViewTextBoxColumn
89+ {
90+ DataPropertyName = "RaceName",
91+ Name = "レース名",
92+ },
93+ new DataGridViewTextBoxColumn
94+ {
95+ DataPropertyName = "GradeName",
96+ Name = "グレード",
97+ },
98+ new DataGridViewTextBoxColumn
99+ {
100+ DataPropertyName = "Race.Kyori",
101+ Name = "距離",
102+ },
103+ };
104+
105+ grid1Cols.Do(col => col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter);
106+
107+ dataGridView1.Columns.AddRange(grid1Cols);
108+ }
109+
110+ private void OnViewModelChanged(object sender, EventArgs e)
111+ {
112+ PropertyChangedEventArgs args = e as PropertyChangedEventArgs;
113+
114+ switch (args.PropertyName)
115+ {
116+ case "TokuRaceList":
117+ dataGridView1.SuspendLayout();
118+ //dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None;
119+ dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
120+ bindingSource1.DataSource = vm.TokuRaceList;
121+ //dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
122+ dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
123+ dataGridView1.ResumeLayout();
124+ break;
125+ default:
126+ break;
127+ }
128+ }
129+ }
130+}
--- /dev/null
+++ b/App/Presentation/View/TokuRaceListView.resx
@@ -0,0 +1,120 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<root>
3+ <!--
4+ Microsoft ResX Schema
5+
6+ Version 2.0
7+
8+ The primary goals of this format is to allow a simple XML format
9+ that is mostly human readable. The generation and parsing of the
10+ various data types are done through the TypeConverter classes
11+ associated with the data types.
12+
13+ Example:
14+
15+ ... ado.net/XML headers & schema ...
16+ <resheader name="resmimetype">text/microsoft-resx</resheader>
17+ <resheader name="version">2.0</resheader>
18+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23+ <value>[base64 mime encoded serialized .NET Framework object]</value>
24+ </data>
25+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27+ <comment>This is a comment</comment>
28+ </data>
29+
30+ There are any number of "resheader" rows that contain simple
31+ name/value pairs.
32+
33+ Each data row contains a name, and value. The row also contains a
34+ type or mimetype. Type corresponds to a .NET class that support
35+ text/value conversion through the TypeConverter architecture.
36+ Classes that don't support this are serialized and stored with the
37+ mimetype set.
38+
39+ The mimetype is used for serialized objects, and tells the
40+ ResXResourceReader how to depersist the object. This is currently not
41+ extensible. For a given mimetype the value must be set accordingly:
42+
43+ Note - application/x-microsoft.net.object.binary.base64 is the format
44+ that the ResXResourceWriter will generate, however the reader can
45+ read any of the formats listed below.
46+
47+ mimetype: application/x-microsoft.net.object.binary.base64
48+ value : The object must be serialized with
49+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50+ : and then encoded with base64 encoding.
51+
52+ mimetype: application/x-microsoft.net.object.soap.base64
53+ value : The object must be serialized with
54+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55+ : and then encoded with base64 encoding.
56+
57+ mimetype: application/x-microsoft.net.object.bytearray.base64
58+ value : The object must be serialized into a byte array
59+ : using a System.ComponentModel.TypeConverter
60+ : and then encoded with base64 encoding.
61+ -->
62+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64+ <xsd:element name="root" msdata:IsDataSet="true">
65+ <xsd:complexType>
66+ <xsd:choice maxOccurs="unbounded">
67+ <xsd:element name="metadata">
68+ <xsd:complexType>
69+ <xsd:sequence>
70+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
71+ </xsd:sequence>
72+ <xsd:attribute name="name" use="required" type="xsd:string" />
73+ <xsd:attribute name="type" type="xsd:string" />
74+ <xsd:attribute name="mimetype" type="xsd:string" />
75+ <xsd:attribute ref="xml:space" />
76+ </xsd:complexType>
77+ </xsd:element>
78+ <xsd:element name="assembly">
79+ <xsd:complexType>
80+ <xsd:attribute name="alias" type="xsd:string" />
81+ <xsd:attribute name="name" type="xsd:string" />
82+ </xsd:complexType>
83+ </xsd:element>
84+ <xsd:element name="data">
85+ <xsd:complexType>
86+ <xsd:sequence>
87+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89+ </xsd:sequence>
90+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93+ <xsd:attribute ref="xml:space" />
94+ </xsd:complexType>
95+ </xsd:element>
96+ <xsd:element name="resheader">
97+ <xsd:complexType>
98+ <xsd:sequence>
99+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100+ </xsd:sequence>
101+ <xsd:attribute name="name" type="xsd:string" use="required" />
102+ </xsd:complexType>
103+ </xsd:element>
104+ </xsd:choice>
105+ </xsd:complexType>
106+ </xsd:element>
107+ </xsd:schema>
108+ <resheader name="resmimetype">
109+ <value>text/microsoft-resx</value>
110+ </resheader>
111+ <resheader name="version">
112+ <value>2.0</value>
113+ </resheader>
114+ <resheader name="reader">
115+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116+ </resheader>
117+ <resheader name="writer">
118+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119+ </resheader>
120+</root>
\ No newline at end of file
--- a/UmaTest.csproj
+++ b/UmaTest.csproj
@@ -103,10 +103,15 @@
103103 </ItemGroup>
104104 <ItemGroup>
105105 <Compile Include="App\Adaptor\Gateway\UI\IManualHorseListProxy.cs" />
106+ <Compile Include="App\Adaptor\Gateway\UI\TokuRaceListProxy.cs" />
107+ <Compile Include="App\Adaptor\Gateway\ViewModel\Dto\TokuRaceRowDto.cs" />
106108 <Compile Include="App\Adaptor\Gateway\ViewModel\Dto\ChakudosuuByGradeRowDto.cs" />
107109 <Compile Include="App\Adaptor\Gateway\ViewModel\Dto\UmaRaceRowDto.cs" />
108110 <Compile Include="App\Adaptor\Gateway\ViewModel\Dto\UmaSummaryRowDto.cs" />
111+ <Compile Include="App\Adaptor\Gateway\UI\ITokuRaceListProxy.cs" />
109112 <Compile Include="App\Adaptor\Gateway\ViewModel\IMainWindowViewModel.cs" />
113+ <Compile Include="App\Adaptor\Gateway\ViewModel\ITokuRaceListViewModel.cs" />
114+ <Compile Include="App\Adaptor\Gateway\ViewModel\TokuRaceListViewModel.cs" />
110115 <Compile Include="App\Adaptor\Presenter\IAsyncLoadHorseRaceSummaryPresenter.cs" />
111116 <Compile Include="App\Adaptor\Presenter\ILoadHorseRaceSummaryPresenter.cs" />
112117 <Compile Include="App\Adaptor\Presenter\AsyncLoadHorseRaceSummaryPresenter.cs" />
@@ -115,7 +120,17 @@
115120 <Compile Include="App\Adaptor\Gateway\UI\ManualHorseListProxy.cs" />
116121 <Compile Include="App\Domain\Model\Logic\IUmaLogic.cs" />
117122 <Compile Include="App\Domain\Model\Logic\IUmaRaceLogic.cs" />
123+ <Compile Include="App\Domain\UseCase\Request\AsyncLoadTokuUmaRaceListRequest.cs" />
124+ <Compile Include="App\Domain\UseCase\Request\AsyncLoadTokuRaceListRequest .cs" />
125+ <Compile Include="App\Domain\UseCase\Response\AsyncLoadTokuUmaRaceListResponse.cs" />
126+ <Compile Include="App\Domain\UseCase\Response\AsyncLoadTokuRaceListResponse.cs" />
118127 <Compile Include="App\Domain\UseCase\Response\AsyncLoadHorseRaceSummaryResponse.cs" />
128+ <Compile Include="App\Presentation\View\TokuRaceListView.cs">
129+ <SubType>Form</SubType>
130+ </Compile>
131+ <Compile Include="App\Presentation\View\TokuRaceListView.Designer.cs">
132+ <DependentUpon>TokuRaceListView.cs</DependentUpon>
133+ </Compile>
119134 <Compile Include="Infra\Adaptor\Gateway\UI\IStatusBarProxy.cs" />
120135 <Compile Include="Infra\Adaptor\Gateway\UI\StatusBarProxy.cs" />
121136 <Compile Include="Infra\Adaptor\Presenter\IAsyncPresenter.cs" />
@@ -220,6 +235,9 @@
220235 <EmbeddedResource Include="App\Presentation\View\ManualHorseListView.resx">
221236 <DependentUpon>ManualHorseListView.cs</DependentUpon>
222237 </EmbeddedResource>
238+ <EmbeddedResource Include="App\Presentation\View\TokuRaceListView.resx">
239+ <DependentUpon>TokuRaceListView.cs</DependentUpon>
240+ </EmbeddedResource>
223241 <EmbeddedResource Include="Properties\Resources.resx">
224242 <Generator>ResXFileCodeGenerator</Generator>
225243 <LastGenOutput>Resources.Designer.cs</LastGenOutput>