SvgGroup.cs 1.73 KB
Newer Older
davescriven's avatar
davescriven committed
1
2
3
4
using System;
using System.Collections.Generic;
using System.Xml;
using System.Text;
5
using System.Drawing;
davescriven's avatar
davescriven committed
6
7
8

namespace Svg
{
9
10
11
    /// <summary>
    /// An element used to group SVG shapes.
    /// </summary>
davescriven's avatar
davescriven committed
12
13
14
15
16
17
    public class SvgGroup : SvgGraphicsElement
    {
        public SvgGroup()
        {
        }

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
        /// <summary>
        /// Gets or sets the fill.
        /// </summary>
        /// <value>The fill.</value>
        [SvgAttribute("fill")]
        public override SvgPaintServer Fill
        {
            get { return (this.Attributes["Fill"] == null) ? new SvgColourServer(Color.Transparent) : (SvgPaintServer)this.Attributes["Fill"]; }
            set { this.Attributes["Fill"] = value; }
        }

        /// <summary>
        /// Gets the <see cref="GraphicsPath"/> for this element.
        /// </summary>
        /// <value></value>
davescriven's avatar
davescriven committed
33
34
35
36
37
        public override System.Drawing.Drawing2D.GraphicsPath Path
        {
            get { return null; }
        }

38
39
40
41
        /// <summary>
        /// Gets the bounds of the element.
        /// </summary>
        /// <value>The bounds.</value>
davescriven's avatar
davescriven committed
42
43
44
45
46
        public override System.Drawing.RectangleF Bounds
        {
            get { return new System.Drawing.RectangleF(); }
        }

47
48
49
50
        /// <summary>
        /// Renders the <see cref="SvgElement"/> and contents to the specified <see cref="Graphics"/> object.
        /// </summary>
        /// <param name="graphics">The <see cref="Graphics"/> object to render to.</param>
davescriven's avatar
davescriven committed
51
52
53
54
55
56
57
58
        protected override void Render(System.Drawing.Graphics graphics)
        {
            this.PushTransforms(graphics);
            base.RenderContents(graphics);
            this.PopTransforms(graphics);
        }
    }
}