Exemple #1
0
        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]);
        }
Exemple #2
0
        public static string GetProcessAnsiString(Process target)
        {
            IColorMatch match = sProcessColorMatcher.Value.GetMatch(target);

            return(match == null ? ColorReset : sForegroundAnsiColors[match.ForegroundColor]);
        }
Exemple #3
0
        public static string GetFileInfoAnsiString(FileSystemInfo target)
        {
            IColorMatch match = sFileInfoColorMatcher.Value.GetMatch(target);

            return(match == null ? ColorReset : sForegroundAnsiColors[match.ForegroundColor]);
        }