SvgTextSpan.cs 1.77 KB
Newer Older
davescriven's avatar
davescriven committed
1
2
3
using System;
using System.ComponentModel;
using System.Collections.Generic;
4
using System.Drawing.Drawing2D;
davescriven's avatar
davescriven committed
5
6
7
8
9
using System.Linq;
using System.Text;

namespace Svg
{
10
    [SvgElement("tspan")]
11
	public class SvgTextSpan : SvgElement
davescriven's avatar
davescriven committed
12
    {
13
14
15
16
17
18
19
20
21
22
23
		private SvgUnit _x;
		private SvgUnit _y;
		private SvgUnit _dx;
		private SvgUnit _dy;

		/// <summary>
		/// Gets or sets the X.
		/// </summary>
		/// <value>The X.</value>
		[SvgAttribute("x")]
		public SvgUnit X
davescriven's avatar
davescriven committed
24
        {
25
26
27
28
29
30
31
32
33
34
			get { return this._x; }
			set { this._x = value; }
		}

		/// <summary>
		/// Gets or sets the X.
		/// </summary>
		/// <value>The X.</value>
		[SvgAttribute("y")]
		public SvgUnit Y
davescriven's avatar
davescriven committed
35
        {
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
			get { return this._y; }
			set { this._y = value; }
		}


		/// <summary>
		/// Gets or sets the deltaX from the containing text.
		/// </summary>
		/// <value>The dX.</value>
		[SvgAttribute("dx")]
		public SvgUnit DX
		{
			get { return this._dx; }
			set { this._dx = value; }
		}

		/// <summary>
		/// Gets or sets the deltaY from the containing text.
		/// </summary>
		/// <value>The dY.</value>
		[SvgAttribute("dy")]
		public SvgUnit DY
		{
			get { return this._dy; }
			set { this._dy = value; }
		}
		

		/// <summary>
		/// Gets or sets the text to be rendered.
		/// </summary>
		public virtual string Text
		{
			get { return base.Content; }
			set { base.Content = value; this.Content = value; }
		}



		public override SvgElement DeepCopy()
		{
			return DeepCopy<SvgTextSpan>();
		}

		public override SvgElement DeepCopy<T>()
		{
			var newObj = base.DeepCopy<T>() as SvgTextSpan;
			newObj.X = this.X;
			newObj.Y = this.Y;
			newObj.DX = this.DX;
			newObj.DY = this.DY;
			newObj.Text = this.Text;

			return newObj;
		}

92

davescriven's avatar
davescriven committed
93
94
    }
}