Skip to content

Contributors: ISvgEventCaller and Events Support #1122

@paulushub

Description

@paulushub

Description

ISvgEventCaller and events registration in SvgElement are marked or restricted within Net4 preprocessors.
I assumed that was the time Versions lower than .NET 4 are also supported.

#if Net4
	/// <summary>
	/// Use this method to provide your implementation ISvgEventCaller which can register Actions
	/// and call them if one of the events occurs. Make sure, that your SvgElement has a unique ID.
	/// The SvgTextElement overwrites this and regsiters the Change event tor its text content.
	/// </summary>
	/// <param name="caller"></param>
	public virtual void RegisterEvents(ISvgEventCaller caller)
	{
		if (caller != null && !string.IsNullOrEmpty(this.ID))
		{
			var rpcID = this.ID + "/";

			// NOTE: ... deleted all others ...
			caller.RegisterAction<int, bool, bool, bool, string>(rpcID + "onmousescroll", OnMouseScroll);
		}
	}

	/// <summary>
	/// Use this method to provide your implementation ISvgEventCaller to unregister Actions
	/// </summary>
	/// <param name="caller"></param>
	public virtual void UnregisterEvents(ISvgEventCaller caller)
	{
		if (caller != null && !string.IsNullOrEmpty(this.ID))
		{
			var rpcID = this.ID + "/";

			// NOTE: ... deleted all others ...
			caller.UnregisterAction(rpcID + "onmousescroll");
		}
	}
#endif

Question

  • What is the status of event support in SVG-NET?
  • With supports for .NET 4 and later in SVG-NET, can we remove the preprocessor and enable it for all?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions