• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

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

なろうブックマーク分析用ツールのPrism+WPFサンプル実装


コミットメタ情報

リビジョンc1a816e7e1073c8765976dabc25b3f499e2d82b2 (tree)
日時2022-08-06 20:50:08
作者yoshy <yoshy.org.bitbucket@gz.j...>
コミッターyoshy

ログメッセージ

[ADD] ブックマーク詳細リストにサマリ列を追加

変更サマリ

差分

--- a/10Domain/Model/Entity/Child/BookmarkDetailListRow.cs
+++ b/10Domain/Model/Entity/Child/BookmarkDetailListRow.cs
@@ -9,6 +9,7 @@ namespace TestNarou.Domain.Model.Entity.Child
99 string NCode,
1010 ReactivePropertySlim<string> Title,
1111 ReactivePropertySlim<string> Writer,
12+ ReactivePropertySlim<string> Story,
1213 ReactivePropertySlim<int> GeneralAllNo,
1314 ReactivePropertySlim<int> Time,
1415 ReactivePropertySlim<int> IsStop,
@@ -34,6 +35,7 @@ namespace TestNarou.Domain.Model.Entity.Child
3435 NCode: null,
3536 Title: new(),
3637 Writer: new(),
38+ Story: new(),
3739 GeneralAllNo: new(),
3840 Time: new(),
3941 IsStop: new(),
@@ -54,6 +56,7 @@ namespace TestNarou.Domain.Model.Entity.Child
5456 {
5557 this.Title.AddTo(this.disposables);
5658 this.Writer.AddTo(this.disposables);
59+ this.Story.AddTo(this.disposables);
5760 this.GeneralAllNo.AddTo(this.disposables);
5861 this.Time.AddTo(this.disposables);
5962 this.IsStop.AddTo(this.disposables);
--- a/10Domain/Translator/BookmarkDetailListRowTranslator.cs
+++ b/10Domain/Translator/BookmarkDetailListRowTranslator.cs
@@ -29,6 +29,7 @@ namespace TestNarou.Domain.Translator
2929 .ForMember(d => d.NCode, opts => opts.MapFrom(s => s.NCode))
3030 .ForMember(d => d.Title, opts => opts.MapFrom(s => s.Title))
3131 .ForMember(d => d.Writer, opts => opts.MapFrom(s => s.Writer))
32+ .ForMember(d => d.Story, opts => opts.MapFrom(s => s.Story))
3233 .ForMember(d => d.GeneralAllNo, opts => opts.MapFrom(s => s.GeneralAllNo))
3334 .ForMember(d => d.Time, opts => opts.MapFrom(s => s.Time))
3435 .ForMember(d => d.IsStop, opts => opts.MapFrom(s => s.IsStop))
--- a/30Adaptor/Boundary/Gateway/ViewModel/Child/IBookmarkDetailListRowViewModel.cs
+++ b/30Adaptor/Boundary/Gateway/ViewModel/Child/IBookmarkDetailListRowViewModel.cs
@@ -6,6 +6,7 @@ namespace TestNarou.Adaptor.Boundary.Gateway.ViewModel.Child
66 public interface IBookmarkDetailListRowViewModel
77 {
88 string NCode { get; }
9+ ReadOnlyReactiveProperty<string> Summary { get; }
910 ReadOnlyReactiveProperty<string> Title { get; }
1011 ReadOnlyReactiveProperty<string> Writer { get; }
1112 ReadOnlyReactiveProperty<int> GeneralAllNo { get; }
--- a/30Adaptor/Boundary/Gateway/ViewModel/IBookmarkDetailListViewModel.cs
+++ b/30Adaptor/Boundary/Gateway/ViewModel/IBookmarkDetailListViewModel.cs
@@ -8,6 +8,8 @@ namespace TestNarou.Adaptor.Boundary.Gateway.ViewModel
88 {
99 public interface IBookmarkDetailListViewModel
1010 {
11+ public static readonly string SUMMARY_LABEL = "●";
12+
1113 internal const string CATEGORY_NO_KEY = "CATEGORY_NO";
1214
1315 internal static readonly Uri URI = new("BookmarkDetailListView", UriKind.Relative);
--- a/30Adaptor/Gateway/ViewModel/Child/BookmarkDetailListRowViewModel.cs
+++ b/30Adaptor/Gateway/ViewModel/Child/BookmarkDetailListRowViewModel.cs
@@ -11,6 +11,7 @@ namespace TestNarou.Adaptor.Gateway.ViewModel.Child
1111 : IBookmarkDetailListRowViewModel, IDisposable
1212 {
1313 public string NCode { get; private set; }
14+ public ReadOnlyReactiveProperty<string> Summary { get; private set; }
1415 public ReadOnlyReactiveProperty<string> Title { get; private set; }
1516 public ReadOnlyReactiveProperty<string> Writer { get; private set; }
1617 public ReadOnlyReactiveProperty<int> GeneralAllNo { get; private set; }
--- a/30Adaptor/Translator/BookmarkDetailListRowViewModelTranslator.cs
+++ b/30Adaptor/Translator/BookmarkDetailListRowViewModelTranslator.cs
@@ -35,6 +35,8 @@ namespace TestNarou.Adaptor.Translator
3535 mappingExpression
3636 .ForMember(d => d.NCode,
3737 opts => opts.MapFrom(s => s.NCode))
38+ .ForMember(d => d.Summary,
39+ opts => opts.MapFrom<SummaryResolver>())
3840 .ForMember(d => d.Title,
3941 opts => opts.MapFrom(s => s.Title
4042 .ToReadOnlyReactiveProperty(null, ReactivePropertyMode.Default, null, null)))
--- /dev/null
+++ b/30Adaptor/Translator/Converter/SummaryResolver.cs
@@ -0,0 +1,32 @@
1+using AutoMapper;
2+using Reactive.Bindings;
3+using System;
4+using System.Reactive.Linq;
5+using System.Text;
6+using TestNarou.Adaptor.Gateway.ViewModel.Child;
7+using TestNarou.Domain.Model.Entity.Child;
8+
9+namespace TestNarou.Adaptor.Translator.Converter
10+{
11+ internal class SummaryResolver
12+ : IValueResolver<BookmarkDetailListRow, BookmarkDetailListRowViewModel, ReadOnlyReactiveProperty<string>>
13+ {
14+ public ReadOnlyReactiveProperty<string> Resolve(
15+ BookmarkDetailListRow source, BookmarkDetailListRowViewModel destination,
16+ ReadOnlyReactiveProperty<string> destMember, ResolutionContext context)
17+ {
18+ return source.Title.CombineLatest(source.Story, (title, story) => Convert(title, story)).ToReadOnlyReactiveProperty();
19+ }
20+
21+ private static string Convert(string title, string story)
22+ {
23+ StringBuilder buf = new();
24+
25+ buf.AppendLine(title);
26+ buf.AppendLine();
27+ buf.Append(story);
28+
29+ return buf.ToString();
30+ }
31+ }
32+}
--- a/40OuterEdge/UI/View/BookmarkDetailListView.xaml
+++ b/40OuterEdge/UI/View/BookmarkDetailListView.xaml
@@ -44,20 +44,40 @@
4444 </DataGrid.CellStyle>
4545
4646 <DataGrid.Columns>
47+ <DataGridTextColumn Header="概" Width="10"
48+ Binding="{Binding Source={x:Static vm:IBookmarkDetailListViewModel.SUMMARY_LABEL}, Mode=OneWay}">
49+ <DataGridTextColumn.CellStyle>
50+ <Style TargetType="DataGridCell">
51+ <Setter Property="ToolTip" Value="{Binding Summary.Value}" />
52+ </Style>
53+ </DataGridTextColumn.CellStyle>
54+ </DataGridTextColumn>
4755 <DataGridTextColumn Header="タイトル" Width="300"
48- Binding="{Binding Title.Value}" />
56+ Binding="{Binding Title.Value}">
57+ <DataGridTextColumn.CellStyle>
58+ <Style TargetType="DataGridCell">
59+ <Setter Property="ToolTip" Value="{Binding Title.Value}" />
60+ </Style>
61+ </DataGridTextColumn.CellStyle>
62+ </DataGridTextColumn>
4963 <DataGridTextColumn Header="作者" Width="100"
50- Binding="{Binding Writer.Value}" />
64+ Binding="{Binding Writer.Value}">
65+ <DataGridTextColumn.CellStyle>
66+ <Style TargetType="DataGridCell">
67+ <Setter Property="ToolTip" Value="{Binding Writer.Value}" />
68+ </Style>
69+ </DataGridTextColumn.CellStyle>
70+ </DataGridTextColumn>
5171 <DataGridTextColumn Header="話数" Width="40"
52- Binding="{Binding GeneralAllNo.Value, StringFormat=\{0:N0\}}">
72+ Binding="{Binding GeneralAllNo.Value, StringFormat=\{0:N0\}}">
5373 <DataGridTextColumn.ElementStyle>
5474 <Style TargetType="{x:Type TextBlock}">
5575 <Setter Property="HorizontalAlignment" Value="Right" />
5676 </Style>
5777 </DataGridTextColumn.ElementStyle>
5878 </DataGridTextColumn>
59- <DataGridTextColumn Header="長さ[h]" Width="40"
60- Binding="{Binding Time.Value, StringFormat=\{0:N0\}}">
79+ <DataGridTextColumn Header="長さ[h]" Width="50"
80+ Binding="{Binding Time.Value, StringFormat=\{0:N0\}}">
6181 <DataGridTextColumn.ElementStyle>
6282 <Style TargetType="{x:Type TextBlock}">
6383 <Setter Property="HorizontalAlignment" Value="Right" />
@@ -65,7 +85,7 @@
6585 </DataGridTextColumn.ElementStyle>
6686 </DataGridTextColumn>
6787 <DataGridTextColumn Header="エタ" Width="25"
68- Binding="{Binding IsStop.Value}">
88+ Binding="{Binding IsStop.Value}">
6989 <DataGridTextColumn.ElementStyle>
7090 <Style TargetType="{x:Type TextBlock}">
7191 <Setter Property="HorizontalAlignment" Value="Right" />
@@ -73,7 +93,7 @@
7393 </DataGridTextColumn.ElementStyle>
7494 </DataGridTextColumn>
7595 <DataGridTextColumn Header="総合評価pt." Width="60"
76- Binding="{Binding GlobalPoint.Value, StringFormat=\{0:N0\}}">
96+ Binding="{Binding GlobalPoint.Value, StringFormat=\{0:N0\}}">
7797 <DataGridTextColumn.ElementStyle>
7898 <Style TargetType="{x:Type TextBlock}">
7999 <Setter Property="HorizontalAlignment" Value="Right" />
@@ -81,7 +101,7 @@
81101 </DataGridTextColumn.ElementStyle>
82102 </DataGridTextColumn>
83103 <DataGridTextColumn Header="評価/分" Width="50"
84- Binding="{Binding PointPerMin.Value, StringFormat=\{0:N0\}}">
104+ Binding="{Binding PointPerMin.Value, StringFormat=\{0:N0\}}">
85105 <DataGridTextColumn.ElementStyle>
86106 <Style TargetType="{x:Type TextBlock}">
87107 <Setter Property="HorizontalAlignment" Value="Right" />
@@ -89,7 +109,7 @@
89109 </DataGridTextColumn.ElementStyle>
90110 </DataGridTextColumn>
91111 <DataGridTextColumn Header="日間pt." Width="50"
92- Binding="{Binding DailyPoint.Value, StringFormat=\{0:N0\}}">
112+ Binding="{Binding DailyPoint.Value, StringFormat=\{0:N0\}}">
93113 <DataGridTextColumn.ElementStyle>
94114 <Style TargetType="{x:Type TextBlock}">
95115 <Setter Property="HorizontalAlignment" Value="Right" />
@@ -97,7 +117,7 @@
97117 </DataGridTextColumn.ElementStyle>
98118 </DataGridTextColumn>
99119 <DataGridTextColumn Header="週間pt." Width="50"
100- Binding="{Binding WeeklyPoint.Value, StringFormat=\{0:N0\}}">
120+ Binding="{Binding WeeklyPoint.Value, StringFormat=\{0:N0\}}">
101121 <DataGridTextColumn.ElementStyle>
102122 <Style TargetType="{x:Type TextBlock}">
103123 <Setter Property="HorizontalAlignment" Value="Right" />
@@ -105,7 +125,7 @@
105125 </DataGridTextColumn.ElementStyle>
106126 </DataGridTextColumn>
107127 <DataGridTextColumn Header="月間pt." Width="50"
108- Binding="{Binding MonthlyPoint.Value, StringFormat=\{0:N0\}}">
128+ Binding="{Binding MonthlyPoint.Value, StringFormat=\{0:N0\}}">
109129 <DataGridTextColumn.ElementStyle>
110130 <Style TargetType="{x:Type TextBlock}">
111131 <Setter Property="HorizontalAlignment" Value="Right" />
@@ -113,7 +133,7 @@
113133 </DataGridTextColumn.ElementStyle>
114134 </DataGridTextColumn>
115135 <DataGridTextColumn Header="四半期pt." Width="50"
116- Binding="{Binding QuarterPoint.Value, StringFormat=\{0:N0\}}">
136+ Binding="{Binding QuarterPoint.Value, StringFormat=\{0:N0\}}">
117137 <DataGridTextColumn.ElementStyle>
118138 <Style TargetType="{x:Type TextBlock}">
119139 <Setter Property="HorizontalAlignment" Value="Right" />
@@ -121,7 +141,7 @@
121141 </DataGridTextColumn.ElementStyle>
122142 </DataGridTextColumn>
123143 <DataGridTextColumn Header="年間pt." Width="50"
124- Binding="{Binding YearlyPoint.Value, StringFormat=\{0:N0\}}">
144+ Binding="{Binding YearlyPoint.Value, StringFormat=\{0:N0\}}">
125145 <DataGridTextColumn.ElementStyle>
126146 <Style TargetType="{x:Type TextBlock}">
127147 <Setter Property="HorizontalAlignment" Value="Right" />
@@ -129,7 +149,7 @@
129149 </DataGridTextColumn.ElementStyle>
130150 </DataGridTextColumn>
131151 <DataGridTextColumn Header="ブクマ数" Width="50"
132- Binding="{Binding FavNovelCnt.Value, StringFormat=\{0:N0\}}">
152+ Binding="{Binding FavNovelCnt.Value, StringFormat=\{0:N0\}}">
133153 <DataGridTextColumn.ElementStyle>
134154 <Style TargetType="{x:Type TextBlock}">
135155 <Setter Property="HorizontalAlignment" Value="Right" />
@@ -137,7 +157,7 @@
137157 </DataGridTextColumn.ElementStyle>
138158 </DataGridTextColumn>
139159 <DataGridTextColumn Header="感想数" Width="50"
140- Binding="{Binding ImpressionCnt.Value, StringFormat=\{0:N0\}}">
160+ Binding="{Binding ImpressionCnt.Value, StringFormat=\{0:N0\}}">
141161 <DataGridTextColumn.ElementStyle>
142162 <Style TargetType="{x:Type TextBlock}">
143163 <Setter Property="HorizontalAlignment" Value="Right" />
@@ -145,7 +165,7 @@
145165 </DataGridTextColumn.ElementStyle>
146166 </DataGridTextColumn>
147167 <DataGridTextColumn Header="レビュー数" Width="40"
148- Binding="{Binding ReviewCnt.Value, StringFormat=\{0:N0\}}">
168+ Binding="{Binding ReviewCnt.Value, StringFormat=\{0:N0\}}">
149169 <DataGridTextColumn.ElementStyle>
150170 <Style TargetType="{x:Type TextBlock}">
151171 <Setter Property="HorizontalAlignment" Value="Right" />
@@ -153,7 +173,7 @@
153173 </DataGridTextColumn.ElementStyle>
154174 </DataGridTextColumn>
155175 <DataGridTextColumn Header="評価pt." Width="60"
156- Binding="{Binding AllPoint.Value, StringFormat=\{0:N0\}}">
176+ Binding="{Binding AllPoint.Value, StringFormat=\{0:N0\}}">
157177 <DataGridTextColumn.ElementStyle>
158178 <Style TargetType="{x:Type TextBlock}">
159179 <Setter Property="HorizontalAlignment" Value="Right" />
@@ -161,7 +181,7 @@
161181 </DataGridTextColumn.ElementStyle>
162182 </DataGridTextColumn>
163183 <DataGridTextColumn Header="評価者数" Width="50"
164- Binding="{Binding AllHyokaCnt.Value, StringFormat=\{0:N0\}}">
184+ Binding="{Binding AllHyokaCnt.Value, StringFormat=\{0:N0\}}">
165185 <DataGridTextColumn.ElementStyle>
166186 <Style TargetType="{x:Type TextBlock}">
167187 <Setter Property="HorizontalAlignment" Value="Right" />
@@ -169,7 +189,7 @@
169189 </DataGridTextColumn.ElementStyle>
170190 </DataGridTextColumn>
171191 <DataGridTextColumn Header="最終更新" Width="120"
172- Binding="{Binding NovelUpdatedAt.Value}">
192+ Binding="{Binding NovelUpdatedAt.Value}">
173193 <DataGridTextColumn.ElementStyle>
174194 <Style TargetType="{x:Type TextBlock}">
175195 <Setter Property="HorizontalAlignment" Value="Right" />