ME3Explorer.Texplorer2.GoToTex C# (CSharp) Method

GoToTex() public method

public GoToTex ( string name, string nodeName, int selectedIndex ) : void
name string
nodeName string
selectedIndex int
return void
        public void GoToTex(string name, string nodeName, int selectedIndex)
        {
            // Clear previous search
            MainListView.SelectedItems.Clear();
            foreach (myTreeNode node in Tree.GetNodesAsList())
                node.BackColor = Color.White;

            // KFreon: Search in tree for specified texture
            List<TreeTexInfo> found = new List<TreeTexInfo>(Tree.GetTreeAsList().Where(tex => (name.ToLowerInvariant() == tex.TexName.ToLowerInvariant() && nodeName.ToLowerInvariant() == tex.ParentNode.Text.ToLowerInvariant())));

            // KFreon: Pick one of the textures found based on which is selected in the search box
            TreeTexInfo treetex = found[selectedIndex];

            // KFreon: Set selected node and set its colour
            MainTreeView.SelectedNode = treetex.ParentNode;
            treetex.ParentNode.BackColor = Color.Green;

            // KFreon: Select item in ListView and ensure it's visible and focused
            MainListView.Items[treetex.ListViewIndex].Selected = true;
            MainListView.EnsureVisible(treetex.ListViewIndex);
            MainListView.Focus();
        }
Texplorer2