Exemplo n.º 1
0
        private void button_chg_epgAutoAdd_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                EpgAutoAddData addItem = new EpgAutoAddData();
                addItem.dataID = autoAddID;
                EpgSearchKeyInfo searchKey = new EpgSearchKeyInfo();
                searchKeyView.GetSearchKey(ref searchKey);

                RecSettingData recSetKey = new RecSettingData();
                recSettingView.GetRecSetting(ref recSetKey);

                addItem.searchInfo = searchKey;
                addItem.recSetting = recSetKey;

                List <EpgAutoAddData> addList = new List <EpgAutoAddData>();
                addList.Add(addItem);

                if (cmd.SendChgEpgAutoAdd(addList) != 1)
                {
                    MessageBox.Show("変更に失敗しました");
                }
                else
                {
                    CommonManager.Instance.DB.SetUpdateNotify((UInt32)UpdateNotifyItem.ReserveInfo);
                    CommonManager.Instance.DB.ReloadReserveInfo();
                    SearchPg();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
Exemplo n.º 2
0
 public static bool?OpenChangeEpgAutoAddDialog(EpgAutoAddData Data)
 {
     if (SearchWindow.ChangeDataLastUsedWindow(Data) != null)
     {
         return(true);
     }
     return(OpenEpgAutoAddDialog(Data, AutoAddMode.Change));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 自動登録情報をセットし、ウィンドウを変更モードにする
 /// </summary>
 public void SetChangeModeData(EpgAutoAddData item)
 {
     autoAddID = item.dataID;
     SetSearchDefKey(item.searchInfo);
     recSettingView.SetDefSetting(item.recSetting);
     Title = "EPG予約条件";
     button_chg_epgAutoAdd.Visibility = Visibility.Visible;
 }
Exemplo n.º 4
0
        public void SetAutoAddData(EpgAutoAddData data)
        {
            autoAddID = data.dataID;
            SetSearchKey(data.searchInfo);
            SetRecSetting(data.recSetting);

            //nekopanda版(8beae159)
            SetRecFileList(data.recFileList);
        }
Exemplo n.º 5
0
        public override AutoAddData GetData()
        {
            var data = new EpgAutoAddData();

            data.dataID     = (uint)dataID;
            data.searchInfo = GetSearchKey();
            data.recSetting = GetRecSetting();
            return(data);
        }
Exemplo n.º 6
0
        public EpgAutoAddData GetAutoAddData()
        {
            var data = new EpgAutoAddData();

            data.dataID     = autoAddID;
            data.searchInfo = GetSearchKey();
            data.recSetting = GetRecSetting();
            return(data);
        }
Exemplo n.º 7
0
 private static bool?OpenEpgAutoAddDialog(EpgAutoAddData Data, AutoAddMode mode)
 {
     try
     {
         new SearchWindow(Data, mode).Show();
         return(true);
     }
     catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
     return(null);
 }
Exemplo n.º 8
0
        public EpgAutoAddDataAppend GetEpgAutoAddDataAppend(EpgAutoAddData master)
        {
            if (master == null)
            {
                return(null);
            }

            //データ更新は必要になったときにまとめて行う
            var dict = epgAutoAddAppendList ?? new Dictionary <uint, EpgAutoAddDataAppend>();

            if (updateEpgAutoAddAppend == true)
            {
                List <EpgAutoAddData> srcList = EpgAutoAddList.Values.Where(data => dict.ContainsKey(data.dataID) == false).ToList();
                if (srcList.Count != 0 && Settings.Instance.NoEpgAutoAddAppend == false)
                {
                    List <EpgSearchKeyInfo> keyList = srcList.RecSearchKeyList().DeepClone();
                    keyList.ForEach(key => key.keyDisabledFlag = 0); //無効解除

                    var list_list = new List <List <EpgEventInfo> >();
                    try { CommonManager.CreateSrvCtrl().SendSearchPgByKey(keyList, ref list_list); }
                    catch { }

                    //通常あり得ないが、コマンド成功にもかかわらず何か問題があった場合は飛ばす
                    if (srcList.Count == list_list.Count)
                    {
                        int i = 0;
                        foreach (EpgAutoAddData item in srcList)
                        {
                            dict[item.dataID] = new EpgAutoAddDataAppend(list_list[i++]);
                        }
                    }
                }

                epgAutoAddAppendList              = dict;
                updateEpgAutoAddAppend            = false;
                updateEpgAutoAddAppendReserveInfo = true;//現時刻でのSearchList再作成も含む
            }

            //予約情報との突き合わせが古い場合
            if (updateEpgAutoAddAppendReserveInfo == true)
            {
                foreach (EpgAutoAddDataAppend item in dict.Values)
                {
                    item.UpdateCounts();
                }
                updateEpgAutoAddAppendReserveInfo = false;
            }

            //SendSearchPgByKeyに失敗した場合などは引っかかる。
            EpgAutoAddDataAppend retv;

            dict.TryGetValue(master.dataID, out retv);
            return(retv ?? new EpgAutoAddDataAppend());
        }
Exemplo n.º 9
0
        private static void CopyData(EpgAutoAddData src, EpgAutoAddData dest)
        {
            dest.addCount   = src.addCount;
            dest.dataID     = src.dataID;
            dest.recSetting = src.recSetting.Clone();       //RecSettingData
            dest.searchInfo = src.searchInfo.Clone();       //EpgSearchKeyInfo

            dest.recFileList = src.recFileList.ToList();    //List<RecFileBasicInfo>

            dest.reserveList = src.reserveList.ToList();    //List<ReserveBasicData>
        }
Exemplo n.º 10
0
        protected override bool SetData(EpgAutoAddData data)
        {
            if (data == null)
            {
                return(false);
            }

            dataID = data.dataID;
            SetSearchKey(data.searchInfo);
            SetRecSetting(data.recSetting);
            return(true);
        }
Exemplo n.º 11
0
        private void ChangeAutoAddData(EpgAutoAddData data, bool refresh = true)
        {
            this.SetViewMode(SearchMode.Change);
            this.SetAutoAddData(data);
            this.UpdateEpgAutoAddViewSelection();

            //EPG自動予約登録と、登録された予約、および録画済みファイルとの関連付けを実装
            this.SetRecFileList(data.recFileList);

            if (refresh == true)
            {
                UpdateInfo();
            }
        }
Exemplo n.º 12
0
 private static bool?OpenEpgAutoAddDialog(EpgAutoAddData Data, SearchWindow.SearchMode mode)
 {
     try
     {
         var dlg = new SearchWindow();
         dlg.SetViewMode(mode);
         if (Data != null)
         {
             dlg.SetAutoAddData(Data);
         }
         dlg.Show();
         return(true);
     }
     catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
     return(null);
 }
Exemplo n.º 13
0
        private void button_add_epgAutoAdd_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                EpgAutoAddData addItem = new EpgAutoAddData();
                addItem.searchInfo = searchKeyView.GetSearchKey();
                addItem.recSetting = recSettingView.GetRecSetting();

                List <EpgAutoAddData> addList = new List <EpgAutoAddData>();
                addList.Add(addItem);

                if (CommonManager.CreateSrvCtrl().SendAddEpgAutoAdd(addList) != ErrCode.CMD_SUCCESS)
                {
                    MessageBox.Show("追加に失敗しました");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
Exemplo n.º 14
0
        private void button_chg_epgAutoAdd_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                EpgAutoAddData addItem = new EpgAutoAddData();
                addItem.dataID     = autoAddID;
                addItem.searchInfo = searchKeyView.GetSearchKey();
                addItem.recSetting = recSettingView.GetRecSetting();

                List <EpgAutoAddData> addList = new List <EpgAutoAddData>();
                addList.Add(addItem);

                if (CommonManager.CreateSrvCtrl().SendChgEpgAutoAdd(addList) != ErrCode.CMD_SUCCESS)
                {
                    MessageBox.Show("変更に失敗しました");
                }
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Exemplo n.º 15
0
 public static bool?OpenChangeEpgAutoAddDialog(EpgAutoAddData Data)
 {
     return(OpenEpgAutoAddDialog(Data, SearchWindow.SearchMode.Change));
 }
Exemplo n.º 16
0
        public EpgAutoAddDataAppend GetEpgAutoAddDataAppend(EpgAutoAddData master)
        {
            if (master == null)
            {
                return(null);
            }

            //データ更新は必要になったときにまとめて行う
            var dict = epgAutoAddAppendList ?? new Dictionary <uint, EpgAutoAddDataAppend>();

            if (updateEpgAutoAddAppend == true)
            {
                List <EpgAutoAddData> srcList = epgAutoAddList.Values.Where(data => dict.ContainsKey(data.dataID) == false).ToList();
                if (srcList.Count != 0)
                {
                    List <EpgSearchKeyInfo> keyList = srcList.RecSearchKeyList().Clone();
                    keyList.ForEach(key => key.keyDisabledFlag = 0); //無効解除

                    try
                    {
                        var list_list = new List <List <EpgEventInfo> >();
                        cmd.SendSearchPgByKey(keyList, ref list_list);

                        //通常あり得ないが、コマンド成功にもかかわらず何か問題があった場合は飛ばす
                        if (srcList.Count == list_list.Count)
                        {
                            int i = 0;
                            foreach (EpgAutoAddData item in srcList)
                            {
                                dict.Add(item.dataID, new EpgAutoAddDataAppend(list_list[i++]));
                            }
                        }

                        epgAutoAddAppendList = dict;
                    }
                    catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
                }

                updateEpgAutoAddAppend            = false;
                updateEpgAutoAddAppendReserveInfo = true;//現時刻でのSearchList再作成も含む
            }

            //予約情報との突き合わせが古い場合
            if (updateEpgAutoAddAppendReserveInfo == true)
            {
                ReloadReserveInfo();//notify残ってれば更新
                foreach (EpgAutoAddDataAppend item in dict.Values)
                {
                    item.UpdateCounts();
                }
                updateEpgAutoAddAppendReserveInfo = false;
            }

            //SendSearchPgByKeyに失敗した場合などは引っかかる。
            EpgAutoAddDataAppend retv;

            if (dict.TryGetValue(master.dataID, out retv) == false)
            {
                retv = new EpgAutoAddDataAppend();
            }
            return(retv);
        }
Exemplo n.º 17
0
        private void button_chg_epgAutoAdd_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                EpgAutoAddData addItem = new EpgAutoAddData();
                addItem.dataID = autoAddID;
                EpgSearchKeyInfo searchKey = new EpgSearchKeyInfo();
                searchKeyView.GetSearchKey(ref searchKey);

                RecSettingData recSetKey = new RecSettingData();
                recSettingView.GetRecSetting(ref recSetKey);

                addItem.searchInfo = searchKey;
                addItem.recSetting = recSetKey;

                List<EpgAutoAddData> addList = new List<EpgAutoAddData>();
                addList.Add(addItem);

                if (cmd.SendChgEpgAutoAdd(addList) != 1)
                {
                    MessageBox.Show("変更に失敗しました");
                }
                else
                {
                    CommonManager.Instance.DB.SetUpdateNotify((UInt32)UpdateNotifyItem.ReserveInfo);
                    CommonManager.Instance.DB.ReloadReserveInfo();
                    SearchPg();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
Exemplo n.º 18
0
 private static void CopyData(EpgAutoAddData src, EpgAutoAddData dest)
 {
     dest.addCount = src.addCount;
     dest.dataID = src.dataID;
     dest.recSetting = src.recSetting.Clone();       //RecSettingData
     dest.searchInfo = src.searchInfo.Clone();       //EpgSearchKeyInfo
 }
Exemplo n.º 19
0
        public bool LoadEAAFile(String filePath)
        {
            bool ret = false;

            System.IO.StreamReader reader = null;
            try
            {
                reader = (new System.IO.StreamReader(filePath, System.Text.Encoding.Default));
                while (reader.Peek() >= 0)
                {
                    string buff = reader.ReadLine();
                    if (buff.IndexOf(";") == 0)
                    {
                        //コメント行
                    }
                    else
                    {
                        AddKey = new EpgAutoAddData();
                        EpgSearchKeyInfo searchKey = new EpgSearchKeyInfo();
                        RecSettingData   recSetKey = new RecSettingData();

                        string[] list = buff.Split('\t');
                        if (list.Length == 0)
                        {
                            continue;
                        }
                        try
                        {
                            searchKey.andKey        = list[0];
                            searchKey.notKey        = list[1];
                            searchKey.regExpFlag    = Convert.ToByte(list[2]);
                            searchKey.titleOnlyFlag = Convert.ToByte(list[3]);
                            //対象ジャンル
                            searchKey.contentList = new List <EpgContentData>();
                            string[] valBuff;
                            if (list[4].Length > 0)
                            {
                                valBuff = list[4].Split(',');
                                foreach (string val in valBuff)
                                {
                                    UInt32         content = Convert.ToUInt32(val);
                                    EpgContentData addItem = new EpgContentData();
                                    addItem.content_nibble_level_1 = (byte)((content & 0xFF000000) >> 24);
                                    addItem.content_nibble_level_2 = (byte)((content & 0x00FF0000) >> 16);
                                    addItem.user_nibble_1          = (byte)((content & 0x0000FF00) >> 8);
                                    addItem.user_nibble_2          = (byte)((content & 0x000000FF));

                                    searchKey.contentList.Add(addItem);
                                }
                            }
                            //対象期間
                            searchKey.dateList = new List <EpgSearchDateInfo>();
                            if (list[5].Length > 0)
                            {
                                valBuff = list[5].Split(',');
                                foreach (string val in valBuff)
                                {
                                    string[]          dateBuff = val.Split('-');
                                    EpgSearchDateInfo addItem  = new EpgSearchDateInfo();
                                    addItem.startDayOfWeek = Convert.ToByte(dateBuff[0]);
                                    UInt32 time = Convert.ToUInt32(dateBuff[1]);
                                    addItem.startHour    = (UInt16)((time & 0xFFFF0000) >> 16);
                                    addItem.startMin     = (UInt16)((time & 0x0000FFFF));
                                    addItem.endDayOfWeek = Convert.ToByte(dateBuff[2]);
                                    time            = Convert.ToUInt32(dateBuff[3]);
                                    addItem.endHour = (UInt16)((time & 0xFFFF0000) >> 16);
                                    addItem.endMin  = (UInt16)((time & 0x0000FFFF));

                                    searchKey.dateList.Add(addItem);
                                }
                            }
                            //対象サービス
                            searchKey.serviceList = new List <UInt64>();
                            if (list[6].Length > 0)
                            {
                                valBuff = list[6].Split(',');
                                foreach (string val in valBuff)
                                {
                                    UInt64 addItem = 0;
                                    addItem = Convert.ToUInt64(val, 16);

                                    searchKey.serviceList.Add(addItem);
                                }
                            }
                            searchKey.aimaiFlag = Convert.ToByte(list[7]);


                            Settings.GetDefRecSetting(0, ref recSetKey);

                            AddKey.searchInfo = searchKey;
                            AddKey.recSetting = recSetKey;

                            ret = true;
                        }
                        catch
                        {
                        }
                    }
                }
            }
            catch
            {
                AddKey = null;
            }
            if (reader != null)
            {
                reader.Close();
            }
            return(ret);
        }
Exemplo n.º 20
0
        public SearchWindow(EpgAutoAddData data = null, AutoAddMode mode = AutoAddMode.Find)
            : base(data, mode)
        {
            InitializeComponent();

            try
            {
                buttonID = "検索";
                base.SetParam(true, checkBox_windowPinned, checkBox_dataReplace);

                //スプリッタ位置設定。操作不可能な値をセットしないよう努める。
                if (Settings.Instance.SearchWndTabsHeight > grid_Tabs.Height.Value)
                {
                    grid_Tabs.Height = new GridLength(Math.Min(Settings.Instance.SearchWndTabsHeight, Height));
                }
                if (Settings.Instance.SearchWndJunreHeight >= 0)
                {
                    searchKeyView.grid_Junre.Height = new GridLength(Settings.Instance.SearchWndJunreHeight);
                }

                //リストビュー関連の設定
                var list_columns = Resources["ReserveItemViewColumns"] as GridViewColumnList;
                list_columns.AddRange(Resources["RecSettingViewColumns"] as GridViewColumnList);

                lstCtrl = new ListViewController <SearchItem>(this);
                lstCtrl.SetSavePath(CommonUtil.NameOf(() => Settings.Instance.SearchWndColumn)
                                    , CommonUtil.NameOf(() => Settings.Instance.SearchColumnHead)
                                    , CommonUtil.NameOf(() => Settings.Instance.SearchSortDirection));
                lstCtrl.SetViewSetting(listView_result, gridView_result, true, true, list_columns);
                lstCtrl.SetSelectedItemDoubleClick(EpgCmds.ShowDialog);

                //ステータス変更の設定
                lstCtrl.SetSelectionChangedEventHandler((sender, e) => this.UpdateStatus(1));

                //最初にコマンド集の初期化
                mc = new CmdExeSearch(this);
                mc.SetFuncGetSearchList(isAll => (isAll == true ? lstCtrl.dataList.ToList() : lstCtrl.GetSelectedItemsList()));
                mc.SetFuncSelectSingleSearchData((noChange) => lstCtrl.SelectSingleItem(noChange));
                mc.SetFuncReleaseSelectedData(() => listView_result.UnselectAll());
                mc.SetFuncGetRecSetting(() => recSettingView.GetRecSetting());
                mc.SetFuncGetSearchKey(() => searchKeyView.GetSearchKey());

                //コマンド集に無いもの
                mc.AddReplaceCommand(EpgCmds.ReSearch, mc_Research);
                mc.AddReplaceCommand(EpgCmds.ReSearch2, mc_Research);
                mc.AddReplaceCommand(EpgCmds.Search, button_search_Click);
                mc.AddReplaceCommand(EpgCmds.AddInDialog, autoadd_add);
                mc.AddReplaceCommand(EpgCmds.ChangeInDialog, autoadd_chg, (sender, e) => e.CanExecute   = winMode == AutoAddMode.Change);
                mc.AddReplaceCommand(EpgCmds.DeleteInDialog, autoadd_del1, (sender, e) => e.CanExecute  = winMode == AutoAddMode.Change);
                mc.AddReplaceCommand(EpgCmds.Delete2InDialog, autoadd_del2, (sender, e) => e.CanExecute = winMode == AutoAddMode.Change);
                mc.AddReplaceCommand(EpgCmds.BackItem, (sender, e) => MoveViewNextItem(-1));
                mc.AddReplaceCommand(EpgCmds.NextItem, (sender, e) => MoveViewNextItem(1));
                mc.AddReplaceCommand(EpgCmds.Cancel, (sender, e) => this.Close());
                mc.AddReplaceCommand(EpgCmds.ChgOnOffCheck, (sender, e) => lstCtrl.ChgOnOffFromCheckbox(e.Parameter, EpgCmds.ChgOnOff));

                //コマンド集を振り替えるもの
                mc.AddReplaceCommand(EpgCmds.JumpReserve, (sender, e) => mc_JumpTab(CtxmCode.ReserveView));
                mc.AddReplaceCommand(EpgCmds.JumpRecInfo, (sender, e) => mc_JumpTab(lstCtrl.SelectSingleItem(true).IsReserved ? CtxmCode.ReserveView : CtxmCode.RecInfoView));
                mc.AddReplaceCommand(EpgCmds.JumpTuner, (sender, e) => mc_JumpTab(CtxmCode.TunerReserveView));
                mc.AddReplaceCommand(EpgCmds.JumpTable, (sender, e) => mc_JumpTab(CtxmCode.EpgView));

                //コマンド集からコマンドを登録。
                mc.ResetCommandBindings(this, listView_result.ContextMenu);

                //コンテキストメニューを開く時の設定
                listView_result.ContextMenu.Opened += new RoutedEventHandler(mc.SupportContextMenuLoading);

                //ボタンの設定
                mBinds.View = CtxmCode.SearchWindow;
                mBinds.SetCommandToButton(button_search, EpgCmds.Search);
                mBinds.SetCommandToButton(button_add_reserve, EpgCmds.Add);
                mBinds.SetCommandToButton(button_delall_reserve, EpgCmds.DeleteAll);
                mBinds.SetCommandToButton(button_add_epgAutoAdd, EpgCmds.AddInDialog);
                mBinds.SetCommandToButton(button_chg_epgAutoAdd, EpgCmds.ChangeInDialog);
                mBinds.SetCommandToButton(button_del_epgAutoAdd, EpgCmds.DeleteInDialog);
                mBinds.SetCommandToButton(button_del2_epgAutoAdd, EpgCmds.Delete2InDialog);
                mBinds.SetCommandToButton(button_up_epgAutoAdd, EpgCmds.BackItem);
                mBinds.SetCommandToButton(button_down_epgAutoAdd, EpgCmds.NextItem);
                mBinds.SetCommandToButton(button_cancel, EpgCmds.Cancel);

                //メニューの作成、ショートカットの登録
                RefreshMenu();

                //予約ウィンドウからのリスト検索、ジャンプ関連の対応
                DataListView = new AutoAddWinListView(listView_result);
                this.grid_main.Children.Add(DataListView);

                //その他のショートカット(検索ダイアログ固有の設定)。コマンドだとコンボボックスアイテムの処理と協調しにくいので‥。
                //searchKeyView.InputBindings.Add(new InputBinding(EpgCmds.Search, new KeyGesture(Key.Enter)));
                searchKeyView.KeyUp += (sender, e) =>
                {
                    if (e.Handled == false && Keyboard.Modifiers == ModifierKeys.None && e.Key == Key.Enter && e.IsRepeat == false)
                    {
                        e.Handled = true;
                        button_search_Click(null, null);
                    }
                    ;
                };
                listView_result.PreviewKeyDown += (sender, e) => ViewUtil.OnKeyMoveNextReserve(sender, e, DataListView);

                //録画設定タブ関係の設定
                recSettingView.SelectedPresetChanged   += SetRecSettingTabHeader;
                recSettingTabHeader.MouseRightButtonUp += recSettingView.OpenPresetSelectMenuOnMouseEvent;

                //過去番組検索
                SetSearchPeriod();

                //ステータスバーの登録
                StatusManager.RegisterStatusbar(this.statusBar, this);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
        }
Exemplo n.º 21
0
 public static void CopyTo(this EpgAutoAddData src, EpgAutoAddData dest)
 {
     CopyObj.CopyTo(src, dest, CopyData);
 }
Exemplo n.º 22
0
        public EpgAutoAddDataAppend GetEpgAutoAddDataAppend(EpgAutoAddData master)
        {
            if (master == null) return null;

            //データ更新は必要になったときにまとめて行う
            //未使用か、EpgAutoAddData更新により古いデータ廃棄済みでデータが無い場合
            Dictionary<uint, EpgAutoAddDataAppend> dict = epgAutoAddAppendList;
            if (dict == null)
            {
                dict = new Dictionary<uint, EpgAutoAddDataAppend>();
                List<EpgAutoAddData> srcList = epgAutoAddList.Values.ToList();

                List<EpgSearchKeyInfo> keyList = srcList.RecSearchKeyList().Clone();
                keyList.ForEach(key => key.keyDisabledFlag = 0); //無効解除

                try
                {
                    var list_list = new List<List<EpgEventInfo>>();
                    cmd.SendSearchPgByKey(keyList, ref list_list);

                    //通常あり得ないが、コマンド成功にもかかわらず何か問題があった場合は飛ばす
                    if (srcList.Count == list_list.Count)
                    {
                        int i = 0;
                        foreach (EpgAutoAddData item in srcList)
                        {
                            dict.Add(item.dataID, new EpgAutoAddDataAppend(list_list[i++]));
                        }
                    }

                    epgAutoAddAppendList = dict;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
                }

                updateAutoAddAppendReserveInfo = true;
            }

            //予約情報との突き合わせが古い場合
            if (updateAutoAddAppendReserveInfo == true)
            {
                ReloadReserveInfo();//notify残ってれば更新
                foreach (EpgAutoAddDataAppend item in dict.Values) item.UpdateCounts();
                updateAutoAddAppendReserveInfo = false;
            }

            //SendSearchPgByKeyに失敗した場合などは引っかかる。
            EpgAutoAddDataAppend retv;
            if (dict.TryGetValue(master.dataID, out retv) == false)
            {
                retv = new EpgAutoAddDataAppend();
            }
            return retv;
        }
Exemplo n.º 23
0
        public bool LoadEAAFile(String filePath)
        {
            bool ret = false;
            System.IO.StreamReader reader = null;
            try
            {
                reader = (new System.IO.StreamReader(filePath, System.Text.Encoding.Default));
                while (reader.Peek() >= 0)
                {
                    string buff = reader.ReadLine();
                    if (buff.IndexOf(";") == 0)
                    {
                        //コメント行
                    }
                    else
                    {
                        AddKey = new EpgAutoAddData();
                        EpgSearchKeyInfo searchKey = new EpgSearchKeyInfo();
                        RecSettingData recSetKey = new RecSettingData();

                        string[] list = buff.Split('\t');
                        if (list.Length == 0)
                        {
                            continue;
                        }
                        try
                        {
                            searchKey.andKey = list[0];
                            searchKey.notKey = list[1];
                            searchKey.regExpFlag = Convert.ToByte(list[2]);
                            searchKey.titleOnlyFlag = Convert.ToByte(list[3]);
                            //対象ジャンル
                            searchKey.contentList = new List<EpgContentData>();
                            string[] valBuff;
                            if (list[4].Length > 0)
                            {
                                valBuff = list[4].Split(',');
                                foreach (string val in valBuff)
                                {
                                    UInt32 content = Convert.ToUInt32(val);
                                    EpgContentData addItem = new EpgContentData();
                                    addItem.content_nibble_level_1 = (byte)((content & 0xFF000000) >> 24);
                                    addItem.content_nibble_level_2 = (byte)((content & 0x00FF0000) >> 16);
                                    addItem.user_nibble_1 = (byte)((content & 0x0000FF00) >> 8);
                                    addItem.user_nibble_2 = (byte)((content & 0x000000FF));

                                    searchKey.contentList.Add(addItem);
                                }
                            }
                            //対象期間
                            searchKey.dateList = new List<EpgSearchDateInfo>();
                            if (list[5].Length > 0)
                            {
                                valBuff = list[5].Split(',');
                                foreach (string val in valBuff)
                                {
                                    string[] dateBuff = val.Split('-');
                                    EpgSearchDateInfo addItem = new EpgSearchDateInfo();
                                    addItem.startDayOfWeek = Convert.ToByte(dateBuff[0]);
                                    UInt32 time = Convert.ToUInt32(dateBuff[1]);
                                    addItem.startHour = (UInt16)((time & 0xFFFF0000) >> 16);
                                    addItem.startMin = (UInt16)((time & 0x0000FFFF));
                                    addItem.endDayOfWeek = Convert.ToByte(dateBuff[2]);
                                    time = Convert.ToUInt32(dateBuff[3]);
                                    addItem.endHour = (UInt16)((time & 0xFFFF0000) >> 16);
                                    addItem.endMin = (UInt16)((time & 0x0000FFFF));

                                    searchKey.dateList.Add(addItem);
                                }
                            }
                            //対象サービス
                            searchKey.serviceList = new List<long>();
                            if (list[6].Length > 0)
                            {
                                valBuff = list[6].Split(',');
                                foreach (string val in valBuff)
                                {
                                    Int64 addItem = 0;
                                    addItem = Convert.ToInt64(val, 16);

                                    searchKey.serviceList.Add(addItem);
                                }
                            }
                            searchKey.aimaiFlag = Convert.ToByte(list[7]);

                            Settings.GetDefRecSetting(0, ref recSetKey);

                            AddKey.searchInfo = searchKey;
                            AddKey.recSetting = recSetKey;

                            ret = true;
                        }
                        catch
                        {
                        }
                    }
                }
            }
            catch
            {
                AddKey = null;
            }
            if( reader != null ){
                reader.Close();
            }
            return ret;
        }
Exemplo n.º 24
0
 public EpgAutoDataItem(EpgAutoAddData item)
 {
     this.EpgAutoAddInfo = item;
 }
Exemplo n.º 25
0
 public EpgAutoDataItem(EpgAutoAddData item)
 {
     this.EpgAutoAddInfo = item;
 }
Exemplo n.º 26
0
 public static EpgAutoAddData Clone(this EpgAutoAddData src)
 {
     return(CopyObj.Clone(src, CopyData));
 }
Exemplo n.º 27
0
 public static void CopyTo(this EpgAutoAddData src, EpgAutoAddData dest)
 {
     CopyObj.CopyTo(src, dest, CopyData);
 }