Page 1 of 1

Duplicate Event Handlers

Posted: Fri Sep 06, 2019 4:38 am
by matthmsft
Product: PowerShell Studio 2019 (64 Bit)
Build: v5.6.167
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.18362.0

Crazy thing has just started happening. In a form on my project, I have started getting prompts for missing event handlers for buttons and lists and would I like to create them. The odd thing is, the code for the event handlers is still there! and when I click to Add them, it creates duplicates, so I have 3 of a particular event handler ($btn_CredentialAdd_Click - for example).

Has anyone seen this behaviour?

Re: Duplicate Event Handlers

Posted: Fri Sep 06, 2019 4:46 am
by matthmsft
This is super crazy, even once I click to create them and they are duplicated, if I go back to the Designer view, the popups appear again that the events are missing still and it creates even more!

Some reference must be corrupted or broken somewhere. Any ideas?

Re: Duplicate Event Handlers

Posted: Fri Sep 06, 2019 5:05 am
by matthmsft
duplicates.PNG
duplicates.PNG (69.15 KiB) Viewed 1793 times
Here are the duplicates being generated each time I click into Designer view. The original event handlers with code is still in place further up the project!

Re: Duplicate Event Handlers

Posted: Fri Sep 06, 2019 7:05 am
by brittneyr
What kind of project are you using? (Multi-Form Project, Form Project, etc)
Is it only this form affected by this behavior?
Can you please upload the form with this behavior to the following location:
https://www.sapien.com/support/upload

Re: Duplicate Event Handlers

Posted: Fri Sep 06, 2019 7:11 am
by matthmsft
Hi
It is only this form which does it. It is a multi-form project. I have uploaded the form.

Thanks!

Re: Duplicate Event Handlers

Posted: Fri Sep 06, 2019 8:07 am
by brittneyr
I'm able to replicate the behavior you are experiencing with the form you uploaded, but I haven't been able to reproduce this on my own form. I will keep investigating and I'll post if I get any new information.

Re: Duplicate Event Handlers

Posted: Fri Sep 06, 2019 9:31 am
by brittneyr
From looking at your form, I can see you are missing some closing braces. This seems be what is causing the weird behavior with the designer.
Some that I found:
- Line 1205
- Line 1866

Re: Duplicate Event Handlers

Posted: Fri Sep 06, 2019 1:33 pm
by matthmsft
Hi

Thanks, I didn't see the 1205 brace but I see the 1866. That was re-jigged before the problem started, but the syntax highlighter didn't catch it.

I have added the 1866 curly brace and the problem seems to have stopped now.

Seems to be that 1 curly brace that the highlighter missed that cause the behavior to start :)

Great catch.