public void SetupConnection(OL.Application application, ActivationPG activatePG) { if (m_Cookie != 0) { return; } m_ActivePG = activatePG; // GUID of the DIID_ApplicationEvents dispinterface. Guid guid = new Guid("{0006300E-0000-0000-C000-000000000046}"); // QI for IConnectionPointContainer. IConnectionPointContainer oConnectionPointContainer = (IConnectionPointContainer)application; try { // Find the connection point and then advise. m_ActivePG.MailGo.Track.Debug("Advise START"); oConnectionPointContainer.FindConnectionPoint(ref guid, out m_oConnectionPoint); m_ActivePG.MailGo.Track.Debug("Advise CONTINUE"); m_oConnectionPoint.Advise(this, out m_Cookie); m_ActivePG.MailGo.Track.Debug("Advise FINISH"); } catch (Exception ex) { m_ActivePG.MailGo.Track.Debug("ERROR"); m_ActivePG.MailGo.Track.Error(ex); } }
public static Model.IActivationPG CreatePG(Model.IMailGoPG v_mailgo, OL.Application v_outlook, OT.Ribbon.RibbonButton cmdBtn, OT.Ribbon.RibbonButton optBtn) { if (Ready) { g_ActivationPG = new ActivationPG(v_mailgo, v_outlook, cmdBtn, optBtn); return(g_ActivationPG); } else { return(null); } }