• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

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

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


Commit MetaInfo

修訂2edbaf8e01cb89a40d001266c9df130abdb21ef9 (tree)
時間2022-08-07 12:48:06
作者yoshy <yoshy.org.bitbucket@gz.j...>
Commiteryoshy

Log Message

[UPD] ブックマーク詳細のサマリツールチップに作者名/ジャンル/キーワードの表示を追加

Change Summary

差異

--- a/10Domain/Model/Entity/Child/BookmarkDetailListRow.cs
+++ b/10Domain/Model/Entity/Child/BookmarkDetailListRow.cs
@@ -10,10 +10,20 @@ namespace TestNarou.Domain.Model.Entity.Child
1010 ReactivePropertySlim<string> Title,
1111 ReactivePropertySlim<string> Writer,
1212 ReactivePropertySlim<string> Story,
13+ ReactivePropertySlim<int> BigGenre,
14+ ReactivePropertySlim<int> Genre,
15+ ReactivePropertySlim<string> Keyword,
16+ ReactivePropertySlim<int> NovelType,
1317 ReactivePropertySlim<int> End,
1418 ReactivePropertySlim<int> GeneralAllNo,
1519 ReactivePropertySlim<int> Time,
1620 ReactivePropertySlim<int> IsStop,
21+ ReactivePropertySlim<int> IsR15,
22+ ReactivePropertySlim<int> IsBL,
23+ ReactivePropertySlim<int> IsGL,
24+ ReactivePropertySlim<int> IsZankoku,
25+ ReactivePropertySlim<int> IsTensei,
26+ ReactivePropertySlim<int> IsTenni,
1727 ReactivePropertySlim<int> GlobalPoint,
1828 ReactivePropertySlim<int> DailyPoint,
1929 ReactivePropertySlim<int> WeeklyPoint,
@@ -39,10 +49,20 @@ namespace TestNarou.Domain.Model.Entity.Child
3949 Title: new(),
4050 Writer: new(),
4151 Story: new(),
52+ BigGenre: new(),
53+ Genre: new(),
54+ Keyword: new(),
55+ NovelType: new(),
4256 End: new(),
4357 GeneralAllNo: new(),
4458 Time: new(),
4559 IsStop: new(),
60+ IsR15: new(),
61+ IsBL: new(),
62+ IsGL: new(),
63+ IsZankoku: new(),
64+ IsTensei: new(),
65+ IsTenni: new(),
4666 GlobalPoint: new(),
4767 DailyPoint: new(),
4868 WeeklyPoint: new(),
@@ -63,10 +83,19 @@ namespace TestNarou.Domain.Model.Entity.Child
6383 this.Title.AddTo(this.disposables);
6484 this.Writer.AddTo(this.disposables);
6585 this.Story.AddTo(this.disposables);
86+ this.BigGenre.AddTo(this.disposables);
87+ this.Genre.AddTo(this.disposables);
88+ this.Keyword.AddTo(this.disposables);
89+ this.NovelType.AddTo(this.disposables);
6690 this.End.AddTo(this.disposables);
6791 this.GeneralAllNo.AddTo(this.disposables);
6892 this.Time.AddTo(this.disposables);
6993 this.IsStop.AddTo(this.disposables);
94+ this.IsR15.AddTo(this.disposables);
95+ this.IsBL.AddTo(this.disposables);
96+ this.IsGL.AddTo(this.disposables);
97+ this.IsZankoku.AddTo(this.disposables);
98+ this.IsTensei.AddTo(this.disposables);
7099 this.GlobalPoint.AddTo(this.disposables);
71100 this.DailyPoint.AddTo(this.disposables);
72101 this.WeeklyPoint.AddTo(this.disposables);
--- a/10Domain/Translator/BookmarkDetailListRowTranslator.cs
+++ b/10Domain/Translator/BookmarkDetailListRowTranslator.cs
@@ -27,13 +27,23 @@ namespace TestNarou.Domain.Translator
2727 {
2828 mappingExpression
2929 .ForMember(d => d.NCode, opts => opts.MapFrom(s => s.NCode))
30- .ForMember(d => d.Title, opts => opts.MapFrom(s => s.Title))
30+ .ForMember(d => d.Title, opts => opts.MapFrom(s => s.Title.Trim()))
3131 .ForMember(d => d.Writer, opts => opts.MapFrom(s => s.Writer))
32- .ForMember(d => d.End, opts => opts.MapFrom(s => s.End))
3332 .ForMember(d => d.Story, opts => opts.MapFrom(s => s.Story))
33+ .ForMember(d => d.BigGenre, opts => opts.MapFrom(s => s.BigGenre))
34+ .ForMember(d => d.Genre, opts => opts.MapFrom(s => s.Genre))
35+ .ForMember(d => d.Keyword, opts => opts.MapFrom(s => s.Keyword))
36+ .ForMember(d => d.NovelType, opts => opts.MapFrom(s => s.NovelType))
37+ .ForMember(d => d.End, opts => opts.MapFrom(s => s.End))
3438 .ForMember(d => d.GeneralAllNo, opts => opts.MapFrom(s => s.GeneralAllNo))
3539 .ForMember(d => d.Time, opts => opts.MapFrom(s => s.Time))
3640 .ForMember(d => d.IsStop, opts => opts.MapFrom(s => s.IsStop))
41+ .ForMember(d => d.IsR15, opts => opts.MapFrom(s => s.IsR15))
42+ .ForMember(d => d.IsBL, opts => opts.MapFrom(s => s.IsBL))
43+ .ForMember(d => d.IsGL, opts => opts.MapFrom(s => s.IsGL))
44+ .ForMember(d => d.IsZankoku, opts => opts.MapFrom(s => s.IsZankoku))
45+ .ForMember(d => d.IsTensei, opts => opts.MapFrom(s => s.IsTensei))
46+ .ForMember(d => d.IsTenni, opts => opts.MapFrom(s => s.IsTenni))
3747 .ForMember(d => d.GlobalPoint, opts => opts.MapFrom(s => s.GlobalPoint))
3848 .ForMember(d => d.DailyPoint, opts => opts.MapFrom(s => s.DailyPoint))
3949 .ForMember(d => d.WeeklyPoint, opts => opts.MapFrom(s => s.WeeklyPoint))
--- a/30Adaptor/Translator/Converter/SummaryResolver.cs
+++ b/30Adaptor/Translator/Converter/SummaryResolver.cs
@@ -1,6 +1,6 @@
11 using AutoMapper;
22 using Reactive.Bindings;
3-using System;
3+using System.Collections.Generic;
44 using System.Reactive.Linq;
55 using System.Text;
66 using TestNarou.Adaptor.Gateway.ViewModel.Child;
@@ -15,14 +15,127 @@ namespace TestNarou.Adaptor.Translator.Converter
1515 BookmarkDetailListRow source, BookmarkDetailListRowViewModel destination,
1616 ReadOnlyReactiveProperty<string> destMember, ResolutionContext context)
1717 {
18- return source.Title.CombineLatest(source.Story, (title, story) => Convert(title, story)).ToReadOnlyReactiveProperty();
18+ return source.Title.CombineLatest(
19+ source.Writer,
20+ source.Story,
21+ source.BigGenre,
22+ source.Genre,
23+ source.Keyword,
24+ source.NovelType,
25+ source.IsR15,
26+ source.IsBL,
27+ source.IsGL,
28+ source.IsZankoku,
29+ source.IsTensei,
30+ source.IsTenni,
31+ (
32+ title,
33+ writer,
34+ story,
35+ bigGenre,
36+ genre,
37+ keyword,
38+ novelType,
39+ isR15,
40+ isBL,
41+ isGL,
42+ isZankoku,
43+ isTensei,
44+ isTenni
45+ ) => Convert(
46+ title,
47+ writer,
48+ story,
49+ bigGenre,
50+ genre,
51+ keyword,
52+ novelType,
53+ isR15,
54+ isBL,
55+ isGL,
56+ isZankoku,
57+ isTensei,
58+ isTenni
59+ )
60+ ).ToReadOnlyReactiveProperty();
1961 }
2062
21- private static string Convert(string title, string story)
63+ private static IDictionary<int, string> BigGenreMap => new Dictionary<int, string>()
64+ {
65+ { 1, "恋愛" },
66+ { 2, "ファンタジー" },
67+ { 3, "文芸" },
68+ { 4, "SF" },
69+ { 99, "その他" },
70+ { 98, "ノンジャンル" },
71+ };
72+
73+ private static IDictionary<int, string> GenreMap => new Dictionary<int, string>()
74+ {
75+ { 101, "異世界" },
76+ { 102, "現実世界" },
77+ { 201, "ハイファンタジー" },
78+ { 202, "ローファンタジー" },
79+ { 301, "純文学" },
80+ { 302, "ヒューマンドラマ" },
81+ { 303, "歴史" },
82+ { 304, "推理" },
83+ { 305, "ホラー" },
84+ { 306, "アクション" },
85+ { 307, "コメディー" },
86+ { 401, "VRゲーム" },
87+ { 402, "宇宙" },
88+ { 403, "空想科学" },
89+ { 404, "パニック" },
90+ { 9901, "童話" },
91+ { 9902, "詩" },
92+ { 9903, "エッセイ" },
93+ { 9904, "リプレイ" },
94+ { 9999, "その他" },
95+ { 9801, "ノンジャンル" },
96+ };
97+
98+ private static string Convert(
99+ string title,
100+ string writer,
101+ string story,
102+ int bigGenre,
103+ int genre,
104+ string keyword,
105+ int novelType,
106+ int isR15,
107+ int isBL,
108+ int isGL,
109+ int isZankoku,
110+ int isTensei,
111+ int isTenni
112+ )
22113 {
23114 StringBuilder buf = new();
24115
25- buf.AppendLine(title);
116+ buf.Append(title);
117+ buf.Append('(');
118+ buf.Append(novelType switch { 1 => "連載", 2 => "短編", _ => "不明" });
119+ buf.Append(':');
120+ buf.Append(BigGenreMap[bigGenre]);
121+ buf.Append('/');
122+ buf.Append(GenreMap[genre]);
123+ buf.Append(')');
124+ buf.AppendLine();
125+ buf.Append('/');
126+ buf.AppendLine(writer);
127+ buf.AppendLine();
128+ buf.Append("必須キーワード:");
129+ if (isR15 == 1) buf.Append("R15 ");
130+ if (isBL == 1) buf.Append("BL ");
131+ if (isGL == 1) buf.Append("GL ");
132+ if (isZankoku == 1) buf.Append("残酷 ");
133+ if (isTensei == 1) buf.Append("異世界転生 ");
134+ if (isTenni == 1) buf.Append("異世界転移 ");
135+ buf.AppendLine();
136+ buf.Append("キーワード:");
137+ buf.Append(keyword);
138+ buf.AppendLine();
26139 buf.AppendLine();
27140 buf.Append(story);
28141