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
30bbbc4b
Commit
30bbbc4b
authored
Oct 16, 2013
by
Tebjan Halm
Browse files
fixed deepcopy, added nuget package
parent
f7c71a5c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Nuget/Svg.1.5.0.nupkg
0 → 100644
View file @
30bbbc4b
File added
Source/SvgElement.cs
View file @
30bbbc4b
...
@@ -459,6 +459,7 @@ namespace Svg
...
@@ -459,6 +459,7 @@ namespace Svg
{
{
var
evt
=
attr
.
Event
.
GetValue
(
this
);
var
evt
=
attr
.
Event
.
GetValue
(
this
);
//if someone has registered publish the attribute
if
(
evt
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
this
.
ID
))
if
(
evt
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
this
.
ID
))
{
{
writer
.
WriteAttributeString
(
attr
.
Attribute
.
Name
,
this
.
ID
+
"/"
+
attr
.
Attribute
.
Name
);
writer
.
WriteAttributeString
(
attr
.
Attribute
.
Name
,
this
.
ID
+
"/"
+
attr
.
Attribute
.
Name
);
...
@@ -638,8 +639,10 @@ namespace Svg
...
@@ -638,8 +639,10 @@ namespace Svg
public
virtual
SvgElement
DeepCopy
<
T
>()
where
T
:
SvgElement
,
new
()
public
virtual
SvgElement
DeepCopy
<
T
>()
where
T
:
SvgElement
,
new
()
{
{
var
newObj
=
new
T
();
var
newObj
=
new
T
();
newObj
.
ID
=
this
.
ID
;
newObj
.
Content
=
this
.
Content
;
newObj
.
Content
=
this
.
Content
;
newObj
.
ElementName
=
this
.
ElementName
;
newObj
.
ElementName
=
this
.
ElementName
;
// if (this.Parent != null)
// if (this.Parent != null)
// this.Parent.Children.Add(newObj);
// this.Parent.Children.Add(newObj);
...
@@ -655,6 +658,28 @@ namespace Svg
...
@@ -655,6 +658,28 @@ namespace Svg
newObj
.
Children
.
Add
(
child
.
DeepCopy
());
newObj
.
Children
.
Add
(
child
.
DeepCopy
());
}
}
foreach
(
var
attr
in
this
.
_svgEventAttributes
)
{
var
evt
=
attr
.
Event
.
GetValue
(
this
);
//if someone has registered also register here
if
(
evt
!=
null
)
{
if
(
attr
.
Event
.
Name
==
"MouseDown"
)
newObj
.
MouseDown
+=
delegate
{
};
else
if
(
attr
.
Event
.
Name
==
"MouseUp"
)
newObj
.
MouseUp
+=
delegate
{
};
else
if
(
attr
.
Event
.
Name
==
"MouseOver"
)
newObj
.
MouseOver
+=
delegate
{
};
else
if
(
attr
.
Event
.
Name
==
"MouseOut"
)
newObj
.
MouseOut
+=
delegate
{
};
else
if
(
attr
.
Event
.
Name
==
"MouseMove"
)
newObj
.
MouseMove
+=
delegate
{
};
else
if
(
attr
.
Event
.
Name
==
"MouseScroll"
)
newObj
.
MouseScroll
+=
delegate
{
};
}
}
if
(
this
.
_customAttributes
.
Count
>
0
)
if
(
this
.
_customAttributes
.
Count
>
0
)
{
{
foreach
(
var
element
in
_customAttributes
)
foreach
(
var
element
in
_customAttributes
)
...
...
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