Example #1
0
 public void AddGlobalDeclarations(IWritableSymbolTable table, int level)
 {
     IProject project = this.GetProject();
     if (project != null)
     {
         table.DependencySet.AddNamespaceQualifierDependency("", project);
         IDeclaredElement[] elementsFromCache = this.GetManager().GetDeclarationsCache(DeclarationsCacheScope.ProjectScope(project, true),true).GetElementsAtQualifiedName(string.Empty);
         foreach (IDeclaredElement declaredElement in elementsFromCache)
         {
             table.AddSymbol(declaredElement, declaredElement.IdSubstitution, this, level);
         }
     }
 }
Example #2
0
        public void AddDeclarationsBeforeElement(IWritableSymbolTable table, IElement element, int level)
        {
            IReference[] references = this.GetReferences();

            if (references == null || references.Length == 0)
                return;

            foreach (IReference reference in references)
            {
                IElement elementFromReference = reference.GetElement();
                IDeclaredElement declaredElement = elementFromReference as IDeclaredElement;

                if (declaredElement == null)
                    continue;

                table.AddSymbol(declaredElement, EmptySubstitution.INSTANCE, this, LevelDelta);
            }
        }