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
23a53f05
Commit
23a53f05
authored
Jul 12, 2013
by
Tebjan Halm
Browse files
improved event publishing
parent
0fdceefc
Changes
1
Show whitespace changes
Inline
Side-by-side
Source/SvgElement.cs
View file @
23a53f05
...
@@ -414,7 +414,9 @@ namespace Svg
...
@@ -414,7 +414,9 @@ namespace Svg
}
}
}
}
//events
//events
if
(
AutoPublishEvents
)
foreach
(
var
attr
in
_svgEventAttributes
)
foreach
(
var
attr
in
_svgEventAttributes
)
{
{
var
evt
=
attr
.
Event
.
GetValue
(
this
);
var
evt
=
attr
.
Event
.
GetValue
(
this
);
...
@@ -432,6 +434,8 @@ namespace Svg
...
@@ -432,6 +434,8 @@ namespace Svg
}
}
}
}
public
bool
AutoPublishEvents
=
true
;
private
bool
TryResolveParentAttributeValue
(
string
attributeKey
,
out
object
parentAttributeValue
)
private
bool
TryResolveParentAttributeValue
(
string
attributeKey
,
out
object
parentAttributeValue
)
{
{
parentAttributeValue
=
null
;
parentAttributeValue
=
null
;
...
@@ -685,11 +689,16 @@ namespace Svg
...
@@ -685,11 +689,16 @@ namespace Svg
}
}
protected
void
OnMouseDown
(
float
x
,
float
y
,
int
button
,
int
clickCount
)
protected
void
OnMouseDown
(
float
x
,
float
y
,
int
button
,
int
clickCount
)
{
RaiseMouseDown
(
this
,
new
MouseArg
{
x
=
x
,
y
=
y
,
Button
=
button
,
ClickCount
=
clickCount
});
}
protected
void
RaiseMouseDown
(
object
sender
,
MouseArg
e
)
{
{
var
handler
=
MouseDown
;
var
handler
=
MouseDown
;
if
(
handler
!=
null
)
if
(
handler
!=
null
)
{
{
handler
(
this
,
new
MouseArg
{
x
=
x
,
y
=
y
,
Button
=
button
,
ClickCount
=
clickCount
}
);
handler
(
sender
,
e
);
}
}
}
}
...
...
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