diff --git a/MT5Connector/MT5Connector.vcxproj b/MT5Connector/MT5Connector.vcxproj index fadb5b89..f877e50e 100755 --- a/MT5Connector/MT5Connector.vcxproj +++ b/MT5Connector/MT5Connector.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -20,7 +20,7 @@ {CB6D4A3E-2F2E-4C67-929D-3C2A8FD1C556} - v4.0 + v4.5 ManagedCProj MT5Connector @@ -30,24 +30,28 @@ true true MultiByte + v120 DynamicLibrary true true Unicode + v120 DynamicLibrary false true Unicode + v120 DynamicLibrary false true Unicode + v120 diff --git a/MTApiService/MTApiService.csproj b/MTApiService/MTApiService.csproj index c1ceebdf..7e85c90d 100755 --- a/MTApiService/MTApiService.csproj +++ b/MTApiService/MTApiService.csproj @@ -38,7 +38,7 @@ true - MetaTraderApiKey.pfx + MtApiKey.pfx @@ -76,7 +76,7 @@ - + diff --git a/MTApiService/MetaTraderApiKey.pfx b/MTApiService/MetaTraderApiKey.pfx deleted file mode 100755 index 54eab36e..00000000 Binary files a/MTApiService/MetaTraderApiKey.pfx and /dev/null differ diff --git a/MTApiService/MtApiKey.pfx b/MTApiService/MtApiKey.pfx new file mode 100755 index 00000000..92568c25 Binary files /dev/null and b/MTApiService/MtApiKey.pfx differ diff --git a/MTConnector/MTConnector.vcxproj b/MTConnector/MTConnector.vcxproj index 73b4534e..2fb94464 100755 --- a/MTConnector/MTConnector.vcxproj +++ b/MTConnector/MTConnector.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -20,7 +20,7 @@ {2BE5FAC1-7FB7-45C3-9215-31A5BC4B964F} - v4.0 + v4.5 ManagedCProj MTConnector MTConnector @@ -31,24 +31,28 @@ true true NotSet + v120 DynamicLibrary true true Unicode + v120 DynamicLibrary false true NotSet + v120 DynamicLibrary false true MultiByte + v120 diff --git a/MetaTraderApi_2013.sln b/MetaTraderApi_2013.sln new file mode 100755 index 00000000..7f2e8b40 --- /dev/null +++ b/MetaTraderApi_2013.sln @@ -0,0 +1,115 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestServer", "TestServer\TestServer.csproj", "{220F01DF-8489-44F3-9C79-D5AFFCE94D6B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApiClientUI", "TestApiClientUI\TestApiClientUI.csproj", "{663CC515-EAAE-47D4-8933-5008C2DA1160}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MTApiService", "MTApiService\MTApiService.csproj", "{DE76D5C7-B99C-4467-8408-78173BDD84E0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MTConnector", "MTConnector\MTConnector.vcxproj", "{2BE5FAC1-7FB7-45C3-9215-31A5BC4B964F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MtApi", "MtApi\MtApi.csproj", "{7A76C388-A8FB-4949-8170-24D4742E934E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MtApi5", "MtApi5\MtApi5.csproj", "{AC8B5010-DA75-477E-9CA5-547C649E12D8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MT5Connector", "MT5Connector\MT5Connector.vcxproj", "{CB6D4A3E-2F2E-4C67-929D-3C2A8FD1C556}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MtApi5TestClient", "MtApi5TestClient\MtApi5TestClient.csproj", "{38B9C657-BC2F-44F0-8824-54B31F2A64F5}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TestMtApi", "TestMtApi\TestMtApi\TestMtApi.vbproj", "{EB7C228D-9494-4985-845E-B8312450DF3D}" +EndProject +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MtApiInstaller", "MtApiInstaller\MtApiInstaller.wixproj", "{78B94552-DB17-40EC-B7C6-23D32DB85DC1}" + ProjectSection(ProjectDependencies) = postProject + {7A76C388-A8FB-4949-8170-24D4742E934E} = {7A76C388-A8FB-4949-8170-24D4742E934E} + {2BE5FAC1-7FB7-45C3-9215-31A5BC4B964F} = {2BE5FAC1-7FB7-45C3-9215-31A5BC4B964F} + {DE76D5C7-B99C-4467-8408-78173BDD84E0} = {DE76D5C7-B99C-4467-8408-78173BDD84E0} + EndProjectSection +EndProject +Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MtApi5Installer", "MtApi5Installer\MtApi5Installer.wixproj", "{A9ED070F-AB4D-4380-9DDE-5D931AC71333}" + ProjectSection(ProjectDependencies) = postProject + {AC8B5010-DA75-477E-9CA5-547C649E12D8} = {AC8B5010-DA75-477E-9CA5-547C649E12D8} + {CB6D4A3E-2F2E-4C67-929D-3C2A8FD1C556} = {CB6D4A3E-2F2E-4C67-929D-3C2A8FD1C556} + {DE76D5C7-B99C-4467-8408-78173BDD84E0} = {DE76D5C7-B99C-4467-8408-78173BDD84E0} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {220F01DF-8489-44F3-9C79-D5AFFCE94D6B}.Debug|Win32.ActiveCfg = Debug|x86 + {220F01DF-8489-44F3-9C79-D5AFFCE94D6B}.Debug|x64.ActiveCfg = Debug|x86 + {220F01DF-8489-44F3-9C79-D5AFFCE94D6B}.Release|Win32.ActiveCfg = Release|x86 + {220F01DF-8489-44F3-9C79-D5AFFCE94D6B}.Release|x64.ActiveCfg = Release|x86 + {663CC515-EAAE-47D4-8933-5008C2DA1160}.Debug|Win32.ActiveCfg = Debug|x86 + {663CC515-EAAE-47D4-8933-5008C2DA1160}.Debug|x64.ActiveCfg = Debug|Any CPU + {663CC515-EAAE-47D4-8933-5008C2DA1160}.Release|Win32.ActiveCfg = Release|x86 + {663CC515-EAAE-47D4-8933-5008C2DA1160}.Release|x64.ActiveCfg = Release|Any CPU + {DE76D5C7-B99C-4467-8408-78173BDD84E0}.Debug|Win32.ActiveCfg = Debug|Any CPU + {DE76D5C7-B99C-4467-8408-78173BDD84E0}.Debug|Win32.Build.0 = Debug|Any CPU + {DE76D5C7-B99C-4467-8408-78173BDD84E0}.Debug|x64.ActiveCfg = Debug|Any CPU + {DE76D5C7-B99C-4467-8408-78173BDD84E0}.Debug|x64.Build.0 = Debug|Any CPU + {DE76D5C7-B99C-4467-8408-78173BDD84E0}.Release|Win32.ActiveCfg = Release|Any CPU + {DE76D5C7-B99C-4467-8408-78173BDD84E0}.Release|Win32.Build.0 = Release|Any CPU + {DE76D5C7-B99C-4467-8408-78173BDD84E0}.Release|x64.ActiveCfg = Release|Any CPU + {DE76D5C7-B99C-4467-8408-78173BDD84E0}.Release|x64.Build.0 = Release|Any CPU + {2BE5FAC1-7FB7-45C3-9215-31A5BC4B964F}.Debug|Win32.ActiveCfg = Debug|Win32 + {2BE5FAC1-7FB7-45C3-9215-31A5BC4B964F}.Debug|Win32.Build.0 = Debug|Win32 + {2BE5FAC1-7FB7-45C3-9215-31A5BC4B964F}.Debug|x64.ActiveCfg = Debug|Win32 + {2BE5FAC1-7FB7-45C3-9215-31A5BC4B964F}.Release|Win32.ActiveCfg = Release|Win32 + {2BE5FAC1-7FB7-45C3-9215-31A5BC4B964F}.Release|Win32.Build.0 = Release|Win32 + {2BE5FAC1-7FB7-45C3-9215-31A5BC4B964F}.Release|x64.ActiveCfg = Release|Win32 + {7A76C388-A8FB-4949-8170-24D4742E934E}.Debug|Win32.ActiveCfg = Debug|Any CPU + {7A76C388-A8FB-4949-8170-24D4742E934E}.Debug|Win32.Build.0 = Debug|Any CPU + {7A76C388-A8FB-4949-8170-24D4742E934E}.Debug|x64.ActiveCfg = Debug|Any CPU + {7A76C388-A8FB-4949-8170-24D4742E934E}.Release|Win32.ActiveCfg = Release|Any CPU + {7A76C388-A8FB-4949-8170-24D4742E934E}.Release|Win32.Build.0 = Release|Any CPU + {7A76C388-A8FB-4949-8170-24D4742E934E}.Release|x64.ActiveCfg = Release|Any CPU + {AC8B5010-DA75-477E-9CA5-547C649E12D8}.Debug|Win32.ActiveCfg = Debug|Any CPU + {AC8B5010-DA75-477E-9CA5-547C649E12D8}.Debug|Win32.Build.0 = Debug|Any CPU + {AC8B5010-DA75-477E-9CA5-547C649E12D8}.Debug|x64.ActiveCfg = Debug|Any CPU + {AC8B5010-DA75-477E-9CA5-547C649E12D8}.Debug|x64.Build.0 = Debug|Any CPU + {AC8B5010-DA75-477E-9CA5-547C649E12D8}.Release|Win32.ActiveCfg = Release|Any CPU + {AC8B5010-DA75-477E-9CA5-547C649E12D8}.Release|Win32.Build.0 = Release|Any CPU + {AC8B5010-DA75-477E-9CA5-547C649E12D8}.Release|x64.ActiveCfg = Release|Any CPU + {AC8B5010-DA75-477E-9CA5-547C649E12D8}.Release|x64.Build.0 = Release|Any CPU + {CB6D4A3E-2F2E-4C67-929D-3C2A8FD1C556}.Debug|Win32.ActiveCfg = Debug|Win32 + {CB6D4A3E-2F2E-4C67-929D-3C2A8FD1C556}.Debug|Win32.Build.0 = Debug|Win32 + {CB6D4A3E-2F2E-4C67-929D-3C2A8FD1C556}.Debug|x64.ActiveCfg = Debug|x64 + {CB6D4A3E-2F2E-4C67-929D-3C2A8FD1C556}.Debug|x64.Build.0 = Debug|x64 + {CB6D4A3E-2F2E-4C67-929D-3C2A8FD1C556}.Release|Win32.ActiveCfg = Release|Win32 + {CB6D4A3E-2F2E-4C67-929D-3C2A8FD1C556}.Release|Win32.Build.0 = Release|Win32 + {CB6D4A3E-2F2E-4C67-929D-3C2A8FD1C556}.Release|x64.ActiveCfg = Release|x64 + {CB6D4A3E-2F2E-4C67-929D-3C2A8FD1C556}.Release|x64.Build.0 = Release|x64 + {38B9C657-BC2F-44F0-8824-54B31F2A64F5}.Debug|Win32.ActiveCfg = Debug|x86 + {38B9C657-BC2F-44F0-8824-54B31F2A64F5}.Debug|x64.ActiveCfg = Debug|Any CPU + {38B9C657-BC2F-44F0-8824-54B31F2A64F5}.Debug|x64.Build.0 = Debug|Any CPU + {38B9C657-BC2F-44F0-8824-54B31F2A64F5}.Release|Win32.ActiveCfg = Release|x86 + {38B9C657-BC2F-44F0-8824-54B31F2A64F5}.Release|x64.ActiveCfg = Release|Any CPU + {EB7C228D-9494-4985-845E-B8312450DF3D}.Debug|Win32.ActiveCfg = Debug|x86 + {EB7C228D-9494-4985-845E-B8312450DF3D}.Debug|x64.ActiveCfg = Debug|x86 + {EB7C228D-9494-4985-845E-B8312450DF3D}.Release|Win32.ActiveCfg = Release|x86 + {EB7C228D-9494-4985-845E-B8312450DF3D}.Release|x64.ActiveCfg = Release|x86 + {78B94552-DB17-40EC-B7C6-23D32DB85DC1}.Debug|Win32.ActiveCfg = Debug|x86 + {78B94552-DB17-40EC-B7C6-23D32DB85DC1}.Debug|Win32.Build.0 = Debug|x86 + {78B94552-DB17-40EC-B7C6-23D32DB85DC1}.Debug|x64.ActiveCfg = Debug|x86 + {78B94552-DB17-40EC-B7C6-23D32DB85DC1}.Release|Win32.ActiveCfg = Release|x86 + {78B94552-DB17-40EC-B7C6-23D32DB85DC1}.Release|Win32.Build.0 = Release|x86 + {78B94552-DB17-40EC-B7C6-23D32DB85DC1}.Release|x64.ActiveCfg = Release|x86 + {A9ED070F-AB4D-4380-9DDE-5D931AC71333}.Debug|Win32.ActiveCfg = Debug|x86 + {A9ED070F-AB4D-4380-9DDE-5D931AC71333}.Debug|Win32.Build.0 = Debug|x86 + {A9ED070F-AB4D-4380-9DDE-5D931AC71333}.Debug|x64.ActiveCfg = Debug|x86 + {A9ED070F-AB4D-4380-9DDE-5D931AC71333}.Release|Win32.ActiveCfg = Release|x86 + {A9ED070F-AB4D-4380-9DDE-5D931AC71333}.Release|Win32.Build.0 = Release|x86 + {A9ED070F-AB4D-4380-9DDE-5D931AC71333}.Release|x64.ActiveCfg = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/MtApi/ExtensionMethods.cs b/MtApi/ExtensionMethods.cs index 3651de34..b59af497 100755 --- a/MtApi/ExtensionMethods.cs +++ b/MtApi/ExtensionMethods.cs @@ -2,26 +2,45 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using System.Threading.Tasks; namespace MtApi { static class ExtensionMethods { #region Event Methods - public static void FireEvent(this EventHandler eventHandler, object sender) + + public static async void FireEvent(this MtApiQuoteHandler evenHandler, object sender, string symbol, double bid, double ask) { - if (eventHandler != null) + if (evenHandler != null) { - eventHandler(sender, EventArgs.Empty); + await Task.Factory.StartNew(() => + { + evenHandler(sender, symbol, bid, ask); + }); } } - public static void FireEvent(this EventHandler eventHandler, object sender, T e) + public static async void FireEvent(this EventHandler eventHandler, object sender) + { + if (eventHandler != null) + { + await Task.Factory.StartNew(() => + { + eventHandler(sender, EventArgs.Empty); + }); + } + } + + public static async void FireEvent(this EventHandler eventHandler, object sender, T e) where T : EventArgs { if (eventHandler != null) { - eventHandler(sender, e); + await Task.Factory.StartNew(() => + { + eventHandler(sender, e); + }); } } diff --git a/MtApi/MtApi.csproj b/MtApi/MtApi.csproj index 0b3993a9..6cad83ce 100755 --- a/MtApi/MtApi.csproj +++ b/MtApi/MtApi.csproj @@ -10,7 +10,7 @@ Properties MtApi MtApi - v4.0 + v4.5 512 @@ -23,6 +23,7 @@ DEBUG;TRACE prompt 4 + false pdbonly @@ -32,6 +33,7 @@ prompt 4 AnyCPU + false false diff --git a/MtApi/MtApiClient.cs b/MtApi/MtApiClient.cs index f31c57eb..8e6eb504 100755 --- a/MtApi/MtApiClient.cs +++ b/MtApi/MtApiClient.cs @@ -1314,10 +1314,7 @@ namespace MtApi { if (quote != null) { - if (QuoteUpdated != null) - { - QuoteUpdated(this, quote.Instrument, quote.Bid, quote.Ask); - } + QuoteUpdated.FireEvent(this, quote.Instrument, quote.Bid, quote.Ask); } } diff --git a/TestApiClientUI/Properties/Resources.Designer.cs b/TestApiClientUI/Properties/Resources.Designer.cs index 3dae950e..06f334dc 100755 --- a/TestApiClientUI/Properties/Resources.Designer.cs +++ b/TestApiClientUI/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.235 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/TestApiClientUI/Properties/Settings.Designer.cs b/TestApiClientUI/Properties/Settings.Designer.cs index 29700001..2bace71a 100755 --- a/TestApiClientUI/Properties/Settings.Designer.cs +++ b/TestApiClientUI/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.235 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ namespace TestApiClientUI.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/TestApiClientUI/TestApiClientUI.csproj b/TestApiClientUI/TestApiClientUI.csproj index 9c1d3860..684972b7 100755 --- a/TestApiClientUI/TestApiClientUI.csproj +++ b/TestApiClientUI/TestApiClientUI.csproj @@ -10,7 +10,7 @@ Properties TestApiClientUI TestApiClientUI - v4.0 + v4.5 512 @@ -39,6 +39,7 @@ DEBUG;TRACE prompt 4 + false x86 @@ -48,6 +49,7 @@ TRACE prompt 4 + false true @@ -64,6 +66,7 @@ true ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules true + false bin\Release\ @@ -80,12 +83,9 @@ true ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules true + false - - False - C:\Program Files (x86)\MtApi\MtApi.dll - @@ -152,6 +152,12 @@ true + + + {7a76c388-a8fb-4949-8170-24d4742e934e} + MtApi + +