示例#1
0
        private async void DeleteContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
        {
            if (Source_.SelectionMode == ListViewSelectionMode.Multiple)
            {
                List <Items> Temp_list = new List <Items>();
                foreach (var item_M in Source_.SelectedItems)
                {
                    Temp_list.Add(item_M as Items);
                }

                foreach (var item_D in Temp_list)
                {
                    Cache_Processed_File.Remove(item_D);
                    Cache.Remove(item_D.StorageFile_);
                    //Cache_Processed_File.Remove(item_);
                    //Cache_Processed_Doc.Remove(item_);
                    foreach (var item in Cache_Processed)
                    {
                        if (item_D.Name == item.Name && item.Path == item_D.Path)
                        {
                            Cache_Processed.Remove(item);
                            break;
                        }
                    }
                    await item_D.StorageFile_.DeleteAsync();
                }
            }
            else
            {
                Cache_Processed_File.Remove(item_);
                Cache.Remove(item_.StorageFile_);
                //Cache_Processed_File.Remove(item_);
                //Cache_Processed_Doc.Remove(item_);
                foreach (var item in Cache_Processed)
                {
                    if (item_.Name == item.Name && item.Path == item_.Path)
                    {
                        Cache_Processed.Remove(item);
                        break;
                    }
                }
                await item_.StorageFile_.DeleteAsync();
            }
        }
示例#2
0
        private async void DeleteContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
        {
            Cache.Remove(Item_.StorageFile_);
            //Cache_Processed_File.Remove(item_);
            //Cache_Processed_Doc.Remove(item_);

            foreach (var item in Cache_Processed)
            {
                if (Item_.Name == item.Name && item.Path == Item_.Path)
                {
                    Cache_Processed_File.Remove(item);
                    break;
                }
            }
            foreach (var item in Cache_Processed_File)
            {
                if (Item_.Name == item.Name && item.Path == Item_.Path)
                {
                    Cache_Processed_File.Remove(item);
                    break;
                }
            }
            foreach (var item in Cache_Processed_Doc)
            {
                if (Item_.Name == item.Name && item.Path == Item_.Path)
                {
                    Cache_Processed_Doc.Remove(item);
                    break;
                }
            }
            foreach (var item in Cache_Processed_Media)
            {
                if (Item_.Name == item.Name && item.Path == Item_.Path)
                {
                    Cache_Processed_Media.Remove(item);
                    break;
                }
            }


            await Item_.StorageFile_.DeleteAsync();
        }
示例#3
0
        private async void DeleteContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
        {
            Media_in.MediaPlayer.Pause();
            _timer.Stop();
            try
            {
                await Item_.StorageFile_.DeleteAsync();

                foreach (var item in Item_list)
                {
                    if (Item_.Name == item.Name && item.Path == Item_.Path)
                    {
                        Item_list.Remove(item);
                        break;
                    }
                }
                Cache.Remove(Item_.StorageFile_);

                //Cache_Processed_File.Remove(item_);
                //Cache_Processed_Doc.Remove(item_);

                foreach (var item in Cache_Processed)
                {
                    if (Item_.Name == item.Name && item.Path == Item_.Path)
                    {
                        Cache_Processed_File.Remove(item);
                        break;
                    }
                }
                foreach (var item in Cache_Processed_File)
                {
                    if (Item_.Name == item.Name && item.Path == Item_.Path)
                    {
                        Cache_Processed_File.Remove(item);
                        break;
                    }
                }
                foreach (var item in Cache_Processed_Doc)
                {
                    if (Item_.Name == item.Name && item.Path == Item_.Path)
                    {
                        Cache_Processed_Doc.Remove(item);
                        break;
                    }
                }
                foreach (var item in Cache_Processed_Media)
                {
                    if (Item_.Name == item.Name && item.Path == Item_.Path)
                    {
                        Cache_Processed_Media.Remove(item);
                        break;
                    }
                }
                foreach (var item in Item_list)
                {
                    if (Item_.Name == item.Name && item.Path == Item_.Path)
                    {
                        Item_list.Remove(item);
                        break;
                    }
                }
                PlayNext();
            }
            catch (Exception e)
            {
                tip.Text         = e.ToString();
                recentTip.IsOpen = true;
            }
            Media_in.MediaPlayer.Pause();
            _timer.Start();
        }