internal void Merge(AttributeSetAction attributeAction) { // add the contents of "attributeAction" to this action // place them at the end Action action; int i = 0; while((action = attributeAction.GetAction(i)) != null) { AddAction(action); i++; } }
private void MirgeAttributeSets(Stylesheet stylesheet) { // mirge stylesheet.AttributeSetTable to this.AttributeSetTable if (stylesheet.AttributeSetTable != null) { foreach (AttributeSetAction srcAttSet in stylesheet.AttributeSetTable.Values) { ArrayList srcAttList = srcAttSet.containedActions; AttributeSetAction dstAttSet = (AttributeSetAction)this.attributeSetTable[srcAttSet.Name]; if (dstAttSet == null) { dstAttSet = new AttributeSetAction(); { dstAttSet.name = srcAttSet.Name; dstAttSet.containedActions = new ArrayList(); } this.attributeSetTable[srcAttSet.Name] = dstAttSet; } ArrayList dstAttList = dstAttSet.containedActions; // We adding attributes in reverse order for purpuse. In the mirged list most importent attset shoud go last one // so we'll need to invert dstAttList finaly. if (srcAttList != null) { for (int src = srcAttList.Count - 1; 0 <= src; src--) { // We can ignore duplicate attibutes here. dstAttList.Add(srcAttList[src]); } } } } foreach (Stylesheet importedStylesheet in stylesheet.Imports) { MirgeAttributeSets(importedStylesheet); } }
// // Attribute-Set management // internal void AddAttributeSet(AttributeSetAction attributeSet) { Debug.Assert(this.stylesheet == _stylesheets.Peek()); this.stylesheet.AddAttributeSet(attributeSet); }
public virtual AttributeSetAction CreateAttributeSetAction() { AttributeSetAction action = new AttributeSetAction(); action.Compile(this); return action; }
private void MirgeAttributeSets(Stylesheet stylesheet) { // mirge stylesheet.AttributeSetTable to this.AttributeSetTable if (stylesheet.AttributeSetTable != null) { foreach (AttributeSetAction srcAttSet in stylesheet.AttributeSetTable.Values) { ArrayList srcAttList = srcAttSet.containedActions; AttributeSetAction dstAttSet = (AttributeSetAction) this.attributeSetTable[srcAttSet.Name]; if (dstAttSet == null) { dstAttSet = new AttributeSetAction(); { dstAttSet.name = srcAttSet.Name; dstAttSet.containedActions = new ArrayList(); } this.attributeSetTable[srcAttSet.Name] = dstAttSet; } ArrayList dstAttList = dstAttSet.containedActions; // We adding attributes in reverse order for purpuse. In the mirged list most importent attset shoud go last one // so we'll need to invert dstAttList finaly. if (srcAttList != null) { for(int src = srcAttList.Count - 1; 0 <= src; src --) { // We can ignore duplicate attibutes here. dstAttList.Add(srcAttList[src]); } } } } foreach (Stylesheet importedStylesheet in stylesheet.Imports) { MirgeAttributeSets(importedStylesheet); } }
internal void AddAttributeSet(AttributeSetAction attributeSet) { Debug.Assert(attributeSet.Name != null); if (this.attributeSetTable == null) { this.attributeSetTable = new Hashtable(); } Debug.Assert(this.attributeSetTable != null); if (this.attributeSetTable.ContainsKey(attributeSet.Name) == false) { this.attributeSetTable[attributeSet.Name] = attributeSet; } else { // merge the attribute-sets ((AttributeSetAction)this.attributeSetTable[attributeSet.Name]).Merge(attributeSet); } }