Message 1 of 5
ApplicationEvents won't trigger

Not applicable
08-27-2014
06:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm having a general problem with the ApplicationEvents. They wont fire as they should...but sometimes they do!!
It's sort of like a 50/50 chance that they are working
Currenty I'm hooking up the OnQuit, OnOpenDocument and the OnSaveDocument events using the following code:
_application.ApplicationEvents.OnQuit += ApplicationEvents_OnQuit; void ApplicationEvents_OnQuit(EventTimingEnum BeforeOrAfter, NameValueMap Context, out HandlingCodeEnum HandlingCode) { switch (BeforeOrAfter) { case EventTimingEnum.kBefore: SaveSettingsToXml(_addinSettingsFilename); HandlingCode = HandlingCodeEnum.kEventNotHandled; break; default: HandlingCode = HandlingCodeEnum.kEventNotHandled; break; } }
This model is applicable to all the events i mentioned, and is pretty straight forward. Tried running in Debug/Release which rules out any VisualStudio debugging problems, and right now I'm sort of out of ideas?! Anyone else having similar problems?
Previous versions of this addin seems to be working ok using VB.Net - could there some sort of problem related to c#?