Beispiel #1
0
 void xd_OnReceiveSubscribrDevChargeStatus(SubscribeDevChargeStatusRet obj)
 {
     if (InvokeRequired)
     {
         this.Invoke(new Action <SubscribeDevChargeStatusRet>(xd_OnReceiveSubscribrDevChargeStatus), obj);
     }
     else
     {
         listBox1.Items.Add("xd_OnReceiveSubscribrDevChargeStatus retFlag:" + obj.retFlag + System.Environment.NewLine);
     }
 }
Beispiel #2
0
        private void OnReceiveData_SubscribrDevChargeStatus(byte[] body)
        {
            IntPtr pdata = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SubscribeDevChargeStatusRet)));

            Marshal.Copy(body, 0, pdata, Marshal.SizeOf(typeof(SubscribeDevChargeStatusRet)));
            SubscribeDevChargeStatusRet msg = (SubscribeDevChargeStatusRet)Marshal.PtrToStructure(pdata, typeof(SubscribeDevChargeStatusRet));

            if (OnReceiveSubscribrDevChargeStatus != null)
            {
                OnReceiveSubscribrDevChargeStatus(msg);
            }
        }