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.cs39
1 files changed, 39 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
new file mode 100644
index 000000000..e2d525d95
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleManager.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+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);
+ }
+ }
+}