private void FeaturesPane_VisibleChanged(object sender, EventArgs e) { mailTangyContainer = null; taskPaneContainer.VisibleChanged -= new EventHandler(FeaturesPane_VisibleChanged); ShowCasesWindow(); }
private void ShowCasesWindow() { if (Globals.ThisAddIn.myCredentials == null) { return; } foreach (Microsoft.Office.Tools.CustomTaskPane item in Globals.ThisAddIn.CustomTaskPanes) { if (item.Title == "MailTangy UserSpecific") { item.Visible = false; } if (item.Title == "MailTangy Cases") { item.Visible = true; } if (item.Title == "MailTangy Features") { Globals.ThisAddIn.CustomTaskPanes.Remove(item); break; } } System.Threading.Thread.Sleep(500); if (MailTangyContainer == null) { if (AreFeatureSubmitted().Contains("false")) { FeatureContainer = new MailTangyContainer(PaneType.FeaturesPane); taskPaneContainer = Globals.ThisAddIn.CustomTaskPanes.Add(FeatureContainer, "MailTangy Features"); taskPaneContainer.Visible = true; taskPaneContainer.VisibleChanged += new EventHandler(FeaturesPane_VisibleChanged); taskPaneContainer.Width = 340; } else { mailTangyContainer = new MailTangyContainer(PaneType.CasesPane); taskPaneContainer = Globals.ThisAddIn.CustomTaskPanes.Add(mailTangyContainer, "MailTangy Cases"); //taskPaneValue.DockPosition = MsoCTPDockPosition.msoCTPDockPositionFloating; //taskPaneValue.Height = 420; taskPaneContainer.Visible = true; taskPaneContainer.VisibleChanged += new EventHandler(taskPaneValue_VisibleChanged); taskPaneContainer.Width = 340; } } }
public void CurrentExplorer_SelectionChangeEvent() { try { if (myCredentials == null) { return; } if (this.Application.ActiveExplorer().Selection.Count > 0) { Object selObject = Globals.ThisAddIn.Application.ActiveExplorer().Selection[1]; if (selObject is Microsoft.Office.Interop.Outlook.MailItem) { this.Application.ActiveExplorer().SelectionChange -= new Outlook.ExplorerEvents_10_SelectionChangeEventHandler(CurrentExplorer_SelectionChangeEvent); SelectedMailItem = selObject as Microsoft.Office.Interop.Outlook.MailItem; //LoggedinUserID = "*****@*****.**"; SenderEmailID = SelectedMailItem.SenderEmailAddress; if (mailTangyContainer == null) { mailTangyContainer = new MailTangyContainer(PaneType.UserSpecificPane); taskPaneContainer = Globals.ThisAddIn.CustomTaskPanes.Add(mailTangyContainer, "MailTangy UserSpecific"); //taskPaneValue.DockPosition = MsoCTPDockPosition.msoCTPDockPositionFloating; //taskPaneValue.Height = 420; taskPaneContainer.Width = 340; var fPane = Globals.ThisAddIn.CustomTaskPanes.Where(pane => pane.Title == "MailTangy Features"); if (fPane == null) { taskPaneContainer.Visible = true; } } SenderEmailID = SelectedMailItem.SenderEmailAddress; Globals.ThisAddIn.Application.ActiveExplorer().AddToSelection(selObject); } } } catch (System.Exception ex) { throw ex; } //this.Application.ActiveExplorer().SelectionChange += new Outlook.ExplorerEvents_10_SelectionChangeEventHandler(CurrentExplorer_SelectionChangeEvent); }