コード例 #1
0
        public InspectorWrapper(OutlookTagBarAddin addin, Outlook.Inspector Inspector, Outlook.MailItem mailItem)
        {
            this.mailItem  = mailItem;
            this.inspector = Inspector;
            ((Outlook.InspectorEvents_Event)inspector).Close +=
                new Outlook.InspectorEvents_CloseEventHandler(InspectorWrapper_Close);

            logger.Info("ADDING taskPane (inspectorTagBar)\n");



            inspectorTagBar          = new TagBar();
            inspectorTagBarDecorator = new OutlookTagBarDecorator(addin, inspectorTagBar, new OutlookTagBarContext(addin.GetGlobalTaggingContext()));
            inspectorTagBar.SetTagBarHelper(this.inspectorTagBarDecorator);
            inspectorTagBar.LoadTagList(Utils.GetLatestTagList());
            taskPane = Globals.OutlookTagBarAddin.CustomTaskPanes.Add(inspectorTagBar, "Inspector Tag Bar", this.inspector);
            taskPane.DockPosition    = Office.MsoCTPDockPosition.msoCTPDockPositionTop;
            taskPane.Height          = 57;
            taskPane.Visible         = true;
            taskPane.VisibleChanged += new EventHandler(TaskPane_VisibleChanged);
        }
コード例 #2
0
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            /**
             * This section from https://msdn.microsoft.com/en-us/library/bb296010.aspx is for the
             * case where the add in is loaded after outlook is already up, which I don't believe is
             * a use case we need to support, but leave this in case.
             */
            inspectors = this.Application.Inspectors;
            inspectors.NewInspector +=
                new Outlook.InspectorsEvents_NewInspectorEventHandler(
                    Inspectors_NewInspector);

            currentExplorer = this.Application.ActiveExplorer();

            foreach (Outlook.Inspector inspector in inspectors)
            {
                Inspectors_NewInspector(inspector);
            }


            /*
             * create the explorer tagBar
             */
            this.explorerTagBar          = new TagBar();
            this.explorerTagBarDecorator = new OutlookTagBarDecorator(this, explorerTagBar, new OutlookTagBarContext(this.globalTaggingContext));
            explorerTagBar.SetTagBarHelper(this.explorerTagBarDecorator);
            explorerCustomTaskPane = this.CustomTaskPanes.Add(explorerTagBar, "Explorer Tag Bar");
            explorerCustomTaskPane.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionTop;
            explorerCustomTaskPane.Height       = 57;
            explorerTagBar.LoadTagList(Utils.GetLatestTagList());
            explorerCustomTaskPane.Visible = true;

            // explorer event
            currentExplorer = this.Application.ActiveExplorer();
            currentExplorer.SelectionChange += new Outlook.ExplorerEvents_10_SelectionChangeEventHandler(CurrentExplorer_SelectionChanged);

            // inspector event
            logger.Debug("WOOHOO Started Addin...");
        }