/// <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); }
protected override int GetKey() { if (string.IsNullOrEmpty(this.elementClass)) { return(0); } return(ClassSelector.GetSelectorKey(this.elementClass).GetHashCode()); }
public override bool Equals(IElementSelector elementSelector) { ClassSelector classSelector = elementSelector as ClassSelector; if (classSelector != null) { return(classSelector.elementClass == this.elementClass); } return(false); }
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); }
public override bool Equals(IElementSelector elementSelector) { ClassSelector selector = elementSelector as ClassSelector; return(selector != null && selector.elementClass == this.elementClass); }