コード例 #1
0
 /// <summary>
 /// 卸载右键菜单
 /// </summary>
 public static void RemoveContextMenu()
 {
     try
     {
         if (m_ContextMenu != null)
         {
             Application.RemoveObjectContextMenuExtension(RXObject.GetClass(typeof(Entity)), m_ContextMenu);
             m_ContextMenu.Dispose();
         }
     }
     catch
     {
         PublicMethod.Instance.ShowMessage("卸载右键菜单失败!");
     }
 }
コード例 #2
0
 /// <summary>
 /// 卸载右键菜单
 /// </summary>
 private void RemoveContextMenu()
 {
     try
     {
         if (m_ContextMenu != null)
         {
             Autodesk.AutoCAD.ApplicationServices.Application.RemoveObjectContextMenuExtension(RXObject.GetClass(typeof (Entity)),m_ContextMenu);
             m_ContextMenu.Dispose();
             m_ContextMenu = null;
         }
     }
     catch(CADException ex)
     {
         PublicMethod.Instance.ShowMessage(ex.Message);
     }
 }