Esempio n. 1
0
 private void _InstallApp(object argv)
 {
     try
     {
         InstallAppArg temp = (InstallAppArg)argv;
         FileInfo      f    = new FileInfo(temp.app);
         string        aid  = f.Name;
         aid = aid.Substring(0, aid.IndexOf("."));
         bool ret = adbHelper.InstallApp(temp.device.DeivceId, temp.app);
         if (OnInstallAppComplete != null)
         {
             Control target = OnInstallAppComplete.Target as Control;
             if (target != null)
             {
                 lock (this)
                 {
                     target.Invoke(OnInstallAppComplete, new object[] { temp, aid, ret });
                 }
             }
             else
             {
                 OnInstallAppComplete(temp, aid, ret);
             }
         }
     }
     catch { }
 }
Esempio n. 2
0
        public void InstallApp(AndoridDevice device, string app)
        {
            InstallAppArg temp = new InstallAppArg();

            temp.device = device;
            temp.app    = app;
            new Thread(new ParameterizedThreadStart(_InstallApp)).Start(temp);
        }
Esempio n. 3
0
 void Devices_OnInstallAppComplete(InstallAppArg installAppArg, string aid, bool success)
 {
     if (installAppArg.device.DeivceId == andoridDevice.DeivceId)
     {
         progressBar1.Value++;
         if (success)
         {
             API.Install(uid, username, aid, andoridDevice.DeivceId);
             successCount++;
         }
         else
         {
             noSuccessCount++;
         }
         if (progressBar1.Value == progressBar1.Maximum)
         {
             imageButton1.Enabled = true;
             label2.Text          = string.Format("共安装{0}个应用,成功{1}个,失败{2}个.", successCount + noSuccessCount, successCount, noSuccessCount);
             successCount         = 0;
             noSuccessCount       = 0;
             player.Play();
         }
     }
 }