fbpx

Bug in XIDE (event insert with delegate inside class)

More
10 months 1 week ago #1 by Stefan Hirsch
Hi Chris,
....
METHOD OKButtonClick(sender AS OBJECT , e AS System.EventArgs) AS VOID
	SELF:Close()
RETURN

DELEGATE PropertyChangedDelegate(o AS OBJECT, e AS System.ComponentModel.PropertyChangedEventArgs) AS VOID

METHOD btnTestClick(sender AS System.Object , e AS System.EventArgs) AS VOID
RETURN

END CLASS

When you now change something in the painter and save you get this code:
METHOD OKButtonClick(sender AS OBJECT , e AS System.EventArgs) AS VOID
	SELF:Close()
RETURN

METHOD btnTestClick(sender AS System.Object , e AS System.EventArgs) AS VOID
RETURN

END CLASS
DELEGATE PropertyChangedDelegate(o AS OBJECT, e AS System.ComponentModel.PropertyChangedEventArgs) AS VOID

METHOD btnTestClick(sender AS System.Object , e AS System.EventArgs) AS VOID
RETURN

END CLASS

As you can see the event handler implemented after
DELEGATE
is ignored and a new one is inserted. Also
END CLASS
is inserted.
When I put the
DELEGATE
outside the
CLASS
everything is ok.

Attached a simple sample.

Regards,
Stefan
Attachments:

Please Log in or Create an account to join the conversation.

More
10 months 1 week ago #2 by Chris Pyrgas
Hi Stefan,

Thanks, I see the problem. It's because the DELEGATE is considered a class and nested classes are not properly supported by the code generator yet (that was implemented in XIDE (VIDE back then) before nested classes were implemented in the vulcan compiler). I'll look into it, I think I should be able to add a small hack in there :)

Chris

XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.