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
c132ed53
Commit
c132ed53
authored
Dec 07, 2013
by
Tebjan Halm
Browse files
GetXML method also makes sure it uses invariant culture for serialization
parent
11c363d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/SvgExtentions.cs
View file @
c132ed53
...
...
@@ -5,6 +5,8 @@ using System.Text;
using
System.Drawing
;
using
System.IO
;
using
System.Xml
;
using
System.Threading
;
using
System.Globalization
;
namespace
Svg
{
...
...
@@ -39,13 +41,22 @@ namespace Svg
public
static
string
GetXML
(
this
SvgElement
elem
)
{
var
result
=
""
;
var
currentCulture
=
Thread
.
CurrentThread
.
CurrentCulture
;
Thread
.
CurrentThread
.
CurrentCulture
=
CultureInfo
.
InvariantCulture
;
using
(
StringWriter
str
=
new
StringWriter
())
using
(
XmlTextWriter
xml
=
new
XmlTextWriter
(
str
))
{
elem
.
WriteElement
(
xml
);
return
str
.
ToString
();
using
(
XmlTextWriter
xml
=
new
XmlTextWriter
(
str
))
{
elem
.
WriteElement
(
xml
);
result
=
str
.
ToString
();
}
}
Thread
.
CurrentThread
.
CurrentCulture
=
currentCulture
;
return
result
;
}
public
static
bool
HasNonEmptyCustomAttribute
(
this
SvgElement
element
,
string
name
)
...
...
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