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
e108cbdd
Commit
e108cbdd
authored
Nov 25, 2013
by
Tebjan Halm
Browse files
added sessionID to svg events
parent
dbdd5b2a
Changes
3
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
e108cbdd
Source/bin/
Source/bin/
Source/obj/
Source/obj/
Source/Svg.csproj.user
Source/Svg.csproj.user
Source/Svg.suo
Source/Svg.suo
Source/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Source/SvgElement.cs
View file @
e108cbdd
...
@@ -733,14 +733,14 @@ namespace Svg
...
@@ -733,14 +733,14 @@ namespace Svg
{
{
var
rpcID
=
this
.
ID
+
"/"
;
var
rpcID
=
this
.
ID
+
"/"
;
caller
.
RegisterAction
<
float
,
float
,
int
,
int
>(
rpcID
+
"onclick"
,
OnClick
);
caller
.
RegisterAction
<
float
,
float
,
int
,
int
,
string
>(
rpcID
+
"onclick"
,
OnClick
);
caller
.
RegisterAction
<
float
,
float
,
int
,
int
>(
rpcID
+
"onmousedown"
,
OnMouseDown
);
caller
.
RegisterAction
<
float
,
float
,
int
,
int
,
string
>(
rpcID
+
"onmousedown"
,
OnMouseDown
);
caller
.
RegisterAction
<
float
,
float
,
int
>(
rpcID
+
"onmouseup"
,
OnMouseUp
);
caller
.
RegisterAction
<
float
,
float
,
int
,
string
>(
rpcID
+
"onmouseup"
,
OnMouseUp
);
caller
.
RegisterAction
<
float
,
float
>(
rpcID
+
"onmousemove"
,
OnMouseMove
);
caller
.
RegisterAction
<
float
,
float
,
string
>(
rpcID
+
"onmousemove"
,
OnMouseMove
);
caller
.
RegisterAction
<
float
>(
rpcID
+
"onmousescroll"
,
OnMouseScroll
);
caller
.
RegisterAction
<
float
,
string
>(
rpcID
+
"onmousescroll"
,
OnMouseScroll
);
caller
.
RegisterAction
(
rpcID
+
"onmouseover"
,
OnMouseOver
);
caller
.
RegisterAction
<
string
>
(
rpcID
+
"onmouseover"
,
OnMouseOver
);
caller
.
RegisterAction
(
rpcID
+
"onmouseout"
,
OnMouseOut
);
caller
.
RegisterAction
<
string
>
(
rpcID
+
"onmouseout"
,
OnMouseOut
);
caller
.
RegisterAction
<
string
>(
rpcID
+
"onchange"
,
OnChange
);
caller
.
RegisterAction
<
string
,
string
>(
rpcID
+
"onchange"
,
OnChange
);
}
}
}
}
...
@@ -781,18 +781,18 @@ namespace Svg
...
@@ -781,18 +781,18 @@ namespace Svg
public
event
EventHandler
<
PointArg
>
MouseScroll
;
public
event
EventHandler
<
PointArg
>
MouseScroll
;
[
SvgAttribute
(
"onmouseover"
)]
[
SvgAttribute
(
"onmouseover"
)]
public
event
EventHandler
MouseOver
;
public
event
EventHandler
<
SVGArg
>
MouseOver
;
[
SvgAttribute
(
"onmouseout"
)]
[
SvgAttribute
(
"onmouseout"
)]
public
event
EventHandler
MouseOut
;
public
event
EventHandler
<
SVGArg
>
MouseOut
;
[
SvgAttribute
(
"onchange"
)]
[
SvgAttribute
(
"onchange"
)]
public
event
EventHandler
<
StringArg
>
Change
;
public
event
EventHandler
<
StringArg
>
Change
;
//click
//click
protected
void
OnClick
(
float
x
,
float
y
,
int
button
,
int
clickCount
)
protected
void
OnClick
(
float
x
,
float
y
,
int
button
,
int
clickCount
,
string
sessionID
)
{
{
RaiseMouseClick
(
this
,
new
MouseArg
{
x
=
x
,
y
=
y
,
Button
=
button
,
ClickCount
=
clickCount
});
RaiseMouseClick
(
this
,
new
MouseArg
{
x
=
x
,
y
=
y
,
Button
=
button
,
ClickCount
=
clickCount
,
SessionID
=
sessionID
});
}
}
protected
void
RaiseMouseClick
(
object
sender
,
MouseArg
e
)
protected
void
RaiseMouseClick
(
object
sender
,
MouseArg
e
)
...
@@ -805,9 +805,9 @@ namespace Svg
...
@@ -805,9 +805,9 @@ namespace Svg
}
}
//down
//down
protected
void
OnMouseDown
(
float
x
,
float
y
,
int
button
,
int
clickCount
)
protected
void
OnMouseDown
(
float
x
,
float
y
,
int
button
,
int
clickCount
,
string
sessionID
)
{
{
RaiseMouseDown
(
this
,
new
MouseArg
{
x
=
x
,
y
=
y
,
Button
=
button
,
ClickCount
=
clickCount
});
RaiseMouseDown
(
this
,
new
MouseArg
{
x
=
x
,
y
=
y
,
Button
=
button
,
ClickCount
=
clickCount
,
SessionID
=
sessionID
});
}
}
protected
void
RaiseMouseDown
(
object
sender
,
MouseArg
e
)
protected
void
RaiseMouseDown
(
object
sender
,
MouseArg
e
)
...
@@ -820,9 +820,9 @@ namespace Svg
...
@@ -820,9 +820,9 @@ namespace Svg
}
}
//up
//up
protected
void
OnMouseUp
(
float
x
,
float
y
,
int
button
)
protected
void
OnMouseUp
(
float
x
,
float
y
,
int
button
,
string
sessionID
)
{
{
RaiseMouseUp
(
this
,
new
MouseArg
{
x
=
x
,
y
=
y
,
Button
=
button
});
RaiseMouseUp
(
this
,
new
MouseArg
{
x
=
x
,
y
=
y
,
Button
=
button
,
SessionID
=
sessionID
});
}
}
protected
void
RaiseMouseUp
(
object
sender
,
MouseArg
e
)
protected
void
RaiseMouseUp
(
object
sender
,
MouseArg
e
)
...
@@ -835,9 +835,9 @@ namespace Svg
...
@@ -835,9 +835,9 @@ namespace Svg
}
}
//move
//move
protected
void
OnMouseMove
(
float
x
,
float
y
)
protected
void
OnMouseMove
(
float
x
,
float
y
,
string
sessionID
)
{
{
RaiseMouseMove
(
this
,
new
PointArg
{
x
=
x
,
y
=
y
});
RaiseMouseMove
(
this
,
new
PointArg
{
x
=
x
,
y
=
y
,
SessionID
=
sessionID
});
}
}
protected
void
RaiseMouseMove
(
object
sender
,
PointArg
e
)
protected
void
RaiseMouseMove
(
object
sender
,
PointArg
e
)
...
@@ -850,9 +850,9 @@ namespace Svg
...
@@ -850,9 +850,9 @@ namespace Svg
}
}
//scroll
//scroll
protected
void
OnMouseScroll
(
float
y
)
protected
void
OnMouseScroll
(
float
y
,
string
sessionID
)
{
{
RaiseMouseScroll
(
this
,
new
PointArg
{
x
=
0
,
y
=
y
});
RaiseMouseScroll
(
this
,
new
PointArg
{
x
=
0
,
y
=
y
,
SessionID
=
sessionID
});
}
}
protected
void
RaiseMouseScroll
(
object
sender
,
PointArg
e
)
protected
void
RaiseMouseScroll
(
object
sender
,
PointArg
e
)
...
@@ -865,39 +865,39 @@ namespace Svg
...
@@ -865,39 +865,39 @@ namespace Svg
}
}
//over
//over
protected
void
OnMouseOver
()
protected
void
OnMouseOver
(
string
sessionID
)
{
{
RaiseMouseOver
(
this
);
RaiseMouseOver
(
this
,
new
SVGArg
{
SessionID
=
sessionID
}
);
}
}
protected
void
RaiseMouseOver
(
object
sender
)
protected
void
RaiseMouseOver
(
object
sender
,
SVGArg
args
)
{
{
var
handler
=
MouseOver
;
var
handler
=
MouseOver
;
if
(
handler
!=
null
)
if
(
handler
!=
null
)
{
{
handler
(
sender
,
new
EventA
rgs
()
);
handler
(
sender
,
a
rgs
);
}
}
}
}
//out
//out
protected
void
OnMouseOut
()
protected
void
OnMouseOut
(
string
sessionID
)
{
{
RaiseMouseOut
(
this
);
RaiseMouseOut
(
this
,
new
SVGArg
{
SessionID
=
sessionID
}
);
}
}
protected
void
RaiseMouseOut
(
object
sender
)
protected
void
RaiseMouseOut
(
object
sender
,
SVGArg
args
)
{
{
var
handler
=
MouseOut
;
var
handler
=
MouseOut
;
if
(
handler
!=
null
)
if
(
handler
!=
null
)
{
{
handler
(
sender
,
new
EventA
rgs
()
);
handler
(
sender
,
a
rgs
);
}
}
}
}
//change
//change
protected
void
OnChange
(
string
newString
)
protected
void
OnChange
(
string
newString
,
string
sessionID
)
{
{
RaiseChange
(
this
,
new
StringArg
{
s
=
newString
});
RaiseChange
(
this
,
new
StringArg
{
s
=
newString
,
SessionID
=
sessionID
});
}
}
protected
void
RaiseChange
(
object
sender
,
StringArg
s
)
protected
void
RaiseChange
(
object
sender
,
StringArg
s
)
...
@@ -913,10 +913,16 @@ namespace Svg
...
@@ -913,10 +913,16 @@ namespace Svg
}
}
public
class
SVGArg
:
EventArgs
{
public
string
SessionID
;
}
/// <summary>
/// <summary>
/// Describes the Attribute which was set
/// Describes the Attribute which was set
/// </summary>
/// </summary>
public
class
AttributeEventArgs
:
Event
Arg
s
public
class
AttributeEventArgs
:
SVG
Arg
{
{
public
string
Attribute
;
public
string
Attribute
;
public
object
Value
;
public
object
Value
;
...
@@ -930,13 +936,14 @@ namespace Svg
...
@@ -930,13 +936,14 @@ namespace Svg
void
RegisterAction
<
T1
,
T2
>(
string
rpcID
,
Action
<
T1
,
T2
>
action
);
void
RegisterAction
<
T1
,
T2
>(
string
rpcID
,
Action
<
T1
,
T2
>
action
);
void
RegisterAction
<
T1
,
T2
,
T3
>(
string
rpcID
,
Action
<
T1
,
T2
,
T3
>
action
);
void
RegisterAction
<
T1
,
T2
,
T3
>(
string
rpcID
,
Action
<
T1
,
T2
,
T3
>
action
);
void
RegisterAction
<
T1
,
T2
,
T3
,
T4
>(
string
rpcID
,
Action
<
T1
,
T2
,
T3
,
T4
>
action
);
void
RegisterAction
<
T1
,
T2
,
T3
,
T4
>(
string
rpcID
,
Action
<
T1
,
T2
,
T3
,
T4
>
action
);
void
RegisterAction
<
T1
,
T2
,
T3
,
T4
,
T5
>(
string
rpcID
,
Action
<
T1
,
T2
,
T3
,
T4
,
T5
>
action
);
void
UnregisterAction
(
string
rpcID
);
void
UnregisterAction
(
string
rpcID
);
}
}
/// <summary>
/// <summary>
/// Represents the state of the mouse at the moment the event occured.
/// Represents the state of the mouse at the moment the event occured.
/// </summary>
/// </summary>
public
class
MouseArg
:
Event
Arg
s
public
class
MouseArg
:
SVG
Arg
{
{
public
float
x
;
public
float
x
;
public
float
y
;
public
float
y
;
...
@@ -952,7 +959,7 @@ namespace Svg
...
@@ -952,7 +959,7 @@ namespace Svg
/// <summary>
/// <summary>
/// Represents the mouse position at the moment the event occured.
/// Represents the mouse position at the moment the event occured.
/// </summary>
/// </summary>
public
class
PointArg
:
Event
Arg
s
public
class
PointArg
:
SVG
Arg
{
{
public
float
x
;
public
float
x
;
public
float
y
;
public
float
y
;
...
@@ -961,7 +968,7 @@ namespace Svg
...
@@ -961,7 +968,7 @@ namespace Svg
/// <summary>
/// <summary>
/// Represents a string argument
/// Represents a string argument
/// </summary>
/// </summary>
public
class
StringArg
:
Event
Arg
s
public
class
StringArg
:
SVG
Arg
{
{
public
string
s
;
public
string
s
;
}
}
...
...
Source/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
deleted
100644 → 0
View file @
dbdd5b2a
File deleted
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