SetDefSearchSettingWindow.xaml の相互作用ロジック
Наследование: System.Windows.Window
Пример #1
0
        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));
                }
            }
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
        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);
        }
Пример #4
0
 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);
     }
 }
Пример #5
0
 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));
         }
     }
 }
Пример #6
0
        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();
            }
        }