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
540bfa57
"vscode:/vscode.git/clone" did not exist on "23a53f0576783d9042cf218662f070a5c337d21e"
Commit
540bfa57
authored
May 20, 2014
by
tebjan
Browse files
auto fix ids by default and log it to console
parent
fe32d9ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/SvgElementCollection.cs
View file @
540bfa57
...
...
@@ -53,7 +53,12 @@ namespace Svg
/// <param name="item">The <see cref="SvgElement"/> to be added.</param>
public
void
Insert
(
int
index
,
SvgElement
item
)
{
InsertAndForceUniqueID
(
index
,
item
,
false
,
false
);
InsertAndForceUniqueID
(
index
,
item
,
true
,
true
,
LogIDChange
);
}
private
void
LogIDChange
(
SvgElement
elem
,
string
oldId
,
string
newID
)
{
Console
.
WriteLine
(
"ID of SVG element "
+
elem
.
ToString
()
+
" changed from "
+
oldId
+
" to "
+
newID
);
}
public
void
InsertAndForceUniqueID
(
int
index
,
SvgElement
item
,
bool
autoForceUniqueID
=
true
,
bool
autoFixChildrenID
=
true
,
Action
<
SvgElement
,
string
,
string
>
logElementOldIDNewID
=
null
)
...
...
@@ -81,7 +86,7 @@ namespace Svg
public
void
Add
(
SvgElement
item
)
{
this
.
AddAndForceUniqueID
(
item
,
false
,
fals
e
);
this
.
AddAndForceUniqueID
(
item
,
true
,
true
,
LogIDChang
e
);
}
public
void
AddAndForceUniqueID
(
SvgElement
item
,
bool
autoForceUniqueID
=
true
,
bool
autoFixChildrenID
=
true
,
Action
<
SvgElement
,
string
,
string
>
logElementOldIDNewID
=
null
)
...
...
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