/// /// <summary> /// Signals a single process or all processes to be stopped. /// </summary> /// <param name="e">The target IP that has been stopped</param> public void processStopEvent(ProcessEventArgs e) { if (e.strTarget == "") //If "", all have been stopped { _stopAll = true; } else { if (_lstStopList.Contains(e.strTarget) != true) { _lstStopList.Add(e.strTarget); } } }
/// /// <summary> /// Called whenever a process wput process terminates. /// Removes the object and Thread from their respective lists. /// </summary> /// <param name="strTarget">Target IP address</param> private void processExitEvent(object sender, ProcessEventArgs e) { Thread.Sleep(1000); //Pauses the method for 1 second. Without it, processCompleteEvent would not have time to add to lstCompleted if(killAll == false) { if(this.dicActiveUploads.ContainsKey(e.strTarget) == true) { dicActiveUploads.Remove(e.strTarget); } } foreach(Thread thread in lstThreads) //Removes finished Thread from list { if(thread.Name == e.strTarget) { lstThreads.Remove(thread); break; } } if((pSettings.InstallUpdate == true) && lstCompleted.Contains(e.strTarget)) { launchInstallation(e.strTarget); //Call event to begin installation } if(lstStopped.Contains(e.strTarget) == true) { lstStopped.Remove(e.strTarget); tabInt.OnConnectionFail(pSettings.ProjectName, e.strTarget, "Stopped"); } }
/// /// <summary> /// Called whenever a process has completed it's upload. /// Then IP address is added to the completed list /// </summary> /// <param name="strTarget">Target IP address</param> /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void processCompleteEvent(object sender, ProcessEventArgs e) { if(lstCompleted.Contains(e.strTarget) == false) { lstCompleted.Add(e.strTarget); } }
/// /// <summary> /// Signals a single process or all processes to be stopped. /// </summary> /// <param name="e">The target IP that has been stopped</param> public void processStopEvent(ProcessEventArgs e) { if(e.strTarget == "") //If "", all have been stopped { _stopAll = true; } else { if(_lstStopList.Contains(e.strTarget) != true) { _lstStopList.Add(e.strTarget); } } }