/// <summary> /// Called when the editor is disposed /// </summary> public void Dispose() { if (ExecutionEngine != null && ExecutionEngine.IsRunning()) { try { ExecutionEngine.Stop(); } catch (Exception ex) { GuiLogMessage(string.Format(Resources.WorkspaceManagerClass_Dispose_Exception_during_stopping_of_the_ExecutionEngine___0_, ex), NotificationLevel.Error); } } EventsHelper.AsynchronousPropertyChanged = true; try { if (WorkspaceModel != null) { WorkspaceModel.Dispose(); } } catch (Exception ex) { GuiLogMessage(string.Format(Resources.WorkspaceManagerClass_Dispose_Exception_during_disposing_of_the_Model___0_, ex), NotificationLevel.Error); } }
public void Dispose() { PopupModel?.Dispose(); WorkspaceModel?.Dispose(); AuthenticationModel?.Dispose(); _modelDisposable.Dispose(); }
private void GoToInitialPage() { PageIndex = (int)Page.Initial; AuthenticationModel?.Dispose(); AuthenticationModel = null; WorkspaceModel?.Dispose(); WorkspaceModel = null; }
private void GoToAuthenticationPage() { PageIndex = (int)Page.Authentication; if (AuthenticationModel == null) { WorkspaceModel?.Dispose(); WorkspaceModel = null; AuthenticationModel = _authenticationModelFactory.Create(); } }
/// <summary> /// Remove a workspace from the dynamo model. /// </summary> /// <param name="workspace">Workspace to remove</param> public void RemoveWorkspace(WorkspaceModel workspace) { OnWorkspaceRemoveStarted(workspace); if (_workspaces.Remove(workspace)) { if (workspace is HomeWorkspaceModel) { workspace.Dispose(); } OnWorkspaceRemoved(workspace); } }