Beispiel #1
0
        ///
        /// <summary>
        /// Starts a single upload.
        /// </summary>
        /// <param name="strTarget">Target IP address</param>
        private void uploadSingle(string strTarget)
        {
            if (this.dicActiveUploads.ContainsKey(strTarget) == false) //Checks to see if target is currently being uploaded
            {
                TargetSettings targetInfo = null;

                foreach (TargetSettings ti in this.lstTargets)  //Searches for matching target in the list
                {
                    if (ti.TargetServer == strTarget)
                    {
                        targetInfo = ti;
                        break;
                    }
                }
                CheckConnection cc = new CheckConnection(targetInfo);

                if (cc.testAll() == true)
                {
                    TargetUpload tu = new TargetUpload(this.pSettings, targetInfo, this.tabInt);
                    tu.ProcessExit     += processExitEvent;   //Subscribes to Process exit event
                    tu.ProcessComplete += processCompleteEvent;
                    this.dicActiveUploads.Add(strTarget, tu);
                    Thread uploadThread = new Thread(tu.startProcess); //Creates Thread
                    uploadThread.IsBackground = true;                  //The Thread/Process ends when the _Main Thread ends
                    uploadThread.Name         = strTarget;             //Sets name of Thread
                    uploadThread.Start();                              //Starts Thread
                    this.lstThreads.Add(uploadThread);                 //Adds Thread to list
                }
                else
                {
                    tabInt.OnConnectionFail(pSettings.ProjectName, targetInfo.TargetServer, "Connection Failed");
                }
            }
        }
Beispiel #2
0
 ///
 /// <summary>
 /// Creates and starts a Thread for each Target Address.
 /// </summary>
 private void uploadAll()
 {
     try
     {
         foreach (TargetSettings ts in lstTargets)
         {
             if (lstStopped.Contains(ts.TargetServer) != true)
             {
                 if (dicActiveUploads.ContainsKey(ts.TargetServer) == false)
                 {
                     CheckConnection cc = new CheckConnection(ts);
                     if (cc.testAll() == true)
                     {
                         TargetUpload tu = new TargetUpload(this.pSettings, ts, this.tabInt);         //New target upload
                         tu.ProcessExit     += new TargetUpload.ProcessExitHandler(processExitEvent); //Subscribes to Process exit event
                         tu.ProcessComplete += new TargetUpload.ProcessCompleteHandler(processCompleteEvent);
                         dicActiveUploads.Add(ts.TargetServer, tu);
                         Thread uploadThread = new Thread(tu.startProcess); //Creates Thread
                         uploadThread.IsBackground = true;                  //The Thread/Process ends when the _Main Thread ends
                         uploadThread.Name         = ts.TargetServer;       //Sets name of Thread
                         uploadThread.Start();                              //Starts Thread
                         lstThreads.Add(uploadThread);                      //Adds Thread to list
                     }
                     else
                     {
                         tabInt.OnConnectionFail(pSettings.ProjectName, ts.TargetServer, "Connection Failed");
                     }
                 }
             }
             else
             {
                 tabInt.OnConnectionFail(pSettings.ProjectName, ts.TargetServer, "Please Wait");
             }
         }
     }
     catch
     {
     }
 }
        /// 
        /// <summary>
        /// Starts a single upload.  
        /// </summary>
        /// <param name="strTarget">Target IP address</param>
        private void uploadSingle(string strTarget)
        {
            if(this.dicActiveUploads.ContainsKey(strTarget) == false) //Checks to see if target is currently being uploaded
              {
            TargetSettings targetInfo = null;

            foreach(TargetSettings ti in this.lstTargets)           //Searches for matching target in the list
            {
              if(ti.TargetServer == strTarget)
              {
            targetInfo = ti;
            break;
              }
            }
            CheckConnection cc = new CheckConnection(targetInfo);

            if(cc.testAll() == true)
            {
              TargetUpload tu = new TargetUpload(this.pSettings, targetInfo, this.tabInt);
              tu.ProcessExit += processExitEvent;                 //Subscribes to Process exit event
              tu.ProcessComplete += processCompleteEvent;
              this.dicActiveUploads.Add(strTarget, tu);
              Thread uploadThread = new Thread(tu.startProcess);  //Creates Thread
              uploadThread.IsBackground = true;                   //The Thread/Process ends when the _Main Thread ends
              uploadThread.Name = strTarget;                      //Sets name of Thread
              uploadThread.Start();                               //Starts Thread
              this.lstThreads.Add(uploadThread);                  //Adds Thread to list
            }
            else
            {
              tabInt.OnConnectionFail(pSettings.ProjectName, targetInfo.TargetServer, "Connection Failed");
            }
              }
        }
 /// 
 /// <summary>
 /// Creates and starts a Thread for each Target Address.
 /// </summary>
 private void uploadAll()
 {
     try
       {
     foreach(TargetSettings ts in lstTargets)
     {
       if(lstStopped.Contains(ts.TargetServer) != true)
       {
     if(dicActiveUploads.ContainsKey(ts.TargetServer) == false)
     {
       CheckConnection cc = new CheckConnection(ts);
       if(cc.testAll() == true)
       {
         TargetUpload tu = new TargetUpload(this.pSettings, ts, this.tabInt); //New target upload
         tu.ProcessExit += new TargetUpload.ProcessExitHandler(processExitEvent);                     //Subscribes to Process exit event
         tu.ProcessComplete += new TargetUpload.ProcessCompleteHandler(processCompleteEvent);
         dicActiveUploads.Add(ts.TargetServer, tu);
         Thread uploadThread = new Thread(tu.startProcess);      //Creates Thread
         uploadThread.IsBackground = true;                       //The Thread/Process ends when the _Main Thread ends
         uploadThread.Name = ts.TargetServer;                    //Sets name of Thread
         uploadThread.Start();                                   //Starts Thread
         lstThreads.Add(uploadThread);                           //Adds Thread to list
       }
       else
       {
         tabInt.OnConnectionFail(pSettings.ProjectName, ts.TargetServer, "Connection Failed");
       }
     }
       }
       else
       {
     tabInt.OnConnectionFail(pSettings.ProjectName, ts.TargetServer, "Please Wait");
       }
     }
       }
       catch
       {
       }
 }