private void DisplayResults(hMailServer.DiagnosticResults results)
{
treeResults.Nodes.Clear();
_resultString = "";
for (int i = 0; i < results.Count; i++)
{
hMailServer.DiagnosticResult result = results.get_Item(i);
int imageIndex = result.Result ? 1 : 0;
_resultString += "Test: " + result.Name + "\r\n";
TreeNode node = treeResults.Nodes.Add(result.Name, result.Name, imageIndex, imageIndex);
node.ToolTipText = result.Description;
string [] subItems = Microsoft.VisualBasic.Strings.Split(result.ExecutionDetails, "\r\n", -1, Microsoft.VisualBasic.CompareMethod.Text);
foreach (string subItem in subItems)
{
if (subItem.Length == 0)
continue;
int subImageIndex = subItem.Contains("ERROR:") ? 0 : 1;
_resultString += subItem + "\r\n";
node.Nodes.Add(subItem, subItem, subImageIndex, subImageIndex);
}
_resultString += "\r\n";
Marshal.ReleaseComObject(result);
}
treeResults.ExpandAll();
}