public ToolArgsDialog(LogTabWindow logTabWin, Form parent) { this.logTabWin = logTabWin; parent.AddOwnedForm(this); this.TopMost = parent.TopMost; InitializeComponent(); }
public void LoadFiles(string[] fileNames) { _logger.Info("Loading files into existing LogTabWindow"); LogTabWindow logWin = this.windowList[this.windowList.Count - 1]; logWin.Invoke(new MethodInvoker(logWin.SetForeground)); logWin.LoadFiles(fileNames); }
public void Instantiate_JsonFile_BuildCorrectColumnizer(string fileName, Type columnizerType) { LogTabWindow logTabWindow = new LogTabWindow(null, 0, false); LogWindow logWindow = new LogWindow(logTabWindow, fileName, false, false); Assert.AreEqual(columnizerType, logWindow.CurrentColumnizer.GetType()); }
public void NewWindowWorker(string[] fileNames) { _logger.Info("Creating new LogTabWindow"); LogTabWindow logWin = new LogTabWindow(fileNames.Length > 0 ? fileNames : null, logWindowIndex++, true); logWin.LogExpertProxy = this; AddWindow(logWin); logWin.Show(); logWin.Activate(); }
public void Instantiate_AnyFile_NotCrash(string fileName) { PluginRegistry.GetInstance().RegisteredColumnizers.Add(new Log4jXmlColumnizer()); LogTabWindow logTabWindow = new LogTabWindow(null, 0, false); LogWindow logWindow = new LogWindow(logTabWindow, fileName, false, false); Assert.True(true); }
public void WindowClosed(LogTabWindow logWin) { RemoveWindow(logWin); if (this.windowList.Count == 0) { _logger.Info("Last LogTabWindow was closed"); PluginRegistry.GetInstance().CleanupPlugins(); OnLastWindowClosed(); } else { if (this.firstLogTabWindow == logWin) { // valid firstLogTabWindow is needed for the Invoke()-Calls in NewWindow() this.firstLogTabWindow = this.windowList[this.windowList.Count - 1]; } } }
public void NewWindow(string[] fileNames) { if (this.firstLogTabWindow.IsDisposed) { _logger.Warn("first GUI thread window is disposed. Setting a new one."); // may occur if a window is closed because of unhandled exception. // Determine a new 'firstWindow'. If no window is left, start a new one. RemoveWindow(this.firstLogTabWindow); if (this.windowList.Count == 0) { _logger.Info("No windows left. New created window will be the new 'first' GUI window"); LoadFiles(fileNames); } else { this.firstLogTabWindow = this.windowList[this.windowList.Count - 1]; NewWindow(fileNames); } } else { this.firstLogTabWindow.Invoke(new NewWindowFx(NewWindowWorker), new object[] { fileNames }); } }
public SettingsDialog(Preferences prefs, LogTabWindow logTabWin, int tabToOpen) : this(prefs, logTabWin) { this.tabControl1.SelectedIndex = tabToOpen; }
public SettingsDialog(Preferences prefs, LogTabWindow logTabWin) { this.Preferences = prefs; this.logTabWin = logTabWin; InitializeComponent(); }
public SettingsDialog(Preferences prefs, LogTabWindow logTabWin) { this.preferences = prefs; this.logTabWin = logTabWin; InitializeComponent(); }
public LogExpertProxy(LogTabWindow logTabWindow) { AddWindow(logTabWindow); logTabWindow.LogExpertProxy = this; firstLogTabWindow = logTabWindow; }
private void RemoveWindow(LogTabWindow window) { _logger.Info("Removing window from list"); this.windowList.Remove(window); }
private void AddWindow(LogTabWindow window) { _logger.Info("Adding window to list"); this.windowList.Add(window); }
public LogExpertApplicationContext(LogExpertProxy proxy, LogTabWindow firstLogWin) { this.proxy = proxy; this.proxy.LastWindowClosed += new LogExpertProxy.LastWindowClosedEventHandler(proxy_LastWindowClosed); firstLogWin.Show(); }