예제 #1
0
        public ReferencesViewModel(IEnumerable<AssemblyReference> loadedReferences, IEnumerable<string> recentReferenceLocations)
        {
            Log.Info(() => string.Format("Loaded references: {0}", string.Join(", ", loadedReferences)));

            var standardReferences = new StandardReferencesLocator().GetStandardReferences().ToArray();
            var recentReferences = (recentReferenceLocations ?? Enumerable.Empty<string>()).Where(File.Exists).Select(x => new AssemblyReference(x) { IsRecent = true }).ToArray();
            var allReferences = loadedReferences.Union(standardReferences).Union(recentReferences).ToArray();

            StandardReferences = new SearchableReferencesViewModel(standardReferences);
            StandardReferences.References.ItemPropertyChanged += StandardReferences_ListChanged;

            RecentReferences = new SearchableReferencesViewModel(recentReferences);
            RecentReferences.References.ItemPropertyChanged += RecentReferences_ListChanged;

            InstalledReferences = new SearchableReferencesViewModel(allReferences.Where(r => r.IsInstalled));
        }
예제 #2
0
        public ReferencesViewModel(IEnumerable <AssemblyReference> loadedReferences, IEnumerable <string> recentReferenceLocations)
        {
            Log.Info(() => string.Format("Loaded references: {0}", string.Join(", ", loadedReferences)));

            var standardReferences = new StandardReferencesLocator().GetStandardReferences().ToArray();
            var recentReferences   = (recentReferenceLocations ?? Enumerable.Empty <string>()).Where(File.Exists).Select(x => new AssemblyReference(x)
            {
                IsRecent = true
            }).ToArray();
            var allReferences = loadedReferences.Union(standardReferences).Union(recentReferences).ToArray();


            StandardReferences = new SearchableReferencesViewModel(standardReferences);
            StandardReferences.References.ItemPropertyChanged += StandardReferences_ListChanged;

            RecentReferences = new SearchableReferencesViewModel(recentReferences);
            RecentReferences.References.ItemPropertyChanged += RecentReferences_ListChanged;

            InstalledReferences = new SearchableReferencesViewModel(allReferences.Where(r => r.IsInstalled));
        }