Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
 public virtual AttributeSetAction CreateAttributeSetAction() {
     AttributeSetAction action = new AttributeSetAction();
     action.Compile(this);
     return action;
 }
Ejemplo n.º 3
0
        //
        // Attribute-Set management
        //

        internal void AddAttributeSet(AttributeSetAction attributeSet) {
            Debug.Assert(this.stylesheet == this.stylesheets.Peek());
            this.stylesheet.AddAttributeSet(attributeSet);
        }
Ejemplo n.º 4
0
        //
        // Attribute-Set management
        //

        internal void AddAttributeSet(AttributeSetAction attributeSet)
        {
            Debug.Assert(this.stylesheet == this.stylesheets.Peek());
            this.stylesheet.AddAttributeSet(attributeSet);
        }
Ejemplo n.º 5
0
        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);
            }
        }
Ejemplo n.º 6
0
        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++;
            }
        }
Ejemplo n.º 7
0
        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);
            }
        }