Exemplo n.º 1
0
        public static void DeleteSelectedListBoxItem(IList lstSelectedItems)
        {
            foreach (ListBoxItem item in lstSelectedItems)
            {
                IMyCollectionsData data = item.DataContext as IMyCollectionsData;

                if (data != null)
                {
                    switch (data.ObjectType)
                    {
                    case EntityType.Apps:
                        AppServices.Delete(data.Id);
                        break;

                    case EntityType.Artist:
                        ArtistServices.Delete(data.Id);
                        break;

                    case EntityType.Books:
                        BookServices.Delete(data.Id);
                        break;

                    case EntityType.Games:
                        GameServices.Delete(data.Id);
                        break;

                    case EntityType.Movie:
                        MovieServices.Delete(data.Id);
                        break;

                    case EntityType.Music:
                        MusicServices.Delete(data.Id);
                        break;

                    case EntityType.Nds:
                        NdsServices.Delete(data.Id);
                        break;

                    case EntityType.Series:
                        SerieServices.Delete(data.Id);
                        break;

                    case EntityType.XXX:
                        XxxServices.Delete(data.Id);
                        break;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public static void DeleteSelected(IList lstSelectedItems)
        {
            foreach (ThumbItem item in lstSelectedItems)
            {
                switch (item.EType)
                {
                case EntityType.Apps:
                    AppServices.Delete(item.Id);
                    break;

                case EntityType.Artist:
                    ArtistServices.Delete(item.Id);
                    break;

                case EntityType.Books:
                    BookServices.Delete(item.Id);
                    break;

                case EntityType.Games:
                    GameServices.Delete(item.Id);
                    break;

                case EntityType.Movie:
                    MovieServices.Delete(item.Id);
                    break;

                case EntityType.Music:
                    MusicServices.Delete(item.Id);
                    break;

                case EntityType.Nds:
                    NdsServices.Delete(item.Id);
                    break;

                case EntityType.Series:
                    SerieServices.Delete(item.Id);
                    break;

                case EntityType.XXX:
                    XxxServices.Delete(item.Id);
                    break;
                }
            }
        }