How toi detect which operation will be/was executed?

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

How toi detect which operation will be/was executed?

Post 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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

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

Post 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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

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

Post 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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

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

Post 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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

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

Post 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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

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

Post 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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

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

Post by cew »

Got it to work, thank you! :D

Best regards,
cew
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

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

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply