aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Core
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2017-12-19 10:25:40 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2017-12-19 10:25:40 +0200
commitafc7a07d285e08d905c58dd5978441c155b2f296 (patch)
treea2f4f51ef2747ae3a2aded2637a352ce8ef85934 /Software/Visual_Studio/Tango.Core
parentad35c9c2df0001157ea13312382f3cdfdad67f06 (diff)
downloadTango-afc7a07d285e08d905c58dd5978441c155b2f296.tar.gz
Tango-afc7a07d285e08d905c58dd5978441c155b2f296.zip
MERGE.
Diffstat (limited to 'Software/Visual_Studio/Tango.Core')
-rw-r--r--Software/Visual_Studio/Tango.Core/Cryptography/ICryptographer.cs16
-rw-r--r--Software/Visual_Studio/Tango.Core/Cryptography/Rfc2898Cryptographer.cs70
-rw-r--r--Software/Visual_Studio/Tango.Core/ExtensionMethods/IServiceLocatorExtensions.cs22
-rw-r--r--Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs4
-rw-r--r--Software/Visual_Studio/Tango.Core/Helpers/ColorHelper.cs40
-rw-r--r--Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs22
-rw-r--r--Software/Visual_Studio/Tango.Core/Properties/Resources.Designer.cs72
-rw-r--r--Software/Visual_Studio/Tango.Core/Properties/Resources.resx124
-rw-r--r--Software/Visual_Studio/Tango.Core/Software - Shortcut.lnkbin0 -> 956 bytes
-rw-r--r--Software/Visual_Studio/Tango.Core/Tango.Core.csproj36
-rw-r--r--Software/Visual_Studio/Tango.Core/Threading/StaThreadHelper.cs23
-rw-r--r--Software/Visual_Studio/Tango.Core/packages.config3
12 files changed, 430 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Tango.Core/Cryptography/ICryptographer.cs b/Software/Visual_Studio/Tango.Core/Cryptography/ICryptographer.cs
new file mode 100644
index 000000000..a5c9ea923
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Core/Cryptography/ICryptographer.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Core.Cryptography
+{
+ public interface ICryptographer
+ {
+ String Encrypt(String text);
+ String Decrypt(String text);
+ String Encrypt(String text, String key);
+ String Decrypt(String text, String key);
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Core/Cryptography/Rfc2898Cryptographer.cs b/Software/Visual_Studio/Tango.Core/Cryptography/Rfc2898Cryptographer.cs
new file mode 100644
index 000000000..9d369d323
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Core/Cryptography/Rfc2898Cryptographer.cs
@@ -0,0 +1,70 @@
+using System.IO;
+using System.Text;
+using System.Security.Cryptography;
+using System;
+using SimpleValidator.Extensions;
+
+namespace Tango.Core.Cryptography
+{
+ public class Rfc2898Cryptographer : ICryptographer
+ {
+ public string Decrypt(string text)
+ {
+ return Decrypt(text, Properties.Resources.EncryptionPassword);
+ }
+
+ public string Decrypt(string text, string key)
+ {
+ if (text.IsNullOrWhiteSpace()) return text;
+
+ string EncryptionKey = Properties.Resources.EncryptionPassword;
+ text = text.Replace(" ", "+");
+ byte[] cipherBytes = Convert.FromBase64String(text);
+ using (Aes encryptor = Aes.Create())
+ {
+ Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(EncryptionKey, new byte[] { 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76 });
+ encryptor.Key = pdb.GetBytes(32);
+ encryptor.IV = pdb.GetBytes(16);
+ using (MemoryStream ms = new MemoryStream())
+ {
+ using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateDecryptor(), CryptoStreamMode.Write))
+ {
+ cs.Write(cipherBytes, 0, cipherBytes.Length);
+ cs.Close();
+ }
+ text = Encoding.Unicode.GetString(ms.ToArray());
+ }
+ }
+ return text;
+ }
+
+ public string Encrypt(string text)
+ {
+ return Encrypt(text, Properties.Resources.EncryptionPassword);
+ }
+
+ public string Encrypt(string text, string key)
+ {
+ if (text.IsNullOrWhiteSpace()) return text;
+
+ string EncryptionKey = key;
+ byte[] clearBytes = Encoding.Unicode.GetBytes(text);
+ using (Aes encryptor = Aes.Create())
+ {
+ Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(EncryptionKey, new byte[] { 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76 });
+ encryptor.Key = pdb.GetBytes(32);
+ encryptor.IV = pdb.GetBytes(16);
+ using (MemoryStream ms = new MemoryStream())
+ {
+ using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateEncryptor(), CryptoStreamMode.Write))
+ {
+ cs.Write(clearBytes, 0, clearBytes.Length);
+ cs.Close();
+ }
+ text = Convert.ToBase64String(ms.ToArray());
+ }
+ }
+ return text;
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/IServiceLocatorExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/IServiceLocatorExtensions.cs
new file mode 100644
index 000000000..d39cf478f
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/IServiceLocatorExtensions.cs
@@ -0,0 +1,22 @@
+using Microsoft.Practices.ServiceLocation;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+public static class IServiceLocatorExtensions
+{
+ public static List<Object> GetAllInstances(this IServiceLocator locator)
+ {
+ var dictionaries = locator.GetType().GetField("_instancesRegistry", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(locator) as Dictionary<Type, Dictionary<string, object>>;
+ var instances = dictionaries.SelectMany(x => x.Value).Select(x => x.Value).ToList();
+ return instances;
+ }
+
+ public static List<T> GetAllInstancesByBase<T>(this IServiceLocator locator)
+ {
+ return locator.GetAllInstances().Where(x => typeof(T).IsAssignableFrom(x.GetType())).Select(x => (T)x).ToList();
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs
index 3b46ab7cc..544b4a1da 100644
--- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs
+++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs
@@ -56,7 +56,7 @@ public static class StringExtensions
/// </summary>
/// <param name="text">The text.</param>
/// <returns></returns>
- public static String Singularize(this String text)
+ public static String SingularizeMVC(this String text)
{
var serv = PluralizationService.CreateService(new System.Globalization.CultureInfo("en-us"));
return serv.Singularize(text);
@@ -67,7 +67,7 @@ public static class StringExtensions
/// </summary>
/// <param name="text">The text.</param>
/// <returns></returns>
- public static String Pluralize(this String text)
+ public static String PluralizeMVC(this String text)
{
var serv = PluralizationService.CreateService(new System.Globalization.CultureInfo("en-us"));
return serv.Pluralize(text);
diff --git a/Software/Visual_Studio/Tango.Core/Helpers/ColorHelper.cs b/Software/Visual_Studio/Tango.Core/Helpers/ColorHelper.cs
new file mode 100644
index 000000000..c88d5aead
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Core/Helpers/ColorHelper.cs
@@ -0,0 +1,40 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Media;
+
+namespace Tango.Core.Helpers
+{
+ /// <summary>
+ /// Contains several color helper methods.
+ /// </summary>
+ public static class ColorHelper
+ {
+ /// <summary>
+ /// Converts a color to integer.
+ /// </summary>
+ /// <param name="color">The color.</param>
+ /// <returns></returns>
+ public static int ColorToInteger(Color color)
+ {
+ return (int)((color.A << 24) | (color.R << 16) |
+ (color.G << 8) | (color.B << 0));
+ }
+
+ /// <summary>
+ /// Converts an integer to color.
+ /// </summary>
+ /// <param name="integer">The integer.</param>
+ /// <returns></returns>
+ public static Color IntegerToColor(int integer)
+ {
+ byte a = (byte)(integer >> 24);
+ byte r = (byte)(integer >> 16);
+ byte g = (byte)(integer >> 8);
+ byte b = (byte)(integer >> 0);
+ return Color.FromArgb(a, r, g, b);
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs b/Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs
new file mode 100644
index 000000000..5f140d344
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Core/Helpers/ThreadsHelper.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Threading;
+
+namespace Tango.Core.Helpers
+{
+ public static class ThreadsHelper
+ {
+ public static void InvokeUI(Action action)
+ {
+ Dispatcher.CurrentDispatcher.BeginInvoke(action);
+ }
+
+ public static void InvokeUINow(Action action)
+ {
+ Dispatcher.CurrentDispatcher.Invoke(action);
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Core/Properties/Resources.Designer.cs b/Software/Visual_Studio/Tango.Core/Properties/Resources.Designer.cs
new file mode 100644
index 000000000..4f47c533a
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Core/Properties/Resources.Designer.cs
@@ -0,0 +1,72 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Tango.Core.Properties {
+ using System;
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [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 {
+
+ 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() {
+ }
+
+ /// <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 (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.Core.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 {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to twineAa123456.
+ /// </summary>
+ internal static string EncryptionPassword {
+ get {
+ return ResourceManager.GetString("EncryptionPassword", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Core/Properties/Resources.resx b/Software/Visual_Studio/Tango.Core/Properties/Resources.resx
new file mode 100644
index 000000000..dedc8ed88
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Core/Properties/Resources.resx
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : 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">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <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">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <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" 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">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="EncryptionPassword" xml:space="preserve">
+ <value>twineAa123456</value>
+ <comment>Standard password for cryptography</comment>
+ </data>
+</root> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Core/Software - Shortcut.lnk b/Software/Visual_Studio/Tango.Core/Software - Shortcut.lnk
new file mode 100644
index 000000000..70db0cc38
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Core/Software - Shortcut.lnk
Binary files differ
diff --git a/Software/Visual_Studio/Tango.Core/Tango.Core.csproj b/Software/Visual_Studio/Tango.Core/Tango.Core.csproj
index fd3eeddf9..59afc2931 100644
--- a/Software/Visual_Studio/Tango.Core/Tango.Core.csproj
+++ b/Software/Visual_Studio/Tango.Core/Tango.Core.csproj
@@ -31,15 +31,34 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="GalaSoft.MvvmLight, Version=5.3.0.19026, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
+ <HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
+ </Reference>
+ <Reference Include="GalaSoft.MvvmLight.Extras, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
+ <HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
+ </Reference>
+ <Reference Include="GalaSoft.MvvmLight.Platform, Version=5.3.0.19032, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
+ <HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
+ </Reference>
<Reference Include="Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
+ <Reference Include="Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
+ </Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
+ <Reference Include="SimpleValidator, Version=0.6.1.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\packages\SimpleValidator.0.6.1.0\lib\net40\SimpleValidator.dll</HintPath>
+ </Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data.Entity.Design" />
<Reference Include="System.Windows" />
+ <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <HintPath>..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
+ <Private>True</Private>
+ </Reference>
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
@@ -55,6 +74,8 @@
</Compile>
<Compile Include="Commands\RelayCommand.cs" />
<Compile Include="ConcurrentList.cs" />
+ <Compile Include="Cryptography\ICryptographer.cs" />
+ <Compile Include="Cryptography\Rfc2898Cryptographer.cs" />
<Compile Include="ExtendedObject.cs" />
<Compile Include="ExtensionMethods\DateTimeExtensions.cs" />
<Compile Include="ExtensionMethods\DependencyObjectExtensions.cs" />
@@ -64,15 +85,24 @@
<Compile Include="ExtensionMethods\IParameterizedExtensions.cs" />
<Compile Include="ExtensionMethods\ObjectExtensions.cs" />
<Compile Include="ExtensionMethods\ReflectionExtensions.cs" />
+ <Compile Include="ExtensionMethods\IServiceLocatorExtensions.cs" />
<Compile Include="ExtensionMethods\StringExtensions.cs" />
<Compile Include="Helpers\AssemblyHelper.cs" />
+ <Compile Include="Helpers\ColorHelper.cs" />
<Compile Include="Helpers\PathHelper.cs" />
+ <Compile Include="Helpers\ThreadsHelper.cs" />
<Compile Include="IParameterized.cs" />
<Compile Include="ParameterIgnoreAttribute.cs" />
<Compile Include="ParameterItem.cs" />
<Compile Include="ParameterItemAttribute.cs" />
<Compile Include="ParameterItemMode.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Properties\Resources.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
+ <Compile Include="Threading\StaThreadHelper.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
@@ -83,5 +113,11 @@
<Name>Tango.Serialization</Name>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Properties\Resources.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Core/Threading/StaThreadHelper.cs b/Software/Visual_Studio/Tango.Core/Threading/StaThreadHelper.cs
new file mode 100644
index 000000000..5c1f5b93c
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Core/Threading/StaThreadHelper.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Tango.Core.Threading
+{
+ public static class StaThreadHelper
+ {
+ public static void StartStaThread(Action action)
+ {
+ Thread thread = new Thread(() =>
+ {
+ action();
+ });
+ thread.SetApartmentState(ApartmentState.STA);
+ thread.IsBackground = true;
+ thread.Start();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Core/packages.config b/Software/Visual_Studio/Tango.Core/packages.config
index e7e6cbade..114eefdba 100644
--- a/Software/Visual_Studio/Tango.Core/packages.config
+++ b/Software/Visual_Studio/Tango.Core/packages.config
@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
+ <package id="CommonServiceLocator" version="1.3" targetFramework="net46" />
<package id="Google.Protobuf" version="3.4.1" targetFramework="net45" />
+ <package id="MvvmLightLibs" version="5.3.0.0" targetFramework="net46" />
+ <package id="SimpleValidator" version="0.6.1.0" targetFramework="net46" />
</packages> \ No newline at end of file