Beispiel #1
0
        public DateItem DeepClone()
        {
            var other = new DateItem();

            other.DateInfo = DateInfo == null ? null : DateInfo.DeepClone();
            return(other);
        }
        private void button_timeAdd_Click(object sender, RoutedEventArgs e)
        {
            if (comboBox_time_sw.SelectedItem == null ||
                comboBox_time_sh.SelectedItem == null ||
                comboBox_time_sm.SelectedItem == null ||
                comboBox_time_ew.SelectedItem == null ||
                comboBox_time_eh.SelectedItem == null ||
                comboBox_time_em.SelectedItem == null)
            {
                return;
            }

            DateItem          item      = new DateItem();
            EpgSearchDateInfo info      = new EpgSearchDateInfo();
            DayOfWeekInfo     startWeek = comboBox_time_sw.SelectedItem as DayOfWeekInfo;
            DayOfWeekInfo     endWeek   = comboBox_time_ew.SelectedItem as DayOfWeekInfo;

            info.startDayOfWeek = startWeek.Value;
            info.startHour      = (UInt16)comboBox_time_sh.SelectedItem;
            info.startMin       = (UInt16)comboBox_time_sm.SelectedItem;
            info.endDayOfWeek   = endWeek.Value;
            info.endHour        = (UInt16)comboBox_time_eh.SelectedItem;
            info.endMin         = (UInt16)comboBox_time_em.SelectedItem;

            String viewText = "";

            viewText = startWeek.DisplayName + " " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                       " ~ " + endWeek.DisplayName + " " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

            item.DateInfo = info;
            item.ViewText = viewText;

            listBox_date.Items.Add(item);
        }
