aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/Console/DefaultConsoleEngineService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/Console/DefaultConsoleEngineService.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Console/DefaultConsoleEngineService.cs26
1 files changed, 21 insertions, 5 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Console/DefaultConsoleEngineService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Console/DefaultConsoleEngineService.cs
index 42228614e..4a9ee468a 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Console/DefaultConsoleEngineService.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Console/DefaultConsoleEngineService.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Console;
+using Tango.Console.Network;
using Tango.Core.DI;
using Tango.Integration.ExternalBridge;
using Tango.PPC.Common.ExternalBridge;
@@ -21,16 +22,31 @@ namespace Tango.PPC.Common.Console
externalBridge.RegisterRequestHandler(this);
}
- [ExternalBridgeRequestHandlerMethod(typeof(ConsoleCommandDTO))]
- public async void OnConsoleCommandReceived(ConsoleCommandDTO command, String token, ITransporter transporter)
+ [ExternalBridgeRequestHandlerMethod(typeof(GetCurrentDirectoryRequest))]
+ public async void OnGetCurrentDirectoryRequest(GetCurrentDirectoryRequest request, String token, ITransporter transporter)
+ {
+ await transporter.SendGenericResponse(new GetCurrentDirectoryResponse()
+ {
+ CurrentDirectory = Environment.CurrentDirectory,
+ Suggestions = ConsoleExecutionEngine.GetSuggestions(Environment.CurrentDirectory)
+ }, token);
+ }
+
+ [ExternalBridgeRequestHandlerMethod(typeof(ConsoleCommandRequest))]
+ public async void OnConsoleCommandRequest(ConsoleCommandRequest request, String token, ITransporter transporter)
{
if (Enabled)
{
try
{
ConsoleExecutionEngine engine = new ConsoleExecutionEngine();
- var result = await engine.Execute(command);
- await transporter.SendGenericResponse<ConsoleCommandExecutionResult>(result, token, new TransportResponseConfig()
+ var result = await engine.Execute(request);
+ await transporter.SendGenericResponse<ConsoleCommandResponse>(new ConsoleCommandResponse()
+ {
+ Output = result.Output,
+ Suggestions = result.Suggestions,
+ WorkingFolder = result.WorkingFolder
+ }, token, new TransportResponseConfig()
{
Immediate = true,
});
@@ -44,7 +60,7 @@ namespace Tango.PPC.Common.Console
public void OnReceiverDisconnected(ExternalBridgeReceiver receiver)
{
-
+
}
}
}