Пример #1
0
        public override AutoAddData GetData()
        {
            try
            {
                var data = new ManualAutoAddData();
                data.dataID = (uint)dataID;

                UInt32 startTime = ((UInt32)comboBox_startHH.SelectedIndex * 60 * 60) + ((UInt32)comboBox_startMM.SelectedIndex * 60) + (UInt32)comboBox_startSS.SelectedIndex;
                UInt32 endTime   = ((UInt32)comboBox_endHH.SelectedIndex * 60 * 60) + ((UInt32)comboBox_endMM.SelectedIndex * 60) + (UInt32)comboBox_endSS.SelectedIndex;
                while (endTime < startTime)
                {
                    endTime += 24 * 60 * 60;
                }
                UInt32 duration = endTime - startTime;
                if (duration >= 24 * 60 * 60)
                {
                    //深夜時間帯の処理の関係で、不可条件が新たに発生しているため、その対応。
                    MessageBox.Show("24時間以上の録画時間は設定出来ません。", "録画時間長の確認", MessageBoxButton.OK);
                    return(null);
                }

                data.startTime      = startTime;
                data.durationSecond = duration;

                //曜日の処理、0~6bit目:日~土
                data.dayOfWeekFlag = 0;
                int val = 0;
                chbxList.ForEach(chbx => data.dayOfWeekFlag |= (byte)((chbx.IsChecked == true ? 0x01 : 0x00) << val++));

                //開始時刻を0~24時に調整する。
                data.RegulateData();

                data.IsEnabled = checkBox_keyDisabled.IsChecked != true;

                data.title = textBox_title.Text;

                var chItem = comboBox_service.SelectedItem as EpgServiceInfo;
                data.stationName       = chItem.service_name;
                data.originalNetworkID = chItem.ONID;
                data.transportStreamID = chItem.TSID;
                data.serviceID         = chItem.SID;
                data.recSetting        = recSettingView.GetRecSetting();

                return(data);
            }
            catch (Exception ex) { MessageBox.Show(ex.ToString()); }
            return(null);
        }
Пример #2
0
        private void button_add_chg(object sender, ExecutedRoutedEventArgs e, bool chgFlag)
        {
            try
            {
                UInt32 startTime = ((UInt32)comboBox_startHH.SelectedIndex * 60 * 60) + ((UInt32)comboBox_startMM.SelectedIndex * 60) + (UInt32)comboBox_startSS.SelectedIndex;
                UInt32 endTime   = ((UInt32)comboBox_endHH.SelectedIndex * 60 * 60) + ((UInt32)comboBox_endMM.SelectedIndex * 60) + (UInt32)comboBox_endSS.SelectedIndex;
                while (endTime < startTime)
                {
                    endTime += 24 * 60 * 60;
                }
                UInt32 duration = endTime - startTime;
                if (duration >= 24 * 60 * 60)
                {
                    //深夜時間帯の処理の関係で、不可条件が新たに発生しているため、その対応。
                    MessageBox.Show("24時間以上の録画時間は設定出来ません。", "録画時間長の確認", MessageBoxButton.OK);
                    return;
                }

                if (CheckAutoAddChange(e, chgFlag == false ? 0 : 1) == false)
                {
                    return;
                }
                //
                if (defKey == null)
                {
                    defKey = new ManualAutoAddData();
                }

                defKey.startTime      = startTime;
                defKey.durationSecond = duration;

                defKey.dayOfWeekFlag = 0;
                if (checkBox_week0.IsChecked == true)
                {
                    defKey.dayOfWeekFlag |= 0x01;
                }
                if (checkBox_week1.IsChecked == true)
                {
                    defKey.dayOfWeekFlag |= 0x02;
                }
                if (checkBox_week2.IsChecked == true)
                {
                    defKey.dayOfWeekFlag |= 0x04;
                }
                if (checkBox_week3.IsChecked == true)
                {
                    defKey.dayOfWeekFlag |= 0x08;
                }
                if (checkBox_week4.IsChecked == true)
                {
                    defKey.dayOfWeekFlag |= 0x10;
                }
                if (checkBox_week5.IsChecked == true)
                {
                    defKey.dayOfWeekFlag |= 0x20;
                }
                if (checkBox_week6.IsChecked == true)
                {
                    defKey.dayOfWeekFlag |= 0x40;
                }

                //開始時刻を0~24時に調整する。
                defKey.RegulateData();

                defKey.IsEnabled = checkBox_keyDisabled.IsChecked != true;

                defKey.title = textBox_title.Text;

                ChSet5Item chItem = comboBox_service.SelectedItem as ChSet5Item;
                defKey.stationName       = chItem.ServiceName;
                defKey.originalNetworkID = chItem.ONID;
                defKey.transportStreamID = chItem.TSID;
                defKey.serviceID         = chItem.SID;
                defKey.recSetting        = recSettingView.GetRecSetting();

                if (chgFlag == true)
                {
                    bool ret = MenuUtil.AutoAddChange(CommonUtil.ToList(defKey));
                    CommonManager.Instance.StatusNotifySet(ret, "プログラム予約登録を変更");
                }
                else
                {
                    bool ret = MenuUtil.AutoAddAdd(CommonUtil.ToList(defKey));
                    CommonManager.Instance.StatusNotifySet(ret, "プログラム予約登録を追加");
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
            DialogResult = true;
        }