public void UpdateAllService(IGuideData guideData) { Trace.WriteLineIf(trace.TraceInfo, "EPG.UpdateAllService()"); //if (guideData != null) //{ // IEnumTuneRequests ppEnumTuneRequests; // guideData.GetServices(out ppEnumTuneRequests); // if (ppEnumTuneRequests != null) // { // ITuneRequest[] tuneRequest = new ITuneRequest[1]; // //22 int fetched = 0; // //22 while (ppEnumTuneRequests.Next(1, tuneRequest, out fetched) == 0) // IntPtr p = Marshal.AllocCoTaskMem(4); // try // { // while (ppEnumTuneRequests.Next(1, tuneRequest, p) == 0) // { // Trace.WriteLineIf(trace.TraceVerbose, tuneRequest[0].ToString()); // UpdateService(tuneRequest[0], guideData); // Marshal.ReleaseComObject(tuneRequest[0]); // } // } // finally // { // Marshal.FreeCoTaskMem(p); // } // Marshal.ReleaseComObject(ppEnumTuneRequests); // tuneRequest = null; // } //} }
public DotaHelperData(IDotaHelperRepository <DotaHelperUser> users, IGuideData guides, IDotaHelperRepository <DotaHelperUserGuide> userguides, IUnitOfWork unitOfWork) { this.Users = users ?? throw new ArgumentException(nameof(users)); this.Guides = guides ?? throw new ArgumentException(nameof(guides)); this.unitOfWork = unitOfWork ?? throw new ArgumentException(nameof(unitOfWork)); this.UserGuides = userguides; }
public void UpdateAllProgram(IGuideData guideData) { Trace.WriteLineIf(trace.TraceInfo, "EPG.UpdateAllProgram()"); //if (guideData != null) //{ // IEnumVARIANT pEnumPrograms; // guideData.GetGuideProgramIDs(out pEnumPrograms); // //pEnumPrograms.Reset(); // if (pEnumPrograms != null) // { // object[] varProgramEntryId = new object[1]; // //unsafe // { // //22 int fetched = 0; // //22 IntPtr pFetched = new IntPtr(&fetched); //new IntPtr(fetched); // IntPtr.Zero; // new IntPtr(&fetched); // IntPtr p = Marshal.AllocCoTaskMem(4); // try // { // while (pEnumPrograms.Next(1, varProgramEntryId, p) == 0) // { // Trace.WriteLineIf(trace.TraceVerbose, varProgramEntryId[0].ToString()); // UpdateProgram((string)varProgramEntryId[0], guideData); // varProgramEntryId[0] = null; // } // } // finally // { // Marshal.FreeCoTaskMem(p); // } // } // pEnumPrograms = null; // } //} }
public GuidesController(IGuideData guideData) { _guideData = guideData; // реализуем интерфейс obj.constructionObj = _guideData.AllConstructionObjects; // получаем все сразу при запуске сервиса, а именно данные по объектам строительства obj.dataVersions = _guideData.AllDataVersions; //версиям данных obj.guides = _guideData.AllGuides; //всем справочникам obj.guideAtributes = _guideData.GuideAtributes; //всем атрибутам }
//public event EventHandler UpdateAsynchroneEnded; //public void UpdateAsynchrone(IGuideData guideData) //{ // Trace.WriteLineIf(trace.TraceInfo, "UpdateAsynchrone() threadid=" + Thread.CurrentThread.ManagedThreadId); // UpdateDelegate updateDelegate = new UpdateDelegate(this.Update); // updateDelegate.BeginInvoke(guideData, new AsyncCallback(UpdateAsynchroneFinished), updateDelegate); //} //private void UpdateAsynchroneFinished(IAsyncResult ar) //{ // Trace.WriteLineIf(trace.TraceInfo, "UpdateAsynchroneFinished() threadid=" + Thread.CurrentThread.ManagedThreadId); // UpdateDelegate caller = (UpdateDelegate)ar.AsyncState; // //caller.EndInvoke(ar); // if (UpdateAsynchroneEnded != null) // UpdateAsynchroneEnded(this, new EventArgs()); //} //private delegate void UpdateDelegate(IGuideData guideData); public void UpdateAll(IGuideData guideData) { Trace.WriteLineIf(trace.TraceInfo, "UpdateAll() threadid=" + Thread.CurrentThread.ManagedThreadId); UpdateAllService(guideData); UpdateAllProgram(guideData); UpdateAllSchedule(guideData); }
protected override void StartTask(int index) { base.StartTask(index); IGuideData data = ConfigReader.GetIGuideInfo(currentTask.GetTaskId()); IGuideTaskManager.Instance().SendTaskEffectShow((EGameEvent)data.EndTaskEvent); IGuideTaskManager.Instance().AddHasTriggerTask(data.TaskId); CGLCtrl_GameLogic.Instance.EmsgTocsAskFinishUIGuideTask(2, taskId, 0); }
public void OnEnter() { taskData = ConfigReader.GetIGuideInfo(taskId); if (iParent.GetIGuideTaskData().IsTriggerTask) { effect = new IGuideTriggerTaskEffect(iParent.GetIGuideTaskData( ), taskId); } else { effect = new IGuideTaskEffect(iParent.GetIGuideTaskData(), taskId); } EventCenter.AddListener <CEvent>((EGameEvent)taskData.EndTaskEvent, OnTrigger); IGuideTaskManager.Instance().SendTaskStart((EGameEvent)taskData.EndTaskEvent, (EGameEvent)taskData.StartTaskEvent); }
public void UpdateService(string serviceId, ITuningSpace tuningSpace, IGuideData guideData) { Trace.WriteLineIf(trace.TraceInfo, "EPG.UpdateService(" + serviceId + ")"); if (serviceId == null) { UpdateAllService(guideData); } else if (tuningSpace != null && NeedServiceUpdate(serviceId)) { // serviceId = "ONID:TSID:SID" string[] serviceIds = serviceId.Split(new char[] { ':' }); int onid = int.Parse(serviceIds[0]); int tsid = int.Parse(serviceIds[1]); int sid = int.Parse(serviceIds[2]); ITuneRequest tr; tuningSpace.CreateTuneRequest(out tr); IDVBTuneRequest tuneRequest = (IDVBTuneRequest)tr; tuneRequest.put_ONID(onid); tuneRequest.put_TSID(tsid); tuneRequest.put_SID(sid); UpdateService(tuneRequest, guideData); } }
public IGuideTaskEffect(IGuideManagerData parentData, int id) { pData = parentData; taskId = id; taskData = ConfigReader.GetIGuideInfo(taskId); }
public ReadIGuideTaskConfig(string xmlFilePath) { //TextAsset xmlfile = Resources.Load(xmlFilePath) as TextAsset; ResourceItem xmlfileUnit = ResourcesManager.Instance.loadImmediate(xmlFilePath, ResourceType.ASSET); TextAsset xmlfile = xmlfileUnit.Asset as TextAsset; if (!xmlfile) { Debug.LogError(" error infos: 没有找到指定的xml文件:" + xmlFilePath); } xmlDoc = new XmlDocument(); xmlDoc.LoadXml(xmlfile.text); XmlNodeList infoNodeList = xmlDoc.SelectSingleNode("UiTaskEvent").ChildNodes; for (int i = 0; i < infoNodeList.Count; i++)//(XmlNode xNode in infoNodeList) { if ((infoNodeList[i] as XmlElement).GetAttributeNode("id") == null) { continue; } string typeName = (infoNodeList[i] as XmlElement).GetAttributeNode("id").InnerText; IGuideData taskInfo = new IGuideData(); taskInfo.TaskId = Convert.ToInt32(typeName); foreach (XmlElement xEle in infoNodeList[i].ChildNodes) { #region 搜索 switch (xEle.Name) { case "startEvent": taskInfo.StartTaskEvent = Convert.ToInt32(xEle.InnerText); break; case "endEvent": taskInfo.EndTaskEvent = Convert.ToInt32(xEle.InnerText); break; case "textpath": taskInfo.TextPath = Convert.ToString(xEle.InnerText); break; case "textpos": taskInfo.TextPos = GameMethod.ResolveToVector3(Convert.ToString(xEle.InnerText), ';'); break; case "content": taskInfo.TextContent = GameMethod.ResolveToStrList(Convert.ToString(xEle.InnerText), ';'); break; case "shakepath": taskInfo.ShakePath = Convert.ToString(xEle.InnerText); break; case "shakepos": taskInfo.ShakePos = GameMethod.ResolveToVector3(Convert.ToString(xEle.InnerText), ';'); break; case "flashpath": taskInfo.FlashPath = Convert.ToString(xEle.InnerText); break; case "flashpos": taskInfo.FlashPos = GameMethod.ResolveToVector3(Convert.ToString(xEle.InnerText), ';'); break; case "destpos": taskInfo.FlashDstPos = GameMethod.ResolveToVector3(Convert.ToString(xEle.InnerText), ';'); break; case "isshield": taskInfo.IsMask = (Convert.ToInt32(xEle.InnerText) == 1) ? true : false; break; } #endregion } ConfigReader.iGuideDatalXmlInfoDict.Add(taskInfo.TaskId, taskInfo); } }
//ServiceChanged(object varProgramDescriptionID) //ProgramChanged(object varProgramDescriptionID) //ScheduleEntryChanged(object varProgramDescriptionID) public void UpdateProgram(string programmId, IGuideData guideData) { Trace.WriteLineIf(trace.TraceInfo, "EPG.UpdateProgram(" + programmId + ")"); //if (programmId == null) // UpdateAllProgram(guideData); //else //{ // if (guideData != null && NeedProgramUpdate(programmId)) // { // IEnumGuideDataProperties ppEnumProperties; // int hr = guideData.GetProgramProperties(programmId, out ppEnumProperties); // if (ppEnumProperties != null) // { // Hashtable hashtable = new Hashtable(); // IGuideDataProperty[] ppProp = new IGuideDataProperty[1]; // //while (ppEnumProperties.Next(1, out ppProp, out pcelt) == 0 && pcelt > 0) // //22 int pcelt = 1; // //22 while (ppEnumProperties.Next(1, ppProp, out pcelt) == 0 && pcelt > 0) // IntPtr p = Marshal.AllocCoTaskMem(4); // try // { // //x = Marshal.ReadInt32(p); // while (ppEnumProperties.Next(1, ppProp, p) == 0) // { // string name; // ppProp[0].get_Name(out name); // int language; // ppProp[0].get_Language(out language); // object value; // ppProp[0].get_Value(out value); // hashtable[name] = value; // Trace.WriteLineIf(trace.TraceVerbose, " name: '" + name + "', value: '" + value.ToString() + "', language: " + language); // Marshal.ReleaseComObject(ppProp[0]); // ppProp[0] = null; // } // } // finally // { // Marshal.FreeCoTaskMem(p); // } // // Character seems to be encoded in ISO/IEC 6937 // // http://en.wikipedia.org/wiki/ISO/IEC_6937 // //IGuideData.GetGuideProgramIDs() // //8442:6:1537:46 // // name: 'Description.ID', value: '8442:6:1537:46' // // name: 'Description.Title', value: 'Navarro' // // name: 'Description.One Sentence', value: '' // //8442:6:1537:47 // // name: 'Description.ID', value: '8442:6:1537:47' // // name: 'Description.Title', value: 'La méthode Cauet' // // name: 'Description.One Sentence', value: '' // object o = hashtable["Description.ID"]; // if (o != null) // { // EPGProgram program = (EPGProgram)programs[o]; // if (program == null) // { // program = new EPGProgram(); // program.ProgramId = (string)hashtable["Description.ID"]; // program.Title = (string)hashtable["Description.Title"]; // program.OneSentence = (string)hashtable["Description.One Sentence"]; // program.NeedProgramUpdate = false; // programs[program.ProgramId] = program; // } // } // ppEnumProperties = null; // } // } //} }
public void UpdateService(ITuneRequest tuneRequest, IGuideData guideData) { Trace.WriteLineIf(trace.TraceInfo, "EPG.UpdateService(" + tuneRequest.ToString() + ")"); //if (guideData != null) //{ // IEnumGuideDataProperties ppEnumProperties; // int hr = guideData.GetServiceProperties(tuneRequest, out ppEnumProperties); // if (ppEnumProperties != null) // { // Hashtable hashtable = new Hashtable(); // IGuideDataProperty[] ppProp = new IGuideDataProperty[1]; // //22 int pcelt = 1; // //22 while (ppEnumProperties.Next(1, ppProp, out pcelt) == 0 && pcelt > 0) // IntPtr p = Marshal.AllocCoTaskMem(4); // try // { // while (ppEnumProperties.Next(1, ppProp, p) == 0) // { // int language; // ppProp[0].get_Language(out language); // string name; // ppProp[0].get_Name(out name); // object value; // ppProp[0].get_Value(out value); // // name: 'Description.ID', value: '8442:6:1537' // // name: 'Description.Name', value: 'TF1' // // name: 'Provider.Name', value: '' // // name: 'Provider.NetworkName', value: 'Réseau Numérique Terrestre Français' // hashtable[name] = value; // Trace.WriteLineIf(trace.TraceVerbose, " name: '" + name + "', value: '" + value.ToString() + "', language: " + language); // Marshal.ReleaseComObject(ppProp[0]); // ppProp[0] = null; // } // } // finally // { // Marshal.FreeCoTaskMem(p); // } // EPGProvider provider = (EPGProvider)providers[hashtable["Provider.Name"]]; // if (provider == null) // { // provider = new EPGProvider(); // provider.Name = (string)hashtable["Provider.Name"]; // provider.NetworkName = (string)hashtable["Provider.NetworkName"]; // providers[provider.Name] = provider; // } // EPGService service = (EPGService)services[hashtable["Description.ID"]]; // if (service == null) // { // service = new EPGService(); // service.ServiceId = (string)hashtable["Description.ID"]; // services[service.ServiceId] = service; // } // service.Name = (string)hashtable["Description.Name"]; // service.ProviderName = provider.Name; // Marshal.ReleaseComObject(ppEnumProperties); // } //} }
public void UpdateAllSchedule(IGuideData guideData) { Trace.WriteLineIf(trace.TraceInfo, "EPG.UpdateAllSchedule()"); //if (guideData != null) //{ // IEnumVARIANT pEnumPrograms; // guideData.GetScheduleEntryIDs(out pEnumPrograms); // //pEnumPrograms.Reset(); // if (pEnumPrograms != null) // { // object[] varScheduleEntryDescriptionID = new object[1]; // //unsafe // { // //22 int fetched = 0; // //22 IntPtr pFetched = new IntPtr(&fetched); //new IntPtr(fetched); // IntPtr.Zero; // new IntPtr(&fetched); // //22 int hr = 0; // IntPtr p = Marshal.AllocCoTaskMem(4); // try // { // while (pEnumPrograms.Next(1, varScheduleEntryDescriptionID, p) == 0) // { // Trace.WriteLineIf(trace.TraceVerbose, varScheduleEntryDescriptionID[0].ToString()); // UpdateSchedule((string)varScheduleEntryDescriptionID[0], guideData); // varScheduleEntryDescriptionID[0] = null; // } // } // finally // { // Marshal.FreeCoTaskMem(p); // } // } // pEnumPrograms = null; // } //} }
public void UpdateSchedule(string programmId, IGuideData guideData) { Trace.WriteLineIf(trace.TraceInfo, "EPG.UpdateSchedule(" + programmId + ")"); //if (programmId == null) // UpdateAllSchedule(guideData); //else //{ // if (guideData != null && NeedScheduleUpdate(programmId)) // { // IEnumGuideDataProperties ppEnumProperties; // int hr = guideData.GetScheduleEntryProperties(programmId, out ppEnumProperties); // if (ppEnumProperties != null) // { // Hashtable hashtable = new Hashtable(); // IGuideDataProperty[] ppProp = new IGuideDataProperty[1]; // //22 int pcelt = 1; // //22 while (ppEnumProperties.Next(1, ppProp, out pcelt) == 0 && pcelt > 0) // IntPtr p = Marshal.AllocCoTaskMem(4); // try // { // while (ppEnumProperties.Next(1, ppProp, p) == 0) // { // int language; // ppProp[0].get_Language(out language); // string name; // ppProp[0].get_Name(out name); // object value; // ppProp[0].get_Value(out value); // hashtable[name] = value; // Trace.WriteLineIf(trace.TraceVerbose, " name: '" + name + "', value: '" + value.ToString() + "', language: " + language); // Marshal.ReleaseComObject(ppProp[0]); // ppProp[0] = null; // //ppProp = null; // } // } // finally // { // Marshal.FreeCoTaskMem(p); // } // //IGuideData.GetScheduleEntryIDs() // //8442:6:1537:46 // // name: 'Description.ID', value: '8442:6:1537:46' // // name: 'Time.Start', value: '830198865' // // name: 'Time.End', value: '830204878' // // name: 'ScheduleEntry.ProgramID', value: '8442:6:1537:46' // // name: 'ScheduleEntry.ServiceID', value: '8442:6:1537' // //8442:6:1537:47 // // name: 'Description.ID', value: '8442:6:1537:47' // // name: 'Time.Start', value: '830204878' // // name: 'Time.End', value: '830213733' // // name: 'ScheduleEntry.ProgramID', value: '8442:6:1537:47' // // name: 'ScheduleEntry.ServiceID', value: '8442:6:1537' // object o = hashtable["ScheduleEntry.ProgramID"]; // if (o != null) // { // EPGProgram program = (EPGProgram)programs[o]; // if (program == null) // { // program = new EPGProgram(); // program.ProgramId = (string)hashtable["ScheduleEntry.ProgramID"]; // programs[program.ProgramId] = program; // } // EPGService service = (EPGService)services[hashtable["ScheduleEntry.ServiceID"]]; // if (service == null) // { // service = new EPGService(); // service.ServiceId = (string)hashtable["ScheduleEntry.ServiceID"]; // services[service.ServiceId] = service; // } // program.TimeStart = GPSTimeToDateTime((int)hashtable["Time.Start"]); // program.TimeEnd = GPSTimeToDateTime((int)hashtable["Time.End"]); // program.ServiceId = service.ServiceId; // program.NeedScheduleUpdate = false; // service.Programs[program.ProgramId] = program; // //EPGProgram program = (EPGProgram)programs[o]; // //if (program == null) // //{ // // program = new EPGProgram(); // // program.ProgramId = (string)hashtable["ScheduleEntry.ProgramID"]; // // programs[program.ProgramId] = program; // //} // //EPGService service = (EPGService)services[hashtable["ScheduleEntry.ServiceID"]]; // //if (service == null) // //{ // // service = new EPGService(); // // service.ServiceId = (string)hashtable["ScheduleEntry.ServiceID"]; // // services[service.ServiceId] = service; // // service.Programs[program.ProgramId] = program; // //} // //program.TimeStart = GPSTimeToDateTime((int)hashtable["Time.Start"]); // //program.TimeEnd = GPSTimeToDateTime((int)hashtable["Time.End"]); // //program.ServiceId = service.ServiceId; // //program.NeedScheduleUpdate = false; // } // ppEnumProperties = null; // } // } //} }
public void UpdateService(string serviceId, ITuningSpace tuningSpace, IGuideData guideData) { Trace.WriteLineIf(trace.TraceInfo, "EPG.UpdateService(" + serviceId + ")"); if (serviceId == null) UpdateAllService(guideData); else if (tuningSpace != null && NeedServiceUpdate(serviceId)) { // serviceId = "ONID:TSID:SID" string[] serviceIds = serviceId.Split(new char[] { ':' }); int onid = int.Parse(serviceIds[0]); int tsid = int.Parse(serviceIds[1]); int sid = int.Parse(serviceIds[2]); ITuneRequest tr; tuningSpace.CreateTuneRequest(out tr); IDVBTuneRequest tuneRequest = (IDVBTuneRequest)tr; tuneRequest.put_ONID(onid); tuneRequest.put_TSID(tsid); tuneRequest.put_SID(sid); UpdateService(tuneRequest, guideData); } }