Skip to content

Commit

Permalink
Merge pull request #42 from r-koubou/release/v0.5.3
Browse files Browse the repository at this point in the history
Release/v0.5.3
  • Loading branch information
r-koubou authored Oct 23, 2023
2 parents 27fab99 + 542c5b5 commit f922edc
Show file tree
Hide file tree
Showing 77 changed files with 440 additions and 1,159 deletions.
14 changes: 0 additions & 14 deletions KeySwitchManager/KeySwitchManager.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Interactors", "Sources\Runt
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Infrastructures", "Infrastructures", "{505E86DD-3A59-4038-B109-22B3678D035E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Database.LiteDB", "Sources\Runtime\Infrastructures\Database.LiteDB\Database.LiteDB.csproj", "{20749A6A-AD52-4545-B6B2-A921EC8CF850}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Storage.Json", "Sources\Runtime\Infrastructures\Storage.Json\Storage.Json.csproj", "{EAE5D07E-8455-4C33-BCD1-07EFF958E21B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Storage.Xml", "Sources\Runtime\Infrastructures\Storage.Xml\Storage.Xml.csproj", "{499CCE1B-A7D9-4EFA-B890-8785C137EF72}"
Expand All @@ -32,8 +30,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Domain", "Sources\Tests\Dom
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Infrastructures", "Infrastructures", "{B1FC3859-B078-471F-81F2-FBB0A25C974B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Database.LiteDB", "Sources\Tests\Infrastructures\Database.LiteDB\Database.LiteDB.csproj", "{87930720-147C-4DD4-89C8-F022A65BE461}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Storage.Xml", "Sources\Tests\Infrastructures\Storage.Xml\Storage.Xml.csproj", "{20F51031-CED4-48E2-BBC2-99239D4C3A68}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Storage.Yaml", "Sources\Runtime\Infrastructures\Storage.Yaml\Storage.Yaml.csproj", "{17FB1646-6A55-422B-AB7C-9AEB25126D03}"
Expand Down Expand Up @@ -74,10 +70,6 @@ Global
{8CAA9A5D-B054-42F7-8589-300866F8223A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8CAA9A5D-B054-42F7-8589-300866F8223A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8CAA9A5D-B054-42F7-8589-300866F8223A}.Release|Any CPU.Build.0 = Release|Any CPU
{20749A6A-AD52-4545-B6B2-A921EC8CF850}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20749A6A-AD52-4545-B6B2-A921EC8CF850}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20749A6A-AD52-4545-B6B2-A921EC8CF850}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20749A6A-AD52-4545-B6B2-A921EC8CF850}.Release|Any CPU.Build.0 = Release|Any CPU
{EAE5D07E-8455-4C33-BCD1-07EFF958E21B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EAE5D07E-8455-4C33-BCD1-07EFF958E21B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EAE5D07E-8455-4C33-BCD1-07EFF958E21B}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -106,10 +98,6 @@ Global
{D023CB3F-71C6-4925-9651-5FBA3BEF4404}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D023CB3F-71C6-4925-9651-5FBA3BEF4404}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D023CB3F-71C6-4925-9651-5FBA3BEF4404}.Release|Any CPU.Build.0 = Release|Any CPU
{87930720-147C-4DD4-89C8-F022A65BE461}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{87930720-147C-4DD4-89C8-F022A65BE461}.Debug|Any CPU.Build.0 = Debug|Any CPU
{87930720-147C-4DD4-89C8-F022A65BE461}.Release|Any CPU.ActiveCfg = Release|Any CPU
{87930720-147C-4DD4-89C8-F022A65BE461}.Release|Any CPU.Build.0 = Release|Any CPU
{20F51031-CED4-48E2-BBC2-99239D4C3A68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20F51031-CED4-48E2-BBC2-99239D4C3A68}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20F51031-CED4-48E2-BBC2-99239D4C3A68}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -136,14 +124,12 @@ Global
{D35DCF05-CE3B-4258-AF17-5D73C2A9EE86}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{20749A6A-AD52-4545-B6B2-A921EC8CF850} = {505E86DD-3A59-4038-B109-22B3678D035E}
{EAE5D07E-8455-4C33-BCD1-07EFF958E21B} = {505E86DD-3A59-4038-B109-22B3678D035E}
{499CCE1B-A7D9-4EFA-B890-8785C137EF72} = {505E86DD-3A59-4038-B109-22B3678D035E}
{1747E137-ABC6-4DE6-BE33-9C6B6335266F} = {505E86DD-3A59-4038-B109-22B3678D035E}
{62BED324-A809-4740-BB44-7D0ADC88B8E3} = {505E86DD-3A59-4038-B109-22B3678D035E}
{BA5C1A39-004B-45EC-8FB6-59DB7F80A305} = {505E86DD-3A59-4038-B109-22B3678D035E}
{01822D19-80DD-4979-BA62-FE10E4ACE5CA} = {DF635B48-6000-45EF-AA41-01E06BA4A254}
{87930720-147C-4DD4-89C8-F022A65BE461} = {B1FC3859-B078-471F-81F2-FBB0A25C974B}
{20F51031-CED4-48E2-BBC2-99239D4C3A68} = {B1FC3859-B078-471F-81F2-FBB0A25C974B}
{17FB1646-6A55-422B-AB7C-9AEB25126D03} = {505E86DD-3A59-4038-B109-22B3678D035E}
{A2D9D05E-00A1-456D-93DF-40CB784BB74A} = {B1FC3859-B078-471F-81F2-FBB0A25C974B}
Expand Down
2 changes: 2 additions & 0 deletions KeySwitchManager/Sources/Runtime/Applications/CLI/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Automatically generated during the build and publish process
./VERSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<RootNamespace>KeySwitchManager.Applications.CLI</RootNamespace>
<Company>R-Koubou</Company>
<Product>KeySwitchManager CLI Application</Product>
<Version>0.5.2</Version>
<Version>0.5.3</Version>
<Description>KeySwitchManager CLI Application</Description>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class New : ICommand
[Verb( "new", HelpText = "export a template file" )]
public class CommandOption : ICommandOption
{
[Value( index: 0, MetaName = "output", HelpText = "Output path for template file (*.yaml or *.xlsx or *.db)", Default = "(ProductName).yaml" )]
[Value( index: 0, MetaName = "output", HelpText = "Output path for template file (*.yaml or *.xlsx)", Default = "(ProductName).yaml" )]
public string OutputPath { get; set; } = string.Empty;
}

