private void UISetup() { try { Version cv = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; string ver = cv.ToString(); taskpaneView = swApp.CreateTaskpaneView2(Properties.Settings.Default.NetPath + Properties.Settings.Default.Icon, string.Format(Properties.Resources.Title, ver)); taskpaneHost = (SWTaskPaneHost)taskpaneView.AddControl(SWTaskPaneHost.SWTASKPANE_PROGID, string.Empty); taskpaneHost.OnRequestSW += new Func <SldWorks>(delegate { return(this.swApp); }); bool result = taskpaneView.AddStandardButton((int)swTaskPaneBitmapsOptions_e.swTaskPaneBitmapsOptions_Ok, "OK"); result = taskpaneView.AddStandardButton((int)swTaskPaneBitmapsOptions_e.swTaskPaneBitmapsOptions_Options, "Configuration"); //result = taskpaneView.AddStandardButton((int)swTaskPaneBitmapsOptions_e.swTaskPaneBitmapsOptions_Close, "Close"); result = taskpaneView.AddCustomButton(Properties.Settings.Default.NetPath + Properties.Settings.Default.RefreshIcon, "Refresh"); result = taskpaneView.AddCustomButton(Properties.Settings.Default.NetPath + Properties.Settings.Default.ArchiveIcon, "Archive PDF"); result = taskpaneView.AddCustomButton(Properties.Settings.Default.NetPath + Properties.Settings.Default.HelpIcon, "Usage Help"); taskpaneView.TaskPaneToolbarButtonClicked += taskpaneView_TaskPaneToolbarButtonClicked; taskpaneHost.cookie = cookie; taskpaneHost.Start(); } catch (Exception e) { RedbrickErr.ErrMsg em = new RedbrickErr.ErrMsg(e); em.ShowDialog(); } }
private void UITearDown() { taskpaneHost = null; taskpaneView.DeleteView(); Marshal.ReleaseComObject(taskpaneView); taskpaneView = null; }
private void UISetup() { try { Version cv = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; string ver = cv.ToString(); taskpaneView = swApp.CreateTaskpaneView2(Properties.Settings.Default.NetPath + Properties.Settings.Default.Icon, string.Format(Properties.Resources.Title, ver)); taskpaneHost = (SWTaskPaneHost)taskpaneView.AddControl(SWTaskPaneHost.SWTASKPANE_PROGID, string.Empty); taskpaneHost.OnRequestSW += new Func<SldWorks>(delegate { return this.swApp; }); bool result = taskpaneView.AddStandardButton((int)swTaskPaneBitmapsOptions_e.swTaskPaneBitmapsOptions_Ok, "OK"); result = taskpaneView.AddStandardButton((int)swTaskPaneBitmapsOptions_e.swTaskPaneBitmapsOptions_Options, "Configuration"); //result = taskpaneView.AddStandardButton((int)swTaskPaneBitmapsOptions_e.swTaskPaneBitmapsOptions_Close, "Close"); result = taskpaneView.AddCustomButton(Properties.Settings.Default.NetPath + Properties.Settings.Default.RefreshIcon, "Refresh"); result = taskpaneView.AddCustomButton(Properties.Settings.Default.NetPath + Properties.Settings.Default.ArchiveIcon, "Archive PDF"); result = taskpaneView.AddCustomButton(Properties.Settings.Default.NetPath + Properties.Settings.Default.HelpIcon, "Usage Help"); taskpaneView.TaskPaneToolbarButtonClicked += taskpaneView_TaskPaneToolbarButtonClicked; taskpaneHost.cookie = cookie; taskpaneHost.Start(); } catch (Exception e) { RedbrickErr.ErrMsg em = new RedbrickErr.ErrMsg(e); em.ShowDialog(); } }