Lost another big piece of code

This forum is meant for questions and discussions about the X# language and tools
leighproman
Posts: 60
Joined: Tue Oct 11, 2016 8:56 pm
Location: UK

Lost another big piece of code

Post by leighproman »

Tried it again the other way around and yes it deleted the DocumentCompleted method and replaced with the blank DocumentNavigated method.

So sequence was:
Open the code-behind prg
Comment out the lines in the event method
Save the changes
Leave the code page open
Open the form
Click the browser control and go to event properties page
Delete the event name next to DocumentCompleted
Double-click on event for DocumentNavigated
VS puts me back on the code-behind page with an empty DocumentNavigated method and no DocumentCompleted method.
formcode.jpg
formcode.jpg (96.18 KiB) Viewed 432 times
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Lost another big piece of code

Post by ic2 »

Hello Leigh,

Apart from the fact that this is a serious issue (and apparently difficult to reproduce to make it worse...) I still wonder how you can separate the written code from the generated code? E.g. if I would double click on a button the click event will be created somewhere in a random line in the .prg with the generated code, right?

Does it mean you keep deleting this code and pasting it in your written prg?

But it's "good" to know Kees is not the only one having seen this issue.

Dick
leighproman
Posts: 60
Joined: Tue Oct 11, 2016 8:56 pm
Location: UK

Lost another big piece of code

Post by leighproman »

The newly generated event code is always added to the end of the generated code (as you can see in the screenshots)
I usually just cut and paste it to another prg containing a partial class of the same window.
Once there it doesn't get touched if I modify the window.
The window in the example has so little code I hadn't bothered separating it out.
Leigh
User avatar
Chris
Posts: 4899
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Lost another big piece of code

Post by Chris »

Hi Leigh,

Thanks a lot for the very detailed report! Those steps indeed reproduce the problem, and the critical step needed is to have the design mode file closed and reopened after the code is written in the .prg, or have it closed already before doing that. In my case I had the design mode always open side by side, and that prevents the problem from happening. I will pass this for Robert for fixing, hopefully this will take care of all related issues.

.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Lost another big piece of code

Post by ic2 »

Hello Leigh, Chris,

Good news that you found it and most certainly can fix it (I hope before you release 2.9)!

And I thought already that separating code in Visual Studio required this manual work. Working with VS requires many workarounds to keep it working, well, working...more or less..

Dick
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Lost another big piece of code

Post by robert »

Dick,
We have found this and fixed it.
The 2.9 build is now being tested further (internally) before it is released. I think we can release it in a few days.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Lost another big piece of code

Post by ic2 »

Hello Robert,
robert wrote:We have found this and fixed it.
The 2.9 build is now being tested further (internally) before it is released. I think we can release it in a few days.
That is very good news!

Dick
Post Reply