Beispiel #1
0
 private void VisitSelectorList(AggregateSelectorList selectorList)
 {
     if (selectorList.Delimiter == ",")
     {
         foreach (BaseSelector current in selectorList)
         {
             this.VisitBaseSelector(current);
         }
     }
     else if (selectorList.Delimiter == string.Empty)
     {
         this.VisitSimpleSelector(selectorList.ToString());
     }
     else
     {
         this.m_Errors.AddSemanticError(StyleSheetImportErrorCode.InvalidSelectorListDelimiter, selectorList.Delimiter);
     }
 }
        string ExtractSimpleSelector(BaseSelector selector)
        {
            SimpleSelector simpleSelector = selector as SimpleSelector;

            if (simpleSelector != null)
            {
                return(selector.ToString());
            }

            AggregateSelectorList selectorList = selector as AggregateSelectorList;

            // Work around a strange parser issue where sometimes simple selectors
            // are wrapped inside SelectorList with no delimiter
            if (selectorList != null && selectorList.Delimiter == string.Empty)
            {
                return(selectorList.ToString());
            }

            return(string.Empty);
        }
 void VisitSelectorList(AggregateSelectorList selectorList)
 {
     // OR selectors, just create an entry for each of them
     if (selectorList.Delimiter == ",")
     {
         foreach (BaseSelector selector in selectorList)
         {
             VisitBaseSelector(selector);
         }
     }
     // Work around a strange parser issue where sometimes simple selectors
     // are wrapped inside SelectorList with no delimiter
     else if (selectorList.Delimiter == string.Empty)
     {
         VisitSimpleSelector(selectorList.ToString());
     }
     else
     {
         m_Errors.AddSemanticError(StyleSheetImportErrorCode.InvalidSelectorListDelimiter, selectorList.Delimiter);
     }
 }
Beispiel #4
0
        private string ExtractSimpleSelector(BaseSelector selector)
        {
            SimpleSelector simpleSelector = selector as SimpleSelector;
            string         result;

            if (simpleSelector != null)
            {
                result = selector.ToString();
            }
            else
            {
                AggregateSelectorList aggregateSelectorList = selector as AggregateSelectorList;
                if (aggregateSelectorList != null && aggregateSelectorList.Delimiter == string.Empty)
                {
                    result = aggregateSelectorList.ToString();
                }
                else
                {
                    result = string.Empty;
                }
            }
            return(result);
        }