コード例 #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);
        }
コード例 #2
0
ファイル: ClassSelector.cs プロジェクト: RichardHaggard/BDC
 protected override int GetKey()
 {
     if (string.IsNullOrEmpty(this.elementClass))
     {
         return(0);
     }
     return(ClassSelector.GetSelectorKey(this.elementClass).GetHashCode());
 }
コード例 #3
0
ファイル: ClassSelector.cs プロジェクト: RichardHaggard/BDC
        public override bool Equals(IElementSelector elementSelector)
        {
            ClassSelector classSelector = elementSelector as ClassSelector;

            if (classSelector != null)
            {
                return(classSelector.elementClass == this.elementClass);
            }
            return(false);
        }
コード例 #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);
        }
コード例 #5
0
ファイル: ClassSelector.cs プロジェクト: configare/hispeed
        public override bool Equals(IElementSelector elementSelector)
        {
            ClassSelector selector = elementSelector as ClassSelector;

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