Пример #1
0
        public IReadOnlyCollection <Declaration> LoadDeclarationsFromXml(ReferenceInfo reference)
        {
            var file         = FilePath(reference);
            var reader       = new XmlPersistableDeclarations();
            var deserialized = reader.Load(file);

            return(deserialized.Unwrap());
        }
Пример #2
0
        public List <Declaration> LoadDeclarationsFromXml()
        {
            var path         = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Rubberduck", "Declarations");
            var file         = Path.Combine(path, string.Format("{0}.{1}.{2}", _referenceName, _referenceMajor, _referenceMinor) + ".xml");
            var reader       = new XmlPersistableDeclarations();
            var deserialized = reader.Load(file);

            var declarations = deserialized.Unwrap();

            foreach (var members in declarations.Where(d => d.DeclarationType != DeclarationType.Project &&
                                                       d.ParentDeclaration.DeclarationType == DeclarationType.ClassModule &&
                                                       ProceduralTypes.Contains(d.DeclarationType))
                     .GroupBy(d => d.ParentDeclaration))
            {
                _state.CoClasses.TryAdd(members.Select(m => m.IdentifierName).ToList(), members.First().ParentDeclaration);
            }
            return(declarations);
        }