private void UpdateText(Book book) { int index = lstBooks.Items.IndexOf(book); lstBooks.BeginUpdate(); lstBooks.Items[index] = book; lstBooks.EndUpdate(); }
/// <summary> /// Tries to set all possible information for a book /// </summary> /// <param name="book">The book with its FilePath set</param> private void SetBookInfo(Book book) { Match match = _fileRegex.Match(book.FilePath); string extension = match.Groups["extension"].Value; if (extension == "azw" || extension == "tpz") { book.FileName = match.Groups["file"] + "." + extension; lstBooks.Items.Add(book); new Thread(new ParameterizedThreadStart(SetBookName)).Start(book); } }