diff --git a/.gitignore b/.gitignore index b83a6e1e7dcde74a93eaceb5fd4943b8b8f6bcb3..df25fbbb5ced16209be7441bcd0f4cbe2ad28519 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 d99c3a0709c1accab814454053eefda25806c969..59887b0435c028686c430b544efd35926fb24dcf 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 Binary files a/Source/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and /dev/null differ