Example #1
0
 /// <summary>
 /// Converts the string representation of a log entry into its <see cref="LogEntry"/> equivalent. The return value indicates whether the conversion succeeded.
 /// </summary>
 /// <param name="line">The string containing the log entry to convert.</param>
 /// <param name="entry">When the method returns, it contains either the converted <see cref="LogEntry"/> or null, <b>Nothing</b> in VB.</param>
 /// <returns><b>True</b> if <paramref name="line"/> was converted successfully; otherwise, <b>false</b>.</returns>
 public static bool TryParse(string line, out LogEntry entry)
 {
     try
     {
         entry = LoggingHelper.ParseLogLine(line);
         return(entry != null);
     }
     catch
     {
         entry = null;
         return(false);
     }
 }
Example #2
0
 /// <summary>
 /// Converts the string representation of a log entry into its <see cref="LogEntry"/> equivalent.
 /// </summary>
 /// <param name="line">The string containing the log entry to convert.</param>
 /// <returns>The <paramref name="line"/> converted into a <see cref="LogEntry"/> or null, <b>Nothing</b> in VB.</returns>
 public static LogEntry Parse(string line)
 {
     return(LoggingHelper.ParseLogLine(line));
 }