private IEnumerable <string> GetReferences(IEnumerable <string> loadedReferences)
        {
            var references = loadedReferences.ToArray();

            var assemblyReferences = references.Select(s =>
                                                       new AssemblyReference(s)
            {
                IsOptional  = true,
                IsInstalled = true,
            });

            var dialogDataContext = new ReferencesViewModel(assemblyReferences, ViewModel.Preferences.RecentReferences);
            var dlg = new ReferencesDialogWindow
            {
                Owner       = this,
                DataContext = dialogDataContext
            };

            var referencesUpdated = dlg.ShowDialog();

            if (referencesUpdated == true)
            {
                var selectedReferences = dialogDataContext.InstalledReferences.References;
                references = selectedReferences.Select(reference => reference.Location).ToArray();

                var recentReferences =
                    dialogDataContext.RecentReferences.References
                    .Distinct()
                    .Take(50)
                    .Select(r => r.Location);

                ViewModel.SetRecentReferences(recentReferences);
            }

            return(references);
        }
Exemple #2
0
        private IEnumerable<string> GetReferences(IEnumerable<string> loadedReferences)
        {
            var references = loadedReferences.ToArray();

            var assemblyReferences = references.Select(s =>
                new AssemblyReference(s)
                {
                    IsOptional = true,
                    IsInstalled = true,
                });

            var dialogDataContext = new ReferencesViewModel(assemblyReferences, ViewModel.Preferences.RecentReferences);
            var dlg = new ReferencesDialogWindow
            {
                Owner = this,
                DataContext = dialogDataContext
            };

            var referencesUpdated = dlg.ShowDialog();

            if (referencesUpdated == true)
            {
                var selectedReferences = dialogDataContext.InstalledReferences.References;
                references = selectedReferences.Select(reference => reference.Location).ToArray();

                var recentReferences =
                    dialogDataContext.RecentReferences.References
                        .Distinct()
                        .Take(50)
                        .Select(r => r.Location);

                ViewModel.SetRecentReferences(recentReferences);
            }

            return references;
        }