Exemplo n.º 1
0
        public async Task RunAsync()
        {
            var savedHighlights = _tree.HighlightedNodes;

            var settings = CreateSettings();
            var solver   = Tabs[_selectedTabIndex].CreateSolver(settings);

            var controllerResult = await _dialogCoordinator
                                   .ShowControllerDialogAsync(this, solver, Tabs[_selectedTabIndex].DisplayName, _tree);

            if (controllerResult != null)
            {
                _tree.SkilledNodes.Clear();
                _tree.AllocateSkillNodes(controllerResult.Select(n => SkillTree.Skillnodes[n]));
            }
            _tree.HighlightedNodes.Clear();
            _tree.HighlightedNodes.UnionWith(savedHighlights);
            _tree.DrawHighlights();

            RunFinished?.Invoke(this, EventArgs.Empty);
        }