Exemplo n.º 1
0
        /// <summary>
        /// Adds a style classification to the StyleSheet.
        /// </summary>
        /// <param name="target">The string to be styled.</param>
        /// <param name="color">The color to be applied to the target.</param>
        public void AddStyle(string target, Color color)
        {
            Styler.MatchFound handler = (s, l, m) => m;
            Styler            styler  = new Styler(target, color, handler);

            Styles.Add(styler);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds a style classification to the StyleSheet.
        /// </summary>
        /// <param name="target">The string to be styled.</param>
        /// <param name="color">The color to be applied to the target.</param>
        /// <param name="matchHandler">A delegate instance which describes a simpler transformation that
        /// can be applied to the target.</param>
        public void AddStyle(string target, Color color, Styler.MatchFoundLite matchHandler)
        {
            Styler.MatchFound wrapper = (s, l, m) => matchHandler.Invoke(m);
            Styler            styler  = new Styler(target, color, wrapper);

            Styles.Add(styler);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Adds a style classification to the StyleSheet.
        /// </summary>
        /// <param name="target">The string to be styled.</param>
        /// <param name="color">The color to be applied to the target.</param>
        /// <param name="filterMatchesByIndex">An array contain index of the matches to filter.</param>
        public void AddStyle(string target, Color color, params int[] filterMatchesByIndex)
        {
            string Handler(string s, MatchLocation l, string m) => m;

            Styler styler = new Styler(target, color, Handler, filterMatchesByIndex);

            Styles.Add(styler);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Adds a style classification to the StyleSheet.
        /// </summary>
        /// <param name="target">The string to be styled.</param>
        /// <param name="color">The color to be applied to the target.</param>
        /// <param name="matchHandler">A delegate instance which describes a simpler transformation that
        /// can be applied to the target.</param>
        /// <param name="filterMatchesByIndex">An array contain index of the matches to filter.</param>
        public void AddStyle(string target, Color color, Styler.MatchFoundLite matchHandler, params int[] filterMatchesByIndex)
        {
            string Wrapper(string s, MatchLocation l, string m) => matchHandler.Invoke(m);

            Styler styler = new Styler(target, color, Wrapper, filterMatchesByIndex);

            Styles.Add(styler);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Adds a style classification to the StyleSheet.
        /// </summary>
        /// <param name="target">The string to be styled.</param>
        /// <param name="color">The color to be applied to the target.</param>
        public void AddStyle(string target, Color color)
        {
            string Handler(string s, MatchLocation l, string m) => m;

            Styler styler = new Styler(target, color, Handler);

            Styles.Add(styler);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Adds a style classification to the StyleSheet.
        /// </summary>
        /// <param name="target">The string to be styled.</param>
        /// <param name="color">The color to be applied to the target.</param>
        /// <param name="matchHandler">A delegate instance which describes a simpler transformation that
        /// can be applied to the target.</param>
        public void AddStyle(string target, Color color, Styler.MatchFoundLite matchHandler)
        {
            string Wrapper(string s, MatchLocation l, string m) => matchHandler.Invoke(m);

            Styler styler = new Styler(target, color, Wrapper);

            Styles.Add(styler);
        }
Exemplo n.º 7
0
        public bool Equals(Styler other)
        {
            if (other == null)
            {
                return(false);
            }

            return(base.Equals(other) &&
                   this.MatchFoundHandler == other.MatchFoundHandler);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Adds a style classification to the StyleSheet.
        /// </summary>
        /// <param name="target">The string to be styled.</param>
        /// <param name="color">The color to be applied to the target.</param>
        /// <param name="matchHandler">A delegate instance which describes a transformation that
        /// can be applied to the target.</param>
        /// <param name="filterMatchesByIndex">An array contain index of the matches to filter.</param>
        public void AddStyle(string target, Color color, Styler.MatchFound matchHandler, params int[] filterMatchesByIndex)
        {
            Styler styler = new Styler(target, color, matchHandler, filterMatchesByIndex);

            Styles.Add(styler);
        }
Exemplo n.º 9
0
        /// <summary>
        /// Adds a style classification to the StyleSheet.
        /// </summary>
        /// <param name="target">The string to be styled.</param>
        /// <param name="color">The color to be applied to the target.</param>
        /// <param name="matchHandler">A delegate instance which describes a transformation that
        /// can be applied to the target.</param>
        public void AddStyle(string target, Color color, Styler.MatchFound matchHandler)
        {
            Styler styler = new Styler(target, color, matchHandler);

            Styles.Add(styler);
        }