Exemplo n.º 1
0
 /// <summary>
 /// Remove all the books in the "other" BookSet from this BookSet.
 /// </summary>
 /// <param name="other"></param>
 public void Remove(BookSet other)
 {
     foreach (int bookNum in other.SelectedBookNumbers)
     {
         Remove(bookNum);
     }
 }
Exemplo n.º 2
0
 public void Add(BookSet other)
 {
     foreach (int bookNum in other.SelectedBookNumbers)
     {
         Add(bookNum);
     }
 }
Exemplo n.º 3
0
        public override bool Equals(object obj)
        {
            BookSet other = (obj as BookSet);

            if (other == null)
            {
                return(false);
            }

            return(selected.SequenceEqual(other.selected));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Creates a book set containing books in verses
        /// </summary>
        public static BookSet CreateBookSetFromRefs(IEnumerable <VerseRef> verseRefs)
        {
            BookSet books = new BookSet();

            foreach (var verseRef in verseRefs)
            {
                books.Add(verseRef.BookNum);
            }

            return(books);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Intersects two book sets
        /// </summary>
        /// <param name="other"></param>
        /// <returns>books that are present in both</returns>
        public BookSet Intersect(BookSet other)
        {
            BookSet bookSet = new BookSet();

            foreach (int bookNum in other.SelectedBookNumbers)
            {
                if (IsSelected(bookNum))
                {
                    bookSet.Add(bookNum);
                }
            }
            return(bookSet);
        }
Exemplo n.º 6
0
 public BookSet(BookSet bset)
 {
     Books = bset.Books;
 }