1 | using System;
|
---|
2 | using System.Xml;
|
---|
3 |
|
---|
4 | namespace SharpVectors.Dom.Svg
|
---|
5 | {
|
---|
6 | public sealed class SvgSymbolElement : SvgStyleableElement, ISvgSymbolElement
|
---|
7 | {
|
---|
8 | #region Private Fields
|
---|
9 |
|
---|
10 | private SvgFitToViewBox svgFitToViewBox;
|
---|
11 | private SvgExternalResourcesRequired svgExternalResourcesRequired;
|
---|
12 |
|
---|
13 | #endregion
|
---|
14 |
|
---|
15 | #region Constructors and Destructor
|
---|
16 |
|
---|
17 | internal SvgSymbolElement(string prefix, string localname, string ns, SvgDocument doc) : base(prefix, localname, ns, doc)
|
---|
18 | {
|
---|
19 | svgExternalResourcesRequired = new SvgExternalResourcesRequired(this);
|
---|
20 | svgFitToViewBox = new SvgFitToViewBox(this);
|
---|
21 | }
|
---|
22 |
|
---|
23 | #endregion
|
---|
24 |
|
---|
25 | #region ISvgElement Members
|
---|
26 |
|
---|
27 | /// <summary>
|
---|
28 | /// Gets a value indicating whether this SVG element is renderable.
|
---|
29 | /// </summary>
|
---|
30 | /// <value>
|
---|
31 | /// This is <see langword="'true"/> if the element is renderable; otherwise,
|
---|
32 | /// it is <see langword="false"/>.
|
---|
33 | /// </value>
|
---|
34 | public override bool IsRenderable
|
---|
35 | {
|
---|
36 | get
|
---|
37 | {
|
---|
38 | XmlNode parentNode = this.ParentNode;
|
---|
39 | if (parentNode != null && String.Equals(parentNode.LocalName, "use"))
|
---|
40 | {
|
---|
41 | return true;
|
---|
42 | }
|
---|
43 |
|
---|
44 | return false;
|
---|
45 | }
|
---|
46 | }
|
---|
47 |
|
---|
48 | /// <summary>
|
---|
49 | /// Gets a value providing a hint on the rendering defined by this element.
|
---|
50 | /// </summary>
|
---|
51 | /// <value>
|
---|
52 | /// An enumeration of the <see cref="SvgRenderingHint"/> specifying the rendering hint.
|
---|
53 | /// This will always return <see cref="SvgRenderingHint.Containment"/>
|
---|
54 | /// </value>
|
---|
55 | public override SvgRenderingHint RenderingHint
|
---|
56 | {
|
---|
57 | get
|
---|
58 | {
|
---|
59 | return SvgRenderingHint.Containment;
|
---|
60 | }
|
---|
61 | }
|
---|
62 |
|
---|
63 | #endregion
|
---|
64 |
|
---|
65 | #region ISvgExternalResourcesRequired Members
|
---|
66 |
|
---|
67 | public ISvgAnimatedBoolean ExternalResourcesRequired
|
---|
68 | {
|
---|
69 | get
|
---|
70 | {
|
---|
71 | return svgExternalResourcesRequired.ExternalResourcesRequired;
|
---|
72 | }
|
---|
73 | }
|
---|
74 |
|
---|
75 | #endregion
|
---|
76 |
|
---|
77 | #region ISvgFitToViewBox Members
|
---|
78 |
|
---|
79 | public ISvgAnimatedRect ViewBox
|
---|
80 | {
|
---|
81 | get
|
---|
82 | {
|
---|
83 | return svgFitToViewBox.ViewBox;
|
---|
84 | }
|
---|
85 | }
|
---|
86 |
|
---|
87 | public ISvgAnimatedPreserveAspectRatio PreserveAspectRatio
|
---|
88 | {
|
---|
89 | get
|
---|
90 | {
|
---|
91 | return svgFitToViewBox.PreserveAspectRatio;
|
---|
92 | }
|
---|
93 | }
|
---|
94 |
|
---|
95 | #endregion
|
---|
96 | }
|
---|
97 | }
|
---|