private void LogListControlMain_DoubleClickListView(object sender, ListViewControlEventArgs e) { LogListControl llc = sender as LogListControl; Follow = false; if (e.SearchEventArgs != null) { LogPos lp = llc.SelectedLogPos; if (lp != null) { JumpToLine((int)lp.Order); } } if (e.Bookmark) { TabPage oldPage = tabPageInfo; TabPage selectedPage = AddInfoTabPage(llc.SelectedIndex); if (oldPage != tabPageInfo && oldPage != null) { oldPage.Text = $"Bookmark {llc.SelectedIndex:n0}"; LoglineInfoControl llic = (LoglineInfoControl)oldPage.Controls[0]; llic.SelectedLine = llc.SelectedIndex; llic.DoubleClickTextBox += InfoControl_DoubleClickTextBox; tabControlMain.SelectedTab = oldPage; } else { tabControlMain.SelectedTab = selectedPage; } } else { tabControlMain.SelectedTab = tabPageInfo; } }
private TabPage AddInfoTabPage(int pos) { foreach (TabPage tp in tabControlMain.TabPages) { if (tp.Name == "tabPageInfo" && (pos == -1 || ((LoglineInfoControl)tp.Controls[0]).SelectedLine == pos)) { return(tp); } } tabPageInfo = new TabPage(); infoControl = new LoglineInfoControl(); infoControl.Font = new System.Drawing.Font("Courier New", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); tabPageInfo.Controls.Add(infoControl); infoControl.Dock = DockStyle.Fill; infoControl.SearchEvent += InfoControl_SearchEvent; tabPageInfo.Name = "tabPageInfo"; tabPageInfo.Padding = new System.Windows.Forms.Padding(3); tabPageInfo.Text = "Details"; tabPageInfo.UseVisualStyleBackColor = true; tabControlMain.TabPages.Add(tabPageInfo); SelectedIndexChanged(selectedLogListControl); return(tabPageInfo); }
private void InfoControl_DoubleClickTextBox(object sender, EventArgs e) { LoglineInfoControl lic = sender as LoglineInfoControl; selectedLogListControl.SelectIndexVisible(lic.SelectedLine); }