From 4eee351d5c4c7465bd1449f21a481bfab96b6bf7 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 1 May 2018 15:37:36 +0300 Subject: Started working on developer console. --- .../Console/ConsoleManager.cs | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleManager.cs') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleManager.cs index 0a737c526..e2d525d95 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleManager.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleManager.cs @@ -4,11 +4,36 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.Core.DI; +using Tango.MachineStudio.Common.Modules; namespace Tango.MachineStudio.UI.Console { public class ConsoleManager { public TangoIOC TangoIOC { get; set; } + private Action _writeLine; + + public ConsoleManager(Action writeLine) + { + _writeLine = writeLine; + TangoIOC = TangoIOC.Default; + } + + public void WriteLine(String text) + { + _writeLine(text); + } + + public void InvokeUI(Action action) + { + Core.Helpers.ThreadsHelper.InvokeUI(action); + } + + public void StartModule(String name) + { + IStudioModuleLoader loader = TangoIOC.Default.GetInstance(); + var module = loader.AllModules.SingleOrDefault(x => x.Name == name); + TangoIOC.Default.GetInstance().StartModule(module); + } } } -- cgit v1.3.1