コード例 #1
0
 public void addPad(PadInfo padInfo)
 {
     lock (mAddQueue)
     {
         mAddQueue.Enqueue(padInfo);
         Monitor.Pulse(mAddQueue);
     }
 }
コード例 #2
0
 public void connectPad(PadInfo info)
 {
     if (mWorking)
         return;
     mPadInfo = info;
     Thread workThread = new Thread(new ThreadStart(startConnectPad));
     workThread.Start();
     mWorking = true;
 }
コード例 #3
0
 public void onDeviceAdded(PadInfo info)
 {
     ToolStripMenuItem deviceMenuItem = new ToolStripMenuItem();
     deviceMenuItem.DisplayStyle = ToolStripItemDisplayStyle.Text;
     deviceMenuItem.Size = new Size(50, 22);
     deviceMenuItem.Text = info.DeviceName;
     Console.WriteLine("add " + info.DeviceName);
     deviceMenuItem.Click += new EventHandler(onDeviceToolStripMenuItemClick);
     while (!mContextMenuStrip.IsHandleCreated) ;
     mContextMenuStrip.BeginInvoke(new AddDeviceItemDelegate(addDeviceItem), new object[] { info.DeviceId, deviceMenuItem });
 }
コード例 #4
0
 public void onDeviceRemoved(PadInfo info)
 {
     Log.v("invoke remove delegate:" + info.DeviceId);
     try
     {
         while (!mContextMenuStrip.IsHandleCreated) ;
         mContextMenuStrip.BeginInvoke(new RemoveDeviceItemDelegate(removeDeviceItem), new object[]{info.DeviceId});
     }
     catch (Exception e)
     {
         Log.v(e.Message);
     }
 }
コード例 #5
0
 private PadInfo makePadInfo(BroadcastMsg msg, IPAddress address)
 {
     PadInfo info = new PadInfo(msg.DeviceId, msg.DeviceName, address, msg.Port);
     return info;
 }