private void LoadSelectedPackages() { if (isLoading) { /*var md = new MessageDialog(ParentWindow, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, "Currently loading packages, please wait."); * md.ButtonReleaseEvent += (o, args) => { * md.HideAll(); * }; * md.Show();*/ return; } isLoading = true; // Get all the packages that are selected var rows = TreeView.Selection.GetSelectedRows(); if (rows.Length != 0) { // Get all the names of the un-loaded packages. var packageNames = new HashSet <string>(); foreach (var row in rows) { TreeIter iter; Model.GetIter(out iter, row); var packageRef = (PackageReference)Model.GetValue(iter, PACKAGE_REF_COLUMN); if (!PackageManager.IsLoaded(packageRef.Name)) { packageNames.Add(packageRef.Name); } } // Start loading PackageManager.AsyncLoadPackages(packageNames, (n, p) => { Gtk.Application.Invoke((s, args) => { if (string.IsNullOrEmpty(n)) { if (StatusReceiver != null) { StatusReceiver.OnStatusReceived("", 0); } isLoading = false; } else { if (StatusReceiver != null) { StatusReceiver.OnStatusReceived("Loading " + n, p); } } UpdateRightPane(); }); }); } }