Exemplo n.º 1
0
        private void HandleBackTestDll(ScriptingDLLs scriptingDlls, StringBuilder stringBuilder)
        {
            var backtesterDllPath    = Path.Combine(PathManager.DeployDirectory, "Backtest.dll");
            var backtesterDllVersion = Extentions.GetFileVersion(backtesterDllPath);

            if (backtesterDllVersion != scriptingDlls.BacktesterDllVersion && !string.IsNullOrEmpty(scriptingDlls.BacktesterDllVersion))
            {
                if (scriptingDlls.BacktesterDll.Length > 0)
                {
                    try
                    {
                        var data = Extentions.Decompress(scriptingDlls.BacktesterDll);
                        File.WriteAllBytes(backtesterDllPath, data);
                        if (stringBuilder.Length > 0)
                        {
                            stringBuilder.Append(Environment.NewLine);
                        }

                        stringBuilder.Append("Updated backtester library to v" + scriptingDlls.BacktesterDllVersion);
                    }
                    catch (Exception ex)
                    {
                        ScriptingLogManager.SendLogMessage(ex.ToString());
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void HandeScriptingDll(ScriptingDLLs scriptingDlls, StringBuilder stringBuilder)
        {
            var scriptingDllPath    = Path.Combine(PathManager.DeployDirectory, "Scripting.dll");
            var scriptingDllVersion = Extentions.GetFileVersion(scriptingDllPath);

            if (scriptingDllVersion != scriptingDlls.ScriptingDllVersion && !string.IsNullOrEmpty(scriptingDlls.ScriptingDllVersion))
            {
                if (scriptingDlls.ScriptingDll.Length > 0)
                {
                    try
                    {
                        var data = Extentions.Decompress(scriptingDlls.ScriptingDll);
                        File.WriteAllBytes(scriptingDllPath, data);
                        stringBuilder.Append("Updated Scripting library to v" + scriptingDlls.ScriptingDllVersion);
                    }
                    catch (Exception ex)
                    {
                        ScriptingLogManager.SendLogMessage(ex.ToString());
                    }
                }
            }
        }