private void OpenFilesForTailing(string[] fileNames) { #if DEBUG foreach (string file in fileNames) #else System.Threading.Tasks.Parallel.ForEach(fileNames, file => #endif { var temp = file.ToLower(); if (mapOpenFiles.ContainsKey(temp)) { mapOpenFiles[temp]?.ActivateAndMaximize(); } else { var tailForm = new LogFileViewer(this, file, true); tailForm.SetLSVFont(fontForListView); mapOpenFiles[temp] = tailForm; var newPage = new TabPage(tailForm.Text) { ToolTipText = file }; TbcMDIChildren.TabPages.Add(newPage); TbcMDIChildren.SelectedTab = newPage; TbcMDIChildren.Show(); } #if DEBUG } #else }); #endif }
public void NotifyStoppedTailing(string fileName, string title) { mapOpenFiles.Remove(fileName.ToLower()); foreach (TabPage page in TbcMDIChildren.TabPages) { if (page.Text.Equals(title)) { TbcMDIChildren.TabPages.Remove(page); break; } } if (TbcMDIChildren.TabPages.Count < 1) { TbcMDIChildren.Hide(); } }