/// <summary> /// Method called when a model command ends or is cancelled /// </summary> private void endModelCommand() { if (modelCmd != null) { modelCmd.Cancel = true; } mainFrm.ReportProgress("", 0, "", 0, DateTime.Now.AddMilliseconds(1)); if (!mainFrm.SmallPanel.IsDisposed && !mainFrm.SmallPanel.Disposing) { mainFrm.SmallPanel.Stop(); } mainFrm.HideCommandToolbox(); Model.Model.Instance.Undo.Commit(); modelCmd = null; if (services != null) { services.Dispose(); services = null; } TrackingController.TrackingService = null; TrackingController.ResetStatus(Canguro.View.GraphicViewManager.Instance.ActiveView); TrackingController.SnapController.IsActive = false; TrackingController.SnapController.PrimaryPoint = Snap.PointMagnet.ZeroMagnet; // Reset selection SelectionCommand.Start(null); viewCmd = SelectionCommand; mainFrm.ScenePanel.Cursor = viewCmd.Cursor; if (EndModelCommand != null) { EndModelCommand(this, EventArgs.Empty); } }