private void Worker_GetPhotoSearchResult(object sender, DoWorkEventArgs e) { SearchPersonByPhotoParams jobParams = (SearchPersonByPhotoParams)e.Argument; //JobParams jobParams = (JobParams)e.Argument; //this.getProxy().GetDataDuplex(this.personPhotoArray, // this.personPhotoExt, // this.sex.Id, // jobParams.Years, // this.nationality, // Environment.MachineName, // jobParams.IsSupressed); this.getProxy().SearchPersonByPhoto(jobParams); }
private void startJob(bool isSupressed = false) { this.IsJobRunning = true; int yearStartInt = Convert.ToInt16(this.yearStart); int yearEndInt = Convert.ToInt16(this.yearEnd); if (yearEndInt < yearStartInt) { yearEndInt = yearStartInt; this.YearEnd = this.yearStart; } StringBuilder sb = new StringBuilder(); for (int i = yearStartInt; i <= yearEndInt; i++) { sb.Append(i.ToString()).Append(" "); } //JobParams jobParams; SearchPersonByPhotoParams jobParams = new SearchPersonByPhotoParams(); jobParams.PhotoArray = this.personPhotoArray; jobParams.PhotoFileExtention = this.personPhotoExt; jobParams.Sex = this.sex.Id; jobParams.Years = sb.ToString().Trim(); jobParams.Natinality = this.nationality; jobParams.MashineName = Environment.MachineName; jobParams.IsSupressed = isSupressed; //jobParams.Years = sb.ToString().Trim(); //jobParams.IsSupressed = isSupressed; BackgroundWorker worker = new BackgroundWorker(); //worker.WorkerSupportsCancellation = true; worker.DoWork += Worker_GetPhotoSearchResult; worker.RunWorkerCompleted += Worker_GetPhotoSerachResultCompleted; worker.RunWorkerAsync(jobParams); }