예제 #1
0
        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;
        }
예제 #2
0
        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;
        }
예제 #3
0
		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);
			}
		}
예제 #4
0
		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();
		}