internal override void OnProjectReferenceRemoved(ProjectReference pref)
        {
            ProjectCodeCompletionDatabase db = (ProjectCodeCompletionDatabase)database;

            db.UpdateFromProject();
            this.UpdateReferences();
        }
Пример #2
0
        internal override void OnProjectReferenceRemoved(ProjectReference pref)
        {
            var netProject = Project as DotNetProject;

            if (netProject == null)
            {
                return;
            }

            var db = (ProjectCodeCompletionDatabase)database;

            if (pref.ReferenceType != ReferenceType.Project)
            {
                foreach (var fileName in pref.GetReferencedFileNames(ConfigurationSelector.Default))
                {
                    var uri = ProjectCodeCompletionDatabase.GetReferenceUri(netProject, fileName);
                    if (db.HasReference(uri))
                    {
                        db.RemoveReference(uri);
                    }
                }
            }
            else
            {
                var uri = "Project:" + pref.Reference;
                if (db.HasReference(uri))
                {
                    db.RemoveReference(uri);
                }
            }

            this.UpdateReferences();
        }
        public override TypeUpdateInformation UpdateFromParseInfo(ICompilationUnit unit)
        {
            ProjectCodeCompletionDatabase db = database as ProjectCodeCompletionDatabase;

            if (db != null)
            {
                return(db.UpdateFromParseInfo(unit, unit.FileName));
            }

            SimpleCodeCompletionDatabase sdb = database as SimpleCodeCompletionDatabase;

            if (sdb != null)
            {
                return(sdb.UpdateFromParseInfo(unit));
            }

            return(null);
        }
Пример #4
0
        public override TypeUpdateInformation UpdateFromParseInfo(ICompilationUnit unit)
        {
            if (string.IsNullOrEmpty(unit.FileName))
            {
                throw new ArgumentException("Compilation unit has no file name set.", "unit");
            }
            ProjectCodeCompletionDatabase db = database as ProjectCodeCompletionDatabase;

            if (db != null)
            {
                return(db.UpdateFromParseInfo(unit, unit.FileName));
            }

            SimpleCodeCompletionDatabase sdb = database as SimpleCodeCompletionDatabase;

            if (sdb != null)
            {
                return(sdb.UpdateFromParseInfo(unit));
            }

            return(null);
        }