public void ReceiveEvent(SEventElement evt, Int16 clientNo) { EventFunctor fac = new EventFunctor(evt, this); //fac.fireEvent(); System.Threading.Thread thread = new System.Threading.Thread(fac.fireEvent); thread.Name = "Event thread"; thread.Start(); }
public void PublishEvent(SEventElement evt, Int16 ClientNo) { if (_SessionList == null) { return; } for (int i = 0; i < _SessionList.Count; i++) { _SessionList[i].ReceiveEvent(evt, ClientNo); } }
public Int32 HNC_EventPut(SEventElement ev) { Int32 ret = -1; IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SEventElement))); Marshal.StructureToPtr(ev, ptr, true); ret = HncApi.HNC_EventPut(ptr, _ClientNo); Marshal.FreeHGlobal(ptr); return(ret); }
public void EventFunc(SEventElement evt, Int16 clientNo) { try { if (EventAvailable != null) { EventAvailable(evt, clientNo); } } catch (Exception ex) { Console.WriteLine("EventAvailable:" + ex.Message); } }
private void EventCollectFunc() { Int32 ret = 0; Int16 clientNo = -1; SEventElement ev = new SEventElement(); while (_eventThreadStart) { ret = HncApi.HNC_EventGetSysEv(ref ev); if (ret != 0) { continue; } short[] info = new short[2]; Buffer.BlockCopy(ev.buf, 0, info, 0, info.Length); clientNo = info[0]; SessionManager.Instance().PublishEvent(ev, clientNo); } }
public EventFunctor(SEventElement e, Machine mac) { _e = e; _mac = mac; }