SvgPaintServer.cs 963 Bytes
Newer Older
davescriven's avatar
davescriven committed
1
2
3
4
5
6
7
8
9
10
11
12
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace Svg
{
    [TypeConverter(typeof(SvgPaintServerFactory))]
    public abstract class SvgPaintServer : SvgElement
    {
13
        public static readonly SvgPaintServer None = new SvgColourServer();
davescriven's avatar
davescriven committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

        public SvgPaintServer()
        {
            
        }

        protected override void Render(Graphics graphics)
        {
            // Never render paint servers or their children
        }

        public abstract Brush GetBrush(SvgGraphicsElement styleOwner, float opacity);

        public static bool IsNullOrEmpty(SvgPaintServer server)
        {
            return (server == null || server == SvgPaintServer.None);
        }

        public override string ToString()
        {
            return String.Format("url(#{0})", this.ID);
        }
    }
}