void wlmailApiInit_OnShutdown() { wlmailApiCore = null; wlmailApiInit.OnInit -= new NktWLMailApiInit.IWLMailApiInitEvents_OnInitEventHandler(wlmailApiInit_OnInit); wlmailApiInit.OnShutdown -= new NktWLMailApiInit.IWLMailApiInitEvents_OnShutdownEventHandler(wlmailApiInit_OnShutdown); GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); GC.WaitForPendingFinalizers(); }
void wlmailApiInit_OnInit() { wlmailApiCore = new NktWLMailApi.WLMailApi(); folderManager = new NktWLMailStore.FolderManager(); accountManager = new NktWLMailStore.MailAccountManager(); utils = new Utils(wlmailApiCore, folderManager, accountManager); this.clamClient = new ClamClient(CLAM_HOST, CLAM_PORT); this.wlmailApiCore.OnDatabaseChange += new NktWLMailApi.IWLMailApiEvents_OnDatabaseChangeEventHandler(wlmailApiCore_OnDatabaseChange); }