コード例 #1
0
ファイル: StyleSheet.cs プロジェクト: PizzaDevv/ObjectClash
        /// <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;
            var styler = new Styler(target, color, handler);

            Styles.Add(styler);
        }
コード例 #2
0
ファイル: StyleSheet.cs プロジェクト: PizzaDevv/ObjectClash
        /// <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);
            var styler = new Styler(target, color, wrapper);

            Styles.Add(styler);
        }
コード例 #3
0
ファイル: Styler.cs プロジェクト: PizzaDevv/ObjectClash
        public bool Equals(Styler other)
        {
            if (other == null)
            {
                return(false);
            }

            return(base.Equals(other) &&
                   MatchFoundHandler == other.MatchFoundHandler);
        }
コード例 #4
0
ファイル: StyleSheet.cs プロジェクト: PizzaDevv/ObjectClash
        /// <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)
        {
            var styler = new Styler(target, color, matchHandler);

            Styles.Add(styler);
        }