private void button_searchKey_Click(object sender, RoutedEventArgs e) { var dlg = new SetDefSearchSettingWindow(); dlg.Owner = CommonUtil.GetTopWindow(this); EpgSearchKeyInfo setKey = searchKey.Clone(); if (checkBox_searchServiceFromView.IsChecked == true) { setKey.serviceList = listBox_serviceView.Items.OfType <ChSet5Item>().Select(ch => (long)ch.Key).ToList(); } dlg.SetDefSetting(setKey); if (dlg.ShowDialog() == true) { searchKey = dlg.GetSetting(); if (checkBox_searchServiceFromView.IsChecked == true) { var oldList = listBox_serviceView.Items.OfType <object>().ToList(); var searchList = new List <object>(); foreach (ulong sv in searchKey.serviceList) { if (ChSet5.ChList.ContainsKey(sv) == true) { searchList.Add(ChSet5.ChList[sv]); } } listBox_serviceView.UnselectAll(); listBox_serviceView.Items.RemoveItems(oldList.Where(sv => searchList.Contains(sv) == false)); listBox_serviceView.Items.AddItems(searchList.Where(sv => oldList.Contains(sv) == false)); } } }
private void button_searchKey_Click(object sender, RoutedEventArgs e) { SetDefSearchSettingWindow dlg = new SetDefSearchSettingWindow(); PresentationSource topWindow = PresentationSource.FromVisual(this); if (topWindow != null) { dlg.Owner = (Window)topWindow.RootVisual; } dlg.SetDefSetting(searchKey); if (dlg.ShowDialog() == true) { dlg.GetSetting(ref searchKey); } }
public static bool ChgGenre(List <EpgSearchKeyInfo> infoList, Control owner = null) { try { var dlg = new SetDefSearchSettingWindow(); dlg.Owner = CommonUtil.GetTopWindow(owner); dlg.SetDefSetting(infoList[0]); dlg.searchKey.searchKeyDescView.SetChangeMode(0); if (dlg.ShowDialog() == false) { return(false); } EpgSearchKeyInfo setData = dlg.GetSetting(); infoList.ForEach(info => info.contentList = setData.contentList.Clone()); return(true); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } return(false); }
private void button_searchKey_Click(object sender, RoutedEventArgs e) { SetDefSearchSettingWindow dlg = new SetDefSearchSettingWindow(); PresentationSource topWindow = PresentationSource.FromVisual(this); if (topWindow != null) { dlg.Owner = (Window)topWindow.RootVisual; } dlg.SetDefSetting(searchKey); if (dlg.ShowDialog() == true) { dlg.GetSetting(ref searchKey); } }
private void button_searchKey_Click(object sender, RoutedEventArgs e) { var dlg = new SetDefSearchSettingWindow(); dlg.Owner = CommonUtil.GetTopWindow(this); EpgSearchKeyInfo setKey = searchKey.Clone(); if (checkBox_searchServiceFromView.IsChecked == true) { setKey.serviceList = listBox_serviceView.Items.OfType<ChSet5Item>().Select(ch => (long)ch.Key).ToList(); } dlg.SetDefSetting(setKey); if (dlg.ShowDialog() == true) { searchKey = dlg.GetSetting(); if (checkBox_searchServiceFromView.IsChecked == true) { var oldList = listBox_serviceView.Items.OfType<object>().ToList(); var searchList = new List<object>(); foreach (ulong sv in searchKey.serviceList) { if (ChSet5.ChList.ContainsKey(sv) == true) { searchList.Add(ChSet5.ChList[sv]); } } listBox_serviceView.UnselectAll(); listBox_serviceView.Items.RemoveItems(oldList.Where(sv => searchList.Contains(sv) == false)); listBox_serviceView.Items.AddItems(searchList.Where(sv => oldList.Contains(sv) == false)); } } }
private void button_searchKey_Click(object sender, RoutedEventArgs e) { var dlg = new SetDefSearchSettingWindow(); dlg.Owner = (Window)PresentationSource.FromVisual(this).RootVisual; dlg.SetDefSetting(searchKey); if (dlg.ShowDialog() == true) { searchKey = dlg.GetSetting(); } }