aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2017-12-07 17:42:02 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2017-12-07 17:42:02 +0200
commitab99fb80dfc78c31b1e6cf8d5e4a8458978f4ddc (patch)
treef22a07c9ddac03ea1b070d33dc0b4fd84476704b /Software/Visual_Studio
parent4cf1e800a5743d1194281703a4bcd6df0a910e8f (diff)
downloadTango-ab99fb80dfc78c31b1e6cf8d5e4a8458978f4ddc.tar.gz
Tango-ab99fb80dfc78c31b1e6cf8d5e4a8458978f4ddc.zip
Added Tango.Scripting
Stubs.UI scripting works.. Implemented ScriptEditorControl.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/SideChains/ICSharpCode.AvalonEdit/Document/UndoStack.cs24
-rw-r--r--Software/Visual_Studio/Tango.Scripting/OnExecuteParameters.cs13
-rw-r--r--Software/Visual_Studio/Tango.Scripting/Properties/AssemblyInfo.cs6
-rw-r--r--Software/Visual_Studio/Tango.Scripting/ScriptEngine.cs73
-rw-r--r--Software/Visual_Studio/Tango.Scripting/Tango.Scripting.csproj144
-rw-r--r--Software/Visual_Studio/Tango.Scripting/app.config47
-rw-r--r--Software/Visual_Studio/Tango.Scripting/packages.config51
-rw-r--r--Software/Visual_Studio/Tango.Serialization/Tango.Serialization.csproj2
-rw-r--r--Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj2
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml22
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs116
-rw-r--r--Software/Visual_Studio/Tango.sln14
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Stubs.UI/App.config50
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Stubs.UI/Properties/Resources.Designer.cs66
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Stubs.UI/Properties/Resources.resx17
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Stubs.UI/Resources/CodeTabTemplate.cs20
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Stubs.UI/StubManager.cs132
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Stubs.UI/StubOnExecuteParameters.cs19
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Stubs.UI/Tango.Stubs.UI.csproj26
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Stubs.UI/ViewModels/CodeTabVM.cs9
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Stubs.UI/ViewModels/MainViewVM.cs71
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Stubs.UI/Views/MainView.xaml6
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Stubs.UI/packages.config2
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj4
-rw-r--r--Software/Visual_Studio/Web/Tango.MachineService/packages.config2
25 files changed, 835 insertions, 103 deletions
diff --git a/Software/Visual_Studio/SideChains/ICSharpCode.AvalonEdit/Document/UndoStack.cs b/Software/Visual_Studio/SideChains/ICSharpCode.AvalonEdit/Document/UndoStack.cs
index 918277fd4..14f2c9deb 100644
--- a/Software/Visual_Studio/SideChains/ICSharpCode.AvalonEdit/Document/UndoStack.cs
+++ b/Software/Visual_Studio/SideChains/ICSharpCode.AvalonEdit/Document/UndoStack.cs
@@ -209,7 +209,7 @@ namespace ICSharpCode.AvalonEdit.Document
/// </summary>
public void EndUndoGroup()
{
- if (undoGroupDepth == 0) throw new InvalidOperationException("There are no open undo groups");
+ if (undoGroupDepth == 0) return;
undoGroupDepth--;
//Util.LoggingService.Debug("Close undo group (new depth=" + undoGroupDepth + ")");
if (undoGroupDepth == 0) {
@@ -237,13 +237,21 @@ namespace ICSharpCode.AvalonEdit.Document
/// </summary>
void ThrowIfUndoGroupOpen()
{
- if (undoGroupDepth != 0) {
- undoGroupDepth = 0;
- throw new InvalidOperationException("No undo group should be open at this point");
- }
- if (state != StateListen) {
- throw new InvalidOperationException("This method cannot be called while an undo operation is being performed");
- }
+ try
+ {
+ if (undoGroupDepth != 0)
+ {
+ undoGroupDepth = 0;
+ throw new InvalidOperationException("No undo group should be open at this point");
+ }
+ if (state != StateListen)
+ {
+ throw new InvalidOperationException("This method cannot be called while an undo operation is being performed");
+ }
+ }
+ catch
+ {
+ }
}
List<TextDocument> affectedDocuments;
diff --git a/Software/Visual_Studio/Tango.Scripting/OnExecuteParameters.cs b/Software/Visual_Studio/Tango.Scripting/OnExecuteParameters.cs
new file mode 100644
index 000000000..af66d84a8
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Scripting/OnExecuteParameters.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Scripting
+{
+ public abstract class OnExecuteParameters
+ {
+
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Scripting/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.Scripting/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000..ed04ceb0c
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Scripting/Properties/AssemblyInfo.cs
@@ -0,0 +1,6 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("Tango - Roslyn Scripting Components")]
+[assembly: ComVisible(false)] \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Scripting/ScriptEngine.cs b/Software/Visual_Studio/Tango.Scripting/ScriptEngine.cs
new file mode 100644
index 000000000..7e9bdd6e3
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Scripting/ScriptEngine.cs
@@ -0,0 +1,73 @@
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Scripting;
+using Microsoft.CodeAnalysis.Scripting;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace Tango.Scripting
+{
+ public class ScriptEngine
+ {
+ private CancellationTokenSource _cancaller;
+ private OnExecuteParameters _onExecuteParameters;
+ public List<Type> ReferencedAssemblies { get; private set; }
+
+ public ScriptEngine(OnExecuteParameters parameters)
+ {
+ _onExecuteParameters = parameters;
+ ReferencedAssemblies = new List<Type>();
+ }
+
+ public async Task Run(String code)
+ {
+ //My References.
+ var options = ScriptOptions.Default;
+
+ //External References.
+ //foreach (var r in item.References)
+ //{
+ // options = options.AddReferences(r.FilePath);
+ //}
+
+ //My Assemblies.
+ options = options.AddReferences(typeof(Form).Assembly.Location);
+ options = options.AddReferences(typeof(Enumerable).Assembly.Location);
+ options = options.AddReferences(typeof(ScriptEngine).Assembly.Location);
+
+ foreach (var asm in ReferencedAssemblies)
+ {
+ options = options.AddReferences(asm.Assembly.Location);
+ }
+
+ //Imports.
+ options = options.AddImports(
+ "System",
+ "System.Collections.Generic",
+ "System.Linq",
+ "System.Text",
+ "System.Diagnostics",
+ "System.Windows.Forms"
+ );
+
+ String methodParameters = String.Join(", ", _onExecuteParameters.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance).Select(x => x.Name));
+
+ _cancaller = new CancellationTokenSource();
+ await CSharpScript.RunAsync(
+ code +
+ Environment.NewLine +
+ Environment.NewLine +
+ "await Task.Factory.StartNew(() => { OnExecute(" + methodParameters + "); });", options: options, globals: _onExecuteParameters, cancellationToken: _cancaller.Token);
+ }
+
+ public void Stop()
+ {
+ _cancaller.Cancel();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Scripting/Tango.Scripting.csproj b/Software/Visual_Studio/Tango.Scripting/Tango.Scripting.csproj
new file mode 100644
index 000000000..091ef5881
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Scripting/Tango.Scripting.csproj
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{401989E7-AE1E-4002-B0EE-9A9F63740B97}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Tango.Scripting</RootNamespace>
+ <AssemblyName>Tango.Scripting</AssemblyName>
+ <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\Build\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.CodeAnalysis, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <HintPath>..\packages\Microsoft.CodeAnalysis.Common.2.4.0\lib\netstandard1.3\Microsoft.CodeAnalysis.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.CSharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <HintPath>..\packages\Microsoft.CodeAnalysis.CSharp.2.4.0\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.CSharp.Scripting, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <HintPath>..\packages\Microsoft.CodeAnalysis.CSharp.Scripting.2.4.0\lib\netstandard1.3\Microsoft.CodeAnalysis.CSharp.Scripting.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.Scripting, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <HintPath>..\packages\Microsoft.CodeAnalysis.Scripting.Common.2.4.0\lib\netstandard1.3\Microsoft.CodeAnalysis.Scripting.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.AppContext, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll</HintPath>
+ <SpecificVersion>False</SpecificVersion>
+ </Reference>
+ <Reference Include="System.Collections.Immutable, Version=1.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.Collections.Immutable.1.4.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
+ </Reference>
+ <Reference Include="System.ComponentModel.Composition" />
+ <Reference Include="System.Console, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.Console.4.3.0\lib\net46\System.Console.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Core" />
+ <Reference Include="System.Diagnostics.FileVersionInfo, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.Diagnostics.FileVersionInfo.4.3.0\lib\net46\System.Diagnostics.FileVersionInfo.dll</HintPath>
+ <SpecificVersion>False</SpecificVersion>
+ </Reference>
+ <Reference Include="System.Diagnostics.StackTrace, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.Diagnostics.StackTrace.4.3.0\lib\net46\System.Diagnostics.StackTrace.dll</HintPath>
+ <SpecificVersion>False</SpecificVersion>
+ </Reference>
+ <Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
+ <SpecificVersion>False</SpecificVersion>
+ </Reference>
+ <Reference Include="System.IO.FileSystem, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll</HintPath>
+ <SpecificVersion>False</SpecificVersion>
+ </Reference>
+ <Reference Include="System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath>
+ <SpecificVersion>False</SpecificVersion>
+ </Reference>
+ <Reference Include="System.Numerics" />
+ <Reference Include="System.Reflection.Metadata, Version=1.4.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.Reflection.Metadata.1.5.0\lib\portable-net45+win8\System.Reflection.Metadata.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Security.Cryptography.Algorithms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net46\System.Security.Cryptography.Algorithms.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
+ <SpecificVersion>False</SpecificVersion>
+ </Reference>
+ <Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
+ <SpecificVersion>False</SpecificVersion>
+ </Reference>
+ <Reference Include="System.Security.Cryptography.X509Certificates, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.2\lib\net46\System.Security.Cryptography.X509Certificates.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Text.Encoding.CodePages, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.Text.Encoding.CodePages.4.4.0\lib\net46\System.Text.Encoding.CodePages.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Threading.Thread, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.Threading.Thread.4.3.0\lib\net46\System.Threading.Thread.dll</HintPath>
+ <SpecificVersion>False</SpecificVersion>
+ </Reference>
+ <Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Net.Http" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Xml.ReaderWriter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Xml.XmlDocument, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.Xml.XmlDocument.4.3.0\lib\net46\System.Xml.XmlDocument.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Xml.XPath, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.Xml.XPath.4.3.0\lib\net46\System.Xml.XPath.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Xml.XPath.XDocument, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.Xml.XPath.XDocument.4.3.0\lib\net46\System.Xml.XPath.XDocument.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\Versioning\GlobalVersionInfo.cs">
+ <Link>GlobalVersionInfo.cs</Link>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="ScriptEngine.cs" />
+ <Compile Include="OnExecuteParameters.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="app.config" />
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" />
+ <Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Scripting/app.config b/Software/Visual_Studio/Tango.Scripting/app.config
new file mode 100644
index 000000000..8766b29db
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Scripting/app.config
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.2.2.0" newVersion="1.2.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.4.2.0" newVersion="1.4.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Scripting/packages.config b/Software/Visual_Studio/Tango.Scripting/packages.config
new file mode 100644
index 000000000..20a9927d5
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Scripting/packages.config
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="net46" />
+ <package id="Microsoft.CodeAnalysis.Common" version="2.4.0" targetFramework="net46" />
+ <package id="Microsoft.CodeAnalysis.CSharp" version="2.4.0" targetFramework="net46" />
+ <package id="Microsoft.CodeAnalysis.CSharp.Scripting" version="2.4.0" targetFramework="net46" />
+ <package id="Microsoft.CodeAnalysis.Scripting" version="2.4.0" targetFramework="net46" />
+ <package id="Microsoft.CodeAnalysis.Scripting.Common" version="2.4.0" targetFramework="net46" />
+ <package id="System.AppContext" version="4.3.0" targetFramework="net46" />
+ <package id="System.Collections" version="4.3.0" targetFramework="net46" />
+ <package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net46" />
+ <package id="System.Collections.Immutable" version="1.4.0" targetFramework="net46" />
+ <package id="System.Console" version="4.3.0" targetFramework="net46" />
+ <package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net46" />
+ <package id="System.Diagnostics.FileVersionInfo" version="4.3.0" targetFramework="net46" />
+ <package id="System.Diagnostics.StackTrace" version="4.3.0" targetFramework="net46" />
+ <package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net46" />
+ <package id="System.Dynamic.Runtime" version="4.3.0" targetFramework="net46" />
+ <package id="System.Globalization" version="4.3.0" targetFramework="net46" />
+ <package id="System.IO" version="4.3.0" targetFramework="net46" />
+ <package id="System.IO.Compression" version="4.3.0" targetFramework="net46" />
+ <package id="System.IO.FileSystem" version="4.3.0" targetFramework="net46" />
+ <package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net46" />
+ <package id="System.Linq" version="4.3.0" targetFramework="net46" />
+ <package id="System.Linq.Expressions" version="4.3.0" targetFramework="net46" />
+ <package id="System.Reflection" version="4.3.0" targetFramework="net46" />
+ <package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net46" />
+ <package id="System.Reflection.Metadata" version="1.5.0" targetFramework="net46" />
+ <package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net46" />
+ <package id="System.Runtime" version="4.3.0" targetFramework="net46" />
+ <package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net46" />
+ <package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net46" />
+ <package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net46" />
+ <package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net46" />
+ <package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net46" />
+ <package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net46" />
+ <package id="System.Security.Cryptography.X509Certificates" version="4.3.2" targetFramework="net46" />
+ <package id="System.Text.Encoding" version="4.3.0" targetFramework="net46" />
+ <package id="System.Text.Encoding.CodePages" version="4.4.0" targetFramework="net46" />
+ <package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net46" />
+ <package id="System.Threading" version="4.3.0" targetFramework="net46" />
+ <package id="System.Threading.Tasks" version="4.3.0" targetFramework="net46" />
+ <package id="System.Threading.Tasks.Parallel" version="4.3.0" targetFramework="net46" />
+ <package id="System.Threading.Thread" version="4.3.0" targetFramework="net46" />
+ <package id="System.ValueTuple" version="4.4.0" targetFramework="net46" />
+ <package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net46" />
+ <package id="System.Xml.XDocument" version="4.3.0" targetFramework="net46" />
+ <package id="System.Xml.XmlDocument" version="4.3.0" targetFramework="net46" />
+ <package id="System.Xml.XPath" version="4.3.0" targetFramework="net46" />
+ <package id="System.Xml.XPath.XDocument" version="4.3.0" targetFramework="net46" />
+</packages> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Serialization/Tango.Serialization.csproj b/Software/Visual_Studio/Tango.Serialization/Tango.Serialization.csproj
index 453d317f5..910444743 100644
--- a/Software/Visual_Studio/Tango.Serialization/Tango.Serialization.csproj
+++ b/Software/Visual_Studio/Tango.Serialization/Tango.Serialization.csproj
@@ -16,7 +16,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
+ <OutputPath>..\Build\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
diff --git a/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj b/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj
index 2916075bf..2d77a1b02 100644
--- a/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj
+++ b/Software/Visual_Studio/Tango.Settings/Tango.Settings.csproj
@@ -16,7 +16,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
+ <OutputPath>..\Build\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml b/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml
index 6f8968d12..1329bedc5 100644
--- a/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml
+++ b/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml
@@ -18,7 +18,7 @@
<Border BorderThickness="0 0 0 1" BorderBrush="#545454">
<ToolBar Background="#202020">
<StackPanel Margin="20 0 0 0" Orientation="Horizontal">
- <Button Cursor="Hand" Click="Save" ToolTip="Save" Style="{DynamicResource MetroCircleButtonStyle}" Width="16" Height="16">
+ <Button Cursor="Hand" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SaveCommand}" ToolTip="Save" Style="{DynamicResource MetroCircleButtonStyle}" Width="16" Height="16">
<fa:ImageAwesome Icon="Save" Foreground="LightGray"></fa:ImageAwesome>
</Button>
<Rectangle Margin="20 7 10 5" HorizontalAlignment="Center" VerticalAlignment="Stretch" Stroke="#3E3E3E" StrokeThickness="2"></Rectangle>
@@ -39,10 +39,10 @@
<fa:ImageAwesome Icon="Paste" Foreground="LightGray"></fa:ImageAwesome>
</Button>
<Rectangle Margin="20 7 10 5" HorizontalAlignment="Center" VerticalAlignment="Stretch" Stroke="#3E3E3E" StrokeThickness="2"></Rectangle>
- <Button Cursor="Hand" x:Name="btnStart" Click="btnStart_Click" Margin="10 0 0 0" ToolTip="Run" Style="{DynamicResource MetroCircleButtonStyle}" Width="16" Height="16">
+ <Button Cursor="Hand" Margin="10 0 0 0" ToolTip="Run" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=RunCommand}" Style="{DynamicResource MetroCircleButtonStyle}" Width="16" Height="16">
<fa:ImageAwesome Icon="Play" Foreground="#39B839"></fa:ImageAwesome>
</Button>
- <Button Cursor="Hand" x:Name="btnStop" Click="btnStop_Click" Margin="15 0 0 0" IsEnabled="False" ToolTip="Stop" Style="{DynamicResource MetroCircleButtonStyle}" Width="14" Height="14">
+ <Button Cursor="Hand" Margin="15 0 0 0" IsEnabled="False" ToolTip="Stop" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=StopCommand}" Style="{DynamicResource MetroCircleButtonStyle}" Width="14" Height="14">
<fa:ImageAwesome Icon="Stop" Foreground="Red"></fa:ImageAwesome>
</Button>
</StackPanel>
@@ -50,7 +50,7 @@
</Border>
<Border Grid.Row="1" CornerRadius="5" BorderThickness="0" BorderBrush="#404040">
- <avalonEdit:TextEditor Padding="5" Background="#151515" Foreground="Gainsboro" Margin="5 5 0 0" ScrollViewer.HorizontalScrollBarVisibility="Auto"
+ <avalonEdit:TextEditor Padding="5" TextChanged="textEditor_TextChanged" Background="#151515" Foreground="Gainsboro" Margin="5 5 0 0" ScrollViewer.HorizontalScrollBarVisibility="Auto"
Name="textEditor"
FontFamily="Consolas"
FontSize="10pt"
@@ -58,20 +58,6 @@
ShowLineNumbers="True">
</avalonEdit:TextEditor>
</Border>
-
- <Grid Grid.Row="1" x:Name="gridExecuting" Background="#AA000000" Visibility="Hidden">
- <StackPanel VerticalAlignment="Center">
- <mahapps:ProgressRing Foreground="Gainsboro"></mahapps:ProgressRing>
- <TextBlock Foreground="Gainsboro" HorizontalAlignment="Center" FontSize="16" Margin="0 10 0 0">Executing Script...</TextBlock>
- </StackPanel>
- </Grid>
- </Grid>
-
- <Grid x:Name="gridError" Background="#AA000000" Visibility="Hidden">
- <StackPanel VerticalAlignment="Center" Width="400">
- <TextBox x:Name="txtError" Background="Transparent" BorderBrush="#202020" TextWrapping="Wrap" Height="230" AcceptsReturn="True"></TextBox>
- <Button x:Name="btnOK" Click="btnOK_Click" HorizontalAlignment="Right" Width="100" Padding="8" Margin="0 5 0 0">OK</Button>
- </StackPanel>
</Grid>
</Grid>
</UserControl>
diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs
index 1f9eeb1aa..d3adf4d78 100644
--- a/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs
+++ b/Software/Visual_Studio/Tango.SharedUI/Controls/ScriptEditorControl.xaml.cs
@@ -3,6 +3,7 @@ using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Editing;
using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
using System.Text;
@@ -19,6 +20,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
+using Tango.Core.Commands;
using Tango.SharedUI;
namespace Tango.SharedUI.Controls
@@ -76,8 +78,11 @@ namespace Tango.SharedUI.Controls
public partial class ScriptEditorControl : UserControl
{
private CompletionWindow completionWindow;
+ private bool textChanged;
public ScriptEditorControl()
{
+ HighlightTypes = new ObservableCollection<Type>();
+
InitializeComponent();
textEditor.TextArea.IndentationStrategy = new ICSharpCode.AvalonEdit.Indentation.CSharp.CSharpIndentationStrategy();
@@ -109,10 +114,16 @@ namespace Tango.SharedUI.Controls
types.Add(new KeyValuePair<string, Type>("TimeSpan", typeof(TimeSpan)));
types.Add(new KeyValuePair<string, Type>("Dispatcher", typeof(Dispatcher)));
types.Add(new KeyValuePair<string, Type>("Task", typeof(Task)));
- types.Add(new KeyValuePair<string, Type>("list", typeof(IList<Object>)));
+ types.Add(new KeyValuePair<string, Type>("List", typeof(IList<Object>)));
types.Add(new KeyValuePair<string, Type>("int", typeof(Int32)));
types.Add(new KeyValuePair<string, Type>("double", typeof(Double)));
types.Add(new KeyValuePair<string, Type>("String", typeof(String)));
+ types.Add(new KeyValuePair<string, Type>("string", typeof(String)));
+
+ foreach (var t in HighlightTypes)
+ {
+ types.Add(new KeyValuePair<string, Type>(t.Name, t));
+ }
var type = types.SingleOrDefault(x => x.Key == keyword);
if (type.Key != null)
@@ -146,42 +157,6 @@ namespace Tango.SharedUI.Controls
}
}
- private async void btnStart_Click(object sender, RoutedEventArgs e)
- {
- btnStart.IsEnabled = false;
- btnStop.IsEnabled = true;
- gridExecuting.Visibility = Visibility.Visible;
- //engine = new ScriptEngine();
- //try
- //{
- // await engine.Run(CanvasItem, textEditor.Text);
- //}
- //catch (Exception ex)
- //{
- // txtError.Text = ex.Message;
- // gridError.Visibility = Visibility.Visible;
- //}
-
- gridExecuting.Visibility = Visibility.Hidden;
- btnStart.IsEnabled = true;
- btnStop.IsEnabled = false;
- }
-
- private void btnStop_Click(object sender, RoutedEventArgs e)
- {
- //engine.Stop();
- }
-
- private void btnOK_Click(object sender, RoutedEventArgs e)
- {
- gridError.Visibility = Visibility.Hidden;
- }
-
- private void Save(object sender, RoutedEventArgs e)
- {
- //CanvasItem.Script = textEditor.Text;
- }
-
private void FillType(Type type, IList<ICompletionData> data)
{
List<CompletionData> items = new List<CompletionData>();
@@ -224,6 +199,73 @@ namespace Tango.SharedUI.Controls
}
}
+ #region Properties
+
+
+
+ public String Text
+ {
+ get { return (String)GetValue(TextProperty); }
+ set { SetValue(TextProperty, value); }
+ }
+ public static readonly DependencyProperty TextProperty =
+ DependencyProperty.Register("Text", typeof(String), typeof(ScriptEditorControl), new PropertyMetadata(null, (d, e) => (d as ScriptEditorControl).OnTextChanged()));
+
+ private void OnTextChanged()
+ {
+ if (!textChanged)
+ {
+ textEditor.Text = Text;
+ textChanged = true;
+ }
+ }
+
+
+
+ public ObservableCollection<Type> HighlightTypes
+ {
+ get { return (ObservableCollection<Type>)GetValue(HighlightTypesProperty); }
+ set { SetValue(HighlightTypesProperty, value); }
+ }
+ public static readonly DependencyProperty HighlightTypesProperty =
+ DependencyProperty.Register("HighlightTypes", typeof(ObservableCollection<Type>), typeof(ScriptEditorControl), new PropertyMetadata(null));
+
+
+
+ #endregion
+
+ #region Commands
+
+ public RelayCommand RunCommand
+ {
+ get { return (RelayCommand)GetValue(RunCommandProperty); }
+ set { SetValue(RunCommandProperty, value); }
+ }
+ public static readonly DependencyProperty RunCommandProperty =
+ DependencyProperty.Register("RunCommand", typeof(RelayCommand), typeof(ScriptEditorControl), new PropertyMetadata(null));
+
+ public RelayCommand StopCommand
+ {
+ get { return (RelayCommand)GetValue(StopCommandProperty); }
+ set { SetValue(StopCommandProperty, value); }
+ }
+ public static readonly DependencyProperty StopCommandProperty =
+ DependencyProperty.Register("StopCommand", typeof(RelayCommand), typeof(ScriptEditorControl), new PropertyMetadata(null));
+
+ public RelayCommand SaveCommand
+ {
+ get { return (RelayCommand)GetValue(SaveCommandProperty); }
+ set { SetValue(SaveCommandProperty, value); }
+ }
+ public static readonly DependencyProperty SaveCommandProperty =
+ DependencyProperty.Register("SaveCommand", typeof(RelayCommand), typeof(ScriptEditorControl), new PropertyMetadata(null));
+
+ #endregion
+
+ private void textEditor_TextChanged(object sender, EventArgs e)
+ {
+ Text = textEditor.Text;
+ }
}
internal static class DocumentUtils
diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln
index 433efc448..01118c563 100644
--- a/Software/Visual_Studio/Tango.sln
+++ b/Software/Visual_Studio/Tango.sln
@@ -77,6 +77,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SideChains", "SideChains",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.AvalonEdit", "SideChains\ICSharpCode.AvalonEdit\ICSharpCode.AvalonEdit.csproj", "{6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Scripting", "Tango.Scripting\Tango.Scripting.csproj", "{401989E7-AE1E-4002-B0EE-9A9F63740B97}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -421,6 +423,18 @@ Global
{6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Release|x64.Build.0 = Release|Any CPU
{6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Release|x86.ActiveCfg = Release|Any CPU
{6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}.Release|x86.Build.0 = Release|Any CPU
+ {401989E7-AE1E-4002-B0EE-9A9F63740B97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {401989E7-AE1E-4002-B0EE-9A9F63740B97}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {401989E7-AE1E-4002-B0EE-9A9F63740B97}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {401989E7-AE1E-4002-B0EE-9A9F63740B97}.Debug|x64.Build.0 = Debug|Any CPU
+ {401989E7-AE1E-4002-B0EE-9A9F63740B97}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {401989E7-AE1E-4002-B0EE-9A9F63740B97}.Debug|x86.Build.0 = Debug|Any CPU
+ {401989E7-AE1E-4002-B0EE-9A9F63740B97}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {401989E7-AE1E-4002-B0EE-9A9F63740B97}.Release|Any CPU.Build.0 = Release|Any CPU
+ {401989E7-AE1E-4002-B0EE-9A9F63740B97}.Release|x64.ActiveCfg = Release|Any CPU
+ {401989E7-AE1E-4002-B0EE-9A9F63740B97}.Release|x64.Build.0 = Release|Any CPU
+ {401989E7-AE1E-4002-B0EE-9A9F63740B97}.Release|x86.ActiveCfg = Release|Any CPU
+ {401989E7-AE1E-4002-B0EE-9A9F63740B97}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/App.config b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/App.config
index 8324aa6ff..be1387189 100644
--- a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/App.config
+++ b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/App.config
@@ -1,6 +1,54 @@
-<?xml version="1.0" encoding="utf-8" ?>
+<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
</startup>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.2.2.0" newVersion="1.2.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.4.2.0" newVersion="1.4.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
</configuration> \ No newline at end of file
diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Properties/Resources.Designer.cs b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Properties/Resources.Designer.cs
index bace4fad6..0f1dfb64d 100644
--- a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Properties/Resources.Designer.cs
+++ b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Properties/Resources.Designer.cs
@@ -8,10 +8,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
-namespace Tango.Stubs.UI.Properties
-{
-
-
+namespace Tango.Stubs.UI.Properties {
+ using System;
+
+
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@@ -22,50 +22,66 @@ namespace Tango.Stubs.UI.Properties
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources
- {
-
+ internal class Resources {
+
private static global::System.Resources.ResourceManager resourceMan;
-
+
private static global::System.Globalization.CultureInfo resourceCulture;
-
+
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources()
- {
+ internal Resources() {
}
-
+
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null))
- {
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.Stubs.UI.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
-
+
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
return resourceCulture;
}
- set
- {
+ set {
resourceCulture = value;
}
}
+
+ /// <summary>
+ /// Looks up a localized string similar to using System;
+ ///using System.Text;
+ ///using System.Linq;
+ ///using System.Drawing;
+ ///using System.Diagnostics;
+ ///using System.Windows.Forms;
+ ///using System.Threading;
+ ///using System.Threading.Tasks;
+ ///using System.Collections.Generic;
+ ///
+ ///public void OnExecute(MediaManager mediaManager, Preset preset, CanvasScriptItem item)
+ ///{
+ /// CanvasVideoItem canvasVideoItem = new CanvasVideoItem();
+ /// canvasVideoItem.VideoFile = &quot;C:\\video1.mp4&quot;;
+ /// mediaManager.Invoke(() =&gt; mediaManager.Play(canvasVideoItem));
+ /// Thread.Sl [rest of string was truncated]&quot;;.
+ /// </summary>
+ internal static string CodeTabTemplate {
+ get {
+ return ResourceManager.GetString("CodeTabTemplate", resourceCulture);
+ }
+ }
}
}
diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Properties/Resources.resx b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Properties/Resources.resx
index af7dbebba..7693cadac 100644
--- a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Properties/Resources.resx
+++ b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Properties/Resources.resx
@@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
- : System.Serialization.Formatters.Binary.BinaryFormatter
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
@@ -60,6 +60,7 @@
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
@@ -68,9 +69,10 @@
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
@@ -85,9 +87,10 @@
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
@@ -109,9 +112,13 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
+ <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="CodeTabTemplate" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\CodeTabTemplate.cs;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
+ </data>
</root> \ No newline at end of file
diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Resources/CodeTabTemplate.cs b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Resources/CodeTabTemplate.cs
new file mode 100644
index 000000000..68b249a8a
--- /dev/null
+++ b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Resources/CodeTabTemplate.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.Stubs.UI;
+
+public void OnExecute(StubManager stubManager)
+{
+ for (int i = 0; i < 10; i++)
+ {
+ stubManager.Run("calculate", 10, 5);
+ Thread.Sleep(10);
+ }
+}
+
diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/StubManager.cs b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/StubManager.cs
new file mode 100644
index 000000000..4f5761cb0
--- /dev/null
+++ b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/StubManager.cs
@@ -0,0 +1,132 @@
+using Google.Protobuf;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using Tango.PMR;
+using Tango.PMR.Common;
+using Tango.Transport.Adapters;
+
+namespace Tango.Stubs.UI
+{
+ public class StubManager
+ {
+ private UsbTransportAdapter _adapter;
+
+ public event EventHandler<Exception> Failed;
+ public event EventHandler<String> Completed;
+
+ public StubManager(UsbTransportAdapter adapter)
+ {
+ _adapter = adapter;
+ }
+
+ public void Run(String stubName, params Object[] args)
+ {
+ var stubType = GetAvailableRequestStubs().SingleOrDefault(x => x.Name.ToLower() == stubName.ToLower() || x.Name.Replace("Request", "").ToLower() == stubName.ToLower());
+ if (stubType == null)
+ {
+ OnFailed(new ArgumentException("Invalid stub '" + stubName + "'."));
+ }
+
+ var stubProps = stubType.GetProperties(BindingFlags.Public | BindingFlags.Instance);
+
+ if (stubProps.Length > args.Length)
+ {
+ OnFailed(new ArgumentOutOfRangeException("Not enough arguments for " + stubType.Name + "."));
+ }
+
+ try
+ {
+ MessageContainer container = new MessageContainer();
+ container.Token = Guid.NewGuid().ToString();
+ container.Type = (MessageType)Enum.Parse(typeof(MessageType), stubType.Name);
+
+ Object request = Activator.CreateInstance(stubType);
+
+ int argIndex = 0;
+ foreach (var prop in stubProps)
+ {
+ String arg = args[argIndex++].ToString();
+
+ double numD;
+ int numI;
+ if (int.TryParse(arg, out numI))
+ {
+ prop.SetValue(request, numI);
+ }
+ else if (double.TryParse(arg, out numD))
+ {
+ prop.SetValue(request, numD);
+ }
+ else
+ {
+ prop.SetValue(request, args[argIndex++]);
+ }
+ }
+
+ container.Data = typeof(IMessage).GetExtensionMethod(typeof(ByteString).Assembly, "ToByteString").Invoke(request, new object[] { request }) as ByteString;
+
+ byte[] requestData = container.ToByteArray();
+
+ bool done = false;
+
+ Task.Factory.StartNew(() =>
+ {
+ _adapter.Write(requestData);
+
+ DateTime startTime = DateTime.Now;
+
+ MessageContainer responseContainer = null;
+
+ _adapter.DataAvailable += (sender, data) =>
+ {
+ responseContainer = MessageFactory.ParseContainer(data);
+ };
+
+ while (responseContainer == null)
+ {
+ Thread.Sleep(2);
+
+ if (DateTime.Now > startTime.AddSeconds(2))
+ {
+ OnFailed(new TimeoutException("Response has filed to arrive after 2 seconds."));
+ }
+ }
+
+ IMessage message = MessageFactory.ParseMessageFromContainer(responseContainer);
+ OnCompleted(JsonConvert.SerializeObject(message, Formatting.Indented));
+ done = true;
+ });
+
+ while (!done)
+ {
+ Thread.Sleep(2);
+ }
+ }
+ catch (Exception ex)
+ {
+ OnFailed(ex);
+ }
+ }
+
+ private void OnFailed(Exception ex)
+ {
+ Failed?.Invoke(this, ex);
+ }
+
+ private void OnCompleted(String response)
+ {
+ Completed?.Invoke(this, response);
+ }
+
+ private static List<Type> GetAvailableRequestStubs()
+ {
+ return typeof(MessageFactory).Assembly.GetTypes().Where(x => x.Namespace.Contains("Stubs") && x.Name.Contains("Request") && !x.Name.Contains("Reflection")).ToList();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/StubOnExecuteParameters.cs b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/StubOnExecuteParameters.cs
new file mode 100644
index 000000000..1689c56de
--- /dev/null
+++ b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/StubOnExecuteParameters.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Scripting;
+
+namespace Tango.Stubs.UI
+{
+ public class StubOnExecuteParameters : OnExecuteParameters
+ {
+ public StubManager stubManager;
+
+ public StubOnExecuteParameters(StubManager manager)
+ {
+ stubManager = manager;
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Tango.Stubs.UI.csproj b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Tango.Stubs.UI.csproj
index 811dd43f3..c89c273c2 100644
--- a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Tango.Stubs.UI.csproj
+++ b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Tango.Stubs.UI.csproj
@@ -37,9 +37,15 @@
<Reference Include="FontAwesome.WPF, Version=4.7.0.37774, Culture=neutral, PublicKeyToken=0758b07a11a4f466, processorArchitecture=MSIL">
<HintPath>..\..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll</HintPath>
</Reference>
+ <Reference Include="Google.Protobuf, Version=3.5.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\Google.Protobuf.3.5.0\lib\net45\Google.Protobuf.dll</HintPath>
+ </Reference>
<Reference Include="MahApps.Metro, Version=1.5.0.23, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
<HintPath>..\..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll</HintPath>
</Reference>
+ <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+ </Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -63,6 +69,9 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
+ <None Include="Resources\CodeTabTemplate.cs" />
+ <Compile Include="StubManager.cs" />
+ <Compile Include="StubOnExecuteParameters.cs" />
<Compile Include="ViewModels\CodeTabVM.cs" />
<Compile Include="ViewModels\MainViewVM.cs" />
<Compile Include="Views\MainView.xaml.cs">
@@ -125,10 +134,27 @@
<Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project>
<Name>Tango.Core</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\Tango.PMR\Tango.PMR.csproj">
+ <Project>{e4927038-348d-4295-aaf4-861c58cb3943}</Project>
+ <Name>Tango.PMR</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Tango.Scripting\Tango.Scripting.csproj">
+ <Project>{401989e7-ae1e-4002-b0ee-9a9f63740b97}</Project>
+ <Name>Tango.Scripting</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\Tango.SharedUI\Tango.SharedUI.csproj">
<Project>{ac489889-6e50-4f16-9dba-ff4c6f9ec72b}</Project>
<Name>Tango.SharedUI</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\Tango.Stubs\Tango.Stubs.csproj">
+ <Project>{1981b537-39e9-4e7d-8430-27466481aeee}</Project>
+ <Name>Tango.Stubs</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Tango.Transport\Tango.Transport.csproj">
+ <Project>{74e700b0-1156-4126-be40-ee450d3c3026}</Project>
+ <Name>Tango.Transport</Name>
+ </ProjectReference>
</ItemGroup>
+ <ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/ViewModels/CodeTabVM.cs b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/ViewModels/CodeTabVM.cs
index 1a82a3433..5feb564ce 100644
--- a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/ViewModels/CodeTabVM.cs
+++ b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/ViewModels/CodeTabVM.cs
@@ -11,6 +11,14 @@ namespace Tango.Stubs.UI.ViewModels
{
private String _title;
+ private String _code;
+
+ public String Code
+ {
+ get { return _code; }
+ set { _code = value; RaisePropertyChanged(nameof(Code)); }
+ }
+
public String Title
{
get { return _title; }
@@ -20,6 +28,7 @@ namespace Tango.Stubs.UI.ViewModels
public CodeTabVM()
{
Title = "untitled";
+ Code = Properties.Resources.CodeTabTemplate;
}
public override string ToString()
diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/ViewModels/MainViewVM.cs
index d2b8b38eb..f73a43b54 100644
--- a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/ViewModels/MainViewVM.cs
@@ -5,27 +5,96 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core.Commands;
+using Tango.Scripting;
using Tango.SharedUI;
+using Tango.Transport.Adapters;
namespace Tango.Stubs.UI.ViewModels
{
public class MainViewVM : ViewModel
{
+ private UsbTransportAdapter _adapter;
+
public ObservableCollection<CodeTabVM> CodeTabs { get; set; }
+ public ObservableCollection<Type> HighlightTypes { get; set; }
+
+ private String _log;
+
+ public String Log
+ {
+ get { return _log; }
+ set { _log = value; RaisePropertyChanged(nameof(Log)); }
+ }
+
+
+ private CodeTabVM _selectedCodeTab;
+
+ public CodeTabVM SelectedCodeTab
+ {
+ get { return _selectedCodeTab; }
+ set { _selectedCodeTab = value; RaisePropertyChanged(nameof(SelectedCodeTab)); }
+ }
+
public RelayCommand NewCommand { get; set; }
public RelayCommand<CodeTabVM> CloseTabCommand { get; set; }
+ public RelayCommand RunCommand { get; set; }
public MainViewVM()
{
CodeTabs = new ObservableCollection<CodeTabVM>();
- NewCommand = new RelayCommand(() => CodeTabs.Add(new CodeTabVM()));
+ NewCommand = new RelayCommand(OnCreateNewTab);
CloseTabCommand = new RelayCommand<CodeTabVM>(OnTabClosing);
+ RunCommand = new RelayCommand(OnTabRun);
+
+ HighlightTypes = new ObservableCollection<Type>();
+ HighlightTypes.Add(typeof(StubManager));
+
+ _adapter = new UsbTransportAdapter("COM9");
+ _adapter.Connect().Wait();
+ }
+
+ private void OnCreateNewTab()
+ {
+ var newTab = new CodeTabVM();
+ CodeTabs.Add(newTab);
+ SelectedCodeTab = newTab;
+ }
+
+ private async void OnTabRun()
+ {
+ try
+ {
+ StubManager manager = new StubManager(_adapter);
+ manager.Completed += Manager_Completed;
+ manager.Failed += Manager_Failed;
+
+ ScriptEngine engine = new ScriptEngine(new StubOnExecuteParameters(manager));
+
+ engine.ReferencedAssemblies.Add(this.GetType());
+ await engine.Run(SelectedCodeTab.Code);
+ }
+ catch (Exception ex)
+ {
+ throw;
+ }
+ }
+
+ private void Manager_Failed(object sender, Exception e)
+ {
+ Log += e.Message + Environment.NewLine;
+ }
+
+ private void Manager_Completed(object sender, string response)
+ {
+ Log += response + Environment.NewLine;
}
private void OnTabClosing(CodeTabVM codeTab)
{
CodeTabs.Remove(codeTab);
}
+
+
}
}
diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Views/MainView.xaml b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Views/MainView.xaml
index 2b995eaa4..5062e4951 100644
--- a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Views/MainView.xaml
+++ b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/Views/MainView.xaml
@@ -34,7 +34,7 @@
<Setter.Value>
<DataTemplate>
<Grid Background="#181818">
- <controls:ScriptEditorControl/>
+ <controls:ScriptEditorControl Text="{Binding Code,Mode=TwoWay}" RunCommand="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RunCommand}" />
</Grid>
</DataTemplate>
</Setter.Value>
@@ -83,7 +83,7 @@
</Grid.RowDefinitions>
<Grid>
- <TabControl Margin="5" ItemsSource="{Binding CodeTabs}">
+ <TabControl Margin="5" ItemsSource="{Binding CodeTabs}" SelectedItem="{Binding SelectedCodeTab}">
</TabControl>
</Grid>
@@ -105,7 +105,7 @@
</Grid.RowDefinitions>
<TextBlock Foreground="Gainsboro" VerticalAlignment="Center" Margin="5 0 0 0">Response</TextBlock>
<Grid Background="Black" Grid.Row="1">
-
+ <TextBox Background="Transparent" Text="{Binding Log}" BorderThickness="0" AcceptsReturn="True" VerticalScrollBarVisibility="Visible" Padding="5" IsReadOnly="True" TextWrapping="Wrap" FontSize="11" Foreground="Gainsboro"></TextBox>
</Grid>
</Grid>
</Grid>
diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/packages.config b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/packages.config
index 8af518434..cde827aa1 100644
--- a/Software/Visual_Studio/Utilities/Tango.Stubs.UI/packages.config
+++ b/Software/Visual_Studio/Utilities/Tango.Stubs.UI/packages.config
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FontAwesome.WPF" version="4.7.0.9" targetFramework="net46" />
+ <package id="Google.Protobuf" version="3.5.0" targetFramework="net46" />
<package id="MahApps.Metro" version="1.5.0" targetFramework="net46" />
+ <package id="Newtonsoft.Json" version="10.0.3" targetFramework="net46" />
</packages> \ No newline at end of file
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj b/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj
index 4875386c6..fa3d4c537 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj
+++ b/Software/Visual_Studio/Web/Tango.MachineService/Tango.MachineService.csproj
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="..\..\packages\Microsoft.Net.Compilers.2.4.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\..\packages\Microsoft.Net.Compilers.2.4.0\build\Microsoft.Net.Compilers.props')" />
<Import Project="..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
- <Import Project="..\..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props" Condition="Exists('..\..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -248,9 +248,9 @@
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
- <Error Condition="!Exists('..\..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
<Error Condition="!Exists('..\..\packages\System.Data.SQLite.Core.1.0.106.0\build\net46\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\System.Data.SQLite.Core.1.0.106.0\build\net46\System.Data.SQLite.Core.targets'))" />
+ <Error Condition="!Exists('..\..\packages\Microsoft.Net.Compilers.2.4.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Net.Compilers.2.4.0\build\Microsoft.Net.Compilers.props'))" />
</Target>
<Import Project="..\..\packages\System.Data.SQLite.Core.1.0.106.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\..\packages\System.Data.SQLite.Core.1.0.106.0\build\net46\System.Data.SQLite.Core.targets')" />
<PropertyGroup>
diff --git a/Software/Visual_Studio/Web/Tango.MachineService/packages.config b/Software/Visual_Studio/Web/Tango.MachineService/packages.config
index e73c5452b..f7f8b6e14 100644
--- a/Software/Visual_Studio/Web/Tango.MachineService/packages.config
+++ b/Software/Visual_Studio/Web/Tango.MachineService/packages.config
@@ -20,7 +20,7 @@
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.3" targetFramework="net45" />
- <package id="Microsoft.Net.Compilers" version="1.3.2" targetFramework="net45" developmentDependency="true" />
+ <package id="Microsoft.Net.Compilers" version="2.4.0" targetFramework="net46" developmentDependency="true" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="Modernizr" version="2.6.2" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />