Event reception method "ApplicationCloseEvent"

According to the SDK manual, it seems that you only need to receive the event “ApplicationCloseEvent” at the end of the application, please tell me how to receive this event.

It is a great help if there is a sample source code to be helpful.

Thanks

Are you developing a plugin? Smart Client plugin? Which type of plugin?

Please tell me more about the context in which you have this question.

I am developing a Smart Client plugin. (Not Protocol and Component)

I’d like to receive an ApplicationCloseEvent with the Smart Client plugin and exit Client.exe. In this case, please tell me how to receive the ApplicationCloseEvent in the plugin

You must be looking for

-–

virtual EventHandler VideoOS.Platform.ClientControl.ApplicationCloseEvent

-

Subscribe to this event to be notified when the application is about to be shut down.

Generally it is a better idea to do cleanup in the Close() methods as these will be called whenever the application is no longer logged on to the VMS and thus configuration might no longer be valid, but if you have some cleanup that should only be done when the application is actually shutting down, this is the place to do it.

Only do basic cleanup here. Don’t attempt to access any UI or utilize MIP functionality in general here, as a lot of that will already be gone at this point.

The event is only supported in Smart Client and Management Client.

-–

Use it like this:

ClientControl.Instance.ApplicationCloseEvent += Instance_ApplicationCloseEvent;

Note: This requires 2017R2 and newer.

http://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_client_control.html&tree=tree_search.html?search=applicationcloseevent