public MainForm(Konfiguration cfg, Logger log, Language lang, MailParser mp, Outlook.Application objOutlook, Worker w) { InitializeComponent(); this.worker = w; this.outlook = objOutlook; this.mailparser = mp; this.config = cfg; this.loadFromConfig(); this.logger = log; this.language = lang; this.loadFromLanguage(); this.bt_sendLogToDeveloper.Visible = false; this.bt_thankYou.Visible = false; }
public MainForm(Konfiguration cfg, Logger log, Language lang, MailParser mp, Outlook.Application objOutlook, Worker w) { InitializeComponent(); this.worker = w; this.outlook = objOutlook; this.mailparser = mp; this.config = cfg; this.loadFromConfig(); this.logger = log; this.language = lang; this.loadFromLanguage(); this.bt_sendLogToDeveloper.Visible = false; this.bt_thankYou.Visible = false; }
public void Initialise(object applicationInstance) { if (m_bInitialised) return; try { Logger.LogInfo("[WORKSHARE PROTECT ASYNCH-MODE] - Outlook application initialised."); var instance = applicationInstance as WsApplication; m_application = instance ?? new WsApplication(applicationInstance); m_OutlookVersion = OutlookVersion.Convert(m_application.Version); if (IsOutlook2003OrLater()) { m_applicationEvents = m_application; m_applicationEvents.MAPILogonComplete += OnMapiLogonComplete; m_applicationEvents.Quit += OnApplicationQuit; } m_bInitialised = true; if (!ExportRuntimePoliciesIfTheProtectOptionsHaveBeenModified()) { // Call PreCache for synchronous in process processing InitialisePreCache(); } } catch (Exception e) { MethodBase method = MethodBase.GetCurrentMethod(); string err = method.DeclaringType.Name + "." + method.Name + "(): " + e.Message; Logger.LogError(err); } }
private void OnApplicationQuit() { m_applicationEvents.MAPILogonComplete -= OnMapiLogonComplete; m_applicationEvents.Quit -= OnApplicationQuit; if (m_distributionListCacher != null) { if (!m_distributionListCacher.HasExited) { m_distributionListCacher.Kill(); } } if (m_outboxMonitor != null) { m_outboxMonitor.Dispose(); } if (_lcfm != null) { _lcfm.Dispose(); _lcfm = null; } ((IDisposable)m_application).Dispose(); m_application = null; GarbageCollect(); }