private void ReloadList() { ICollectionView dataView = CollectionViewSource.GetDefaultView(listView_log.DataContext); if (dataView != null) { dataView.SortDescriptions.Clear(); dataView.Refresh(); } listView_log.DataContext = null; logList.Clear(); foreach (NotifySrvInfo info in CommonManager.Instance.NotifyLogList) { NotifySrvInfoItem item = new NotifySrvInfoItem(); item.NotifyInfo = info; logList.Add(item); } listView_log.DataContext = logList; if (_lastHeaderClicked != null) { Sort(_lastHeaderClicked, _lastDirection); } else { string header = ((Binding)gridView_log.Columns[0].DisplayMemberBinding).Path.Path; Sort(header, _lastDirection); _lastHeaderClicked = header; } }
public void AddMessage(NotifySrvInfoItem item) { _events.Add(item); }
private bool ReloadList() { return lstCtrl.ReloadInfoData(dataList => { foreach (NotifySrvInfo info in CommonManager.Instance.NotifyLogList) { NotifySrvInfoItem item = new NotifySrvInfoItem(); item.NotifyInfo = info; dataList.Add(item); } return true; }); }
public void AddNotifySave(NotifySrvInfo notifyInfo) { if (Settings.Instance.AutoSaveNotifyLog == 1) { String filePath = SettingPath.ModulePath; filePath += "\\Log"; Directory.CreateDirectory(filePath); filePath += "\\EpgTimerNotify_" + DateTime.Now.ToString("yyyyMMdd") + ".txt"; StreamWriter file = new StreamWriter(filePath, true, System.Text.Encoding.GetEncoding("shift_jis")); NotifySrvInfoItem info = new NotifySrvInfoItem(); info.NotifyInfo = notifyInfo; file.Write(info.FileLogText); file.Close(); } }
private int OutsideCmdCallback(object pParam, CMD_STREAM pCmdParam, ref CMD_STREAM pResParam) { Trace.WriteLine((CtrlCmd)pCmdParam.uiParam); switch ((CtrlCmd)pCmdParam.uiParam) { case CtrlCmd.CMD_TIMER_GUI_SHOW_DLG: { pResParam.uiParam = (uint)ErrCode.CMD_SUCCESS; } break; case CtrlCmd.CMD_TIMER_GUI_UPDATE_RESERVE: { pResParam.uiParam = (uint)ErrCode.CMD_SUCCESS; CommonManager.Instance.DB.SetUpdateNotify((UInt32)UpdateNotifyItem.ReserveInfo); CommonManager.Instance.DB.SetUpdateNotify((UInt32)UpdateNotifyItem.RecInfo); CommonManager.Instance.DB.SetUpdateNotify((UInt32)UpdateNotifyItem.AutoAddEpgInfo); CommonManager.Instance.DB.SetUpdateNotify((UInt32)UpdateNotifyItem.AutoAddManualInfo); CommonManager.Instance.DB.ReloadReserveInfo(); SocketAction.SendAllMessage("UPDATED RESERVE"); } break; case CtrlCmd.CMD_TIMER_GUI_UPDATE_EPGDATA: { pResParam.uiParam = (uint)ErrCode.CMD_SUCCESS; CommonManager.Instance.DB.SetUpdateNotify((UInt32)UpdateNotifyItem.EpgData); CommonManager.Instance.DB.ReloadEpgData(); SocketAction.SendAllMessage("UPDATED EPG"); } break; case CtrlCmd.CMD_TIMER_GUI_VIEW_EXECUTE: { pResParam.uiParam = (uint)ErrCode.CMD_SUCCESS; String exeCmd = ""; CmdStreamUtil.ReadStreamData(ref exeCmd, pCmdParam); try { string[] cmd = exeCmd.Split('\"'); Process process; if (cmd.Length >= 3) { process = Process.Start(cmd[1], cmd[2]); } else if (cmd.Length >= 2) { process = Process.Start(cmd[1]); } else { process = Process.Start(cmd[0]); } CmdStreamUtil.CreateStreamData(process.Id, ref pResParam); } catch { } } break; case CtrlCmd.CMD_TIMER_GUI_QUERY_SUSPEND: { pResParam.uiParam = (uint)ErrCode.CMD_SUCCESS; } break; case CtrlCmd.CMD_TIMER_GUI_QUERY_REBOOT: { pResParam.uiParam = (uint)ErrCode.CMD_SUCCESS; } break; case CtrlCmd.CMD_TIMER_GUI_SRV_STATUS_CHG: { pResParam.uiParam = (uint)ErrCode.CMD_SUCCESS; UInt16 status = 0; CmdStreamUtil.ReadStreamData(ref status, pCmdParam); if (status == 1) //Rec { } else if (status == 2) //EPG { } else { } } break; case CtrlCmd.CMD_TIMER_GUI_SRV_STATUS_NOTIFY2: { pResParam.uiParam = (uint)ErrCode.CMD_SUCCESS; var Status = new NotifySrvInfo(); CmdStreamUtil.ReadStreamData(ref Status, pCmdParam); var Notify = new NotifySrvInfoItem(); Notify.NotifyInfo = Status; if (Notify.Title != "") { SocketAction.SendAllMessage("EVENT " + JsonUtil.Serialize(Notify, false)); //Console.WriteLine("\n" + (Notify.Title + Notify.LogText).Replace("\n", "")); EventStore.Instance.AddMessage(Notify); } NotifyStatus(Status); } break; default: pResParam.uiParam = (uint)ErrCode.CMD_NON_SUPPORT; break; } return 0; }