/// <summary> /// Gets a formatted string showing the value of the current progress as a percentage. /// </summary> /// <param name="numberOfDecimalPlaces">OPTIONAL: The number of decimal places to show /// in the string returned. Default: 0.</param> /// <value></value> /// <returns></returns> /// <remarks></remarks> public string GetCurrentProgressString(int numberOfDecimalPlaces = 0) { if (numberOfDecimalPlaces < 0 || numberOfDecimalPlaces > 8) { numberOfDecimalPlaces = 0; } string formatter = "p" + numberOfDecimalPlaces.ToString(); return(CurrentProgress.ToString(formatter)); }
private void SongAdded(object sender, SongAddedEventArgs e) { CurrentProgress++; Dispatcher.Invoke((Action)(() => { listBox2.Items.Add(e.SongName); label2.Content = "Processed " + CurrentProgress.ToString() + " of " + CollectionToProcessSize.ToString(); progressBar1.Value = CurrentProgress; listBox2.ScrollIntoView(listBox2.Items[listBox2.Items.Count - 1]); })); }