public void CheckMyBooks( XCollection<Book> books ) { if (books != null && _myBooksIds != null) { CheckLibraryBooks(books); foreach (var book in books) { book.IsMyBook = _myBooksIds.Contains( book.Id ); if (book.IsMyBook) { Book myBook = null; if (_myBooksByTime != null) myBook = _myBooksByTime.FirstOrDefault(x => x.Id == book.Id); if (myBook == null && _myBooks != null) myBook = _myBooks.FirstOrDefault(x => x.Id == book.Id); if (myBook != null) { books.BeginUpdate(); book.ReadedPercent = myBook.ReadedPercent; book.ExpiredDateStr = myBook.ExpiredDateStr; book.IsExpiredBook = myBook.IsExpiredBook; book.SelfService = myBook.SelfService; book.SelfServiceMyRequest = myBook.SelfServiceMyRequest; book.isFragment = myBook.isFragment; book.IsMyBook = !book.isFragment; books.EndUpdate(); } } } } }