public static string TryGetTrimmedFile(this IStackTraceLine line, Regex regex, Func <string, string> additionalTransformOnSuccess) { var fileName = line?.File ?? _DefaultFileValue; var match = regex.Match(fileName); return(match.Success ? additionalTransformOnSuccess(match.Value) : fileName); }
public static bool IsFromNamespaces( this IStackTraceLine line, params string[] prefixes) => prefixes.Any(str => (line?.Method?.StartsWith(str)).GetValueOrDefault());
public static string TryGetTrimmedFile(this IStackTraceLine line, Regex regex) => line.TryGetTrimmedFile(regex, str => str);
public static bool HasSuccessfullyParsedFile(this IStackTraceLine line) => !string.IsNullOrWhiteSpace(line?.File);