Rubberduck.Parsing.Symbols.DeclarationFinder.MatchName C# (CSharp) Method

MatchName() public method

public MatchName ( string name ) : IEnumerable
name string
return IEnumerable
        public IEnumerable<Declaration> MatchName(string name)
        {
            Declaration[] result;
            if (_declarationsByName.TryGetValue(name, out result))
            {
                return result;
            }
            if (_declarationsByName.TryGetValue("_" + name, out result))
            {
                return result;
            }
            if (_declarationsByName.TryGetValue("I" + name, out result))
            {
                return result;
            }
            if (_declarationsByName.TryGetValue("_I" + name, out result))
            {
                return result;
            }
            return new List<Declaration>();
        }

Usage Example

コード例 #1
0
        public void SetCurrentScope(string memberName, DeclarationType type)
        {
            Logger.Trace("Setting current scope: {0} ({1}) in thread {2}", memberName, type,
                         Thread.CurrentThread.ManagedThreadId);

            _currentParent = _declarationFinder.MatchName(memberName).SingleOrDefault(item =>
                                                                                      item.QualifiedName.QualifiedModuleName == _qualifiedModuleName && item.DeclarationType == type);

            _currentScope = _declarationFinder.MatchName(memberName).SingleOrDefault(item =>
                                                                                     item.QualifiedName.QualifiedModuleName == _qualifiedModuleName && item.DeclarationType == type) ??
                            _moduleDeclaration;

            Logger.Trace("Current scope is now {0} in thread {1}",
                         _currentScope == null ? "null" : _currentScope.IdentifierName, Thread.CurrentThread.ManagedThreadId);
        }
All Usage Examples Of Rubberduck.Parsing.Symbols.DeclarationFinder::MatchName