-
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 #69 from r-koubou/refactor/usecase_export
Refactor/usecase export
- Loading branch information
Showing
19 changed files
with
207 additions
and
189 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
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
...er/Sources/Runtime/Applications/Standalone.Core/Controllers/Export/ExportFilePresenter.cs
This file was deleted.
Oops, something went wrong.
45 changes: 45 additions & 0 deletions
45
...tchManager/Sources/Runtime/Applications/Standalone.Core/Presenters/ExportFilePresenter.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,45 @@ | ||
using System.Linq; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
using KeySwitchManager.Applications.Standalone.Core.Views.LogView; | ||
using KeySwitchManager.Domain.KeySwitches.Models; | ||
using KeySwitchManager.UseCase.KeySwitches.Export; | ||
|
||
namespace KeySwitchManager.Applications.Standalone.Core.Presenters | ||
{ | ||
public class ExportPresenter : IExportPresenter | ||
{ | ||
private ILogTextView TextView { get; } | ||
|
||
public ExportPresenter( ILogTextView textView ) | ||
{ | ||
TextView = textView; | ||
} | ||
|
||
public async Task HandleAsync( ExportOutputData outputData, CancellationToken cancellationToken = default ) | ||
{ | ||
var keySwitches = outputData.Value.Result; | ||
var count = outputData.Value.WrittenCount; | ||
|
||
var developerName = outputData.Value.Input.DeveloperName; | ||
var productName = outputData.Value.Input.ProductName; | ||
var instrumentName = outputData.Value.Input.InstrumentName; | ||
|
||
if( !keySwitches.Any() ) | ||
{ | ||
TextView.Append( $"No keyswitch(es) found. ({nameof( developerName )}={developerName}, {nameof( productName )}={productName}, {nameof( instrumentName )}={instrumentName})" ); | ||
} | ||
|
||
TextView.Append( $"{count} exported" ); | ||
|
||
await Task.CompletedTask; | ||
} | ||
|
||
public async Task HandleExportedAsync( KeySwitch exported, CancellationToken cancellationToken = default ) | ||
{ | ||
TextView.Append( $"Exported: {exported}" ); | ||
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
20 changes: 19 additions & 1 deletion
20
...Runtime/Applications/Xamarin.Mac/.idea/.idea.Applications.Xamarin.Mac/.idea/workspace.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
78 changes: 0 additions & 78 deletions
78
KeySwitchManager/Sources/Runtime/Interactors/KeySwitches/ExportFileInteractor.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.