예제 #1
0
 private void updateCurrentAcronym(object sender, WordTranslatedEventArgs e)
 {
     if (e.acronym == null || string.IsNullOrEmpty(e.acronym.Text) || e.acronym.Translations == null || e.acronym.Translations.Count < 1)
     {
         this.CurrentAcronym = null;
     }
     else
     {
         this.CurrentAcronym = e.acronym;
     }
 }
 /// <summary>
 /// This method recieves an object of type WordTranslatedEventArgs and updates the properties menu
 /// according to the accronym and it's translations whice are the members of the WordTranslatedEventArgs class
 /// </summary>
 /// <param name="sender">The object that fired the event which is linked to this method</param>
 /// <param name="e">An object which contains the Accronym and it's translations</param>
 private void updateTextPropertiesMenu(object sender, WordTranslatedEventArgs e)
 {
     CommandBar commandBar = null;
     getCommandBarInstanceByName(Globals.ThisAddIn.Application.CommandBars, "Text", out commandBar);
     CleanCommandBar(ref commandBar);
     if (Globals.Ribbons.AccronymHighlightsRibbon.chkBxTranslateOnRightClick.Checked == true)
     {
         updateCommandBarByAccronym(e.acronym, ref commandBar);
         Globals.Ribbons.AccronymHighlightsRibbon.setAcronymAndTranslations(e.acronym);
     }
 }