Skip to content

Commit a206ee7

Browse files
committed
DIもSourceGeneratorで
1 parent 1563018 commit a206ee7

File tree

54 files changed

+65
-118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+65
-118
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "R3.JsonConfig"]
22
path = R3.JsonConfig
33
url = https://github.com/xm-i/R3.JsonConfig.git
4+
[submodule "AutoDiAttributes"]
5+
path = AutoDiAttributes
6+
url = https://github.com/xm-i/AutoDiAttributes

AutoDiAttributes

Submodule AutoDiAttributes added at 7e6f094
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
global using AutoDiAttributes;

RemoteLogViewer.Composition/RemoteLogViewer.Composition.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
<Nullable>enable</Nullable>
66
</PropertyGroup>
77
<ItemGroup>
8+
<ProjectReference Include="..\AutoDiAttributes\AutoDiAttributes\AutoDiAttributes.csproj" />
9+
<ProjectReference Include="..\AutoDiAttributes\AutoDiAttributes.Generator\AutoDiAttributes.Generator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
810
<ProjectReference Include="..\R3.JsonConfig\R3.JsonConfig\R3.JsonConfig.csproj" />
911
<ProjectReference Include="..\R3.JsonConfig\R3.JsonConfig.Generators\R3.JsonConfig.Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
1012
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0" />

RemoteLogViewer.Composition/Stores/Settings/AdvancedSettingsModel.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
using R3;
44
using R3.JsonConfig.Attributes;
55

6-
using RemoteLogViewer.Composition.Utils.Attributes;
7-
86
namespace RemoteLogViewer.Composition.Stores.Settings;
97

108
/// <summary>Advanced設定。</summary>
11-
[AddSingleton]
9+
[Inject(InjectServiceLifetime.Singleton)]
1210
[GenerateR3JsonConfigDto]
1311
public class AdvancedSettingsModel(IServiceProvider service) {
1412
public IServiceProvider ScopedService { get; } = service;

RemoteLogViewer.Composition/Stores/Settings/HighlightConditionModel.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
using R3;
44
using R3.JsonConfig.Attributes;
55

6-
using RemoteLogViewer.Composition.Utils.Attributes;
76
using RemoteLogViewer.Composition.Utils.Objects;
87

98
namespace RemoteLogViewer.Composition.Stores.Settings;
109

1110
/// <summary>ハイライト条件。</summary>
12-
[AddScoped]
11+
[Inject(InjectServiceLifetime.Scoped)]
1312
[GenerateR3JsonConfigDto]
1413
public class HighlightConditionModel(IServiceProvider service) {
1514
public IServiceProvider ScopedService { get; } = service;

RemoteLogViewer.Composition/Stores/Settings/HighlightRuleModel.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
using R3;
88
using R3.JsonConfig.Attributes;
99

10-
using RemoteLogViewer.Composition.Utils.Attributes;
11-
1210
namespace RemoteLogViewer.Composition.Stores.Settings;
1311

1412
/// <summary>ハイライトルール</summary>
15-
[AddScoped]
13+
[Inject(InjectServiceLifetime.Scoped)]
1614
[GenerateR3JsonConfigDto]
1715
public class HighlightRuleModel(IServiceProvider service) {
1816
public IServiceProvider ScopedService {

RemoteLogViewer.Composition/Stores/Settings/HighlightSettingsModel.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66

77
using R3.JsonConfig.Attributes;
88

9-
using RemoteLogViewer.Composition.Utils.Attributes;
10-
119
namespace RemoteLogViewer.Composition.Stores.Settings;
1210

1311
/// <summary>ハイライト設定。</summary>
14-
[AddSingleton]
12+
[Inject(InjectServiceLifetime.Singleton)]
1513
[GenerateR3JsonConfigDto]
1614
public class HighlightSettingsModel(IServiceProvider service) {
1715
public IServiceProvider ScopedService { get; } = service;

RemoteLogViewer.Composition/Stores/Settings/SettingsModel.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
using R3.JsonConfig.Attributes;
22

3-
using RemoteLogViewer.Composition.Utils.Attributes;
4-
53
namespace RemoteLogViewer.Composition.Stores.Settings;
64

75
/// <summary>
86
/// アプリケーション設定全体モデル。カテゴリ毎の設定を保持します。
97
/// </summary>
10-
[AddSingleton]
8+
[Inject(InjectServiceLifetime.Singleton)]
119
[GenerateR3JsonConfigDto]
1210
public class SettingsModel(HighlightSettingsModel highlightSettingModel, TextViewerSettingsModel textViewerSettingsModel, AdvancedSettingsModel advancedSettingsModel) {
1311
/// <summary>ハイライト設定。</summary>

RemoteLogViewer.Composition/Stores/Settings/TextViewerSettingsModel.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
using R3;
44
using R3.JsonConfig.Attributes;
55

6-
using RemoteLogViewer.Composition.Utils.Attributes;
7-
86
namespace RemoteLogViewer.Composition.Stores.Settings;
97

108
/// <summary>TextViewer設定。</summary>
11-
[AddSingleton]
9+
[Inject(InjectServiceLifetime.Singleton)]
1210
[GenerateR3JsonConfigDto]
1311
public class TextViewerSettingsModel(IServiceProvider service) {
1412
public IServiceProvider ScopedService { get; } = service;

0 commit comments

Comments
 (0)