public static string GetAnsiString(object target) { IColorMatcher colorMatcher; if (!MatcherManager.TryGetMatcher(target.GetType(), out colorMatcher)) { return(ColorReset); } IColorMatch match = colorMatcher.GetMatch(target); return(match == null ? ColorReset : sForegroundAnsiColors[match.ForegroundColor]); }
public static string GetProcessAnsiString(Process target) { IColorMatch match = sProcessColorMatcher.Value.GetMatch(target); return(match == null ? ColorReset : sForegroundAnsiColors[match.ForegroundColor]); }
public static string GetFileInfoAnsiString(FileSystemInfo target) { IColorMatch match = sFileInfoColorMatcher.Value.GetMatch(target); return(match == null ? ColorReset : sForegroundAnsiColors[match.ForegroundColor]); }