// Directory processing progress change events... private void ProcessDirectory_ProgressChanged(object sender, ProgressChangedEventArgs e) { // Convert UserStatet and calculate progress... FileInfo fileName = e.UserState as FileInfo; double ProgressValue = (((double)e.ProgressPercentage / FileCounterMax) * 100); // Send progress to ProgressBar... UpdateProgressBar1(ProgressValue); // Update Progress TextLabel... UpdateProgressTextLabel("Processing: " + fileName.Name); // Bind Process Output to DataGrid... ProcessOutput processOutput = new ProcessOutput() { Filename = fileName.Name.Split('.').First(), Type = fileName.Extension.TrimStart('.') }; // Update the fileviewer... UpdateTextView(processOutput); }
/*/ * ################################################################################################ * ############################ User interface update section ##################################### * ################################################################################################ * /*/ // Update log viewer text. private void UpdateTextView(ProcessOutput processOutput) { LogFileViewer.Items.Add(processOutput); }