示例#1
0
        public void ManagePackages()
        {
            // Get the project and project folder
            DotNetProject        project    = CurrentNode.GetParentDataItem(typeof(DotNetProject), true) as DotNetProject;
            IPackageRepository   repository = CreateRepository();
            ManagePackagesDialog dialog     = new ManagePackagesDialog().SetProject(project).SetPackageRepository(repository);

            try {
                if (MessageService.RunCustomDialog(dialog) == (int)Gtk.ResponseType.Ok)
                {
                    project.AddPackage(dialog.SelectedPackage, repository);
                    IdeApp.ProjectOperations.Save(project);
                }
            } catch (Exception exception) {
                MessageService.ShowException(exception);
            } finally {
                dialog.Destroy();
            }
        }