Ejemplo n.º 1
0
 public AttributeList(AttributeList a)
 {
     if (a.attrs != null)
         attrs = new Dictionary<string,string>(a.attrs);
     else
         attrs = null;
 }
Ejemplo n.º 2
0
 public Node(SVGNodeName name, AttributeList attributes, int depth)
 {
     this.parent = null;
     this.children = new List<Node>();
     this.name = name;
     this.attributes = attributes;
     this.depth = depth;
 }
Ejemplo n.º 3
0
 public Node(SVGNodeName name, AttributeList attributes, int depth)
 {
     this.parent     = null;
     this.children   = new List <Node>();
     this.name       = name;
     this.attributes = attributes;
     this.depth      = depth;
 }
Ejemplo n.º 4
0
 public AttributeList(AttributeList a)
 {
     if (a.attrs != null)
     {
         attrs = new Dictionary <string, string>(a.attrs);
     }
     else
     {
         attrs = null;
     }
 }
Ejemplo n.º 5
0
        public void OnStyleElement(string name, AttributeList attrs, string style)
        {
            Node node = new InlineNode(Lookup(name), new AttributeList(attrs), _currentDepth);
            node.content = style;
            node.parent = _lastParent;
            if (_lastParent != null)
            {
                _lastParent.children.Add(node);
            }

            AddNode(node);
        }
Ejemplo n.º 6
0
        public void OnInlineElement(string name, AttributeList attrs)
        {
            Node node = new InlineNode(Lookup(name), new AttributeList(attrs), _currentDepth);
//            Debug.Log("OnInlineElement: "+name);

            node.parent = _lastParent;
            if (_lastParent != null)
            {
                _lastParent.children.Add(node);
            }

            OnNode(node);
        }
Ejemplo n.º 7
0
        public void OnStartElement(string name, AttributeList attrs)
        {
            Node node = new BlockOpenNode(Lookup(name), new AttributeList(attrs), _currentDepth++);
//            Debug.Log("OnStartElement: "+name);

            node.parent = _lastParent;
            if (_lastParent != null)
            {
                _lastParent.children.Add(node);
            }

            _lastParent = node;

            OnNode(node);
            //Debug.Log("OnStartElement: "+node.name+", depth: "+node.depth);
        }
Ejemplo n.º 8
0
        public SVGElement(SVGParser xmlImp,
                    SVGTransformList inheritTransformList,
                    SVGPaintable inheritPaintable,
                    bool root = false) : base(inheritTransformList)
        {
            _rootElement = root;
            _name = _attrList.GetValue("id");
            _xmlImp = xmlImp;
            _attrList = _xmlImp.node.attributes;

            if(inheritPaintable != null)
            {
                _paintable = new SVGPaintable(inheritPaintable, _xmlImp.node);
            } else {
                _paintable = new SVGPaintable(_xmlImp.node);
            }

            Init();
        }
Ejemplo n.º 9
0
        public SVGElement(SVGParser xmlImp,
                          SVGTransformList inheritTransformList,
                          SVGPaintable inheritPaintable,
                          bool root = false) : base(inheritTransformList)
        {
            _rootElement = root;
            _name        = _attrList.GetValue("id");
            _xmlImp      = xmlImp;
            _attrList    = _xmlImp.node.attributes;

            if (inheritPaintable != null)
            {
                _paintable = new SVGPaintable(inheritPaintable, _xmlImp.node);
            }
            else
            {
                _paintable = new SVGPaintable(_xmlImp.node);
            }

            Init();
        }
Ejemplo n.º 10
0
 public BlockOpenNode(SVGNodeName name, AttributeList attributes, int depth) : base(name, attributes, depth)
 {
 }
Ejemplo n.º 11
0
 public InlineNode(SVGNodeName name, AttributeList attributes, int depth) : base(name, attributes, depth)
 {
 }
Ejemplo n.º 12
0
        public void OnStyleElement(string name, AttributeList attrs, string style)
        {
            Node node = new InlineNode(Lookup(name), new AttributeList(attrs), _currentDepth);
            node.content = style;
            node.parent = _lastParent;
            if (_lastParent != null)
            {
                _lastParent.children.Add(node);
            }

            AddNode(node);
        }
Ejemplo n.º 13
0
        public void OnStartElement(string name, AttributeList attrs)
        {
            Node node = new BlockOpenNode(Lookup(name), new AttributeList(attrs), _currentDepth++);
//            Debug.Log("OnStartElement: "+name);

            node.parent = _lastParent;
            if (_lastParent != null)
            {
                _lastParent.children.Add(node);
            }

            _lastParent = node;

            OnNode(node);
            //Debug.Log("OnStartElement: "+node.name+", depth: "+node.depth);
        }
Ejemplo n.º 14
0
        public void OnInlineElement(string name, AttributeList attrs)
        {
            Node node = new InlineNode(Lookup(name), new AttributeList(attrs), _currentDepth);
//            Debug.Log("OnInlineElement: "+name);

            node.parent = _lastParent;
            if (_lastParent != null)
            {
                _lastParent.children.Add(node);
            }

            OnNode(node);
        }
Ejemplo n.º 15
0
 public InlineNode(SVGNodeName name, AttributeList attributes, int depth) : base(name, attributes, depth)
 {
 }
Ejemplo n.º 16
0
        private void ReadAttribute(ref AttributeList a)
        {
            SkipWhitespaces(true);
            if (Peek() == '/' || Peek() == '>')
            // came here just to spend trailing whitespaces
                return;

            string name = ReadName();
            string value;
            SkipWhitespaces();
            Expect('=');
            SkipWhitespaces();
            switch (Read())
            {
                case '\'':
                    value = ReadUntil('\'', true);
                    break;
                case '"':
                    value = ReadUntil('"', true);
                    break;
                default:
                    throw Error("Invalid attribute value markup.");
            }
            a.Add(name, value);
        }
Ejemplo n.º 17
0
 public BlockOpenNode(SVGNodeName name, AttributeList attributes, int depth) : base(name, attributes, depth)
 {
 }