Hi - I want to listen to the project closing event, but am wondering where to put the code. Now I have the code in the initialize event of my addin module, but it only runs if the user clicks to open the addin. Is there some global space where the code will always run, even if the user doesnt click my module? The code is below, and works fine when the module is clicked:
//module code
protected override bool Initialize()
{
//Closing event
ArcGIS.Desktop.Core.Events.ProjectClosingEvent.Subscribe((args) =>
{
MessageBox.Show("ProjectClosingEvent");
return Task.FromResult(0);
});
return true;
}
Thanks
Pete
Solved! Go to Solution.
Pete,
In your config.daml file for the VS project, find the module entry and set autoLoad to true.
<modules>
<insertModule id="EventModule_Module" className="Module1" autoLoad="true" caption="Module1">
Pete,
In your config.daml file for the VS project, find the module entry and set autoLoad to true.
<modules>
<insertModule id="EventModule_Module" className="Module1" autoLoad="true" caption="Module1">
Thanks Sean that did the trick!