diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2020-12-30 13:01:58 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2020-12-30 13:01:58 +0200 |
| commit | 624d19b9b7e540e16f605dce4e1c82af60372099 (patch) | |
| tree | 07889b00717d3a30bb0281ed0233543fabfc9aaf /Software/Visual_Studio/Scripting/Tango.Scripting.Test/MainWindowVM.cs | |
| parent | c4aa1735efed2c87e5056dde442211c08d3f66ff (diff) | |
| parent | 7c56f0ff6a9ceb7148b6cab01bbac5ddf592acb2 (diff) | |
| download | Tango-624d19b9b7e540e16f605dce4e1c82af60372099.tar.gz Tango-624d19b9b7e540e16f605dce4e1c82af60372099.zip | |
merge
Diffstat (limited to 'Software/Visual_Studio/Scripting/Tango.Scripting.Test/MainWindowVM.cs')
| -rw-r--r-- | Software/Visual_Studio/Scripting/Tango.Scripting.Test/MainWindowVM.cs | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Test/MainWindowVM.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.Test/MainWindowVM.cs deleted file mode 100644 index f57de886f..000000000 --- a/Software/Visual_Studio/Scripting/Tango.Scripting.Test/MainWindowVM.cs +++ /dev/null @@ -1,69 +0,0 @@ -using Microsoft.Win32; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using Tango.Core.Commands; -using Tango.Scripting.Basic; -using Tango.SharedUI; - -namespace Tango.Scripting.Test -{ - public class TestContext : IContext - { - - } - - public class MainWindowVM : ViewModel - { - - public RelayCommand AddScriptCommand { get; set; } - public RelayCommand RunCommand { get; set; } - - private Project<TestContext> _project; - public Project<TestContext> Project - { - get { return _project; } - set { _project = value; RaisePropertyChangedAuto(); } - } - - public MainWindowVM() - { - Project = Project<TestContext>.New("untitled"); - Project.Scripts.Add(Script.New("main.csx", Encoding.Default.GetString(Properties.Resources.template), true)); - AddScriptCommand = new RelayCommand(AddScriptFile); - RunCommand = new RelayCommand(RunProject); - } - - private void AddScriptFile() - { - OpenFileDialog dlg = new OpenFileDialog(); - dlg.Filter = "CSharp Script|*.csx"; - if (dlg.ShowDialog().Value) - { - AddScript(dlg.FileName); - } - } - - private void AddScript(String file) - { - Project.Scripts.Add(Script.New(file)); - } - - private async void RunProject() - { - var session = await Project.Run(null); - - session.StateChanged += (x, e) => - { - if (e.State == ProjectSessionState.Completed) - { - MessageBox.Show(e.ReturnValue.ToString()); - } - }; - } - } -} |
