diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2020-04-21 16:04:12 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2020-04-21 16:04:12 +0300 |
| commit | 78430d37ac1dd07d5b5d731698da6761884d4cd5 (patch) | |
| tree | ac46b2870e21e3ddbc7a7d0732340a93e4e774e2 /Software/Visual_Studio/Scripting/Tango.Scripting.Basic/Script.cs | |
| parent | bd2e83f3d46414d756f59c2f70cc561718a3022e (diff) | |
| parent | 97a784b6ce43960bdb92465b08f26d3562a4f202 (diff) | |
| download | Tango-78430d37ac1dd07d5b5d731698da6761884d4cd5.tar.gz Tango-78430d37ac1dd07d5b5d731698da6761884d4cd5.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/Scripting/Tango.Scripting.Basic/Script.cs')
| -rw-r--r-- | Software/Visual_Studio/Scripting/Tango.Scripting.Basic/Script.cs | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Basic/Script.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.Basic/Script.cs new file mode 100644 index 000000000..753026149 --- /dev/null +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Basic/Script.cs @@ -0,0 +1,49 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; +using Tango.Scripting.Core; + +namespace Tango.Scripting.Basic +{ + public class Script : ExtendedObject, IScriptSource + { + public String Name { get; set; } + public String Code { get; set; } + public bool IsEntryPoint { get; set; } + + private bool _isSelected; + [JsonIgnore] + public bool IsSelected + { + get { return _isSelected; } + set { _isSelected = value; RaisePropertyChangedAuto(); } + } + + [JsonIgnore] + public int LoadCount { get; internal set; } + + public static Script New(String file) + { + return new Script() + { + Name = Path.GetFileName(file), + Code = System.IO.File.ReadAllText(file), + }; + } + + public static Script New(String name, String code, bool isEntryPoint = false) + { + return new Script() + { + Name = name, + Code = code, + IsEntryPoint = isEntryPoint, + }; + } + } +} |
