Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ImportedProjects
SVG
Commits
697d0bbe
Commit
697d0bbe
authored
11 years ago
by
Tibor Peluch
Browse files
Options
Download
Email Patches
Plain Diff
added namespace check
parent
31a24ea2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/SvgElementFactory.cs
+17
-12
Source/SvgElementFactory.cs
with
17 additions
and
12 deletions
+17
-12
Source/SvgElementFactory.cs
+
17
-
12
View file @
697d0bbe
...
...
@@ -14,6 +14,7 @@ namespace Svg
internal
class
SvgElementFactory
{
private
static
List
<
ElementInfo
>
availableElements
;
private
const
string
svgNS
=
"http://www.w3.org/2000/svg"
;
/// <summary>
/// Gets a list of available types that can be used when creating an <see cref="SvgElement"/>.
...
...
@@ -77,25 +78,29 @@ namespace Svg
{
SvgElement
createdElement
=
null
;
string
elementName
=
reader
.
LocalName
;
string
elementNS
=
reader
.
NamespaceURI
;
//Trace.TraceInformation("Begin CreateElement: {0}", elementName);
if
(
elementN
ame
==
"
svg
"
)
if
(
elementN
S
==
svg
NS
)
{
createdElement
=
(
fragmentIsDocument
)
?
new
T
()
:
new
SvgFragment
();
}
else
{
ElementInfo
validType
=
AvailableElements
.
SingleOrDefault
(
e
=>
e
.
ElementName
==
elementName
);
if
(
validType
!=
null
)
if
(
elementName
==
"svg"
)
{
createdElement
=
(
SvgElement
)
Activator
.
CreateInstance
(
validType
.
ElementType
);
createdElement
=
(
fragmentIsDocument
)
?
new
T
()
:
new
SvgFragment
();
}
else
{
ElementInfo
validType
=
AvailableElements
.
SingleOrDefault
(
e
=>
e
.
ElementName
==
elementName
);
if
(
validType
!=
null
)
{
createdElement
=
(
SvgElement
)
Activator
.
CreateInstance
(
validType
.
ElementType
);
}
}
}
if
(
createdElement
!=
null
)
{
SetAttributes
(
createdElement
,
reader
,
document
);
if
(
createdElement
!=
null
)
{
SetAttributes
(
createdElement
,
reader
,
document
);
}
}
//Trace.TraceInformation("End CreateElement");
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help