Example #1
0
        protected void autoadd_add_chg(ExecutedRoutedEventArgs e, int code)
        {
            bool ret = false;

            try
            {
                AutoAddData data = GetData();
                if (data != null && CheckAutoAddChange(e, code) == 0)
                {
                    if (code == 0)
                    {
                        ret = MenuUtil.AutoAddAdd(data.IntoList());
                        if (ret == true)
                        {
                            //割り当てられたIDが欲しいだけなのでEpgTimer内のもろもろは再構築せず、Srvからデータだけ取得する。
                            SetData(AutoAddData.GetAutoAddListSrv(typeof(S)).LastOrDefault() as S);
                            SetViewMode(AutoAddMode.Change);
                        }
                    }
                    else
                    {
                        ret = MenuUtil.AutoAddChange(data.IntoList());
                    }
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
            StatusManager.StatusNotifySet(ret, AutoAddString + "を" + cmdMsg[code]);
        }
Example #2
0
        private void button_add_epgAutoAdd_Click(object sender, ExecutedRoutedEventArgs e)
        {
            bool ret = false;

            try
            {
                ret = CheckAutoAddChange(e, 0);
                if (ret == true)
                {
                    //一覧画面非表示の状態から実施する場合のためのコード
                    if (autoAddView.IsVisible == false && CommonManager.Instance.DB.EpgAutoAddList.Count == 0)
                    {
                        CommonManager.Instance.DB.SetUpdateNotify((UInt32)UpdateNotifyItem.AutoAddEpgInfo);
                        CommonManager.Instance.DB.ReloadEpgAutoAddInfo();
                    }

                    List <uint> oldlist = CommonManager.Instance.DB.EpgAutoAddList.Keys.ToList();

                    ret = MenuUtil.AutoAddAdd(CommonUtil.ToList(this.GetAutoAddData()));
                    if (ret == true)
                    {
                        //以降の処理をEpgTimerSrvからの更新通知後に実行すればReload減らせるが、トラブル増えそうなのでこのまま。
                        CommonManager.Instance.DB.SetUpdateNotify((UInt32)UpdateNotifyItem.AutoAddEpgInfo);
                        CommonManager.Instance.DB.ReloadEpgAutoAddInfo();

                        List <uint> newlist = CommonManager.Instance.DB.EpgAutoAddList.Keys.ToList();
                        List <uint> diflist = newlist.Except(oldlist).ToList();

                        if (diflist.Count == 1)
                        {
                            ChangeAutoAddData(CommonManager.Instance.DB.EpgAutoAddList[diflist[0]], false);
                        }
                    }
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
            CommonManager.Instance.StatusNotifySet(ret, "キーワード予約を追加", this);
        }
Example #3
0
 protected override void mcs_CopyItem(object sender, ExecutedRoutedEventArgs e)
 {
     IsCommandExecuted = MenuUtil.AutoAddAdd(dataList);
 }
Example #4
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;
        }