public void Run()
        {
            IAnalysisResult analysisResult;

            if (!ProjectAnalysisUtils.TryChooseAnalysisResult(out analysisResult))
            {
                return;
            }
            Debug.Assert(analysisResult != null);

            var codeBase = analysisResult.CodeBase;
            var types    = codeBase.Application.Types;

            var matchEditor     = new MatchEditor();
            var resultDisplayer = new ResultDisplayer();
            var resultSelector  = new ResultSelector(resultDisplayer);

            matchEditor.Display();

            while (true)
            {
                ConsoleKeyInfo consoleKeyInfo;
                bool           matchersChanged;
                matchEditor.ReadKey(out consoleKeyInfo, out matchersChanged);

                if (!matchersChanged)
                {
                    switch (consoleKeyInfo.Key)
                    {
                    case ConsoleKey.Escape:
                        return;

                    case ConsoleKey.UpArrow:
                        resultSelector.UpArrow();
                        continue;

                    case ConsoleKey.DownArrow:
                        resultSelector.DownArrow();
                        continue;

                    case ConsoleKey.Enter:
                        resultSelector.Enter();
                        continue;
                    }
                    continue;
                }

                var matchersLowerCase = matchEditor.GetMatchersLowerCase();
                var typesMatched      = SearchTypes(types, matchersLowerCase);
                resultDisplayer.Display(typesMatched, matchersLowerCase);
            }
        }
Ejemplo n.º 2
0
 internal ResultSelector(ResultDisplayer resultDisplayer)
 {
     Debug.Assert(resultDisplayer != null);
     m_ResultDisplayer = resultDisplayer;
     m_ResultDisplayer.OnTypesDisplayedChanged += this.OnTypesDisplayedChanged;
 }