diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-05-01 15:37:36 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-05-01 15:37:36 +0300 |
| commit | 4eee351d5c4c7465bd1449f21a481bfab96b6bf7 (patch) | |
| tree | 2e024259b863815615c357951567f9a7c24e347e /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleManager.cs | |
| parent | 47fad304ebc8f056f1c5ffcde037c66029fc80c9 (diff) | |
| download | Tango-4eee351d5c4c7465bd1449f21a481bfab96b6bf7.tar.gz Tango-4eee351d5c4c7465bd1449f21a481bfab96b6bf7.zip | |
Started working on developer console.
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.cs | 25 |
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); + } } } |
