Exemplo n.º 1
0
 private void multiOperationButton_Click(object sender, EventArgs e)
 {
     if (packageView.OperationText == Resources.UpdateOperationName)
     {
         var packages = packageView.Nodes.Cast <TreeNode>()
                        .Select(node => node.Tag as IPackageSearchMetadata)
                        .Where(package => package != null)
                        .ToList();
         packageViewController.RunPackageOperation(packages, true);
     }
 }
Exemplo n.º 2
0
        private void packageView_OperationClick(object sender, TreeViewEventArgs e)
        {
            var package = (IPackageSearchMetadata)e.Node.Tag;

            if (package != null)
            {
                if (!package.Tags.Contains(Constants.GalleryDirectory))
                {
                    MessageBox.Show(this,
                                    string.Format(Resources.InvalidGalleryPackage, package.Identity),
                                    string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                saveFolderDialog.FileName = package.Identity.Id;
                if (saveFolderDialog.ShowDialog(this) == DialogResult.OK)
                {
                    targetPackage = package.Identity;
                    targetPath    = saveFolderDialog.FileName;
                    packageViewController.RunPackageOperation(new[] { package }, true);
                    if (DialogResult == DialogResult.OK)
                    {
                        Close();
                    }
                }
            }
        }