public TPageCollection(TPageCollection pages) { if (pages != null) { foreach (TPage PageItem in pages) { this.Add(new TPage(PageItem)); } } }
public TBook(XElement book) { Name = book.SafeReadAttribute <string>(TAG_ATTRIBUTE_NAME, ""); Pathname = book.SafeReadElementValue <string>(TAG_ELEMENT_PATHNAME, ""); Category = book.SafeReadElementValue <string>(TAG_ELEMENT_GROUPNAME, ""); Author = book.SafeReadAttribute <string>(TAG_ATTRIBUTE_AUTHOR, ""); IsExcluded = book.SafeReadAttribute <bool>("IsExcluded", false); BookType = (BookTypeEnum)Enum.Parse(typeof(BookTypeEnum), book.SafeReadAttribute <string>(TAG_ATTRIBUTE_BOOKTYPE, "unknown")); try { Pages = new TPageCollection(book.Element("Pages")); } catch { Pages = null; } }
public TBook() { Name = ""; Pathname = ""; Author = ""; IsExcluded = false; BookType = BookTypeEnum.unknown; Pages = new TPageCollection(); Category = ""; }
public TBook(TBook book) { Name = book.Name; Pathname = book.Pathname; Author = book.Author; IsExcluded = book.IsExcluded; BookType = book.BookType; Pages = new TPageCollection(book.Pages); Category = book.Category; }
public bool IsIdentical(TPageCollection otherPages) { if (otherPages == null || this.Count != otherPages.Count) { return(false); } foreach (TPage PageItem in this) { if (!PageItem.IsIdentical(otherPages.Find(p => p.Name == PageItem.Name))) { return(false); } } return(true); }