OS : Win7 x64 (SP1)
PrimalStudio Version : 3.0.3.0
Powershell v2
I'm struggling to find a way within the PrimalStudio 2012 interface to properly register an event in a project so that i can process its eventargs.
Code for registration is below
$webclient = New-Object System.Net.WebClient
Register-ObjectEvent $webclient DownloadProgressChanged -SourceIdentifier WebClient.DownloadProgressChanged
I've tried the above in Globals.ps1, Startup.pfs, and MainForm.pff without success, whenever i try a :-
get-event -SourceIdentifier WebClient.DownloadProgressChanged
I get ERROR: Get-Event : Event with source identifier 'WebClient.DownloadProgressChanged' does not exist.
So far the only way i've found out to get round this to manually edit the ps1 file that is generated by PrimalStudio 2012 (via Export), and enter the registration code code in the #region Import Assemblies section of the file. If i do that, i can then access the event from anywhere in my script. This is a bit inconvenient though.
Is there a way for me to do this within PrimalStudio?
thanks,
tim
pringtef2012-05-15 03:58:18
Unable to register event
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Unable to register event
Register-ObjectEvent may not trigger while running a Form. Please try the following instead: $webclient.add_DownloadProgressChanged($scriptBlock)David
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.