LayoutFarm.WebDom.CssRuleSetGroup.Merge C# (CSharp) Method

Merge() public method

public Merge ( CssRuleSetGroup another ) : void
another CssRuleSetGroup
return void
        public void Merge(CssRuleSetGroup another)
        {
            //merge 
            //------------  
            if (another._assignments != null)
            {
                if (this._assignments == null)
                {
                    this._assignments = new CssPropertyAssignmentCollection(this);
                }
                //merge decl 
                this._assignments.MergeProperties(another._assignments);
            }

            //find subgroup
            if (another._subGroups != null)
            {
                if (this._subGroups == null)
                {
                    this._subGroups = new List<CssRuleSetGroup>();
                }
                foreach (CssRuleSetGroup ruleSetGroup in another._subGroups)
                {
                    //merge to this group
                    CssRuleSetGroup exiting = GetOrCreateSubgroup(ruleSetGroup._originalSelector);
                    exiting.Merge(ruleSetGroup);
                }
            }
        }
        public int SubGroupCount

Usage Example

Example #1
0
        public void Merge(CssRuleSetGroup another)
        {
            //merge
            //------------
            if (another._assignments != null)
            {
                if (this._assignments == null)
                {
                    this._assignments = new CssPropertyAssignmentCollection(this);
                }
                //merge decl
                this._assignments.MergeProperties(another._assignments);
            }

            //find subgroup
            if (another._subGroups != null)
            {
                if (this._subGroups == null)
                {
                    this._subGroups = new List <CssRuleSetGroup>();
                }
                foreach (CssRuleSetGroup ruleSetGroup in another._subGroups)
                {
                    //merge to this group
                    CssRuleSetGroup exiting = GetOrCreateSubgroup(ruleSetGroup._originalSelector);
                    exiting.Merge(ruleSetGroup);
                }
            }
        }