/// <summary> /// Cleans up after closing a solution /// </summary> private void OnSolutionClosed() { // --- When the current solution has been closed, // --- stop the virtual machine and clean up Messenger.Default.Send(new SolutionClosedMessage()); MachineViewModel?.StopVmCommand.Execute(null); CodeDiscoverySolution.Clear(); CurrentWorkspace = null; MachineViewModel?.Dispose(); MachineViewModel = null; }
/// <summary> /// Initializes the members used by a solution /// </summary> private void OnSolutionOpened() { // --- Every time a new solution has been opened, initialize the // --- Spectrum virtual machine with all of its accessories var vm = MachineViewModel = new MachineViewModel(); vm.RomProvider = new PackageRomProvider(); vm.ClockProvider = new ClockProvider(); vm.KeyboardProvider = new KeyboardProvider(vm); vm.AllowKeyboardScan = true; vm.ScreenFrameProvider = new DelegatingScreenFrameProvider(); vm.EarBitFrameProvider = new WaveEarbitFrameProvider(new BeeperConfiguration()); vm.LoadContentProvider = new ProjectFileTapeContentProvider(); vm.SaveToTapeProvider = new TempFileSaveToTapeProvider(); vm.StackDebugSupport = new SimpleStackDebugSupport(); vm.DisplayMode = SpectrumDisplayMode.Fit; CodeDiscoverySolution.CollectProjects(ApplicationObject.DTE.Solution); CurrentWorkspace = WorkspaceInfo.CreateFromSolution(CodeDiscoverySolution); Messenger.Default.Send(new SolutionOpenedMessage()); }