private void SetTreeNodeImageIndex()
{
if (this.AutomationElementTreeControl.InvokeRequired)
{
this.AutomationElementTreeControl.BeginInvoke(new MethodInvoker(SetTreeNodeImageIndex));
}
else
{
ImageIndexes imageIndex = ImageIndexes.GeneralNode;
if (this._isNodeLive)
imageIndex = ImageIndexes.NodeIsLive;
if (this._childrenStatus == ChildrenElementsStatus.NotPopulated)
imageIndex = ImageIndexes.NodeBeeingRefreshed;
if (this._errorInPopulatingChildren)
imageIndex = ImageIndexes.GeneralError;
this.TreeNode.ImageIndex = this.TreeNode.SelectedImageIndex = (int)imageIndex;
}
}