private StyleSheet GetDummyStyleSheet()
        {
            StyleSheet styleSheet = new StyleSheet(dummyDefaultColor);
            styleSheet.AddStyle(dummyPattern, dummyStyledColor);

            return styleSheet;
        }
        /// <summary>
        /// Exposes methods and properties used in batch styling of text.
        /// </summary>
        /// <param name="styleSheet">The StyleSheet instance that defines the way in which text should be styled.</param>
        public TextAnnotator(StyleSheet styleSheet)
        {
            this.styleSheet = styleSheet;

            foreach (StyleClass<TextPattern> styleClass in styleSheet.Styles)
            {
                matchFoundHandlers.Add(styleClass, (styleClass as Styler).MatchFoundHandler);
            }
        }
 public static void WriteLineStyled(string format, object arg0, StyleSheet styleSheet)
 {
     WriteInColorStyled(WRITELINE_TRAILER, format, arg0, styleSheet);
 }
 public static void WriteLineStyled(ulong value, StyleSheet styleSheet)
 {
     WriteInColorStyled(WRITELINE_TRAILER, value, styleSheet);
 }
 public static void WriteLineStyled(StyleSheet styleSheet)
 {
     WriteInColorStyled(WRITE_TRAILER, WRITELINE_TRAILER, styleSheet);
 }
 public static void WriteStyled(string format, object arg0, object arg1, object arg2, object arg3, StyleSheet styleSheet)
 {
     WriteInColorStyled(WRITE_TRAILER, format, new object[] { arg0, arg1, arg2, arg3 }, styleSheet);
 }
 public static void WriteStyled(char[] buffer, int index, int count, StyleSheet styleSheet)
 {
     WriteChunkInColorStyled(WRITE_TRAILER, buffer, index, count, styleSheet);
 }
 public static void WriteStyled(StyleSheet styleSheet, string format, params object[] args)
 {
     WriteInColorStyled(WRITE_TRAILER, format, args, styleSheet);
 }
 public static void WriteStyled(uint value, StyleSheet styleSheet)
 {
     WriteInColorStyled(WRITE_TRAILER, value, styleSheet);
 }
 public static void WriteAsciiStyled(string value, FigletFont font, StyleSheet styleSheet)
 {
     WriteLineStyled(GetFiglet(font).ToAscii(value), styleSheet);
 }
 public static void WriteAsciiStyled(string value, StyleSheet styleSheet)
 {
     WriteAsciiStyled(value, null, styleSheet);
 }
        private static void WriteInColorStyled<T, U>(string trailer, T target0, U target1, U target2, U target3, StyleSheet styleSheet)
        {
            TextAnnotator annotator = new TextAnnotator(styleSheet);

            string formatted = string.Format(target0.ToString(), target1, target2, target3);
            List<KeyValuePair<string, Color>> annotationMap = annotator.GetAnnotationMap(formatted);

            MapToScreen(annotationMap, trailer);
        }
        private static void WriteChunkInColorStyled(string trailer, char[] buffer, int index, int count, StyleSheet styleSheet)
        {
            string chunk = buffer.AsString().Substring(index, count);

            WriteInColorStyled(trailer, chunk, styleSheet);
        }
        private static void WriteAsciiInColorStyled(string trailer, StyledString target, StyleSheet styleSheet)
        {
            TextAnnotator annotator = new TextAnnotator(styleSheet);
            List<KeyValuePair<string, Color>> annotationMap = annotator.GetAnnotationMap(target.AbstractValue); // Should eventually be target.AsStyledString() everywhere...?

            PopulateColorGeometry(annotationMap, target);

            MapToScreen(target, trailer);
        }