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_Doc.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_Doc.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(); } }
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(); }
private async void Page_Loaded(object sender, RoutedEventArgs e) { if (NeedNav) { Frame current = Window.Current.Content as Frame; current.Navigate(typeof(Today_NewFile)); NeedNav = false; } if (ApplicationLanguages.PrimaryLanguageOverride == "") { ApplicationLanguages.PrimaryLanguageOverride = "en-US"; } UserSettings.PrimaryLanguage = ApplicationLanguages.PrimaryLanguageOverride; try { if (localSettings.Values["ToggleSwitch_Menu"].ToString() == "Open") { nvSample.PaneDisplayMode = NavigationViewPaneDisplayMode.Auto; } else { nvSample.PaneDisplayMode = NavigationViewPaneDisplayMode.LeftCompact; } } catch (Exception) { nvSample.PaneDisplayMode = NavigationViewPaneDisplayMode.LeftCompact; localSettings.Values["ToggleSwitch_Menu"] = "Close"; } //Background SolidColorBrush myBrush = GetBGColor(); nvSample.Background = myBrush; if (SettingChanged) { contentFrame.Navigate(typeof(Pages.MAIN_Page1), new SuppressNavigationTransitionInfo()); ItemAccess.SettingChanged = false; } if (ItemAccess.Cache_flag == false) { ItemAccess.Cache_flag = true; ItemAccess.Cache.Clear(); Cache_Processed.Clear(); Cache_Processed_Media.Clear(); Cache_Processed_Doc.Clear(); Cache_Processed_File.Clear(); Cache_Recent_Media.Clear(); Cache_Recent_Music.Clear(); Cache_Recent_Doc.Clear(); try { await Refresh(); } catch (Exception Excep) { await new ContentDialog { Title = "发生错误", Content = Excep.Message, CloseButtonText = "关闭", DefaultButton = ContentDialogButton.Close }.ShowAsync(); } } /*if (!Refreshing && ItemAccess.Cache.Count == 0) * { * * contentFrame.Navigate(typeof(Pages.GUIDE_page)); * }*/ }
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(); }