void removeUI() { int[] showInDocumentTypes = new int[2] { (int)swDocumentTypes_e.swDocPART, (int)swDocumentTypes_e.swDocASSEMBLY }; string callback = "PublishCmd_Callback"; foreach (var type in showInDocumentTypes) { SwApp.RemoveMenu(type, PublishMenuTitle, callback); } if (bitmapHandler != null) { bitmapHandler.CleanFiles(); } }