UI/RibbonCustomizations.cs
branchsync
changeset 2687 f7f12cd4dd77
parent 2682 e16dba4f04d7
child 2695 273816414b64
equal deleted inserted replaced
2686:f2e370d69120 2687:f7f12cd4dd77
   876         {
   876         {
   877             return Properties.Resources.StoreContextMenu_OpenPGPKeyImportWizard;
   877             return Properties.Resources.StoreContextMenu_OpenPGPKeyImportWizard;
   878         }
   878         }
   879 
   879 
   880         ///////////////////////////////////////////////////////////
   880         ///////////////////////////////////////////////////////////
       
   881         // ContextMenuResetContactTrust
       
   882         ///////////////////////////////////////////////////////////
       
   883 
       
   884         /// <summary>
       
   885         /// Callback to get the store context menu key import button text.
       
   886         /// </summary>
       
   887         public string ContextMenuResetContactTrust_GetLabel(Office.IRibbonControl control)
       
   888         {
       
   889             return Properties.Resources.PrivacyStatus_ResetTrust;
       
   890         }
       
   891 
       
   892         /// <summary>
       
   893         /// Callback to get the store context menu key import button image.
       
   894         /// </summary>
       
   895         public System.Drawing.Bitmap ContextMenuResetContactTrust_GetImage(Office.IRibbonControl control)
       
   896         {
       
   897             return Properties.Resources.ImageLogoIcon;
       
   898         }
       
   899 
       
   900         ///////////////////////////////////////////////////////////
   881         // ButtonPrivacyStatus
   901         // ButtonPrivacyStatus
   882         ///////////////////////////////////////////////////////////
   902         ///////////////////////////////////////////////////////////
   883 
   903 
   884         /// <summary>
   904         /// <summary>
   885         /// Event handler for when the Privacy Status button is clicked.
   905         /// Event handler for when the Privacy Status button is clicked.
  1497 
  1517 
  1498             /* In Outlook 2010, there is no inline response.
  1518             /* In Outlook 2010, there is no inline response.
  1499              * IMPORTANT: Never call Explorer.ActiveInlineResponse on Outlook 2010
  1519              * IMPORTANT: Never call Explorer.ActiveInlineResponse on Outlook 2010
  1500              *            as this might lead to a crash of Outlook (even inside a
  1520              *            as this might lead to a crash of Outlook (even inside a
  1501              *            try/catch block)
  1521              *            try/catch block)
  1502              */ 
  1522              */
  1503             if (Globals.OutlookVersion != Globals.Version.Outlook2010)
  1523             if (Globals.OutlookVersion != Globals.Version.Outlook2010)
  1504             {
  1524             {
  1505                 Outlook.Explorer explorer = null;
  1525                 Outlook.Explorer explorer = null;
  1506                 try
  1526                 try
  1507                 {
  1527                 {
  1617                 Log.Error("ContextMenuKeyImport_Click: Error opening wizard. " + ex.ToString());
  1637                 Log.Error("ContextMenuKeyImport_Click: Error opening wizard. " + ex.ToString());
  1618             }
  1638             }
  1619             finally
  1639             finally
  1620             {
  1640             {
  1621                 store = null;
  1641                 store = null;
       
  1642             }
       
  1643         }
       
  1644 
       
  1645         /// <summary>
       
  1646         /// Event handler for when the reset contact context menu button is clicked.
       
  1647         /// </summary>
       
  1648         public void ContextMenuResetContactTrustButton_Click(Office.IRibbonControl control)
       
  1649         {
       
  1650             Outlook.Selection selection;
       
  1651             Outlook.ContactItem contact;
       
  1652 
       
  1653             try
       
  1654             {
       
  1655                 // Get the selected contact(s) and reset their trust
       
  1656                 selection = control.Context as Outlook.Selection;
       
  1657 
       
  1658                 for (int i = 1; i <= selection.Count; i++)
       
  1659                 {
       
  1660                     contact = selection[i];
       
  1661                     string id = contact.EntryID;
       
  1662                     ThisAddIn.PEPEngine.KeyResetUser(id, null);
       
  1663                     contact = null;
       
  1664                 }
       
  1665             }
       
  1666             catch (Exception ex)
       
  1667             {
       
  1668                 Log.Error("ContextMenuResetContactTrustButton_Click: Error occured. " + ex.ToString());
       
  1669             }
       
  1670             finally
       
  1671             {
       
  1672                 contact = null;
       
  1673                 selection = null;
  1622             }
  1674             }
  1623         }
  1675         }
  1624 
  1676 
  1625         /**************************************************************
  1677         /**************************************************************
  1626          *
  1678          *