-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from r-koubou/refactor/usecase_create
Refactor/usecase create
- Loading branch information
Showing
36 changed files
with
298 additions
and
165 deletions.
There are no files selected for viewing
This file contains 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
1 change: 0 additions & 1 deletion
1
KeySwitchManager/Sources/Runtime/Applications/Blazor/Pages/FetchData.razor
This file contains 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
5 changes: 3 additions & 2 deletions
5
KeySwitchManager/Sources/Runtime/Applications/Blazor/Program.cs
This file contains 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 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,2 +1,2 @@ | ||
# Automatically generated during the build and publish process | ||
./VERSION.md | ||
/VERSION.md |
This file contains 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 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 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: 0 additions & 28 deletions
28
...anager/Sources/Runtime/Applications/Standalone.Core/Controllers/Create/CreatePresenter.cs
This file was deleted.
Oops, something went wrong.
This file contains 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
48 changes: 48 additions & 0 deletions
48
KeySwitchManager/Sources/Runtime/Applications/Standalone.Core/Presenters/CreatePresenter.cs
This file contains 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
using KeySwitchManager.Applications.Standalone.Core.Views.LogView; | ||
using KeySwitchManager.UseCase.Commons; | ||
using KeySwitchManager.UseCase.KeySwitches.Create; | ||
|
||
namespace KeySwitchManager.Applications.Standalone.Core.Presenters | ||
{ | ||
public sealed class CreatePresenter : IOutputPort<CreateOutputData> | ||
{ | ||
public static readonly IOutputPort<CreateOutputData> Null = new NullImpl(); | ||
|
||
private ILogTextView TextView { get; } | ||
|
||
public CreatePresenter( ILogTextView textView ) | ||
{ | ||
TextView = textView; | ||
} | ||
|
||
public async Task HandleAsync( CreateOutputData outputData, CancellationToken cancellationToken = default ) | ||
{ | ||
if( outputData.Result ) | ||
{ | ||
TextView.Append( $"Created : {outputData.Value}" ); | ||
} | ||
else | ||
{ | ||
TextView.Append( "Failed to create." ); | ||
|
||
if( outputData.Error?.StackTrace != null ) | ||
{ | ||
TextView.Append( outputData.Error.StackTrace ); | ||
} | ||
} | ||
|
||
await Task.CompletedTask; | ||
} | ||
|
||
private class NullImpl : IOutputPort<CreateOutputData> | ||
{ | ||
public async Task HandleAsync( CreateOutputData outputData, CancellationToken cancellationToken = default ) | ||
{ | ||
await Task.CompletedTask; | ||
} | ||
} | ||
} | ||
} |
This file contains 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
17 changes: 0 additions & 17 deletions
17
KeySwitchManager/Sources/Runtime/Applications/Standalone.Core/Views/LogView/LogViewModel.cs
This file was deleted.
Oops, something went wrong.
This file contains 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,2 +1,2 @@ | ||
# Automatically generated during the build and publish process | ||
./VERSION.md | ||
/VERSION.md |
This file contains 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
2 changes: 1 addition & 1 deletion
2
KeySwitchManager/Sources/Runtime/Applications/Xamarin.Mac/.gitignore
This file contains 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,2 +1,2 @@ | ||
# Automatically generated during the build and publish process | ||
./VERSION.md | ||
/VERSION.md |
Oops, something went wrong.