-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
377 additions
and
231 deletions.
There are no files selected for viewing
53 changes: 0 additions & 53 deletions
53
client-generator-tests/App/Commands/CommandWithConnectedWindow.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
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using System; | ||
using client_generator.App.Windows.MenuWindowStates; | ||
using client_generator.Models; | ||
using logger; | ||
using Newtonsoft.Json; | ||
using Terminal.Gui; | ||
|
||
namespace client_generator.App.Commands | ||
{ | ||
public class CommandsProvider : ICommandsProvider | ||
{ | ||
|
||
private readonly AppController _appController; | ||
|
||
private readonly ILogger _logger; | ||
|
||
public CommandsProvider(AppController appController, ILogger logger) | ||
{ | ||
_appController = appController; | ||
_logger = logger; | ||
} | ||
|
||
public ICommand ExitCommand() | ||
{ | ||
return new ExitAppCommand(_appController); | ||
} | ||
|
||
public ICommand ChangeWindowCommand(Window to) | ||
{ | ||
return new ChangeWindowCommand(_appController, to); | ||
} | ||
|
||
public ICommand DeserializationCommand( | ||
FileSystemEntry file, | ||
JsonSerializerSettings deserializationSettings, | ||
Action<OpenApiModel> onDeserialization, | ||
Action<Exception> onError | ||
) | ||
{ | ||
return new DeserializationCommand(file, deserializationSettings, onDeserialization, onError); | ||
} | ||
|
||
public ICommand ShowPopupWindowCommand( | ||
PopupWindow popupWindow, | ||
Action<object> receiver, | ||
Window current | ||
) | ||
{ | ||
var returnCommand = ChangeWindowCommand(current); | ||
popupWindow.SetActionReceiver(o => | ||
{ | ||
receiver?.Invoke(o); | ||
returnCommand.Execute(); | ||
}); | ||
|
||
return ChangeWindowCommand(popupWindow); | ||
} | ||
|
||
public ICommand GeneratorCommand( | ||
OpenApiModel openApiModel, Action onSuccess, | ||
Action<Exception> onError | ||
) | ||
{ | ||
return new GenerateCommand(_appController, _logger, openApiModel, onSuccess, onError); | ||
} | ||
|
||
} | ||
} |
30 changes: 0 additions & 30 deletions
30
client-generator/App/Commands/EditGeneratorSettingsCommand.cs
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
client-generator/App/Commands/EditJsonDeserializationSettingsCommand.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
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,33 @@ | ||
using System; | ||
using client_generator.App.Windows.MenuWindowStates; | ||
using client_generator.Models; | ||
using Newtonsoft.Json; | ||
using Terminal.Gui; | ||
|
||
namespace client_generator.App.Commands | ||
{ | ||
public interface ICommandsProvider | ||
{ | ||
|
||
ICommand ExitCommand(); | ||
|
||
ICommand DeserializationCommand( | ||
FileSystemEntry file, | ||
JsonSerializerSettings deserializationSettings, | ||
Action<OpenApiModel> onDeserialization, | ||
Action<Exception> onError | ||
); | ||
|
||
ICommand ShowPopupWindowCommand( | ||
PopupWindow popupWindow, | ||
Action<object> receiver, | ||
Window current | ||
); | ||
|
||
ICommand GeneratorCommand( | ||
OpenApiModel openApiModel, Action onSuccess, | ||
Action<Exception> onError | ||
); | ||
|
||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.