Expand Down
10 changes: 0 additions & 10 deletions KeySwitchManager/Sources/Runtime/Applications/CLI/VERSION.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

<ItemGroup>
<ProjectReference Include="..\..\Commons\Commons.csproj" />
<ProjectReference Include="..\..\Infrastructures\Database.LiteDB\Database.LiteDB.csproj" />
<ProjectReference Include="..\..\Infrastructures\Storage.Json\Storage.Json.csproj" />
<ProjectReference Include="..\..\Infrastructures\Storage.Spreadsheet.ClosedXml\Storage.Spreadsheet.ClosedXml.csproj" />
<ProjectReference Include="..\..\Infrastructures\Storage.Xml\Storage.Xml.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,31 @@ namespace KeySwitchManager.Applications.Core.Controllers
public static class ControlExecutor
{
public static void Execute( Func<IController> controllerFactory, ILogTextView logTextView )
=> ExecuteAsync( controllerFactory, logTextView ).GetAwaiter().GetResult();

public static async Task ExecuteAsync( Func<IController> controllerFactory, ILogTextView logTextView )
{
try
{
using var controller = controllerFactory.Invoke();
ExecuteImpl( controller, logTextView );
await ExecuteImplAsync( controller, logTextView );
}
catch( Exception exception )
{
logTextView.Append( exception.ToString() );
}
}

private static void ExecuteImpl( IController controller, ILogTextView logTextView )
private static async Task ExecuteImplAsync( IController controller, ILogTextView logTextView )
{
try
{
controller.Execute();
await controller.ExecuteAsync();
}
catch( Exception e )
{
logTextView.Append( e.ToString() );
}
}

public static async Task ExecuteAsync( Func<IController> controllerFactory, ILogTextView logTextView )
{
await Task.Run( () => {
Execute( controllerFactory, logTextView );
} );
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using KeySwitchManager.Applications.Core.Views.LogView;
using KeySwitchManager.Commons.Data;
using KeySwitchManager.Domain.KeySwitches.Models;
using KeySwitchManager.Infrastructures.Database.LiteDB.KeySwitches;
using KeySwitchManager.Infrastructures.Storage.Spreadsheet.ClosedXml.KeySwitches;
using KeySwitchManager.Infrastructures.Storage.Yaml.KeySwitches;

Expand All @@ -26,11 +25,6 @@ public static IController Create( string outputFilePath, ILogTextView logTextVie
return CreateImpl( outputFilePath, logTextView, ( stream ) => new YamlKeySwitchWriter( stream ) );
}

if( path.EndsWith( ".db" ) )
{
return CreateImpl( logTextView, new LiteDbFileWriter( new FilePath( outputFilePath ) ) );
}

throw new ArgumentException( $"{outputFilePath} is unknown file format" );
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using KeySwitchManager.Domain.KeySwitches.Models;
using System.Threading.Tasks;

using KeySwitchManager.Domain.KeySwitches.Models;
using KeySwitchManager.Interactors.KeySwitches;
using KeySwitchManager.UseCase.KeySwitches.Create;

Expand Down Expand Up @@ -27,10 +29,10 @@ public void Dispose()
}
}

