예제 #1
0
        public void Run()
        {
            var codeBase = ProjectAnalysisUtils.ChooseAnalysisResult().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);
            }
        }
예제 #2
0
 internal ResultSelector(ResultDisplayer resultDisplayer)
 {
     Debug.Assert(resultDisplayer != null);
     m_ResultDisplayer = resultDisplayer;
     m_ResultDisplayer.OnTypesDisplayedChanged += this.OnTypesDisplayedChanged;
 }