aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleManager.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleManager.cs25
1 files changed, 25 insertions, 0 deletions
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<String> _writeLine;
+
+ public ConsoleManager(Action<String> 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<IStudioModuleLoader>();
+ var module = loader.AllModules.SingleOrDefault(x => x.Name == name);
+ TangoIOC.Default.GetInstance<ViewModels.MainViewVM>().StartModule(module);
+ }
}
}