private void _InstallApp(object argv) { int ret = 0; IOSInstallArg arg = (IOSInstallArg)argv; foreach (string i in arg.apps) { FileInfo f = new FileInfo(i); string aid = f.Name; aid = aid.Substring(0, aid.IndexOf(".")); try { ret = AMDeviceManger.InstallApp(arg.device, i); } catch { } if (OnInstallAppComplete != null) { Control target = OnInstallAppComplete.Target as Control; if (target != null && arg.device != null) { lock (target) { target.Invoke(OnInstallAppComplete, new object[] { arg.device, aid, ret == 0 ? true : false }); } } else { OnInstallAppComplete(arg.device, aid, ret == 0 ? true : false); } } } }
public bool StatrListenDeviceChange() { bool ret = false; try { ret = AMDeviceManger.StartListen(haveDeviceChange); } catch { } return(ret); }
void HaveDeviceChange(ref AbListenCbk info) { if (info.Status == IOSDeviceStatus.Connected) { try { bool bo = true; foreach (IOSDevice i in devices) { if (i.Device == info.device) { bo = false; } } if (bo) { string typeid = AMDeviceManger.getIOSName(Marshal.PtrToStringAnsi(AMDeviceManger.GetDeivceType(info.device))); string uuid = Marshal.PtrToStringAnsi(AMDeviceManger.GetDeivceUUID(info.device)); devices.Add(new IOSDevice(info.device, typeid, uuid)); } } catch { } } else { try { foreach (IOSDevice i in devices) { if (i.Device == info.device) { devices.Remove(i); break; } } } catch { } } if (OnIOSDeviceChangeComplete != null) { Control target = OnIOSDeviceChangeComplete.Target as Control; if (target != null) { target.Invoke(OnIOSDeviceChangeComplete, new object[] { devices.ToArray() }); } else { OnIOSDeviceChangeComplete(devices.ToArray()); } } }