Beispiel #3
0
 private void button_date_add_Click(object sender, RoutedEventArgs e)
 {
     if (radioButton_week.IsChecked == false)
     {
         var info = new EpgSearchDateInfo();
         info.startDayOfWeek = (byte)Math.Min(Math.Max(comboBox_time_sw.SelectedIndex, 0), 6);
         info.startHour      = (ushort)Math.Min(Math.Max(comboBox_time_sh.SelectedIndex, 0), 23);
         info.startMin       = (ushort)Math.Min(Math.Max(comboBox_time_sm.SelectedIndex, 0), 59);
         info.endDayOfWeek   = (byte)Math.Min(Math.Max(comboBox_time_ew.SelectedIndex, 0), 6);
         info.endHour        = (ushort)Math.Min(Math.Max(comboBox_time_eh.SelectedIndex, 0), 23);
         info.endMin         = (ushort)Math.Min(Math.Max(comboBox_time_em.SelectedIndex, 0), 59);
         EnableDateListBox(true);
         var item = new DateItem();
         item.DateInfo = info;
         listBox_date.Items.Add(item);
     }
     else
     {
         int startHour = Math.Min(Math.Max(comboBox_week_sh.SelectedIndex, 0), 23);
         int startMin  = Math.Min(Math.Max(comboBox_week_sm.SelectedIndex, 0), 59);
         int endHour   = Math.Min(Math.Max(comboBox_time_eh.SelectedIndex, 0), 23);
         int endMin    = Math.Min(Math.Max(comboBox_time_em.SelectedIndex, 0), 59);
         var Add_week  = new Action <CheckBox, byte>((chbox, day) =>
         {
             if (chbox.IsChecked != true)
             {
                 return;
             }
             //
             var info            = new EpgSearchDateInfo();
             info.startDayOfWeek = day;
             info.startHour      = (ushort)startHour;
             info.startMin       = (ushort)startMin;
             info.endDayOfWeek   = info.startDayOfWeek;
             info.endHour        = (ushort)endHour;
             info.endMin         = (ushort)endMin;
             if (endHour * 60 + endMin < startHour * 60 + startMin)
             {
                 //終了時間は翌日のものとみなす
                 info.endDayOfWeek = (byte)((info.endDayOfWeek + 1) % 7);
             }
             EnableDateListBox(true);
             var item      = new DateItem();
             item.DateInfo = info;
             listBox_date.Items.Add(item);
         });
         Add_week(checkBox_sun, 0);
         Add_week(checkBox_mon, 1);
         Add_week(checkBox_tue, 2);
         Add_week(checkBox_wed, 3);
         Add_week(checkBox_thu, 4);
         Add_week(checkBox_fri, 5);
         Add_week(checkBox_sat, 6);
     }
 }
        private void button_weekAdd_Click(object sender, RoutedEventArgs e)
        {
            if (comboBox_week_sh.SelectedItem == null ||
                comboBox_week_sm.SelectedItem == null ||
                comboBox_week_eh.SelectedItem == null ||
                comboBox_week_em.SelectedItem == null)
            {
                return;
            }
            Int32 start = ((UInt16)comboBox_week_sh.SelectedItem) * 60;

            start += (UInt16)comboBox_week_sm.SelectedItem;
            Int32 end = ((UInt16)comboBox_week_eh.SelectedItem) * 60;

            end += (UInt16)comboBox_week_em.SelectedItem;
            if (end < start)
            {
                MessageBox.Show("開始時間が終了時間より前です");
                return;
            }

            if (checkBox_mon.IsChecked == true)
            {
                DateItem          item = new DateItem();
                EpgSearchDateInfo info = new EpgSearchDateInfo();
                info.startDayOfWeek = 1;
                info.startHour      = (UInt16)comboBox_week_sh.SelectedItem;
                info.startMin       = (UInt16)comboBox_week_sm.SelectedItem;
                info.endDayOfWeek   = 1;
                info.endHour        = (UInt16)comboBox_week_eh.SelectedItem;
                info.endMin         = (UInt16)comboBox_week_em.SelectedItem;

                String viewText = "";
                viewText = "月 " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                           " ~ " + "月 " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

                item.DateInfo = info;
                item.ViewText = viewText;
                listBox_date.Items.Add(item);
            }
            if (checkBox_tue.IsChecked == true)
            {
                DateItem          item = new DateItem();
                EpgSearchDateInfo info = new EpgSearchDateInfo();
                info.startDayOfWeek = 2;
                info.startHour      = (UInt16)comboBox_week_sh.SelectedItem;
                info.startMin       = (UInt16)comboBox_week_sm.SelectedItem;
                info.endDayOfWeek   = 2;
                info.endHour        = (UInt16)comboBox_week_eh.SelectedItem;
                info.endMin         = (UInt16)comboBox_week_em.SelectedItem;

                String viewText = "";
                viewText = "火 " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                           " ~ " + "火 " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

                item.DateInfo = info;
                item.ViewText = viewText;
                listBox_date.Items.Add(item);
            }
            if (checkBox_wen.IsChecked == true)
            {
                DateItem          item = new DateItem();
                EpgSearchDateInfo info = new EpgSearchDateInfo();
                info.startDayOfWeek = 3;
                info.startHour      = (UInt16)comboBox_week_sh.SelectedItem;
                info.startMin       = (UInt16)comboBox_week_sm.SelectedItem;
                info.endDayOfWeek   = 3;
                info.endHour        = (UInt16)comboBox_week_eh.SelectedItem;
                info.endMin         = (UInt16)comboBox_week_em.SelectedItem;

                String viewText = "";
                viewText = "水 " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                           " ~ " + "水 " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

                item.DateInfo = info;
                item.ViewText = viewText;
                listBox_date.Items.Add(item);
            }
            if (checkBox_thu.IsChecked == true)
            {
                DateItem          item = new DateItem();
                EpgSearchDateInfo info = new EpgSearchDateInfo();
                info.startDayOfWeek = 4;
                info.startHour      = (UInt16)comboBox_week_sh.SelectedItem;
                info.startMin       = (UInt16)comboBox_week_sm.SelectedItem;
                info.endDayOfWeek   = 4;
                info.endHour        = (UInt16)comboBox_week_eh.SelectedItem;
                info.endMin         = (UInt16)comboBox_week_em.SelectedItem;

                String viewText = "";
                viewText = "木 " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                           " ~ " + "木 " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

                item.DateInfo = info;
                item.ViewText = viewText;
                listBox_date.Items.Add(item);
            }
            if (checkBox_fri.IsChecked == true)
            {
                DateItem          item = new DateItem();
                EpgSearchDateInfo info = new EpgSearchDateInfo();
                info.startDayOfWeek = 5;
                info.startHour      = (UInt16)comboBox_week_sh.SelectedItem;
                info.startMin       = (UInt16)comboBox_week_sm.SelectedItem;
                info.endDayOfWeek   = 5;
                info.endHour        = (UInt16)comboBox_week_eh.SelectedItem;
                info.endMin         = (UInt16)comboBox_week_em.SelectedItem;

                String viewText = "";
                viewText = "金 " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                           " ~ " + "金 " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

                item.DateInfo = info;
                item.ViewText = viewText;
                listBox_date.Items.Add(item);
            }
            if (checkBox_sat.IsChecked == true)
            {
                DateItem          item = new DateItem();
                EpgSearchDateInfo info = new EpgSearchDateInfo();
                info.startDayOfWeek = 6;
                info.startHour      = (UInt16)comboBox_week_sh.SelectedItem;
                info.startMin       = (UInt16)comboBox_week_sm.SelectedItem;
                info.endDayOfWeek   = 6;
                info.endHour        = (UInt16)comboBox_week_eh.SelectedItem;
                info.endMin         = (UInt16)comboBox_week_em.SelectedItem;

                String viewText = "";
                viewText = "土 " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                           " ~ " + "土 " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

                item.DateInfo = info;
                item.ViewText = viewText;
                listBox_date.Items.Add(item);
            }
            if (checkBox_sun.IsChecked == true)
            {
                DateItem          item = new DateItem();
                EpgSearchDateInfo info = new EpgSearchDateInfo();
                info.startDayOfWeek = 0;
                info.startHour      = (UInt16)comboBox_week_sh.SelectedItem;
                info.startMin       = (UInt16)comboBox_week_sm.SelectedItem;
                info.endDayOfWeek   = 0;
                info.endHour        = (UInt16)comboBox_week_eh.SelectedItem;
                info.endMin         = (UInt16)comboBox_week_em.SelectedItem;

                String viewText = "";
                viewText = "日 " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                           " ~ " + "日 " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

                item.DateInfo = info;
                item.ViewText = viewText;
                listBox_date.Items.Add(item);
            }
        }
        private void UpdateView()
        {
            try
            {
                if (defKey.regExpFlag == 1)
                {
                    checkBox_regExp.IsChecked = true;
                    checkBox_aimai.IsChecked  = false;
                }
                else
                {
                    checkBox_regExp.IsChecked = false;
                    if (defKey.aimaiFlag == 1)
                    {
                        checkBox_aimai.IsChecked = true;
                    }
                    else
                    {
                        checkBox_aimai.IsChecked = false;
                    }
                }
                if (defKey.titleOnlyFlag == 1)
                {
                    checkBox_titleOnly.IsChecked = true;
                }
                else
                {
                    checkBox_titleOnly.IsChecked = false;
                }

                listBox_content.Items.Clear();
                foreach (EpgContentData item in defKey.contentList)
                {
                    int    nibble1    = item.content_nibble_level_1;
                    int    nibble2    = item.content_nibble_level_2;
                    UInt16 contentKey = (UInt16)(nibble1 << 8 | nibble2);
                    if (CommonManager.Instance.ContentKindDictionary.ContainsKey(contentKey) == true)
                    {
                        listBox_content.Items.Add(CommonManager.Instance.ContentKindDictionary[contentKey]);
                    }
                }

                foreach (ServiceItem info in serviceDict.Values)
                {
                    info.IsSelected = false;
                }
                foreach (Int64 info in defKey.serviceList)
                {
                    if (serviceDict.ContainsKey(info) == true)
                    {
                        serviceDict[info].IsSelected = true;
                    }
                }

                listBox_date.Items.Clear();
                foreach (EpgSearchDateInfo info in defKey.dateList)
                {
                    DateItem item = new DateItem();

                    String viewText = "";

                    viewText = CommonManager.Instance.DayOfWeekDictionary[info.startDayOfWeek].DisplayName + " " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                               " ~ " + CommonManager.Instance.DayOfWeekDictionary[info.endDayOfWeek].DisplayName + " " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

                    item.DateInfo = info;
                    item.ViewText = viewText;

                    listBox_date.Items.Add(item);
                }

                if (defKey.notContetFlag == 1)
                {
                    checkBox_notContent.IsChecked = true;
                }
                else
                {
                    checkBox_notContent.IsChecked = false;
                }
                if (defKey.notDateFlag == 1)
                {
                    checkBox_notDate.IsChecked = true;
                }
                else
                {
                    checkBox_notDate.IsChecked = false;
                }

                if (defKey.freeCAFlag == 1)
                {
                    radioButton_free_2.IsChecked = true;
                }
                else if (defKey.freeCAFlag == 2)
                {
                    radioButton_free_3.IsChecked = true;
                }
                else
                {
                    radioButton_free_1.IsChecked = true;
                }

                textBox_chkRecDay.Text = defKey.chkRecDay.ToString();
                if (defKey.chkRecEnd == 0)
                {
                    textBox_chkRecDay.Text = "0";
                }
                textBox_chkRecMin.Text = defKey.chkRecMin.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
Beispiel #6
0
        private void button_weekAdd_Click(object sender, RoutedEventArgs e)
        {
            if (comboBox_week_sh.SelectedItem == null ||
                comboBox_week_sm.SelectedItem == null ||
                comboBox_week_eh.SelectedItem == null ||
                comboBox_week_em.SelectedItem == null)
            {
                return;
            }
            Int32 start = ((UInt16)comboBox_week_sh.SelectedItem) * 60;
            start += (UInt16)comboBox_week_sm.SelectedItem;
            Int32 end = ((UInt16)comboBox_week_eh.SelectedItem) * 60;
            end += (UInt16)comboBox_week_em.SelectedItem;
            if (end < start)
            {
                MessageBox.Show("開始時間が終了時間より前です");
                return;
            }

            if (checkBox_mon.IsChecked == true)
            {
                DateItem item = new DateItem();
                EpgSearchDateInfo info = new EpgSearchDateInfo();
                info.startDayOfWeek = 1;
                info.startHour = (UInt16)comboBox_week_sh.SelectedItem;
                info.startMin = (UInt16)comboBox_week_sm.SelectedItem;
                info.endDayOfWeek = 1;
                info.endHour = (UInt16)comboBox_week_eh.SelectedItem;
                info.endMin = (UInt16)comboBox_week_em.SelectedItem;

                String viewText = "";
                viewText = "月 " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                    " ~ " + "月 " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

                item.DateInfo = info;
                item.ViewText = viewText;
                listBox_date.Items.Add(item);
            }
            if (checkBox_tue.IsChecked == true)
            {
                DateItem item = new DateItem();
                EpgSearchDateInfo info = new EpgSearchDateInfo();
                info.startDayOfWeek = 2;
                info.startHour = (UInt16)comboBox_week_sh.SelectedItem;
                info.startMin = (UInt16)comboBox_week_sm.SelectedItem;
                info.endDayOfWeek = 2;
                info.endHour = (UInt16)comboBox_week_eh.SelectedItem;
                info.endMin = (UInt16)comboBox_week_em.SelectedItem;

                String viewText = "";
                viewText = "火 " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                    " ~ " + "火 " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

                item.DateInfo = info;
                item.ViewText = viewText;
                listBox_date.Items.Add(item);
            }
            if (checkBox_wen.IsChecked == true)
            {
                DateItem item = new DateItem();
                EpgSearchDateInfo info = new EpgSearchDateInfo();
                info.startDayOfWeek = 3;
                info.startHour = (UInt16)comboBox_week_sh.SelectedItem;
                info.startMin = (UInt16)comboBox_week_sm.SelectedItem;
                info.endDayOfWeek = 3;
                info.endHour = (UInt16)comboBox_week_eh.SelectedItem;
                info.endMin = (UInt16)comboBox_week_em.SelectedItem;

                String viewText = "";
                viewText = "水 " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                    " ~ " + "水 " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

                item.DateInfo = info;
                item.ViewText = viewText;
                listBox_date.Items.Add(item);
            }
            if (checkBox_thu.IsChecked == true)
            {
                DateItem item = new DateItem();
                EpgSearchDateInfo info = new EpgSearchDateInfo();
                info.startDayOfWeek = 4;
                info.startHour = (UInt16)comboBox_week_sh.SelectedItem;
                info.startMin = (UInt16)comboBox_week_sm.SelectedItem;
                info.endDayOfWeek = 4;
                info.endHour = (UInt16)comboBox_week_eh.SelectedItem;
                info.endMin = (UInt16)comboBox_week_em.SelectedItem;

                String viewText = "";
                viewText = "木 " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                    " ~ " + "木 " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

                item.DateInfo = info;
                item.ViewText = viewText;
                listBox_date.Items.Add(item);
            }
            if (checkBox_fri.IsChecked == true)
            {
                DateItem item = new DateItem();
                EpgSearchDateInfo info = new EpgSearchDateInfo();
                info.startDayOfWeek = 5;
                info.startHour = (UInt16)comboBox_week_sh.SelectedItem;
                info.startMin = (UInt16)comboBox_week_sm.SelectedItem;
                info.endDayOfWeek = 5;
                info.endHour = (UInt16)comboBox_week_eh.SelectedItem;
                info.endMin = (UInt16)comboBox_week_em.SelectedItem;

                String viewText = "";
                viewText = "金 " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                    " ~ " + "金 " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

                item.DateInfo = info;
                item.ViewText = viewText;
                listBox_date.Items.Add(item);
            }
            if (checkBox_sat.IsChecked == true)
            {
                DateItem item = new DateItem();
                EpgSearchDateInfo info = new EpgSearchDateInfo();
                info.startDayOfWeek = 6;
                info.startHour = (UInt16)comboBox_week_sh.SelectedItem;
                info.startMin = (UInt16)comboBox_week_sm.SelectedItem;
                info.endDayOfWeek = 6;
                info.endHour = (UInt16)comboBox_week_eh.SelectedItem;
                info.endMin = (UInt16)comboBox_week_em.SelectedItem;

                String viewText = "";
                viewText = "土 " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                    " ~ " + "土 " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

                item.DateInfo = info;
                item.ViewText = viewText;
                listBox_date.Items.Add(item);
            }
            if (checkBox_sun.IsChecked == true)
            {
                DateItem item = new DateItem();
                EpgSearchDateInfo info = new EpgSearchDateInfo();
                info.startDayOfWeek = 0;
                info.startHour = (UInt16)comboBox_week_sh.SelectedItem;
                info.startMin = (UInt16)comboBox_week_sm.SelectedItem;
                info.endDayOfWeek = 0;
                info.endHour = (UInt16)comboBox_week_eh.SelectedItem;
                info.endMin = (UInt16)comboBox_week_em.SelectedItem;

                String viewText = "";
                viewText = "日 " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                    " ~ " + "日 " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

                item.DateInfo = info;
                item.ViewText = viewText;
                listBox_date.Items.Add(item);
            }
        }
Beispiel #7
0
        private void button_timeAdd_Click(object sender, RoutedEventArgs e)
        {
            if (comboBox_time_sw.SelectedItem == null ||
                comboBox_time_sh.SelectedItem == null ||
                comboBox_time_sm.SelectedItem == null ||
                comboBox_time_ew.SelectedItem == null ||
                comboBox_time_eh.SelectedItem == null ||
                comboBox_time_em.SelectedItem == null)
            {
                return;
            }

            DateItem item = new DateItem();
            EpgSearchDateInfo info = new EpgSearchDateInfo();
            DayOfWeekInfo startWeek = comboBox_time_sw.SelectedItem as DayOfWeekInfo;
            DayOfWeekInfo endWeek = comboBox_time_ew.SelectedItem as DayOfWeekInfo;

            info.startDayOfWeek = startWeek.Value;
            info.startHour = (UInt16)comboBox_time_sh.SelectedItem;
            info.startMin = (UInt16)comboBox_time_sm.SelectedItem;
            info.endDayOfWeek = endWeek.Value;
            info.endHour = (UInt16)comboBox_time_eh.SelectedItem;
            info.endMin = (UInt16)comboBox_time_em.SelectedItem;

            String viewText = "";
            viewText = startWeek.DisplayName + " " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                " ~ " + endWeek.DisplayName + " " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

            item.DateInfo = info;
            item.ViewText = viewText;

            listBox_date.Items.Add(item);
        }
Beispiel #8
0
        private void UpdateView()
        {
            try
            {
                if (defKey.regExpFlag == 1)
                {
                    checkBox_regExp.IsChecked = true;
                    checkBox_aimai.IsChecked = false;
                }
                else
                {
                    checkBox_regExp.IsChecked = false;
                    if (defKey.aimaiFlag == 1)
                    {
                        checkBox_aimai.IsChecked = true;
                    }
                    else
                    {
                        checkBox_aimai.IsChecked = false;
                    }
                }
                if (defKey.titleOnlyFlag == 1)
                {
                    checkBox_titleOnly.IsChecked = true;
                }
                else
                {
                    checkBox_titleOnly.IsChecked = false;
                }
                if (defKey.andKey.StartsWith("^!{999}"))
                {
                    checkBox_keyDisabled.IsChecked = true;
                }
                else
                {
                    checkBox_keyDisabled.IsChecked = false;
                }

                listBox_content.Items.Clear();
                foreach (EpgContentData item in defKey.contentList)
                {
                    int nibble1 = item.content_nibble_level_1;
                    int nibble2 = item.content_nibble_level_2;
                    UInt16 contentKey = (UInt16)(nibble1 << 8 | nibble2);
                    if (CommonManager.Instance.ContentKindDictionary.ContainsKey(contentKey) == true)
                    {
                        listBox_content.Items.Add(CommonManager.Instance.ContentKindDictionary[contentKey]);
                    }
                }

                foreach (ServiceItem info in serviceDict.Values)
                {
                    info.IsSelected = false;
                }
                foreach (Int64 info in defKey.serviceList)
                {
                    if (serviceDict.ContainsKey(info) == true)
                    {
                        serviceDict[info].IsSelected = true;
                    }
                }

                listBox_date.Items.Clear();
                foreach (EpgSearchDateInfo info in defKey.dateList)
                {
                    DateItem item = new DateItem();

                    String viewText = "";

                    viewText = CommonManager.Instance.DayOfWeekDictionary[info.startDayOfWeek].DisplayName + " " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                        " ~ " + CommonManager.Instance.DayOfWeekDictionary[info.endDayOfWeek].DisplayName + " " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

                    item.DateInfo = info;
                    item.ViewText = viewText;

                    listBox_date.Items.Add(item);
                }

                if (defKey.notContetFlag == 1)
                {
                    checkBox_notContent.IsChecked = true;
                }
                else
                {
                    checkBox_notContent.IsChecked = false;
                }
                if (defKey.notDateFlag == 1)
                {
                    checkBox_notDate.IsChecked = true;
                }
                else
                {
                    checkBox_notDate.IsChecked = false;
                }

                if (defKey.freeCAFlag == 1)
                {
                    radioButton_free_2.IsChecked = true;
                }
                else if (defKey.freeCAFlag == 2)
                {
                    radioButton_free_3.IsChecked = true;
                }
                else
                {
                    radioButton_free_1.IsChecked = true;
                }

                if (defKey.chkRecEnd == 1)
                {
                    checkBox_chkRecEnd.IsChecked = true;
                }
                else
                {
                    checkBox_chkRecEnd.IsChecked = false;
                }
                textBox_chkRecDay.Text = defKey.chkRecDay.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
Beispiel #9
0
        public void SetSearchKey(EpgSearchKeyInfo key)
        {
            comboBox_andKey.Text         = Regex.Replace(key.andKey, @"^(?:\^!\{999\})?(?:C!\{999\})?(?:D!\{1[0-9]{8}\})?", "");
            comboBox_notKey.Text         = key.notKey;
            checkBox_regExp.IsChecked    = key.regExpFlag != 0;
            checkBox_aimai.IsChecked     = key.aimaiFlag != 0;
            checkBox_titleOnly.IsChecked = key.titleOnlyFlag != 0;
            var match = Regex.Match(key.andKey, @"^((?:\^!\{999\})?)((?:C!\{999\})?)((?:D!\{1[0-9]{8}\})?)");

            checkBox_keyDisabled.IsChecked = match.Groups[1].Value.Length > 0;
            checkBox_case.IsChecked        = match.Groups[2].Value.Length > 0;
            uint dur = 0;

            if (match.Groups[3].Value.Length > 0)
            {
                dur = uint.Parse(match.Groups[3].Value.Substring(3, 9));
            }
            textBox_chkDurationMin.Text = (dur / 10000 % 10000).ToString();
            textBox_chkDurationMax.Text = (dur % 10000).ToString();

            EnableContentListBox(true);
            listBox_content.Items.Clear();
            foreach (EpgContentData item in key.contentList)
            {
                ushort contentKey = (ushort)(item.content_nibble_level_1 << 8 | item.content_nibble_level_2);
                if (CommonManager.Instance.ContentKindDictionary.ContainsKey(contentKey))
                {
                    listBox_content.Items.Add(CommonManager.Instance.ContentKindDictionary[contentKey]);
                }
                else
                {
                    //未知のジャンル
                    listBox_content.Items.Add(new ContentKindInfo("?", "?", item.content_nibble_level_1, item.content_nibble_level_2));
                }
            }
            if (listBox_content.Items.Count == 0)
            {
                EnableContentListBox(false);
            }
            checkBox_notContent.IsChecked = key.notContetFlag != 0;

            EnableDateListBox(true);
            listBox_date.Items.Clear();
            foreach (EpgSearchDateInfo info in key.dateList)
            {
                DateItem item = new DateItem();
                item.DateInfo = info;
                listBox_date.Items.Add(item);
            }
            if (listBox_date.Items.Count == 0)
            {
                EnableDateListBox(false);
            }
            checkBox_notDate.IsChecked = key.notDateFlag != 0;

            var keySortedServiceList = new List <long>(key.serviceList);

            keySortedServiceList.Sort();
            ServiceItem firstSelected = null;

            foreach (ServiceItem info in listView_service.ItemsSource)
            {
                info.IsSelected = keySortedServiceList.BinarySearch((long)info.ID) >= 0;
                if (firstSelected == null && info.IsSelected)
                {
                    firstSelected = info;
                }
            }
            if (firstSelected != null)
            {
                listView_service.ScrollIntoView(firstSelected);
            }

            comboBox_free.SelectedIndex        = key.freeCAFlag % 3;
            checkBox_chkRecEnd.IsChecked       = key.chkRecEnd != 0;
            textBox_chkRecDay.Text             = (key.chkRecDay >= 40000 ? key.chkRecDay % 10000 : key.chkRecDay).ToString();
            checkBox_chkRecNoService.IsChecked = key.chkRecDay >= 40000;
        }
Beispiel #10
0
        private void button_weekAdd_Click(object sender, RoutedEventArgs e)
        {
            if (comboBox_week_sh.SelectedItem == null ||
                comboBox_week_sm.SelectedItem == null ||
                comboBox_week_eh.SelectedItem == null ||
                comboBox_week_em.SelectedItem == null)
            {
                return;
            }
            Int32 start = ((UInt16)comboBox_week_sh.SelectedItem) * 60+ (UInt16)comboBox_week_sm.SelectedItem;
            Int32 end = ((UInt16)comboBox_week_eh.SelectedItem) * 60+ (UInt16)comboBox_week_em.SelectedItem;

            var Add_week = new Action<CheckBox, byte>((chbox, day) =>
            {
                if (chbox.IsChecked != true) return;
                //
                var info = new EpgSearchDateInfo();
                info.startDayOfWeek = day;
                info.startHour = (UInt16)comboBox_week_sh.SelectedItem;
                info.startMin = (UInt16)comboBox_week_sm.SelectedItem;
                info.endDayOfWeek = info.startDayOfWeek;
                info.endHour = (UInt16)comboBox_week_eh.SelectedItem;
                info.endMin = (UInt16)comboBox_week_em.SelectedItem;
                if (end < start)
                {
                    //終了時間は翌日のものとみなす
                    info.endDayOfWeek = (byte)((info.endDayOfWeek + 1) % 7);
                }

                string viewText = "日月火水木金土"[info.startDayOfWeek] + " " + info.startHour.ToString("00") + ":" + info.startMin.ToString("00") +
                    " ~ " + "日月火水木金土"[info.endDayOfWeek] + " " + info.endHour.ToString("00") + ":" + info.endMin.ToString("00");

                var item = new DateItem();
                item.DateInfo = info;
                item.ViewText = viewText;
                listBox_date.Items.Add(item);
            });

            Add_week(checkBox_mon, 1);
            Add_week(checkBox_tue, 2);
            Add_week(checkBox_wen, 3);
            Add_week(checkBox_thu, 4);
            Add_week(checkBox_fri, 5);
            Add_week(checkBox_sat, 6);
            Add_week(checkBox_sun, 0);
        }