using System.Windows.Media;
using QC.QsprTestObjects.Tests.Base;

namespace QC.QTMApplication.Utilities;

public static class NodeAppearanceUtility
{
	public static void SetNodeColorRecursiveUp(BaseTest node, Color color)
	{
		node.TestUserInterfaceProperties.BackColor = color.ToString();
		if (node.Parent != null)
		{
			SetNodeColorRecursiveUp(node.Parent, color);
		}
	}

	public static void SetNodeColorRecursive(BaseTest node, Color color)
	{
		node.TestUserInterfaceProperties.BackColor = color.ToString();
		if (!(node is FolderTest))
		{
			return;
		}
		foreach (BaseTest test in (node as FolderTest).TestList)
		{
			SetNodeColorRecursive(test, color);
		}
	}
}
