Bug in XIDE (event insert with delegate inside class)

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
SHirsch
Posts: 286
Joined: Tue Jan 30, 2018 8:23 am
Location: Germany

Bug in XIDE (event insert with delegate inside class)

Post by SHirsch »

Hi Chris,

Code: Select all

....
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:

Code: Select all


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

Code: Select all

DELEGATE
is ignored and a new one is inserted. Also

Code: Select all

END CLASS
is inserted.
When I put the

Code: Select all

DELEGATE
outside the

Code: Select all

CLASS
everything is ok.

Attached a simple sample.

Regards,
Stefan
Attachments
Dummy2.zip
(2.01 KiB) Downloaded 49 times
User avatar
Chris
Posts: 4899
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Bug in XIDE (event insert with delegate inside class)

Post by Chris »

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
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Post Reply