/// <summary> /// Occurs when a Managed UPnP log entry is raised. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="a">The event arguments.</param> private void Logging_LogLines(object sender, LogLinesEventArgs a) { string lsDateTime = DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss.fff] "); string lsLineStart = lsDateTime + new String(' ', a.Indent * 4); txtLog.AppendLog(lsLineStart + a.Lines.Replace("\r\n", "\r\n" + lsLineStart) + "\r\n"); }
/// <summary> /// Occurs when a Managed UPnP log entry is raised. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="a">The event arguments.</param> static void Logging_LogLines(object sender, LogLinesEventArgs a) { string lsLineStart = "[UPnP] " + new String(' ', a.Indent * 4); Console.WriteLine(lsLineStart + a.Lines.Replace("\r\n", "\r\n" + lsLineStart)); }
static void Logging_LogLines(object sender, LogLinesEventArgs e) { int maxlen = Console.BufferWidth - (e.Indent + 3); if (e.Lines.Length > maxlen) { string s = e.Lines; while (s.Length > 0) { int cut = s.IndexOf("\r\n")+2; if (cut == 1 || cut > maxlen) cut = (s.Length > maxlen ? maxlen : s.Length); Console.WriteLine(new String(' ', e.Indent + 2) + s.Substring(0, cut).Replace("\r\n", "")); s = s.Substring(cut); } } else { Console.WriteLine(new String(' ', e.Indent + 2) + e.Lines); } }
private void ManagedUPnPLog(object sender, LogLinesEventArgs a) { string lsDateTime = DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss.fff] "); string lsLineStart = lsDateTime + new String(' ', a.Indent * 4); logViewer.log = lsLineStart + a.Lines.Replace("\r\n", "\r\n" + lsLineStart) + "\r\n"; }
/// <summary> /// Occurs when new ManagedUPnP logging occurs. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="a">The event arguments.</param> private void LogIntercept_LogLines(object sender, LogLinesEventArgs a) { WriteLine("\tADVANCED LOG] " + a.Lines.Replace("\r\n", "\r\n\tADVANCEDLOG] ")); }