public void RemoveWindow(LogWindow logWindow) { lock (_logWindowList) { _logWindowList.Remove(logWindow); } OnWindowRemoved(); }
public FilterPipe(FilterParams filterParams, LogWindow logWindow) { FilterParams = filterParams; LogWindow = logWindow; IsStopped = false; FileName = Path.GetTempFileName(); Logger.logInfo("Created temp file: " + FileName); }
public void AddWindow(LogWindow logWindow) { lock (_logWindowList) { if (!_logWindowList.Contains(logWindow)) { _logWindowList.Add(logWindow); } } }
public LogTabPage(LogWindow logWindow, String title) : base("MMi" + (title == null ? Util.GetNameFromPath(logWindow.FileName) : title)) { this.title = title; if (this.title == null) this.title = Util.GetNameFromPath(logWindow.FileName); this.LogWindow = logWindow; this.LogWindow.FileSizeChanged += FileSizeChanged; this.LogWindow.TailFollowed += TailFollowed; this.ledThread = new Thread(new ThreadStart(this.LedThreadProc)); this.ledThread.IsBackground = true; this.ledThread.Start(); }
/// <summary> /// Scrolls all LogWindows to the given timestamp /// </summary> /// <param name="timestamp"></param> public void NavigateToTimestamp(DateTime timestamp, LogWindow sender) { CurrentTimestamp = timestamp; lock (_logWindowList) { foreach (LogWindow logWindow in _logWindowList) { if (sender != logWindow) { logWindow.ScrollToTimestamp(timestamp, false, false); } } } }
private ColumnizerCallback(ColumnizerCallback original) { _logWindow = original._logWindow; LineNum = original.LineNum; }
protected void OnFilterListChanged(LogWindow source) { if (FilterListChanged != null) { FilterListChanged(this, new FilterListChangedEventArgs(source)); } }
public void AddToTimeSync(LogWindow master) { Logger.logInfo("Syncing window for " + Util.GetNameFromPath(FileName) + " to " + Util.GetNameFromPath(master.FileName)); lock (_timeSyncListLock) { if (IsTimeSynced && master.TimeSyncList != TimeSyncList) // already synced but master has different sync list { FreeFromTimeSync(); } TimeSyncList = master.TimeSyncList; TimeSyncList.AddWindow(this); ScrollToTimestamp(TimeSyncList.CurrentTimestamp, false, false); } OnSyncModeChanged(); }
void AddSlaveToTimesync(LogWindow slave) { lock (_timeSyncListLock) { if (TimeSyncList == null) { if (slave.TimeSyncList == null) { TimeSyncList = new TimeSyncList(); TimeSyncList.AddWindow(this); } else { TimeSyncList = slave.TimeSyncList; } int currentLineNum = dataGridView.CurrentCellAddress.Y; int refLine = currentLineNum; DateTime timeStamp = GetTimestampForLine(ref refLine, true); if (!timeStamp.Equals(DateTime.MinValue) && !_shouldTimestampDisplaySyncingCancel) { TimeSyncList.CurrentTimestamp = timeStamp; } TimeSyncList.WindowRemoved += TimeSyncList_WindowRemoved; } } slave.AddToTimeSync(this); OnSyncModeChanged(); }
public WindowFileEntry(LogWindow logWindow) { this.LogWindow = logWindow; }
public WindowFileEntry(LogWindow logWindow) { this.logWindow = logWindow; }
private void ConnectToolWindows(LogWindow logWindow) { ConnectBookmarkWindow(logWindow); }
private void DisconnectToolWindows(LogWindow logWindow) { DisconnectBookmarkWindow(logWindow); }
private void ChangeCurrentLogWindow(LogWindow newLogWindow) { if (newLogWindow == currentLogWindow) { return; // do nothing if wishing to set the same window } LogWindow oldLogWindow = currentLogWindow; currentLogWindow = newLogWindow; string titleName = showInstanceNumbers ? "LogExpert #" + instanceNumber : "LogExpert"; if (oldLogWindow != null) { oldLogWindow.StatusLineEvent -= StatusLineEvent; oldLogWindow.ProgressBarUpdate -= ProgressBarUpdate; oldLogWindow.GuiStateUpdate -= GuiStateUpdate; oldLogWindow.ColumnizerChanged -= ColumnizerChanged; oldLogWindow.BookmarkAdded -= BookmarkAdded; oldLogWindow.BookmarkRemoved -= BookmarkRemoved; oldLogWindow.BookmarkTextChanged -= BookmarkTextChanged; DisconnectToolWindows(oldLogWindow); } if (newLogWindow != null) { newLogWindow.StatusLineEvent += StatusLineEvent; newLogWindow.ProgressBarUpdate += ProgressBarUpdate; newLogWindow.GuiStateUpdate += GuiStateUpdate; newLogWindow.ColumnizerChanged += ColumnizerChanged; newLogWindow.BookmarkAdded += BookmarkAdded; newLogWindow.BookmarkRemoved += BookmarkRemoved; newLogWindow.BookmarkTextChanged += BookmarkTextChanged; if (newLogWindow.IsTempFile) { Text = titleName + @" - " + newLogWindow.TempTitleName; } else { Text = titleName + @" - " + newLogWindow.FileName; } multiFileToolStripMenuItem.Checked = CurrentLogWindow.IsMultiFile; multiFileToolStripMenuItem.Enabled = true; multiFileEnabledStripMenuItem.Checked = CurrentLogWindow.IsMultiFile; cellSelectModeToolStripMenuItem.Checked = true; cellSelectModeToolStripMenuItem.Enabled = true; closeFileToolStripMenuItem.Enabled = true; searchToolStripMenuItem.Enabled = true; filterToolStripMenuItem.Enabled = true; goToLineToolStripMenuItem.Enabled = true; //ConnectToolWindows(newLogWindow); } else { Text = titleName; multiFileToolStripMenuItem.Checked = false; multiFileEnabledStripMenuItem.Checked = false; followTailCheckBox.Checked = false; menuStrip1.Enabled = true; timeshiftToolStripMenuItem.Enabled = false; timeshiftToolStripMenuItem.Checked = false; timeshiftMenuTextBox.Text = ""; timeshiftMenuTextBox.Enabled = false; multiFileToolStripMenuItem.Enabled = false; cellSelectModeToolStripMenuItem.Checked = false; cellSelectModeToolStripMenuItem.Enabled = false; closeFileToolStripMenuItem.Enabled = false; searchToolStripMenuItem.Enabled = false; filterToolStripMenuItem.Enabled = false; goToLineToolStripMenuItem.Enabled = false; dateTimeDragControl.Visible = false; } }
private void StartTool(string cmd, string args, bool sysoutPipe, string columnizerName, string workingDir) { if (string.IsNullOrEmpty(cmd)) { return; } Process process = new Process(); ProcessStartInfo startInfo = new ProcessStartInfo(cmd, args); if (!Util.IsNull(workingDir)) { startInfo.WorkingDirectory = workingDir; } process.StartInfo = startInfo; process.EnableRaisingEvents = true; if (sysoutPipe) { ILogLineColumnizer columnizer = ColumnizerPicker.DecideColumnizerByName(columnizerName, PluginRegistry.GetInstance().RegisteredColumnizers); _logger.Info("Starting external tool with sysout redirection: {0} {1}", cmd, args); startInfo.UseShellExecute = false; startInfo.RedirectStandardOutput = true; //process.OutputDataReceived += pipe.DataReceivedEventHandler; try { process.Start(); } catch (Win32Exception e) { _logger.Error(e); MessageBox.Show(e.Message); return; } SysoutPipe pipe = new SysoutPipe(process.StandardOutput); LogWindow logWin = AddTempFileTab(pipe.FileName, CurrentLogWindow.IsTempFile ? CurrentLogWindow.TempTitleName : Util.GetNameFromPath(CurrentLogWindow.FileName) + "->E"); logWin.ForceColumnizer(columnizer); process.Exited += pipe.ProcessExitedEventHandler; //process.BeginOutputReadLine(); } else { _logger.Info("Starting external tool: {0} {1}", cmd, args); try { startInfo.UseShellExecute = false; process.Start(); } catch (Exception e) { _logger.Error(e); MessageBox.Show(e.Message); } } }
private void SetTooltipText(LogWindow logWindow, string logFileName) { logWindow.ToolTipText = logFileName; }
public TimeSpreadCalculator(LogWindow logWindow) { _logWindow = logWindow; _callback = new ColumnizerCallback(_logWindow); _calcThread = new Thread(new ThreadStart(WorkerFx)); _calcThread.IsBackground = true; _calcThread.Name = "TimeSpreadCalculator Worker"; _calcThread.Priority = ThreadPriority.BelowNormal; _calcThread.Start(); }
public FilterListChangedEventArgs(LogWindow logWindow) { this.LogWindow = logWindow; }
private void DisconnectBookmarkWindow(LogWindow logWindow) { bookmarkWindow.SetBookmarkData(null); bookmarkWindow.SetCurrentFile(null); }
public bool Contains(LogWindow logWindow) { return _logWindowList.Contains(logWindow); }
public CurrentHighlightGroupChangedEventArgs(LogWindow logWindow, HilightGroup currentGroup) { this.LogWindow = logWindow; this.CurrentGroup = currentGroup; }
public ColumnizerCallback(LogWindow logWindow) { this.logWindow = logWindow; }
public void AddOtherWindowToTimesync(LogWindow other) { if (other.IsTimeSynced) { if (IsTimeSynced) { other.FreeFromTimeSync(); AddSlaveToTimesync(other); } else { AddToTimeSync(other); } } else { AddSlaveToTimesync(other); } }
private ColumnizerCallback(ColumnizerCallback original) { this.logWindow = original.logWindow; this.LineNum = original.LineNum; }
void FilterRestore(LogWindow newWin, PersistenceData persistenceData) { newWin.WaitForLoadingFinished(); ILogLineColumnizer columnizer = Util.FindColumnizerByName(persistenceData.columnizerName, PluginRegistry.GetInstance().RegisteredColumnizers); if (columnizer != null) { Action<ILogLineColumnizer> fx = new Action<ILogLineColumnizer>(newWin.ForceColumnizer); newWin.Invoke(fx, new object[] { columnizer }); } else { Logger.logWarn("FilterRestore(): Columnizer " + persistenceData.columnizerName + " not found"); } newWin.BeginInvoke(new Action<PersistenceData>(newWin.RestoreFilters), new object[] { persistenceData }); }
public LogExpertCallback(LogWindow logWindow) : base(logWindow) { }
void FreeSlaveFromTimesync(LogWindow slave) { slave.FreeFromTimeSync(); }
public PatternWindow(LogWindow logWindow) { this.logWindow = logWindow; InitializeComponent(); this.recalcButton.Enabled = false; }
public ColumnizerCallback(LogWindow logWindow) { _logWindow = logWindow; }