VisualUIAVerify.Controls.AutomationElementTreeNode.SetTreeNodeImageIndex C# (CSharp) Method

SetTreeNodeImageIndex() private method

this method sets image index for this currentTestTypeRootNode
private SetTreeNodeImageIndex ( ) : void
return void
        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;
            }
        }