It's all about the answers!

Ask a question

Undo event - ILocalChangeEvent ?

Gidi Gal (962054) | asked Sep 08 '16, 2:46 p.m.
Hello to the forum members,

I want to recognize undo operations in order to reload the related files in another application. I see that ILocalChangeEvent is being thrown when undo is performed and the file is marked as ILocalChangeEvent.CANCELED. However, this happens also when I save file (and it becomes unresolved) - this event is being thrown for other unresolved files in my sandbox and they are marked as ILocalChangeEvent.CANCELED.

How can I recognize only the files related to the undo operation ?


David Lafreniere commented Sep 09 '16, 3:53 p.m.

To clarify, are you asking about an 'Undo' on a pending local change (i.e. a change in the "Unresolved" folder in the Pending Changes view) or an 'Undo' on a change in an active change set in the Pending Changes view? Either way, I don't think there's a specific undo event, but it would be good to clarify which undo you are talking about since they are different.

Gidi Gal commented Sep 11 '16, 4:45 a.m.

Hello David,

Thanks for your reply. I need to catch both events. My general target is to recognize events that change local files on the disk. As far as I understand the following events change local files (if you know of additional ones, I'll be grateful if you share them here):
- User accepts changes of incoming change sets. I use IChangeHistoryEvent.ACCEPT_CHANGESETS  and IChangeHistoryEvent.ACCEPT_COMBINED to recognize this event.
- User discards outgoing changet sets. I use IChangeHistoryEvent.DISCARD_CHANGE_SETS to recognize this event.

Now that I think of it, there's another event - load - which changes local files on the disk. If there's event related to it, I'll be grateful for a pointer.

Regarding the undo operation, I understand that in the case of undo for an active change set, there is a possibility that it will not change the local file on the disk (in case there is an unresolved copy of the file), I will need to recognize these two scenarios.


Be the first one to answer this question!

Register or to post your answer.