示例#1
0
        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);
                    }
                }
            }
        }
示例#2
0
        public void InstallApp(IntPtr device, string[] apps)
        {
            IOSInstallArg temp = new IOSInstallArg();

            temp.device = device;
            temp.apps   = apps;
            new Thread(new ParameterizedThreadStart(_InstallApp)).Start(temp);
        }