Пример #1
0
        public LookupContext(string fullSource, string preSource,
                             string line, int lineStartPos, int currentPos, bool insideClass)
        {
            _fullSource   = fullSource;
            _preSource    = preSource;
            _line         = line;
            _lineStartPos = lineStartPos;
            _currentPos   = currentPos;
            _beforeClass  = insideClass;

            /*
             * Cleanup the source code.
             */

            _preSource = CSharpFormattingTools.RemoveUnwantedText(_preSource);
            _preSource = CSharpFormattingTools.RemoveUnwantedBracketText(_preSource);
            _line      = CSharpFormattingTools.RemoveUnwantedText(_line);
            _line      = CSharpFormattingTools.RemoveUnwantedBracketText(_line);

            /*
             * Get rid of 'global::' - we don't do anything with them
             * so we might as well not have them.
             */

            _line = _line.Replace("global::", String.Empty);

            /*
             * We remove the content of any balanced brackets to
             * allow indexed variables to identified and classified.
             */

            _line = CSharpFormattingTools.RemoveUnwantedParentheses(Line);

            /*
             * Create the target.
             */

            _target = new LookupTarget(_line);

            /*
             * Find the visible methods and properties.
             */

            _localMethods    = new LocalMethods(_fullSource);
            _localProperties = new LocalProperties(_fullSource);
        }