Пример #1
0
        public static TypeNameAndClassSelector ForClass(Selector previous, string className)
        {
            var result = new TypeNameAndClassSelector(previous);

            result.Classes.Add(className);
            return(result);
        }
Пример #2
0
        public static TypeNameAndClassSelector ForName(Selector previous, string name)
        {
            var result = new TypeNameAndClassSelector(previous);

            result.Name = name;
            return(result);
        }
Пример #3
0
        public static TypeNameAndClassSelector Is(Selector previous, Type targetType)
        {
            var result = new TypeNameAndClassSelector(previous);

            result._targetType    = targetType;
            result.IsConcreteType = false;
            return(result);
        }
Пример #4
0
        /// <summary>
        /// Returns a selector which matches a control's Name.
        /// </summary>
        /// <param name="previous">The previous selector.</param>
        /// <param name="name">The name.</param>
        /// <returns>The selector.</returns>
        public static Selector Name(this Selector previous, string name)
        {
            var tac = previous as TypeNameAndClassSelector;

            if (tac != null)
            {
                tac.Name = name;
                return(tac);
            }
            else
            {
                return(TypeNameAndClassSelector.ForName(previous, name));
            }
        }
Пример #5
0
        /// <summary>
        /// Returns a selector which matches a control's style class.
        /// </summary>
        /// <param name="previous">The previous selector.</param>
        /// <param name="name">The name of the style class.</param>
        /// <returns>The selector.</returns>
        public static Selector Class(this Selector previous, string name)
        {
            var tac = previous as TypeNameAndClassSelector;

            if (tac != null)
            {
                tac.Classes.Add(name);
                return(tac);
            }
            else
            {
                return(TypeNameAndClassSelector.ForClass(previous, name));
            }
        }
Пример #6
0
 /// <summary>
 /// Returns a selector which matches a type or a derived type.
 /// </summary>
 /// <param name="previous">The previous selector.</param>
 /// <param name="type">The type.</param>
 /// <returns>The selector.</returns>
 public static Selector Is(this Selector previous, Type type)
 {
     return(TypeNameAndClassSelector.Is(previous, type));
 }