public void EndProperty()
 {
     StyleSheetBuilder.Log("Ending property");
     Debug.Assert(this.m_BuilderState == StyleSheetBuilder.BuilderState.Property);
     this.m_BuilderState           = StyleSheetBuilder.BuilderState.Rule;
     this.m_CurrentProperty.values = this.m_CurrentValues.ToArray();
     this.m_CurrentProperty        = null;
     this.m_CurrentValues.Clear();
 }
 public StyleSheetBuilder.ComplexSelectorScope BeginComplexSelector(int specificity)
 {
     StyleSheetBuilder.Log("Begin complex selector with specificity " + specificity.ToString());
     Debug.Assert(this.m_BuilderState == StyleSheetBuilder.BuilderState.Rule);
     this.m_BuilderState                       = StyleSheetBuilder.BuilderState.ComplexSelector;
     this.m_CurrentComplexSelector             = new StyleComplexSelector();
     this.m_CurrentComplexSelector.specificity = specificity;
     this.m_CurrentComplexSelector.ruleIndex   = this.m_Rules.Count;
     return(new StyleSheetBuilder.ComplexSelectorScope(this));
 }
 public StyleRule BeginRule(int ruleLine)
 {
     StyleSheetBuilder.Log("Beginning rule");
     Debug.Assert(this.m_BuilderState == StyleSheetBuilder.BuilderState.Init);
     this.m_BuilderState = StyleSheetBuilder.BuilderState.Rule;
     this.m_CurrentRule  = new StyleRule
     {
         line = ruleLine
     };
     return(this.m_CurrentRule);
 }
 public int EndRule()
 {
     StyleSheetBuilder.Log("Ending rule");
     Debug.Assert(this.m_BuilderState == StyleSheetBuilder.BuilderState.Rule);
     this.m_BuilderState           = StyleSheetBuilder.BuilderState.Init;
     this.m_CurrentRule.properties = this.m_CurrentProperties.ToArray();
     this.m_Rules.Add(this.m_CurrentRule);
     this.m_CurrentRule = null;
     this.m_CurrentProperties.Clear();
     return(this.m_Rules.Count - 1);
 }
        private void RegisterValue <T>(List <T> list, StyleValueType type, T value)
        {
            string arg_32_0 = "Add value of type ";
            string arg_32_1 = type.ToString();
            string arg_32_2 = " : ";
            T      t        = value;

            StyleSheetBuilder.Log(arg_32_0 + arg_32_1 + arg_32_2 + ((t != null) ? t.ToString() : null));
            Debug.Assert(this.m_BuilderState == StyleSheetBuilder.BuilderState.Property);
            list.Add(value);
            this.m_CurrentValues.Add(new StyleValueHandle(list.Count - 1, type));
        }
        public void AddSimpleSelector(StyleSelectorPart[] parts, StyleSelectorRelationship previousRelationsip)
        {
            Debug.Assert(this.m_BuilderState == StyleSheetBuilder.BuilderState.ComplexSelector);
            StyleSelector styleSelector = new StyleSelector();

            styleSelector.parts = parts;
            styleSelector.previousRelationship = previousRelationsip;
            string        arg_38_0 = "Add simple selector ";
            StyleSelector expr_2C  = styleSelector;

            StyleSheetBuilder.Log(arg_38_0 + ((expr_2C != null) ? expr_2C.ToString() : null));
            this.m_CurrentSelectors.Add(styleSelector);
        }
 public StyleProperty BeginProperty(string name, int line = -1)
 {
     StyleSheetBuilder.Log("Begin property named " + name);
     Debug.Assert(this.m_BuilderState == StyleSheetBuilder.BuilderState.Rule);
     this.m_BuilderState    = StyleSheetBuilder.BuilderState.Property;
     this.m_CurrentProperty = new StyleProperty
     {
         name = name,
         line = line
     };
     this.m_CurrentProperties.Add(this.m_CurrentProperty);
     return(this.m_CurrentProperty);
 }
        private void RegisterVariable(string value)
        {
            StyleSheetBuilder.Log("Add variable : " + value);
            Debug.Assert(this.m_BuilderState == StyleSheetBuilder.BuilderState.Property);
            int  num  = this.m_Strings.IndexOf(value);
            bool flag = num < 0;

            if (flag)
            {
                this.m_Strings.Add(value);
                num = this.m_Strings.Count - 1;
            }
            this.m_CurrentValues.Add(new StyleValueHandle(num, StyleValueType.Variable));
        }
        public void EndComplexSelector()
        {
            StyleSheetBuilder.Log("Ending complex selector");
            Debug.Assert(this.m_BuilderState == StyleSheetBuilder.BuilderState.ComplexSelector);
            this.m_BuilderState = StyleSheetBuilder.BuilderState.Rule;
            bool flag = this.m_CurrentSelectors.Count > 0;

            if (flag)
            {
                this.m_CurrentComplexSelector.selectors = this.m_CurrentSelectors.ToArray();
                this.m_ComplexSelectors.Add(this.m_CurrentComplexSelector);
                this.m_CurrentSelectors.Clear();
            }
            this.m_CurrentComplexSelector = null;
        }
Ejemplo n.º 10
0
 public ComplexSelectorScope(StyleSheetBuilder builder)
 {
     m_Builder = builder;
 }