Message 1 of 6

Not applicable
10-25-2021
10:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How does one get the application in the event to call the VersionName?
Reference the bottom of the code:
var appver = ctrlApp.VersionName;
using something
namespace something
{
public class ExtDbAppEventLogger : IExternalDBApplication
{
public static ControlledApplication _cachedCtrlApp;
//IExternalApplication Members
public ExternalDBApplicationResult OnStartup(ControlledApplication ctrlApp)
{
try
{
_cachedCtrlApp = ctrlApp;
_cachedCtrlApp.DocumentClosed += new EventHandler<DocumentClosedEventArgs>(CachedCtrlApp_DocumentClosed);
return ExternalDBApplicationResult.Succeeded;
}
catch (Exception ex)
{
return ExternalDBApplicationResult.Failed;
}
}
void CachedCtrlApp_DocumentClosed(object sender, DocumentClosedEventArgs e)
{
using (StreamWriter sw = new StreamWriter(@"\\Server\files\log.txt", true))
{
var appver = ctrlApp.VersionName;
sw.WriteLine(appver);
}
}
}
}
Thanks
Solved! Go to Solution.