private ChooseTypeController CreateChooseTypeController() { Assembly assemblyToLoadFrom = GetType().Assembly; Action<Type> onTypeChosen = type => { this.chosenType = type; }; var target = new ChooseTypeController(assemblyToLoadFrom, onTypeChosen); if (this.mockMessenger != null) { var accessor = TypeVisualiserControllerBase_Accessor.AttachShadow(target); accessor.doNotUseMessenger = this.mockMessenger; } return target; }
private void OnChooseTypeExecute() { Assembly assembly = this.fileManager.LoadAssembly(); if (assembly == null) { // Cancel clicked by user return; } ChooseTypeController = new ChooseTypeController(assembly, OnChooseTypeChosenFromDialog); var chooseTypeDialog = new ChooseType { DataContext = ChooseTypeController, ResizeMode = ResizeMode.NoResize }; bool? result = chooseTypeDialog.ShowDialog(); Logger.Instance.WriteEntry("Loading types from DLL for selection. ShowDiaglog returned {0}", result); }