Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the PropertySettingGroup class.
        /// </summary>
        public PropertySettingGroup(string className, Condition condition, params IPropertySetting[] propertySettings)
        {
            ClassSelector selector = new ClassSelector(className);

            selector.Condition = condition;
            this.Selectors.Add(selector);
            this.PropertySettings.AddRange(propertySettings);
        }
Exemplo n.º 2
0
 protected override int GetKey()
 {
     if (string.IsNullOrEmpty(this.elementClass))
     {
         return(0);
     }
     return(ClassSelector.GetSelectorKey(this.elementClass).GetHashCode());
 }
Exemplo n.º 3
0
        public override bool Equals(IElementSelector elementSelector)
        {
            ClassSelector classSelector = elementSelector as ClassSelector;

            if (classSelector != null)
            {
                return(classSelector.elementClass == this.elementClass);
            }
            return(false);
        }
Exemplo n.º 4
0
        private XmlElementSelector CreateSelector(ElementSelector selector)
        {
            XmlSelectorBase xmlSelectorBase = (XmlSelectorBase)null;
            WrapSelector    wrapSelector    = selector as WrapSelector;

            if (wrapSelector != null)
            {
                TypeSelector internalSelector1 = wrapSelector.InternalSelector as TypeSelector;
                if (internalSelector1 != null)
                {
                    return((XmlElementSelector) new XmlTypeSelector(XmlTheme.SerializeType(internalSelector1.ElementType)));
                }
                ClassSelector internalSelector2 = wrapSelector.InternalSelector as ClassSelector;
                if (internalSelector2 != null)
                {
                    return((XmlElementSelector) new XmlClassSelector(internalSelector2.ElementClass));
                }
            }
            if (selector.Type == ElementSelectorTypes.VisualStateSelector)
            {
                xmlSelectorBase = (XmlSelectorBase) new XmlVisualStateSelector(selector.Value);
            }
            else if (selector.Type == ElementSelectorTypes.TypeSelector)
            {
                xmlSelectorBase = (XmlSelectorBase) new XmlTypeSelector(selector.Value);
            }
            else if (selector.Type == ElementSelectorTypes.ClassSelector)
            {
                xmlSelectorBase = (XmlSelectorBase) new XmlClassSelector(selector.Value);
            }
            if (selector.ChildSelector != null)
            {
                xmlSelectorBase.ChildSelector = this.CreateSelector(selector.ChildSelector);
            }
            return((XmlElementSelector)xmlSelectorBase);
        }
Exemplo n.º 5
0
        public override bool Equals(IElementSelector elementSelector)
        {
            ClassSelector selector = elementSelector as ClassSelector;

            return(selector != null && selector.elementClass == this.elementClass);
        }