/// <summary> /// Does the job /// </summary> static void DoWorkTestCustomIndicators(object sender, DoWorkEventArgs e) { bool isErrors = false; StringBuilder errorReport = new StringBuilder(); errorReport.AppendLine("<h1>" + Language.T("Custom Indicators") + "</h1>"); StringBuilder okReport = new StringBuilder(); okReport.AppendLine("<h1>" + Language.T("Custom Indicators") + "</h1>"); okReport.AppendLine("<p>"); foreach (string indicatorName in Indicator_Store.CustomIndicatorNames) { string errorList; if (!Indicator_Tester.CustomIndicatorThoroughTest(indicatorName, out errorList)) { isErrors = true; errorReport.AppendLine("<h2>" + indicatorName + "</h2>"); string error = errorList.Replace("\r\n", "</br>"); error = error.Replace("\t", " "); errorReport.AppendLine("<p>" + error + "</p>"); } else { okReport.AppendLine(indicatorName + " - OK" + "<br />"); } } okReport.AppendLine("</p>"); CustomIndicatorsTestResult result = new CustomIndicatorsTestResult(); result.IsErrors = isErrors; result.ErrorReport = errorReport.ToString(); result.OKReport = okReport.ToString(); e.Result = (object)result; return; }
/// <summary> /// Does the job /// </summary> private static void DoWorkTestCustomIndicators(object sender, DoWorkEventArgs e) { bool isErrors = false; var errorReport = new StringBuilder(); errorReport.AppendLine("<h1>" + Language.T("Custom Indicators") + "</h1>"); var okReport = new StringBuilder(); okReport.AppendLine("<h1>" + Language.T("Custom Indicators") + "</h1>"); okReport.AppendLine("<p>"); foreach (string indicatorName in IndicatorStore.CustomIndicatorNames) { string errorList; if (!IndicatorTester.CustomIndicatorThoroughTest(indicatorName, out errorList)) { isErrors = true; errorReport.AppendLine("<h2>" + indicatorName + "</h2>"); string error = errorList.Replace(Environment.NewLine, "</br>"); error = error.Replace("\t", " "); errorReport.AppendLine("<p>" + error + "</p>"); } else { okReport.AppendLine(indicatorName + " - OK" + "<br />"); } } okReport.AppendLine("</p>"); var result = new CustomIndicatorsTestResult { IsErrors = isErrors, ErrorReport = errorReport.ToString(), OKReport = okReport.ToString() }; e.Result = result; }
/// <summary> /// Test is finished /// </summary> static void Worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { CustomIndicatorsTestResult result = (CustomIndicatorsTestResult)e.Result; if (result.IsErrors) { Fancy_Message_Box msgBoxError = new Fancy_Message_Box(result.ErrorReport, Language.T("Custom Indicators")); msgBoxError.BoxWidth = 550; msgBoxError.BoxHeight = 340; msgBoxError.TopMost = true; msgBoxError.Show(); } Fancy_Message_Box msgBoxOK = new Fancy_Message_Box(result.OKReport, Language.T("Custom Indicators")); msgBoxOK.BoxWidth = 350; msgBoxOK.BoxHeight = 280; msgBoxOK.TopMost = true; msgBoxOK.Show(); return; }
/// <summary> /// Does the job /// </summary> private static void DoWorkTestCustomIndicators(object sender, DoWorkEventArgs e) { bool isErrors = false; var errorReport = new StringBuilder(); errorReport.AppendLine("<h1>" + Language.T("Custom Indicators") + "</h1>"); var okReport = new StringBuilder(); okReport.AppendLine("<h1>" + Language.T("Custom Indicators") + "</h1>"); okReport.AppendLine("<p>"); foreach (string indicatorName in IndicatorStore.CustomIndicatorNames) { string errorList; if (!IndicatorTester.CustomIndicatorThoroughTest(indicatorName, out errorList)) { isErrors = true; errorReport.AppendLine("<h2>" + indicatorName + "</h2>"); string error = errorList.Replace(Environment.NewLine, "</br>"); error = error.Replace("\t", " "); errorReport.AppendLine("<p>" + error + "</p>"); } else { okReport.AppendLine(indicatorName + " - OK" + "<br />"); } } okReport.AppendLine("</p>"); var result = new CustomIndicatorsTestResult {IsErrors = isErrors, ErrorReport = errorReport.ToString(), OKReport = okReport.ToString()}; e.Result = result; }