예제 #1
0
        private void CurrentExplorer_SelectionChanged()
        {
            System.Diagnostics.Debug.Write("CurrentExplorer_SelectionChanged event fired\n");
            try
            {
                if (this.Application.ActiveExplorer().Selection.Count > 0)
                {
                    Object selObject = this.Application.ActiveExplorer().Selection[1];
                    if (selObject is Outlook.MailItem)
                    {
                        Outlook.MailItem mailItem = selObject as Outlook.MailItem;
                        this.globalTaggingContext.SetMostRecentNavigatedToMailItem(mailItem);

                        HookEventHandlersToMailItem(mailItem);
                        this.explorerTagBarDecorator.SetLocalTaggingContext(new OutlookTagBarContext(this.globalTaggingContext));
                        inspectors = this.Application.Inspectors;
                        foreach (Outlook.Inspector inspector in inspectors)
                        {
                            InspectorWrapper iWrapper = InspectorWrapper.inspectorWrappersValue[inspector];
                            TagBar           otb      = iWrapper.getTagBar();
                            if (otb.TagBarHelper.GetContextID().Equals(mailItem.EntryID))
                            {
                                otb.TagBarHelper.RefreshTagButtons();
                            }
                        }
                        String senderName = mailItem.Sender.Name;
                        Backend.AddPerson(Utils.NormalizeName(senderName));
                        Backend.ShowPersons();
                        String entryID        = mailItem.EntryID;
                        String conversationID = mailItem.ConversationID;
                        Backend.AddEmail(entryID, conversationID);
                        System.Diagnostics.Debug.Write("CurrentExplorer_SelectionChanged FIRED \n");
                    }
                }
            }
            catch (Exception e)
            {
                String expMessage = e.Message;
                System.Windows.Forms.MessageBox.Show(expMessage + "\n" + e.StackTrace);
            }
        }