public static void RemoveTaskPane(MOT.CustomTaskPane taskPane, MOT.CustomTaskPaneCollection customTaskPanes) { //PLLog.Trace3("Enter", System.Data.Common.LOG_CATEGORY); customTaskPanes.Remove(taskPane); //PLLog.Trace3("Exit", System.Data.Common.LOG_CATEGORY); }
//public static MOT.CustomTaskPane GetTaskPane(System.Windows.Forms.UserControl taskPane, string name, MOT.CustomTaskPaneCollection customTaskPanes, string Hwnd) //{ // MOT.CustomTaskPane ctp = default(MOT.CustomTaskPane); // //PLLog.Trace3("Enter", Common.LOG_CATEGORY); // string key = string.Format("{0}({1})", name, Hwnd); // if (_CreatedPanes.ContainsKey(key)) // { // ctp = _CreatedPanes[key]; // } // else // { // ctp = customTaskPanes.Add(taskPane, name); // ctp.DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionRight; // //ctp.Visible = true; // } // //PLLog.Trace3("Exit", System.Data.Common.LOG_CATEGORY); // return ctp; //} public static MOT.CustomTaskPane AddTaskPane(System.Windows.Forms.UserControl taskPane, string name, MOT.CustomTaskPaneCollection customTaskPanes) { MOT.CustomTaskPane ctp = default(MOT.CustomTaskPane); //PLLog.Trace3("Enter", Common.LOG_CATEGORY); ctp = customTaskPanes.Add(taskPane, name); ctp.DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionRight; ctp.Visible = true; //PLLog.Trace3("Exit", System.Data.Common.LOG_CATEGORY); return(ctp); }
public static MOT.CustomTaskPane GetTaskPane(Func <UserControl> taskPaneCreatorFunc, string taskPaneName, MOT.CustomTaskPaneCollection customTaskPanes, string Hwnd) { MOT.CustomTaskPane ctp = default(MOT.CustomTaskPane); //PLLog.Trace3("Enter", Common.LOG_CATEGORY); string key = string.Format("{0}({1})", taskPaneName, Hwnd); if (_CreatedPanes.ContainsKey(key)) { // Return the existing TaskPane ctp = _CreatedPanes[key]; } else { // Create a new TaskPane and add to the dictionary ctp = customTaskPanes.Add(taskPaneCreatorFunc(), taskPaneName); _CreatedPanes[key] = ctp; ctp.DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionRight; //ctp.Visible = true; } //PLLog.Trace3("Exit", System.Data.Common.LOG_CATEGORY); return(ctp); }