Bend.MainWindow.TabClick C# (CSharp) Method

TabClick() private method

private TabClick ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void
sender object
e System.Windows.Input.MouseButtonEventArgs
return void
        private void TabClick(object sender, MouseButtonEventArgs e)
        {
            // Find the tab title in tab collection
            for (int i = 0; i < tab.Count; i++)
            {
                if (tab[i].Title == sender)
                {
                    if (currentTabIndex >= 0)
                    {
                        tab[currentTabIndex].TextEditor.Visibility = Visibility.Hidden;
                        tab[currentTabIndex].Title.Opacity = 0.5;
                    }
                    // Clear find on page state
                    this.currentSearchIndex = 0;
                    tab[this.currentTabIndex].TextEditor.Select(0,0);

                    this.currentTabIndex = i;
                    tab[i].Title.Opacity = 1.0;
                    tab[i].TextEditor.Visibility = Visibility.Visible;
                    tab[i].TextEditor.Focus();
                    break;
                }
            }
            // Tab was not found - fail silently
        }