コード例 #1
0
            public static void DoWork()
            {
                int i;
                MagCard_Activity obj = new MagCard_Activity();

                while (runflag)
                {
                    Message msg = new Message();
                    msg = hand.ObtainMessage();
                    //  Message msg = Handler...obtainMessage();
                    if (!runflag)
                    {
                        break;
                    }
                    // Log.d(TAG, "Magcard ------> Thread");

                    if ((i = obj.MgcardAPI.Read(obj.MagcardNo)) > 0)
                    {
                        // Log.d(TAG, "Send The Message to the ReadHandler");
                        hand.SendMessage(msg);
                    }
                    else
                    {
                        //Log.d(TAG, "Read error =========");
                        // System.out.println(i);
                        // Log.d(TAG, "Read error =========");
                    }
                }
            }
コード例 #2
0
            public override void HandleMessage(Message message)
            {
                MagCard_Activity obj = new MagCard_Activity();
                string           aux;

                obj.MgcardAPI.Beep();
                aux = "track1:" + obj.MagcardNo[0] + "\n" + "track2:" + obj.MagcardNo[1] + "\n" + "track3:" + obj.MagcardNo[2];
                obj.MgText.SetText(aux.ToCharArray(), 0, aux.ToCharArray().Length);
            }