Exemplo n.º 1
0
        void DeleteSelected()
        {
            foreach (var group in _view.GetSelected().GroupBy(x => x.ListType))
            {
                switch (group.Key)
                {
                case DragListTypes.AssetItem:
                {
                    foreach (var entry in group)
                    {
                        _model.RemoveAssetItem((string)entry.Model);
                    }
                    break;
                }

                case DragListTypes.PluginItem:
                {
                    foreach (var entry in group)
                    {
                        _model.RemovePluginItem((string)entry.Model);
                    }
                    break;
                }

                case DragListTypes.Package:
                {
                    _asyncProcessor.Process(
                        _packageHandler.DeletePackages(group.Select(x => (PackageInfo)x.Model).ToList()), true, "Deleting Packages");
                    break;
                }
                }
            }
        }
Exemplo n.º 2
0
        void OnContextMenuDeleteSelected()
        {
            var selected = GetSelectedItems();

            _asyncProcessor.Process(_packageHandler.DeletePackages(selected), "Deleting Packages");
        }