示例#1
0
        private void InitiailizeCadComponent()
        {
            dd = new Services();
            SystemObjects.DynamicLinker.LoadApp("GripPoints", false, false);
            SystemObjects.DynamicLinker.LoadApp("PlotSettingsValidator", false, false);
            HostApplicationServices.Current = new HostAppServ(dd);
            Environment.SetEnvironmentVariable("DDPLOTSTYLEPATHS", ((HostAppServ)HostApplicationServices.Current).FindConfigPath(String.Format("PrinterStyleSheetDir")));

            gripManager = new ExGripManager();
            mouseMode   = Mode.Quiescent;
        }
示例#2
0
 private void DisposeCadComponent()
 {
     try
     {
         ClearSelection();
         CadSelectionManager.Instance.Dispose();
         if (selRect != null)
         {
             helperDevice.ActiveView.Erase(selRect);
         }
         selRect = null;
         if (gripManager != null)
         {
             gripManager.uninit();
             gripManager = null;
         }
         if (graphics != null)
         {
             graphics.Dispose();
         }
         if (helperDevice != null)
         {
             if (!helperDevice.IsDisposed)
             {
                 helperDevice.Dispose();
                 helperDevice = null;
             }
         }
         if (database != null)
         {
             if (!database.IsDisposed)
             {
                 database.Dispose();
                 database = null;
             }
         }
         if (dd != null)
         {
             dd.Dispose();
             dd = null;
         }
     }
     catch (System.Exception ex)
     {
         Debug.WriteLine(ex.Message);
     }
 }