Skip to content
GitLab
Menu
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
"Source/vscode:/vscode.git/clone" did not exist on "0715963332609396710fd4dc15d5e5ac0aca51b6"
Commit
697d0bbe
authored
Feb 26, 2014
by
Tibor Peluch
Browse files
added namespace check
parent
31a24ea2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/SvgElementFactory.cs
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");
...
...
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