I tried the TrackEventStateChanged EventHandler.
It seems to occur only when selecting event but don’t occur when Moving event.
Is it the normal way how it work or I'm doing something wrong ?
I noticed a strange behaviour.
Sometimes EventHandler occurs, sometimes it don’t occurs at all (I could not really determine why but it seems related to the media type : generated media or AV media ).
Another strange thing when it occurs
-if “ignore event grouping” is enable, it occurs all the time.
-if “ignore event grouping” is disable, it occurs only when selecting event.
Does someone else noticed the same behaviour ?
Edit : ok , I think I tracked the "bug" : EventHandler work fine when loading Custom command for the first time, but it don’t occurs at all when I close the custom command and load it again.
Please, can you confirm ?
You can download a VS C# Express sample project HERE. Add at least one event on timeline to test it.
When I load the Custom Command for the first time, the listview is updated every time I move the event (“ignore event grouping” must be enable).
If I close the Custom Command and load it again, it don’t work.
I think this problem will be primarily solved by the new TrackEventTimeChanged event which will be in 8.0a. If you are trying to track event start times, use the new event.
The other issue you are having is that you are not removing your handler from Vegas' TrackEventStateChanged event when your DockableControl is closed.
This impacts performance and prevents the event from propagating to new event handlers. The orphaned handlers are probably throwing exceptions before the valid ones have a chance to be called. Use the DockableControl::Closed event or override the OnClosed method of the DockableControl like this:
You will probably need to reorganize your code a bit to add and remove event handlers when the DockableControl is created and closed... you can probably do these things in your command module class.
At this point all work fine, event occurs when DockableControl is closed.
BUT, I get a compilation error when I try to remove the “TrackEventStateChanged” handler from Vegas:
You'll also need to declare essaiForm as an instance variable of the
SampleModule class. For the sake of symmetry, you should probably
move the code that adds the TrackEventStateChanged handler to the
HandleInvoked method. Here's what I ended up with: