Exemple #1
0
        void SetTabTooltip(bool FromDoSearch)
        {
            var currentPage = _tc.TabPages[_tc.SelectedIndex];

            currentPage.ToolTipText  = !String.IsNullOrWhiteSpace(txtSourceFile.Text) ? "File: " + txtSourceFile.Text + "\r\n" : String.Empty;
            currentPage.ToolTipText += !String.IsNullOrWhiteSpace(txtGrep.Text) ? "Search: " + txtGrep.Text + "\r\n" : String.Empty;
            currentPage.ToolTipText += !String.IsNullOrWhiteSpace(txtDLL.Text) ? "DLL: " + txtDLL.Text : String.Empty;

            var t = new TabTag {
                SourceFileName = txtSourceFile.Text, CodeGrep = txtGrep.Text, DLLFileName = txtDLL.Text
            };

            var setSelectedRow = true;

            if (currentPage.Tag != null && (currentPage.Tag as TabTag) != null && _tc.TabPages.Count > 1)
            {
                var tg            = currentPage.Tag as TabTag;
                var fromTabSwitch = tg.FromTabSwitch;
                setSelectedRow  = !fromTabSwitch;
                t.FromTabSwitch = fromTabSwitch;
                t.RowSelected   = tg.RowSelected;
            }

            if (setSelectedRow)
            {
                if (gridResults.SelectedRows.Count > 0)
                {
                    t.RowSelected = gridResults.SelectedRows[0].Index;
                }
                else
                {
                    t.RowSelected = 0;
                }
            }
            else
            {
                if (gridResults.Rows.Count > 0 && gridResults.Rows.Count - 1 >= t.RowSelected)
                {
                    gridResults.Rows[t.RowSelected].Selected = true;
                }
            }

            if (FromDoSearch)
            {
                t.FromTabSwitch = false;
            }

#if DEBUG
            currentPage.ToolTipText += "SELECTED ROW: " + t.RowSelected.ToString();
#endif
            currentPage.Tag = t;
        }
Exemple #2
0
        void SetTabTooltip()
        {
            var currentPage = _tc.TabPages[_tc.SelectedIndex];

            currentPage.ToolTipText  = !String.IsNullOrWhiteSpace(txtSourceFile.Text) ? "File: " + txtSourceFile.Text + "\r\n" : String.Empty;
            currentPage.ToolTipText += !String.IsNullOrWhiteSpace(txtGrep.Text) ? "Search: " + txtGrep.Text + "\r\n" : String.Empty;
            currentPage.ToolTipText += !String.IsNullOrWhiteSpace(txtDLL.Text) ? "DLL: " + txtDLL.Text : String.Empty;

            var t = new TabTag
            {
                SourceFileName = txtSourceFile.Text,
                CodeGrep       = txtGrep.Text,
                DLLFileName    = txtDLL.Text,
                DataSource     = gridResults.DataSource,
                ResultCount    = lblResultCount.Text
            };

            currentPage.Tag = t;
        }