-
-
Notifications
You must be signed in to change notification settings - Fork 448
Introduce Dependency Injection for Better Development Experience #3175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 36 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
20ffff6
Use api to call api functions
Jack251970 8b91050
Add IApp & AppExtensions for accessing the properties & functions fro…
Jack251970 88e8437
Use api in app extensions to call api functions
Jack251970 2716c40
Move MessageBoxEx to main project for better development experience
Jack251970 32cac76
Improve Settings management
Jack251970 1b76a2b
Use dependency injection for all services
Jack251970 a748141
Use IPublicAPI instead
Jack251970 3cb9d1d
Remove IApp & AppExtensions and use dependency injection instead
Jack251970 2a423f0
Improve code quality
Jack251970 ff110b3
Fix test project build issue
Jack251970 c3f71c2
Revert "Fix test project build issue"
Jack251970 3bebb69
Fix unitest build issue
Jack251970 8d83849
Improve dependency injection in updater & settings view model & setti…
Jack251970 cdc5f0e
Merge branch 'dev' into dev4
Jack251970 ed39937
Initialize App.API earlier & Improve code quality
Jack251970 8b290a6
Merge branch 'dev' into dev4
Jack251970 f9983b5
Move dependency injection codes to constructor
Jack251970 bb25774
Merge branch 'dev' into dev4
Jack251970 23a1e5b
Initialize public api instance in constructor so that we can use App.…
Jack251970 ed16d34
Improve code quality
Jack251970 6a2389f
Fix test project build issue
Jack251970 25684a9
Merge branch 'dev' into dev4
Jack251970 23f6342
Merge branch 'dev' into dev4
Jack251970 8b6dcd0
Merge branch 'dev' into dev4
Jack251970 cdf02d5
Resolve conflicts
Jack251970 c072012
Fix parameter name issue.
Jack251970 39d7187
Use constructor injection for updater
Jack251970 39d34b1
Add circular dependency comments
Jack251970 e022ad6
Remove instance for StringMatcher
Jack251970 a3964f5
Remove instance for Internationalization & Theme
Jack251970 d4f9099
Improve constructor injection for updater
Jack251970 e989b5a
Add instance obsolete message
Jack251970 8496cfc
Use Ioc.Default in initialize function
Jack251970 ad63b0e
Improve code quality for field names
Jack251970 f5f0986
remove some usage of Ioc.GetRequiredService when injection is possible.
taooceros ef68ccb
Fix unit test issue
Jack251970 91490c0
Remove usage of _settingsVM._settings and make _settings private
Jack251970 16798a0
use constructor injection for PublicAPIInstance.cs
taooceros File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 7 additions & 21 deletions
28
Flow.Launcher.Core/Resource/InternationalizationManager.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,12 @@ | ||
namespace Flow.Launcher.Core.Resource | ||
using System; | ||
using CommunityToolkit.Mvvm.DependencyInjection; | ||
|
||
namespace Flow.Launcher.Core.Resource | ||
{ | ||
[Obsolete("InternationalizationManager.Instance is obsolete. Use Ioc.Default.GetRequiredService<Internationalization>() instead.")] | ||
public static class InternationalizationManager | ||
{ | ||
private static Internationalization instance; | ||
private static object syncObject = new object(); | ||
|
||
public static Internationalization Instance | ||
{ | ||
get | ||
{ | ||
if (instance == null) | ||
{ | ||
lock (syncObject) | ||
{ | ||
if (instance == null) | ||
{ | ||
instance = new Internationalization(); | ||
} | ||
} | ||
} | ||
return instance; | ||
} | ||
} | ||
=> Ioc.Default.GetRequiredService<Internationalization>(); | ||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.