Page 1 of 1

How toi detect which operation will be/was executed?

Posted: Fri Jun 23, 2017 7:34 am
by cew
Hi there,

I have to know, if the user called "Save" or "Save as Copy".
Therefore I registered the events e_operBeforeExecute,and e_operExecuted,
But if the user executes the command from file menĂ¼r or via icon, only the events e_document_beforeSave and later e_document_afterSave get raised.

How do I detect which command got called?

(Version 6.0.322.4)

Best regards,
cew

Re: How toi detect which operation will be/was executed?

Posted: Fri Jun 23, 2017 7:38 am
by Sasha - Tracker Dev Team
Hello cew,

You can always make a custom command handler as listener for that:
https://gist.github.com/Polaringu/16bb2 ... 7cbe36f4e6

Cheers,
Alex

Re: How toi detect which operation will be/was executed?

Posted: Fri Jun 23, 2017 7:51 am
by cew
Hi Alex,
to be honest, I don't want to create an own command handler. That would be a bit overpowered for just getting the info, which command got executed.
How do I get the existing events e_operBeforeExecute,and e_operExecuted?

Best regards,
cew

Re: How toi detect which operation will be/was executed?

Posted: Fri Jun 23, 2017 7:58 am
by Sasha - Tracker Dev Team
Hello cew,

On the other hand, you can use the https://sdkhelp.pdf-xchange.com/vie ... beforeSave event's IPXV_DocSaveEvent interface to check the https://sdkhelp.pdf-xchange.com/vie ... vent_Flags for PXV_DocSave_Copy flag. That should do it.

Cheers,
Alex

Re: How toi detect which operation will be/was executed?

Posted: Fri Jun 23, 2017 8:03 am
by cew
Hi Alex,

could you please provide me a line of c# code on how to get that flag out of an AxPDFXEdit._IPXV_ControlEvents_OnEventEvent object?

Thank you!

Best regards,
cew

Re: How toi detect which operation will be/was executed?

Posted: Fri Jun 23, 2017 8:09 am
by Sasha - Tracker Dev Team
Hello cew,

I've provided links that have detailed explanation on the interfaces casting and the properties that should be used.
The cast will look somewhat like this (though your interfaces should be used):

Code: Select all

PDFXEdit.IPXV_BeforeShowContextMenuEvent evt = (PDFXEdit.IPXV_BeforeShowContextMenuEvent)e.pEvent;

Cheers,
Alex

Re: How toi detect which operation will be/was executed?

Posted: Fri Jun 23, 2017 11:03 am
by cew
Got it to work, thank you! :D

Best regards,
cew

Re: How toi detect which operation will be/was executed?

Posted: Fri Jun 23, 2017 11:17 am
by Sasha - Tracker Dev Team
:)