Example #1
0
        public void OnViewAction(Office.IRibbonControl control)
        {
            //Event handler for view contacts clicked
            try {
                IssueSelector     ie        = null;
                Outlook.Inspector inspector = (Outlook.Inspector)control.Context;
                if (Globals.ThisAddIn.InspectorWrappers.ContainsKey(inspector))
                {
                    InspectorWrapper     iw  = Globals.ThisAddIn.InspectorWrappers[inspector];
                    Tools.CustomTaskPane ctp = iw.CustomTaskPane;
                    if (ctp != null)
                    {
                        ie = (IssueSelector)ctp.Control;
                    }
                }
                switch (control.Id)
                {
                case "btnRef": if (ie != null)
                    {
                        ie.Refresh();
                    }
                    break;

                case "btnRefC": if (ie != null)
                    {
                        ie.RefreshCache();
                    }
                    break;
                }
            }
            catch (Exception ex) { App.ReportError(new ApplicationException("Unexpected error while handling View actions in the Issue Mgt ribbon extension.", ex), true, LogLevel.Error); }
            finally { this.mRibbonUI.Invalidate(); }
        }
Example #2
0
 public void OnNavClicked(Office.IRibbonControl control, bool pressed)
 {
     //Event handler for nav toggle button action event
     try {
         Outlook.Inspector inspector = (Outlook.Inspector)control.Context;
         if (Globals.ThisAddIn.InspectorWrappers.ContainsKey(inspector))
         {
             InspectorWrapper     iw  = Globals.ThisAddIn.InspectorWrappers[inspector];
             Tools.CustomTaskPane ctp = iw.CustomTaskPane;
             if (ctp != null)
             {
                 ctp.Visible = pressed;
                 if (ctp.Visible)
                 {
                     IssueSelector s = (IssueSelector)ctp.Control;
                     s.Refresh();
                 }
             }
         }
     }
     catch (Exception ex) { App.ReportError(new ApplicationException("Unexpected error while handling button click in the Issue Mgt ribbon extension.", ex), true, LogLevel.Error); }
     finally { this.mRibbonUI.Invalidate(); }
 }