/// <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");
 }
示例#2
0
 /// <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));
 }
示例#3
0
文件: Program.cs 项目: piksel/Uppo
        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);
            }
        }
示例#4
0
 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] "));
 }