public void Execute()
async Task IController.ExecuteAsync()
{
var interactor = new CreateFileInteractor( Presenter );
var response = interactor.Execute( new CreateFileRequest( Writer ) );
ICreateFileUseCase interactor = new CreateFileInteractor( Presenter );
var response = await interactor.ExecuteAsync( new CreateFileRequest( Writer ) );
Presenter.Complete( response );
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using KeySwitchManager.Domain.KeySwitches.Models;
using System.Threading.Tasks;

using KeySwitchManager.Domain.KeySwitches.Models;
using KeySwitchManager.Interactors.KeySwitches;
using KeySwitchManager.UseCase.KeySwitches.Delete;

Expand Down Expand Up @@ -41,11 +43,11 @@ public void Dispose()
}
}

public void Execute()
async Task IController.ExecuteAsync()
{
var interactor = new DeleteInteractor( DatabaseRepository, Presenter );
IDeleteUseCase interactor = new DeleteInteractor( DatabaseRepository, Presenter );
var request = new DeleteRequest( DeveloperName, ProductName, InstrumentName );
var response = interactor.Execute( request );
var response = await interactor.ExecuteAsync( request );

if( response.RemovedCount > 0 )
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using KeySwitchManager.Domain.KeySwitches.Models;
using System.Threading.Tasks;

using KeySwitchManager.Domain.KeySwitches.Models;
using KeySwitchManager.Interactors.KeySwitches;
using KeySwitchManager.UseCase.KeySwitches.Dump;

Expand Down Expand Up @@ -32,15 +34,15 @@ public void Dispose()
}
}

public void Execute()
async Task IController.ExecuteAsync()
{
var interactor = new DumpFileInteractor(
IDumpFileUseCase interactor = new DumpFileInteractor(
SourceRepository,
Writer,
Presenter
);

var response = interactor.Execute( new DumpFileRequest() );
var response = await interactor.ExecuteAsync( new DumpFileRequest() );
Presenter.Complete( response );
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Reactive.Subjects;
using System.Threading.Tasks;

using KeySwitchManager.Domain.KeySwitches.Models;
using KeySwitchManager.Domain.KeySwitches.Models.Values;
Expand Down Expand Up @@ -53,15 +54,15 @@ public void Dispose()
}
}

