ME3Explorer.Texplorer2.SearchList_Click C# (CSharp) Method

SearchList_Click() public method

public SearchList_Click ( ListBox box ) : void
box ListBox
return void
        public void SearchList_Click(ListBox box)
        {
            if (box.SelectedIndex == -1)
                return;

            string fullName = box.SelectedItem.ToString();
            string texName = fullName.Remove(fullName.IndexOf(" ("));
            int lastIndex = fullName.LastIndexOf("(");
            string nodeName = fullName.Remove(0, lastIndex >= 0 ? lastIndex : 0).Replace("(", "").Replace(")", "");

            // KFreon: Get all entries in box
            int index = -1;
            int count = 0;
            for (int i = 0; i < box.Items.Count; i++)
            {
                string name = box.Items[i].ToString();
                if (name.ToLowerInvariant() == fullName.ToLowerInvariant())
                {
                    index = i == box.SelectedIndex ? count : index;
                    count++;
                }
            }

            GoToTex(texName, nodeName, index);
        }
Texplorer2