I'm attempting to implement these events, but they don't seem to be triggered when I close either a company, or the Sage application itself.
My code notifies me that the event handlers are being added, but the handlers never get called.
private static void addEventHandlers(PeachtreeSession session) { Console.WriteLine("Adding Event Handlers"); session.CompanyLogoutPending += new LogoutEventHandler(LogoutRequestedEvent); session.CompanyClosing += new ClosingEventHandler(CompanyClosingEvent); session.CompanyClosed += new ClosedEventHandler(CompanyClosedEvent); } static void LogoutRequestedEvent(object sender, LogoutEventArgs e) { Console.WriteLine("Logout requested." + e.Company.CompanyIdentifier.CompanyName); } static void CompanyClosingEvent(object sender, CompanyClosingEventArgs e) { Console.WriteLine("Company Closing: " + e.Company.CompanyIdentifier.CompanyName); } static void CompanyClosedEvent(object sender, CompanyClosedEventArgs e) { Console.WriteLine("Company Closed: " + e.Company.CompanyIdentifier.CompanyName); }
.