Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 public void PublishEvent(SEventElement evt, Int16 ClientNo)
 {
     if (_SessionList == null)
     {
         return;
     }
     for (int i = 0; i < _SessionList.Count; i++)
     {
         _SessionList[i].ReceiveEvent(evt, ClientNo);
     }
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public void EventFunc(SEventElement evt, Int16 clientNo)
 {
     try
     {
         if (EventAvailable != null)
         {
             EventAvailable(evt, clientNo);
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("EventAvailable:" + ex.Message);
     }
 }
Exemplo n.º 5
0
        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);
            }
        }
Exemplo n.º 6
0
 public EventFunctor(SEventElement e, Machine mac)
 {
     _e   = e;
     _mac = mac;
 }