public void Execute()
async Task IController.ExecuteAsync()
{
var interactor = new ExportFileInteractor(
IExportFileUseCase interactor = new ExportFileInteractor(
SourceRepository,
Writer,
Presenter
);

var response = interactor.Execute(
var response = await interactor.ExecuteAsync(
new ExportFileRequest(
DeveloperName.Value,
ProductName.Value,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using KeySwitchManager.Domain.KeySwitches.Models;
using System.Threading.Tasks;

using KeySwitchManager.Domain.KeySwitches.Models;
using KeySwitchManager.Interactors.KeySwitches;
using KeySwitchManager.UseCase.KeySwitches.Find;

Expand Down Expand Up @@ -41,11 +43,11 @@ public void Dispose()
}
}

public void Execute()
async Task IController.ExecuteAsync()
{
var interactor = new FindInteractor( DatabaseRepository, Presenter );
IFindUseCase interactor = new FindInteractor( DatabaseRepository, Presenter );
var request = new FindRequest( DeveloperName, ProductName, InstrumentName );
var response = interactor.Execute( request );
var response = await interactor.ExecuteAsync( request );

Presenter.Complete( response );
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
using System;
using System.Threading.Tasks;

namespace KeySwitchManager.Applications.Core.Controllers
{
public interface IController : IDisposable
{
void Execute();
void Execute()
=> ExecuteAsync().GetAwaiter().GetResult();

Task ExecuteAsync();
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Threading.Tasks;

using KeySwitchManager.Domain.KeySwitches.Models;
using KeySwitchManager.Interactors.KeySwitches;
Expand Down Expand Up @@ -49,13 +50,13 @@ public void Dispose()
}
}

public void Execute()
async Task IController.ExecuteAsync()
{
var keySwitches = KeySwitchReader.Read();
var interactor = new ImportFileInteractor( DatabaseRepository, Presenter );
IImportFileUseCase interactor = new ImportFileInteractor( DatabaseRepository, Presenter );
var request = new ImportFileRequest( keySwitches );
var response = interactor.Execute( request );
DatabaseRepository.Flush();
var response = await interactor.ExecuteAsync( request );
await DatabaseRepository.FlushAsync();
Presenter.Complete( response );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

using KeySwitchManager.Commons.Data;
using KeySwitchManager.Domain.KeySwitches.Models;
using KeySwitchManager.Infrastructures.Database.LiteDB.KeySwitches;
using KeySwitchManager.Infrastructures.Storage.Yaml.KeySwitches;

namespace KeySwitchManager.Applications.Core.Helpers
Expand All @@ -13,11 +12,6 @@ public static IKeySwitchRepository CreateFileRepository(string filePath)
{
var path = filePath.ToLower();

if( path.EndsWith( ".db" ) )
{
return new LiteDbRepository( new FilePath( filePath ) );
}

if( path.EndsWith( ".yaml" ) || path.EndsWith( ".yml" ) )
{
return new YamlRepository( new FilePath( filePath ) );
Expand Down
2 changes: 2 additions & 0 deletions KeySwitchManager/Sources/Runtime/Applications/WPF/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Automatically generated during the build and publish process
./VERSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
<TargetFramework>net7.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<AssemblyName>KeySwitchManager</AssemblyName>
<RootNamespace>KeySwitchManager.Applications.WPF</RootNamespace>
<Product>KeySwitchManager WPF Application</Product>
<Description>KeySwitchManager WPF Application</Description>
<Version>0.5.2</Version>
<Version>0.5.3</Version>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand All @@ -21,7 +22,6 @@

<ItemGroup>
<PackageReference Include="Microsoft-WindowsAPICodePack-Shell" Version="1.1.4" />
<PackageReference Include="RkHelper" Version="0.0.8" />
<PackageReference Include="YamlDotNet" Version="11.2.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Application x:Class="KeySwitchManager.WPF.App"
<Application x:Class="KeySwitchManager.Applications.WPF.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Sources/MainWindow.xaml">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace KeySwitchManager.WPF
namespace KeySwitchManager.Applications.WPF
{
/// <summary>
/// Interaction logic for App.xaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

using YamlDotNet.Serialization;

namespace KeySwitchManager.WPF
namespace KeySwitchManager.Applications.WPF
{
public class ApplicationConfigModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Window x:Class="KeySwitchManager.WPF.MainWindow"
<Window x:Class="KeySwitchManager.Applications.WPF.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
Expand Down
Loading

0 comments on commit f922edc

Please sign in to comment.