ME3Explorer.KFreonTPFTools3.CheckNodes C# (CSharp) Method

CheckNodes() private method

private CheckNodes ( IEnumerable texes ) : void
texes IEnumerable
return void
        void CheckNodes(IEnumerable<TPFTexInfo> texes)
        {
            MainTreeView.Invoke(new Action(() =>
            {
                foreach (var tex in texes)
                {
                    string nodeName = tex.FormatTexDetails(isAnalysed);
                    myTreeNode texNode = null;

                    // KFreon: Find node with correct name
                    int index = 0;
                    foreach (myTreeNode node in MainTreeView.Nodes)
                    {
                        if (node.Text == nodeName && LoadedTexes[node.TexInd].Hash == tex.Hash)
                        {
                            texNode = node;
                            break;
                        }
                        index++;
                    }

                    if (texNode == null)
                        continue;

                    texNode.Checked = true;

                    // KFreon: Check tree duplicates as well since they're basically the same texture
                    if (tex.TreeDuplicates != null && tex.TreeDuplicates.Count != 0)
                    {
                        foreach (int ind in tex.TreeDuplicates)
                        {
                            myTreeNode dupNode = GetDupNode(tex, index);
                            dupNode.Checked = true;
                            index = ind; // KFreon: Update it's "current position" as GetDupNode looks for the one closest to 'index'.
                        }
                    }
                }
            }));
        }
KFreonTPFTools3