예제 #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);

            this.Styles.Add(styler);
        }
예제 #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);

            this.Styles.Add(styler);
        }
예제 #3
0
        public bool Equals(Styler other)
        {
            if (other == null)
            {
                return(false);
            }

            return(base.Equals(other) &&
                   this.MatchFoundHandler == other.MatchFoundHandler);
        }
예제 #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 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);

            this.Styles.Add(styler);
        }