void FetchGacContents()
        {
            HashSet <string> fullNames = new HashSet <string>();

            UpdateProgressBar(pg => { pg.IsVisible = true; pg.IsIndeterminate = true; });
            var list = GacInterop.GetGacAssemblyFullNames().TakeWhile(_ => !cancelFetchThread).ToList();

            UpdateProgressBar(pg => { pg.IsIndeterminate = false; pg.Maximum = list.Count; });
            foreach (var r in list)
            {
                if (cancelFetchThread)
                {
                    break;
                }
                if (fullNames.Add(r.FullName))                   // filter duplicates
                {
                    var file = GacInterop.FindAssemblyInNetGac(r);
                    if (file != null)
                    {
                        var entry = new GacEntry(r, file);
                        UpdateProgressBar(pg => { pg.Value = pg.Value + 1; AddNewEntry(entry); });
                    }
                }
            }
            UpdateProgressBar(pg => { pg.IsVisible = false; });
        }
Esempio n. 2
0
        void FetchGacContents()
        {
            HashSet <string> fullNames = new HashSet <string>();

            UpdateProgressBar(pg => { pg.Visibility = Visibility.Visible; pg.IsIndeterminate = true; });
            var list = UniversalAssemblyResolver.EnumerateGac().TakeWhile(_ => !cancelFetchThread).ToList();

            UpdateProgressBar(pg => { pg.IsIndeterminate = false; pg.Maximum = list.Count; });
            foreach (var r in list)
            {
                if (cancelFetchThread)
                {
                    break;
                }
                if (fullNames.Add(r.FullName))
                {                 // filter duplicates
                    var file = UniversalAssemblyResolver.GetAssemblyInGac(r);
                    if (file != null)
                    {
                        var entry = new GacEntry(r, file);
                        UpdateProgressBar(pg => { pg.Value++; AddNewEntry(entry); });
                    }
                }
            }
            UpdateProgressBar(pg => { pg.Visibility = Visibility.Hidden; });
        }
        void FetchGacContents()
        {
            IGlobalAssemblyCacheService gacService = SD.GetService <IGlobalAssemblyCacheService>();
            HashSet <string>            fullNames  = new HashSet <string>();

            UpdateProgressBar(pg => { pg.Visibility = System.Windows.Visibility.Visible; pg.IsIndeterminate = true; });
            var list = gacService.Assemblies.TakeWhile(_ => !cancelFetchThread).ToList();

            UpdateProgressBar(pg => { pg.IsIndeterminate = false; pg.Maximum = list.Count; });
            foreach (var r in list)
            {
                if (cancelFetchThread)
                {
                    break;
                }
                if (fullNames.Add(r.FullName))                   // filter duplicates
                {
                    var file = gacService.FindAssemblyInNetGac(r);
                    if (file != null)
                    {
                        var entry = new GacEntry(r, file);
                        UpdateProgressBar(pg => { pg.Value = pg.Value + 1; AddNewEntry(entry); });
                    }
                }
            }
            UpdateProgressBar(pg => { pg.Visibility = System.Windows.Visibility.Hidden; });
        }
 void AddNewEntry(GacEntry entry)
 {
     gacEntries.Add(entry);
     if (filterMethod(entry))
     {
         filteredEntries.Add(entry);
     }
 }
Esempio n. 5
0
        void AddNewEntry(GacEntry entry)
        {
            gacEntries.Add(entry);
            string filter = filterTextBox.Text;

            if (string.IsNullOrEmpty(filter) || entry.ShortName.IndexOf(filter, StringComparison.OrdinalIgnoreCase) >= 0)
            {
                filteredEntries.Add(entry);
            }
        }
Esempio n. 6
0
        void FetchGacContents()
        {
            HashSet <string> fullNames = new HashSet <string>();

            foreach (var r in GacInterop.GetGacAssemblyFullNames())
            {
                if (cancelFetchThread)
                {
                    return;
                }
                if (fullNames.Add(r.FullName))                   // filter duplicates
                {
                    var file = GacInterop.FindAssemblyInNetGac(r);
                    if (file != null)
                    {
                        var entry = new GacEntry(r, file);
                        Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action <GacEntry>(AddNewEntry), entry);
                    }
                }
            }
        }
Esempio n. 7
0
 void FetchGacContents()
 {
     HashSet<string> fullNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
     UpdateProgressBar(pg => { pg.Visibility = System.Windows.Visibility.Visible; pg.IsIndeterminate = true; });
     var list = GacInterop.GetGacAssemblyFullNames().TakeWhile(_ => !cancelFetchThread).ToList();
     UpdateProgressBar(pg => { pg.IsIndeterminate = false; pg.Maximum = list.Count; });
     foreach (var r in list) {
         if (cancelFetchThread)
             break;
         if (fullNames.Add(r.FullName)) { // filter duplicates
             var file = GacInterop.FindAssemblyInNetGac(r);
             if (file != null) {
                 var entry = new GacEntry(r, file);
                 UpdateProgressBar(pg => { pg.Value = pg.Value + 1; AddNewEntry(entry); });
             }
         }
     }
     UpdateProgressBar(pg => { pg.Visibility = System.Windows.Visibility.Hidden; });
 }
Esempio n. 8
0
 void AddNewEntry(GacEntry entry)
 {
     gacEntries.Add(entry);
     if (filterMethod(entry))
         filteredEntries.Add(entry);
 }
 void FetchGacContents()
 {
     IGlobalAssemblyCacheService gacService = SD.GetService<IGlobalAssemblyCacheService>();
     HashSet<string> fullNames = new HashSet<string>();
     UpdateProgressBar(pg => { pg.Visibility = System.Windows.Visibility.Visible; pg.IsIndeterminate = true; });
     var list = gacService.Assemblies.TakeWhile(_ => !cancelFetchThread).ToList();
     UpdateProgressBar(pg => { pg.IsIndeterminate = false; pg.Maximum = list.Count; });
     foreach (var r in list) {
         if (cancelFetchThread)
             break;
         if (fullNames.Add(r.FullName)) { // filter duplicates
             var file = gacService.FindAssemblyInNetGac(r);
             if (file != null) {
                 var entry = new GacEntry(r, file);
                 UpdateProgressBar(pg => { pg.Value = pg.Value + 1; AddNewEntry(entry); });
             }
         }
     }
     UpdateProgressBar(pg => { pg.Visibility = System.Windows.Visibility.Hidden; });
 }