示例#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);
     }
 }
示例#2
0
 public void Add(BookSet other)
 {
     foreach (int bookNum in other.SelectedBookNumbers)
     {
         Add(bookNum);
     }
 }
示例#3
0
        public override bool Equals(object obj)
        {
            BookSet other = (obj as BookSet);

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

            return(selected.SequenceEqual(other.selected));
        }
示例#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);
        }
示例#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);
        }
示例#6
0
 public BookSet(BookSet bset)
 {
     Books = bset.Books;
 }