public void Execute(string keyword, string param, ILogExpertCallback callback, ILogLineColumnizer columnizer) { int start = 0; int end = 0; if (param.StartsWith("\"")) { start = 1; end = param.IndexOf("\"", start); } else { end = param.IndexOf(" "); } if (end == -1) { end = param.Length; } string procName = param.Substring(start, end - start); string parameters = param.Substring(end).Trim(); parameters = parameters.Replace("%F", callback.GetFileName()); parameters = parameters.Replace("%K", keyword); parameters = parameters.Replace("%L", "" + callback.GetLineNum()); parameters = parameters.Replace("%T", callback.GetTabTitle()); parameters = parameters.Replace("%C", callback.GetLogLine(callback.GetLineNum()).FullLine); Process explorer = new Process(); explorer.StartInfo.FileName = procName; explorer.StartInfo.Arguments = parameters; explorer.StartInfo.UseShellExecute = false; explorer.Start(); }
public ContextMenuPluginEventArgs(IContextMenuEntry entry, IList <int> logLines, ILogLineColumnizer columnizer, ILogExpertCallback callback) { this.Entry = entry; this.LogLines = logLines; this.Columnizer = columnizer; this.Callback = callback; }
public ContextMenuPluginEventArgs(IContextMenuEntry entry, IList<int> logLines, ILogLineColumnizer columnizer, ILogExpertCallback callback) { this.Entry = entry; this.LogLines = logLines; this.Columnizer = columnizer; this.Callback = callback; }
public void Execute(string keyword, string param, ILogExpertCallback callback, ILogLineColumnizer columnizer) { int start = 0; int end = 0; if (param.StartsWith("\"")) { start = 1; end = param.IndexOf("\"", start); } else { end = param.IndexOf(" "); } if (end == -1) end = param.Length; string procName = param.Substring(start, end - start); string parameters = param.Substring(end).Trim(); parameters = parameters.Replace("%F", callback.GetFileName()); parameters = parameters.Replace("%K", keyword); parameters = parameters.Replace("%L", "" + callback.GetLineNum()); parameters = parameters.Replace("%T", callback.GetTabTitle()); parameters = parameters.Replace("%C", callback.GetLogLine(callback.GetLineNum())); Process explorer = new Process(); explorer.StartInfo.FileName = procName; explorer.StartInfo.Arguments = parameters; explorer.StartInfo.UseShellExecute = false; explorer.Start(); }
public void MenuSelected(IList<int> logLines, ILogLineColumnizer columnizer, ILogExpertCallback callback) { if (logLines.Count != 1) return; XmlDocument doc = BuildParam(callback.GetLogLine(logLines[0])); if (doc == null) { MessageBox.Show("Cannot parse Java stack trace line", "LogExpert"); } else { try { TcpClient client = new TcpClient(this.config.host, this.config.port); NetworkStream stream = client.GetStream(); StreamWriter writer = new StreamWriter(stream); doc.Save(writer); writer.Flush(); stream.Flush(); writer.Close(); stream.Close(500); client.Close(); } catch (Exception e) { MessageBox.Show(e.Message, "LogExpert"); } } }
public string GetMenuText(IList<int> logLines, ILogLineColumnizer columnizer, ILogExpertCallback callback) { if (logLines.Count == 1 && BuildParam(callback.GetLogLine(logLines[0])) != null) { return "Load class in Eclipse"; } else { return "_Load class in Eclipse"; } }
public void Execute(string keyword, string param, ILogExpertCallback callback, ILogLineColumnizer columnizer) { FormCollection openForms = Application.OpenForms; foreach (Form form in openForms) { if (form.TopLevel && form.Name.Equals("LogTabWindow") && form.Text.Contains(callback.GetFileName())) { FlashWindowFx fx = FlashWindow; form.BeginInvoke(fx, new object[] {form}); } } }
/// <summary> /// The worker function which is called when the entry is choosen by the user. /// What we do here: Take all lines, uppercase the content, keep track of original line numbers, /// write it to a new tab. /// </summary> public void MenuSelected(IList<int> logLines, ILogLineColumnizer columnizer, ILogExpertCallback callback) { List<LineEntry> lineEntryList = new List<LineEntry>(); foreach(int lineNum in logLines) { LineEntry newEntry = new LineEntry(); newEntry.logLine = callback.GetLogLine(lineNum).ToUpper(); newEntry.lineNum = lineNum; lineEntryList.Add(newEntry); } callback.AddPipedTab(lineEntryList, callback.GetTabTitle() + " (uppercased)"); }
public void Execute(string keyword, string param, ILogExpertCallback callback, ILogLineColumnizer columnizer) { FormCollection openForms = Application.OpenForms; foreach (Form form in openForms) { if (form.TopLevel && form.Name.Equals("LogTabWindow") && form.Text.Contains(callback.GetFileName())) { FlashWindowFx fx = FlashWindow; form.BeginInvoke(fx, new object[] { form }); } } }
public void MenuSelected(IList <int> logLines, ILogLineColumnizer columnizer, ILogExpertCallback callback) { if (logLines.Count != 1) { return; } XmlDocument doc = BuildParam(callback.GetLogLine(logLines[0])); if (doc == null) { MessageBox.Show("Cannot parse Java stack trace line", "LogExpert"); } else { try { TcpClient client = new TcpClient(this.config.host, this.config.port); NetworkStream stream = client.GetStream(); StreamWriter writer = new StreamWriter(stream); doc.Save(writer); writer.Flush(); stream.Flush(); writer.Close(); stream.Close(500); client.Close(); } catch (Exception e) { MessageBox.Show(e.Message, "LogExpert"); } } }
public string GetMenuText(IList <int> logLines, ILogLineColumnizer columnizer, ILogExpertCallback callback) { if (logLines.Count == 1 && BuildParam(callback.GetLogLine(logLines[0])) != null) { return("Load class in Eclipse"); } else { return("_Load class in Eclipse"); } }
/// <summary> /// The worker function which is called when the entry is choosen by the user. /// What we do here: Take all lines, uppercase the content, keep track of original line numbers, /// write it to a new tab. /// </summary> public void MenuSelected(IList <int> logLines, ILogLineColumnizer columnizer, ILogExpertCallback callback) { List <LineEntry> lineEntryList = new List <LineEntry>(); foreach (int lineNum in logLines) { LineEntry newEntry = new LineEntry(); newEntry.logLine = callback.GetLogLine(lineNum).ToUpper(); newEntry.lineNum = lineNum; lineEntryList.Add(newEntry); } callback.AddPipedTab(lineEntryList, callback.GetTabTitle() + " (uppercased)"); }
/// <summary> /// The function which gets called to give us a chance to decide whether to show a context menu entry. /// </summary> public string GetMenuText(IList <int> logLines, ILogLineColumnizer columnizer, ILogExpertCallback callback) { // no additional checks. always show the menu entry return("(Example) Write lines to tab"); }
/// <summary> /// The function which gets called to give us a chance to decide whether to show a context menu entry. /// </summary> public string GetMenuText(IList<int> logLines, ILogLineColumnizer columnizer, ILogExpertCallback callback) { // no additional checks. always show the menu entry return "(Example) Write lines to tab"; }