private static void NotifyCallback(ref AMDeviceNotificationCallbackInfo callback)
        {
            if (callback.msg == NotificationMessage.Connected)
            {
                MobileDeviceInstance Inst;
                if (ConnectedDevices.TryGetValue(callback.dev, out Inst))
                {
                    // Already connected, not sure why we got another message...
                }
                else
                {
                    Inst = new MobileDeviceInstance(callback.dev);
                    ConnectedDevices.Add(callback.dev, Inst);
                }

                if (Inst.ConnectToPhone())
                {
                    OnConnect(new ConnectEventArgs(callback));
                }
            }
            else if (callback.msg == NotificationMessage.Disconnected)
            {
                MobileDeviceInstance Inst;
                if (ConnectedDevices.TryGetValue(callback.dev, out Inst))
                {
                    Inst.connected = false;
                    OnDisconnect(new ConnectEventArgs(callback));
                    ConnectedDevices.Remove(callback.dev);
                }
            }
        }
예제 #2
0
 private unsafe void NotifyCallback(ref AMDeviceNotificationCallbackInfo callback)
 {
     if (callback.msg == NotificationMessage.Connected)
     {
         this.iPhoneHandle = callback.dev;
         if (this.ConnectToPhone())
         {
             this.OnConnect(new ConnectEventArgs(callback));
         }
     }
     else if (callback.msg == NotificationMessage.Disconnected)
     {
         this.connected = false;
         this.OnDisconnect(new ConnectEventArgs(callback));
     }
 }
예제 #3
0
        private static void NotifyCallback(ref AMDeviceNotificationCallbackInfo callback)
        {
            if (callback.msg == NotificationMessage.Connected)
            {
                MobileDeviceInstance Inst;
                if (ConnectedDevices.TryGetValue(callback.dev, out Inst))
                {
                    // Already connected, not sure why we got another message...
                }
                else
                {
                    Inst = new MobileDeviceInstance(callback.dev);
                    ConnectedDevices.Add(callback.dev, Inst);
                }

                if (Inst.ConnectToPhone())
                {
                    OnConnect(new ConnectEventArgs(callback));
                }
            }
            else if (callback.msg == NotificationMessage.Disconnected)
            {
                MobileDeviceInstance Inst;
                if (ConnectedDevices.TryGetValue(callback.dev, out Inst))
                {
                    Inst.connected = false;
                    OnDisconnect(new ConnectEventArgs(callback));
                    ConnectedDevices.Remove(callback.dev);
                }
            }
        }
예제 #4
0
 private unsafe void NotifyCallback(ref AMDeviceNotificationCallbackInfo callback)
 {
     if (callback.msg == NotificationMessage.Connected)
     {
         this.iPhoneHandle = callback.dev;
         if (this.ConnectToPhone())
         {
             this.OnConnect(new ConnectEventArgs(callback));
         }
     }
     else if (callback.msg == NotificationMessage.Disconnected)
     {
         this.connected = false;
         this.OnDisconnect(new ConnectEventArgs(callback));
     }
 }
예제 #5
0
 internal unsafe ConnectEventArgs(AMDeviceNotificationCallbackInfo cbi)
 {
     this.message = cbi.msg;
     this.device = cbi.dev;
 }
예제 #6
0
 internal ConnectEventArgs(AMDeviceNotificationCallbackInfo cbi)
 {
     message = cbi.msg;
     device  = cbi.dev;
 }
예제 #7
0
		internal ConnectEventArgs(AMDeviceNotificationCallbackInfo cbi)
        {
			message = cbi.msg;
			device = cbi.dev;
		}
예제 #8
0
 internal unsafe ConnectEventArgs(AMDeviceNotificationCallbackInfo cbi)
 {
     this.message = cbi.msg;
     this.device  = cbi.dev;
 }