From e108cbdde6af8cfa23b73667212a065ebe7e90d9 Mon Sep 17 00:00:00 2001 From: Tebjan Halm Date: Mon, 25 Nov 2013 18:18:24 +0100 Subject: [PATCH] added sessionID to svg events --- .gitignore | 11 +-- Source/SvgElement.cs | 75 ++++++++++-------- ...gnTimeResolveAssemblyReferencesInput.cache | Bin 6285 -> 0 bytes 3 files changed, 47 insertions(+), 39 deletions(-) delete mode 100644 Source/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache diff --git a/.gitignore b/.gitignore index b83a6e1..df25fbb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ - -Source/bin/ -Source/obj/ -Source/Svg.csproj.user -Source/Svg.suo + +Source/bin/ +Source/obj/ +Source/Svg.csproj.user +Source/Svg.suo +Source/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache diff --git a/Source/SvgElement.cs b/Source/SvgElement.cs index d99c3a0..59887b0 100644 --- a/Source/SvgElement.cs +++ b/Source/SvgElement.cs @@ -733,14 +733,14 @@ namespace Svg { var rpcID = this.ID + "/"; - caller.RegisterAction(rpcID + "onclick", OnClick); - caller.RegisterAction(rpcID + "onmousedown", OnMouseDown); - caller.RegisterAction(rpcID + "onmouseup", OnMouseUp); - caller.RegisterAction(rpcID + "onmousemove", OnMouseMove); - caller.RegisterAction(rpcID + "onmousescroll", OnMouseScroll); - caller.RegisterAction(rpcID + "onmouseover", OnMouseOver); - caller.RegisterAction(rpcID + "onmouseout", OnMouseOut); - caller.RegisterAction(rpcID + "onchange", OnChange); + caller.RegisterAction(rpcID + "onclick", OnClick); + caller.RegisterAction(rpcID + "onmousedown", OnMouseDown); + caller.RegisterAction(rpcID + "onmouseup", OnMouseUp); + caller.RegisterAction(rpcID + "onmousemove", OnMouseMove); + caller.RegisterAction(rpcID + "onmousescroll", OnMouseScroll); + caller.RegisterAction(rpcID + "onmouseover", OnMouseOver); + caller.RegisterAction(rpcID + "onmouseout", OnMouseOut); + caller.RegisterAction(rpcID + "onchange", OnChange); } } @@ -781,18 +781,18 @@ namespace Svg public event EventHandler MouseScroll; [SvgAttribute("onmouseover")] - public event EventHandler MouseOver; + public event EventHandler MouseOver; [SvgAttribute("onmouseout")] - public event EventHandler MouseOut; + public event EventHandler MouseOut; [SvgAttribute("onchange")] public event EventHandler Change; //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) @@ -805,9 +805,9 @@ namespace Svg } //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) @@ -820,9 +820,9 @@ namespace Svg } //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) @@ -835,9 +835,9 @@ namespace Svg } //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) @@ -850,9 +850,9 @@ namespace Svg } //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) @@ -865,39 +865,39 @@ namespace Svg } //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; if (handler != null) { - handler(sender, new EventArgs()); + handler(sender, args); } } //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; if (handler != null) { - handler(sender, new EventArgs()); + handler(sender, args); } } //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) @@ -913,10 +913,16 @@ namespace Svg } + public class SVGArg : EventArgs + { + public string SessionID; + } + + /// /// Describes the Attribute which was set /// - public class AttributeEventArgs : EventArgs + public class AttributeEventArgs : SVGArg { public string Attribute; public object Value; @@ -930,13 +936,14 @@ namespace Svg void RegisterAction(string rpcID, Action action); void RegisterAction(string rpcID, Action action); void RegisterAction(string rpcID, Action action); + void RegisterAction(string rpcID, Action action); void UnregisterAction(string rpcID); } /// /// Represents the state of the mouse at the moment the event occured. /// - public class MouseArg : EventArgs + public class MouseArg : SVGArg { public float x; public float y; @@ -952,7 +959,7 @@ namespace Svg /// /// Represents the mouse position at the moment the event occured. /// - public class PointArg : EventArgs + public class PointArg : SVGArg { public float x; public float y; @@ -961,7 +968,7 @@ namespace Svg /// /// Represents a string argument /// - public class StringArg : EventArgs + public class StringArg : SVGArg { public string s; } diff --git a/Source/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Source/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache deleted file mode 100644 index bf56b46dd4618dc4a415b19a4ab62b62e5b66651..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6285 zcmeHLdruoj5VyfxFoYJn9olvPw@^WIc(cqsn08p;a+hi7%_OdxZG@gzmduA^ArE^)HCD&5 z2badm!gJBzr^Ku=*#sRgtA=$2`W*^U&v`Qt5=ziu7>bQRX|(U$x{lx%w@>Pb>r8#f zZx-?78vo)d(?dU%zG7yHOK`N19MojX)l61_N#|gT=>s*{yuui7NzuRvkyld^np|nw zK3|YU$23p~XHd|^U|i5LePw7<1pE->vzyr^u38>zlftVDyNNd2S-2&I14;?`8m;FV zeZrLME&;a^2AccOU2;`YCrZi~GKLK!l^RAmluoA&{388hq}o;*d`vprHAhn#S#KZ! z$sOx0hTwg1clVYlnCIKf3t@|K`F<{*TGf&V&AjO=M@Wy?&ri<6e?B-%OKj0u{Gqr! zzW{}o%X|6T?6{+*_9G5^$%gfgi%X{mDcX-LiceENgx~R;O85W`60{#VG)T~-9-Mmw zZnMKk#1Z!LG z)@v~^%pc(cKHo!?T?Dy)a%Oyja@uRJ>|Yc@O51DJl?z99NjRYofmU`0ahn~;ZO#>n zb2g%$4+u$=T}Gf<-F{t zjD0n-ulVmUx_{Iu)!@iqnfPA0{*F6%fu$nVN8h#kk@rb&e!_5mcW-nwYvQffYdL~S zRJJpoA$gnRZJr|-5Q+W@JDD<8+R_BZB7|mQr`OVi&aQED1lOqL2(pox#&aZ(PSozl_!h^LK!M+(oQcy4J0>VXb+0qy zdu07z40MFeZbb!G+li{Qwvvvm54dz&OzO6sBj6VW_yu;7-8%w()b5!?NeQ*#KL^*% PztzMC*G*j2+#CM~8h$4g -- GitLab