Inheritance: CssDocMember
Ejemplo n.º 1
0
        public void ChangeFontColor(Color newcolor)
        {
            //change prop
            //then need to evaluate 
            if (elem == null)
            {
                return;
            }
            BoxSpec boxSpec = elem.Spec;
            if (boxSpec.ActualColor == newcolor)
            {
                return;
            }

            HtmlElement.InvokeNotifyChangeOnIdleState(
                elem,
                ElementChangeKind.Spec);
            //-------------------------------------
            var existingRuleSet = elem.ElementRuleSet;
            if (existingRuleSet == null)
            {
                //create new one                     
                elem.ElementRuleSet = existingRuleSet = new CssRuleSet();
                elem.IsStyleEvaluated = true;
            }
            existingRuleSet.AddCssCodeProperty(
                new CssPropertyDeclaration(
                    WellknownCssPropertyName.Color,
                    new CssCodeColor(
                        CssColorConv.ConvertToCssColor(newcolor))));
            HtmlElement.InvokeNotifyChangeOnIdleState(elem, ElementChangeKind.Spec);
        }
Ejemplo n.º 2
0
 internal void LoadRuleSet(CssRuleSet ruleSet)
 {
     foreach (CssPropertyDeclaration otherAssignment in ruleSet.GetAssignmentIter())
     {
         if (otherAssignment.WellknownPropertyName == WebDom.WellknownCssPropertyName.Unknown)
         {
             continue;
         }
         _myAssignments[otherAssignment.WellknownPropertyName] = otherAssignment;
     }
 }
Ejemplo n.º 3
0
        public void ChangeBackgroundColor(Color backgroundColor)
        {
            if (elem == null)
            {
                return;
            }
            BoxSpec boxSpec = elem.Spec;
            if (boxSpec.BackgroundColor == backgroundColor)
            {
                return;
            }


            var existingRuleSet = elem.ElementRuleSet;
            if (existingRuleSet == null)
            {
                //create new one                     
                elem.ElementRuleSet = existingRuleSet = new CssRuleSet();
                elem.IsStyleEvaluated = false;
            }

            //-------------------------------------
            existingRuleSet.RemoveCssProperty(WellknownCssPropertyName.BackgroundColor);
            existingRuleSet.AddCssCodeProperty(
               new CssPropertyDeclaration(
                   WellknownCssPropertyName.BackgroundColor,
                   new CssCodeColor(CssColorConv.ConvertToCssColor(backgroundColor))));
            elem.SkipPrincipalBoxEvalulation = false;
            CssBox cssbox = HtmlElement.InternalGetPrincipalBox(elem);
            if (cssbox != null)
            {
#if DEBUG
                cssbox.dbugMark1++;
#endif

                CssBox.InvalidateComputeValue(cssbox);
            }

            HtmlElement.InvokeNotifyChangeOnIdleState(
               elem,
               ElementChangeKind.Spec);
            InvalidateCssBox(cssbox);
        }
Ejemplo n.º 4
0
 public void AddRuleSet(CssRuleSet ruleSet)
 {
     _ruleSets.Add(ruleSet);
 }
Ejemplo n.º 5
0
 internal void LoadRuleSet(CssRuleSet ruleSet)
 {
     foreach (CssPropertyDeclaration otherAssignment in ruleSet.GetAssignmentIter())
     {
         if (otherAssignment.WellknownPropertyName == WebDom.WellknownCssPropertyName.Unknown)
         {
             continue;
         }
         _myAssignments[otherAssignment.WellknownPropertyName] = otherAssignment;
     }
 }
Ejemplo n.º 6
0
 public void AddRuleSet(CssRuleSet ruleSet)
 {
     this._ruleSets.Add(ruleSet);
 }