private void ExpressTagButtonsFromBackend(OutlookTagBarContext localTaggingContext) { if (localTaggingContext.isRead()) { string entryID = localTaggingContext.GetEmailBeingRead().EntryID; string json = TagCommon.Backend.TagsForEmail(entryID); TagNames tagNames = TagCommon.Utils.GetTagNamesForJson(json); List <TagName> tags = tagNames.Tags; foreach (TagName tag in tags) { AddNewButton(tag.Name, localTaggingContext); } } else if (localTaggingContext.isReply()) { string entryID = localTaggingContext.GetEmailBeingRepliedTo().EntryID; string json = TagCommon.Backend.TagsForEmail(entryID); TagNames tagNames = TagCommon.Utils.GetTagNamesForJson(json); List <TagName> tags = tagNames.Tags; foreach (TagName tag in tags) { AddNewButton(tag.Name, localTaggingContext); } } else if (localTaggingContext.isExplorerInit()) { // skip it - the CurrentExplorer_SelectionChanged event will trigger the refresh in a bit } else if (localTaggingContext.isCompose()) { throw new TagServicesException("refreshTagButtons not implemented for Compose state"); } }
public void SetLocalTaggingContext(OutlookTagBarContext context) { this.localTaggingContext = context; if (context.isRead()) { SetContextID(context.GetEmailBeingRead().EntryID); RefreshTagButtons(); Status("read..."); } else if (context.isReply()) { SetContextID(context.GetEmailBeingRepliedTo().EntryID); RefreshTagButtons(); Status("reply..."); } else if (context.isExplorerInit()) { Status("expl init..."); } else if (context.isCompose()) { throw new TagServicesException("isCompose case Not Yet Implemented for OutlookTag Bar"); } }