public void OnCellActionButtonClick(object sender, EventArgs e)
        {
            PackageManagerButton button = (PackageManagerButton)sender;

            if (button.Type == PMButtonType.CancelPackageTasks)
            {
                packageManager.CancelPackageTasks(button.PackageId);
            }
            else if (button.Type == PMButtonType.SetPackagePriority)
            {
                packageManager.SetPackagePriority(button.PackageId, button.PriorityIndex);
            }
            else if (button.Type == PMButtonType.StartPackageDownload)
            {
                packageManager.StartPackageDownload(button.PackageId);
            }
            else if (button.Type == PMButtonType.StartRemovePackage)
            {
                packageManager.StartPackageRemove(button.PackageId);
            }
            else if (button.Type == PMButtonType.UpdatePackages)
            {
                var controller = new PackageManagerController(currentFolder + button.PackageName + "/");
                NavigationController.PushViewController(controller, true);
            }
        }
        public void OnAdapterActionButtonClick(object sender, EventArgs e)
        {
            PMButton button = (PMButton)sender;

            System.Console.WriteLine("Clicked: " + button.PackageId + " - " + button.PackageName + " - " + button.Type);

            if (button.Type == PMButtonType.CancelPackageTasks)
            {
                packageManager.CancelPackageTasks(button.PackageId);
            }
            else if (button.Type == PMButtonType.SetPackagePriority)
            {
                packageManager.SetPackagePriority(button.PackageId, button.PriorityIndex);
                UpdatePackages();
            }
            else if (button.Type == PMButtonType.StartPackageDownload)
            {
                packageManager.StartPackageDownload(button.PackageId);
            }
            else if (button.Type == PMButtonType.StartRemovePackage)
            {
                packageManager.StartPackageRemove(button.PackageId);
            }
            else if (button.Type == PMButtonType.UpdatePackages)
            {
                currentFolder = currentFolder + button.PackageName + "/";
                UpdatePackages();
            }
        }
        public static void StartBboxDownload(CartoPackageManager packageManager)
        {
            // Bounding box download can be done now
            // For the country package download see OnPackageListUpdated in PackageListener

            //string bbox = "bbox(-0.8164,51.2382,0.6406,51.7401)"; // London (approx. 30MB)
            string bbox = "bbox(-73.581182, 41.013, -73.5811, 41.013503)";

            if (packageManager.GetLocalPackage(bbox) == null)
            {
                packageManager.StartPackageDownload(bbox);
            }
        }
        void DownloadAndZoomToBbox(BoundingBox bbox)
        {
            currentCity = bbox;

            string packaged = bbox.ToString();

            // Package version has no use here, can be anything
            if (manager.GetLocalPackageStatus(packaged, 1) == null)
            {
                manager.StartPackageDownload(packaged);
                Alert("Downloading " + bbox.Name);
            }
            else
            {
                UpdateStatusLabel("Download complete");
                Alert(bbox.Name + " already downloaded. Zooming");
                ContentView.ZoomTo(bbox.Center);
            }
        }